From 55446d56ce6308481efe3ea32390bf2cb00fd185 Mon Sep 17 00:00:00 2001 From: Bozo Date: Fri, 26 Jan 2018 04:54:48 -0800 Subject: [PATCH] Publish! Generated from v6.0.11315.11111-test10 --- 6/annotated.html | 26 +-- 6/classes.html | 14 +- ...s_o_n___binary_archive_buffer-members.html | 14 +- 6/d0/d01/class_rtf_composer_1_1_run_info.html | 14 +- 6/d0/d04/class_o_n___group.html | 22 +- .../class_o_n_x___error_counter-members.html | 14 +- 6/d0/d09/class_o_n___pick_point.html | 14 +- 6/d0/d16/class_o_n___texture.html | 30 +-- 6/d0/d19/class_o_n___centermark-members.html | 14 +- 6/d0/d1c/class_o_n___brep_loop.html | 24 +- 6/d0/d29/class_o_n___torus-members.html | 14 +- 6/d0/d30/class_o_n___hatch.html | 18 +- .../opennurbs__3dm__properties_8h_source.html | 16 +- ...o_n__3dm_archive_table_status-members.html | 14 +- 6/d0/d39/class_o_n__3dm_revision_history.html | 18 +- 6/d0/d3b/class_o_n___dim_angular-members.html | 14 +- .../class_o_n___simple_fixed_size_pool.html | 18 +- 6/d0/d43/opennurbs__pluginlist_8h_source.html | 16 +- 6/d0/d4a/class_o_n__4i_rect-members.html | 14 +- 6/d0/d4c/class_o_n___brep_face.html | 25 +- 6/d0/d51/class_o_n___cone.html | 14 +- .../d52/class_o_n__3dm_object_attributes.html | 34 +-- 6/d0/d52/class_o_n___nurbs_curve-members.html | 14 +- .../class_o_n___curve_on_surface-members.html | 14 +- ...class_o_n___progress_reporter-members.html | 14 +- .../opennurbs__function__list_8h_source.html | 16 +- 6/d0/d6c/class_o_n___surface_curvature.html | 14 +- 6/d0/d77/opennurbs__zlib_8h_source.html | 16 +- 6/d0/d7b/class_o_n___brep_vertex-members.html | 14 +- 6/d0/d82/class_o_n___user_string.html | 14 +- .../class_o_n___r_tree_iterator-members.html | 14 +- 6/d0/d89/class_o_n___bump_function.html | 18 +- ...s_o_n___model_component_type_iterator.html | 14 +- 6/d0/d8a/class_o_n__3d_point_list_ref.html | 14 +- 6/d0/d8a/class_o_n__3dm_view-members.html | 14 +- 6/d0/d8b/opennurbs__textdraw_8h_source.html | 16 +- 6/d0/d8d/class_o_n___point.html | 28 +-- ...ndows_b_i_t_m_a_p_f_i_l_e_h_e_a_d_e_r.html | 14 +- ...__n_u_m_b_e_r___c_o_n_t_e_x_t-members.html | 14 +- 6/d0/da3/class_o_n___centermark.html | 26 +-- 6/d0/daa/class_o_n___geometry-members.html | 14 +- 6/d0/dad/class_o_n___text_log_indent.html | 14 +- ...s_o_n__3dm_construction_plane-members.html | 14 +- 6/d0/dbb/class_o_n___linetype.html | 18 +- 6/d0/dc4/opennurbs__fsp__defs_8h_source.html | 16 +- 6/d0/dcd/class_o_n__2d_point_array.html | 14 +- ...ruct_o_n___mesh_topology_face-members.html | 14 +- .../class_o_n__3f_vector_array-members.html | 14 +- 6/d0/ddd/class_o_n___line_curve.html | 21 +- 6/d0/ddd/class_o_n___polyline-members.html | 14 +- 6/d0/de9/class_o_n___debug_write_archive.html | 14 +- 6/d0/dec/class_o_n__3f_point.html | 22 +- 6/d0/dec/class_o_n___mesh_ngon_allocator.html | 14 +- 6/d0/df3/class_o_n___light.html | 18 +- ...rial_number_map_1_1_m_a_p___v_a_l_u_e.html | 14 +- 6/d0/df6/class_o_n__3dm_notes.html | 14 +- 6/d0/df8/opennurbs__surface_8h_source.html | 25 +- 6/d0/df9/class_o_n___color.html | 20 +- 6/d1/d08/opennurbs__textrun_8h_source.html | 23 +- 6/d1/d0f/class_o_n___unknown_user_data.html | 18 +- 6/d1/d11/class_o_n__w_string.html | 27 +-- .../class_o_n___polynomial_curve-members.html | 14 +- 6/d1/d17/class_o_n___bounding_box.html | 20 +- 6/d1/d1b/class_o_n___circle.html | 23 +- .../class_o_n___offset_surface_function.html | 14 +- 6/d1/d37/class_o_n___rev_surface.html | 40 ++-- 6/d1/d3c/opennurbs__rendering_8h_source.html | 16 +- .../d44/class_o_n___dim_ordinate-members.html | 14 +- ...ass_o_n___rtf_first_char_1_1_text_run.html | 14 +- 6/d1/d4b/class_o_n___line-members.html | 14 +- .../class_o_n___mesh_triangle-members.html | 14 +- 6/d1/d57/class_o_n___dim_style-members.html | 14 +- ...ct_o_n___mesh_topology_vertex-members.html | 14 +- .../class_o_n___mesh_topology-members.html | 14 +- 6/d1/d6c/class_o_n___workspace.html | 21 +- 6/d1/d6e/class_o_n___file_system_path.html | 18 +- 6/d1/d7e/class_o_n___object-members.html | 14 +- ...ss_o_n__3dm_object_attributes-members.html | 14 +- 6/d1/d90/opennurbs__string_8h_source.html | 19 +- ...class_o_n___poly_edge_history-members.html | 14 +- 6/d1/d96/class_o_n___mesh_face_side.html | 17 +- 6/d1/d97/class_o_n___polynomial_curve.html | 14 +- ...o_n___rtf_string_builder_1_1_text_run.html | 14 +- 6/d1/d9f/class_o_n___binary_file-members.html | 14 +- ...uct_o_n___windows_b_i_t_m_a_p_i_n_f_o.html | 14 +- 6/d1/da8/opennurbs__linestyle_8h_source.html | 16 +- 6/d1/dac/opennurbs__compress_8h_source.html | 16 +- 6/d1/db0/class_o_n___scale_value-members.html | 14 +- 6/d1/dbb/class_o_n___mapping_ref.html | 14 +- 6/d1/dbf/opennurbs__terminator_8h_source.html | 16 +- 6/d1/dc1/class_o_n___extrusion-members.html | 14 +- ..._o_n___simple_fixed_size_pool-members.html | 14 +- 6/d1/dce/class_o_n___brep_loop_array.html | 14 +- 6/d1/dd5/class_o_n___mesh_triangle.html | 14 +- .../dd7/class_o_n___component_attributes.html | 21 +- 6/d1/ddb/class_o_n___text_run_array.html | 14 +- 6/d1/ddb/structtag_font_key-members.html | 14 +- ...__internal___v2__annotation_8h_source.html | 24 +- .../class_o_n___file_iterator-members.html | 14 +- ...lass_o_n___aggregate_component_status.html | 20 +- 6/d1/df2/opennurbs__sha1_8h_source.html | 16 +- .../d00/class_o_n___length_value-members.html | 14 +- 6/d2/d00/opennurbs__math_8h_source.html | 16 +- 6/d2/d1a/class_o_n___point_cloud-members.html | 14 +- .../d1e/class_o_n___material_ref-members.html | 14 +- ..._o_n___read3dm_buffer_archive-members.html | 14 +- ...ss_o_n___component_attributes-members.html | 14 +- 6/d2/d25/opennurbs__arc_8h_source.html | 16 +- 6/d2/d32/class_o_n__3f_point_array.html | 14 +- 6/d2/d35/class_o_n__3d_point.html | 22 +- 6/d2/d39/opennurbs__brep_8h_source.html | 16 +- 6/d2/d3b/class_o_n___string.html | 33 ++- 6/d2/d44/class_o_n___brep_vertex_array.html | 14 +- ...o_n__3dm_units_and_tolerances-members.html | 14 +- ...f_string_builder_1_1_text_run-members.html | 14 +- 6/d2/d53/class_o_n___linetype_segment.html | 14 +- ..._o_n__3dm_annotation_settings-members.html | 14 +- .../d58/class_o_n___bounding_box-members.html | 14 +- ...bs__internal___v5__dimstyle_8h_source.html | 16 +- ...nnurbs__private__wrap__defs_8h_source.html | 16 +- 6/d2/d6a/class_o_n__3dm_view_position.html | 14 +- ...referenced_component_settings-members.html | 14 +- 6/d2/d6c/class_o_n___earth_anchor_point.html | 17 +- ...ss_o_n___base64_encode_stream-members.html | 14 +- ...terial_instance_id_obsolete_user_data.html | 14 +- ...nstance_id_obsolete_user_data-members.html | 14 +- .../struct_o_n___r_tree_sphere-members.html | 14 +- 6/d2/d7a/class_o_n___linetype-members.html | 14 +- 6/d2/d7c/class_o_n__3dm_notes-members.html | 14 +- 6/d2/d7d/class_o_n___m_d5-members.html | 14 +- 6/d2/d7f/class_o_n___hash32_table.html | 14 +- .../class_o_n___user_string_list-members.html | 14 +- 6/d2/d98/opennurbs__plane_8h_source.html | 16 +- 6/d2/d99/opennurbs__textlog_8h_source.html | 16 +- 6/d2/d9a/class_o_n___text.html | 18 +- 6/d2/d9b/class_o_n__4d_point_array.html | 14 +- ...ass_o_n___obj_ref___i_ref_i_d-members.html | 14 +- 6/d2/da2/class_o_n___face_name_key.html | 14 +- 6/d2/da3/class_o_n___text_log.html | 42 ++-- .../class_o_n___text_run_builder-members.html | 14 +- 6/d2/da9/class_o_n__4d_rect.html | 14 +- ...__rtf_first_char_1_1_text_run-members.html | 14 +- ..._n___fixed_size_pool_iterator-members.html | 14 +- 6/d2/dc2/opennurbs__knot_8h_source.html | 16 +- .../class_o_n___polyline_curve-members.html | 14 +- ...ss_o_n___model_component_content_mark.html | 14 +- 6/d2/dca/class_o_n___detail_view.html | 26 +-- ...ss_o_n___mesh_curvature_stats-members.html | 14 +- 6/d2/dde/class_o_n__3d_ray-members.html | 14 +- 6/d2/de1/opennurbs__defines_8h_source.html | 18 +- ...class_o_n___hash32_table_item-members.html | 14 +- .../opennurbs__3dm__attributes_8h_source.html | 16 +- .../opennurbs__3dm__settings_8h_source.html | 18 +- ..._o_n___clipping_region_points-members.html | 14 +- .../opennurbs__surfaceproxy_8h_source.html | 16 +- 6/d2/df4/class_o_n___text_mask.html | 18 +- 6/d2/df5/class_o_n___file_system-members.html | 14 +- 6/d2/df8/class_o_n___check_sum-members.html | 14 +- ...class_o_n___manifest_map_item-members.html | 14 +- 6/d3/d03/opennurbs__array_8h_source.html | 18 +- 6/d3/d04/class_o_n__3d_ray.html | 14 +- .../class_o_n___binary_archive-members.html | 14 +- 6/d3/d13/class_o_n___xform.html | 29 +-- .../class_o_n___brep_loop_array-members.html | 14 +- 6/d3/d1b/class_o_n___uuid_pair-members.html | 14 +- 6/d3/d1f/class_o_n___detail_view-members.html | 14 +- .../d23/class_o_n___object_array-members.html | 14 +- 6/d3/d2f/class_o_n___xform-members.html | 14 +- 6/d3/d32/class_o_n___user_string_list.html | 14 +- 6/d3/d38/class_o_n___rtf_string_builder.html | 14 +- .../struct_o_n___brep_trim_point-members.html | 14 +- ...___aggregate_component_status-members.html | 14 +- 6/d3/d3c/class_o_n___class_id.html | 21 +- 6/d3/d40/struct_o_n___mesh_part-members.html | 14 +- ...ass_o_n___object_rendering_attributes.html | 14 +- .../d52/class_o_n___simple_array-members.html | 14 +- 6/d3/d56/class_o_n___class_array-members.html | 14 +- 6/d3/d58/class_o_n___mesh_cache.html | 14 +- .../d5c/class_o_n___text_content-members.html | 14 +- 6/d3/d5d/class_o_n__3dm_application.html | 14 +- 6/d3/d6a/class_o_n___nurbs_curve.html | 33 +-- .../opennurbs__evaluate__nurbs_8h_source.html | 16 +- .../opennurbs__planesurface_8h_source.html | 16 +- .../class_o_n__3d_point_array-members.html | 14 +- 6/d3/d7c/opennurbs__memory_8h_source.html | 16 +- .../d7e/class_o_n___text_builder-members.html | 14 +- 6/d3/d7f/struct_o_n___r_tree_sphere.html | 14 +- 6/d3/d80/class_o_n___obj_ref.html | 14 +- 6/d3/d82/class_o_n___text_content.html | 22 +- ...lass_o_n___aerial_photo_image_frustum.html | 18 +- .../d88/class_o_n___display_material_ref.html | 33 +-- ..._n___standard_display_mode_id-members.html | 14 +- .../d90/class_o_n___bezier_curve-members.html | 14 +- .../class_o_n___tensor_product-members.html | 14 +- 6/d3/d98/class_o_n___annotation-members.html | 14 +- 6/d3/d9a/opennurbs__pointcloud_8h_source.html | 16 +- 6/d3/da1/opennurbs__error_8h_source.html | 16 +- 6/d3/da3/class_o_n___clipping_plane_info.html | 14 +- 6/d3/da7/opennurbs__optimize_8h_source.html | 16 +- .../class_o_n__3dm_page_settings-members.html | 14 +- 6/d3/dac/class_o_n___brep_trim.html | 28 +-- 6/d3/dad/opennurbs__archive_8h_source.html | 16 +- 6/d3/db0/class_o_n___rtf_first_char.html | 14 +- 6/d3/db2/class_o_n___brep_face-members.html | 14 +- ...class_o_n___brep_vertex_array-members.html | 14 +- ...s_o_n__3dm_annotation_context-members.html | 14 +- 6/d3/dce/opennurbs__base64_8h_source.html | 16 +- 6/d3/dd0/opennurbs__linecurve_8h_source.html | 16 +- ...n___document_user_string_list-members.html | 14 +- ...class_o_n___brep_region_array-members.html | 14 +- 6/d3/dd8/opennurbs__cone_8h_source.html | 16 +- 6/d3/ddf/class_o_n___arc.html | 48 ++-- ...urbs__internal__unicode__cp_8h_source.html | 16 +- 6/d3/de6/class_o_n___text-members.html | 14 +- 6/d3/dec/class_o_n___plug_in_ref-members.html | 14 +- .../class_o_n___surface_array-members.html | 14 +- 6/d3/df5/class_o_n___glyph_map.html | 14 +- 6/d3/df7/class_o_n__2f_vector-members.html | 14 +- 6/d3/dfa/class_o_n___sum_surface-members.html | 14 +- 6/d3/dfd/class_o_n_x___model.html | 30 +-- ...lass_o_n__3dm_wallpaper_image-members.html | 14 +- 6/d4/d10/class_o_n__3dm_view_trace_image.html | 14 +- .../class_o_n___plane_surface-members.html | 14 +- 6/d4/d1c/class_o_n___unit_system.html | 14 +- 6/d4/d1e/class_o_n___serial_number_map.html | 45 ++-- 6/d4/d1e/class_o_n___text_style-members.html | 14 +- 6/d4/d2b/class_o_n___hatch_loop-members.html | 14 +- 6/d4/d2c/class_o_n___text_run.html | 14 +- 6/d4/d2c/opennurbs__textobject_8h_source.html | 16 +- .../class_o_n__4d_point_array-members.html | 14 +- 6/d4/d2e/class_o_n___space_morph-members.html | 14 +- 6/d4/d30/class_o_n___manifest_map_item.html | 14 +- .../class_o_n___uuid_index_list-members.html | 14 +- ...pennurbs__internal__defines_8h_source.html | 16 +- .../d42/class_o_n___mesh_curvature_stats.html | 14 +- 6/d4/d44/class_o_n___torus.html | 14 +- 6/d4/d48/class_o_n___plane.html | 18 +- .../opennurbs__private__wrap_8h_source.html | 16 +- 6/d4/d5a/class_o_n___curve.html | 37 ++- 6/d4/d5e/class_o_n___angle_value-members.html | 14 +- 6/d4/d62/class_o_n___curve_proxy_history.html | 18 +- ...mple_fixed_size_pool_iterator-members.html | 14 +- 6/d4/d67/class_o_n___triangle-members.html | 14 +- 6/d4/d6b/opennurbs__subd__data_8h_source.html | 16 +- 6/d4/d6f/class_o_n___line.html | 24 +- ...ass_o_n__3dm_view_trace_image-members.html | 14 +- .../struct_o_n___r_tree_search_result.html | 14 +- 6/d4/d80/class_o_n___line_curve-members.html | 14 +- .../class_o_n__3dm_archive_table_status.html | 14 +- ...ndows_b_i_t_m_a_p_i_n_f_o_h_e_a_d_e_r.html | 22 +- .../class_o_n___surface_proxy-members.html | 14 +- 6/d4/d8f/class_o_n___lock-members.html | 14 +- 6/d4/d8f/opennurbs__uuid_8h_source.html | 16 +- ...n_d_o_m___n_u_m_b_e_r___c_o_n_t_e_x_t.html | 18 +- 6/d4/d93/class_o_n___brep_region.html | 21 +- 6/d4/d96/class_o_n___curve_array-members.html | 14 +- 6/d4/da0/class_o_n___hatch_line-members.html | 14 +- .../class_o_n___model_component-members.html | 14 +- .../class_o_n___clipping_region-members.html | 14 +- 6/d4/dac/class_o_n__2dex_map.html | 14 +- 6/d4/dac/class_o_n___interval-members.html | 14 +- 6/d4/dae/class_o_n___user_data_holder.html | 14 +- 6/d4/db4/class_o_n___brep_region_array.html | 14 +- 6/d4/db5/class_o_n___plane_surface.html | 31 ++- 6/d4/dba/class_o_n___name_hash-members.html | 14 +- 6/d4/dbb/class_o_n___stacked_text.html | 18 +- 6/d4/dbe/class_o_n___cage_morph.html | 14 +- ..._n___model_geometry_component-members.html | 14 +- ...ass_o_n___curve_proxy_history-members.html | 14 +- 6/d4/dca/opennurbs__detail_8h_source.html | 16 +- 6/d4/dd7/class_o_n___morph_control.html | 28 +-- 6/d4/ddf/opennurbs__beam_8h_source.html | 16 +- .../opennurbs__string__value_8h_source.html | 16 +- 6/d4/de1/class_o_n___font_glyph-members.html | 16 +- ...s_o_n___progress_step_counter-members.html | 14 +- 6/d4/dea/class_o_n___surface_proxy.html | 37 ++- 6/d4/deb/class_o_n___viewport.html | 39 +--- .../class_o_n___progress_step_counter.html | 14 +- .../opennurbs__polylinecurve_8h_source.html | 16 +- 6/d4/df4/class_o_n___brep_trim_array.html | 14 +- 6/d4/df4/class_o_n___string-members.html | 14 +- 6/d4/df4/opennurbs__xform_8h_source.html | 18 +- 6/d4/df9/class_o_n___triangle.html | 14 +- 6/d5/d00/opennurbs__fsp_8h_source.html | 37 +-- .../opennurbs__dimensionformat_8h_source.html | 16 +- ...o_n___write3dm_buffer_archive-members.html | 14 +- .../struct_o_n___u_u_i_d__struct-members.html | 14 +- 6/d5/d1a/class_o_n___curve_on_surface.html | 22 +- ...class_o_n___poly_edge_segment-members.html | 14 +- 6/d5/d21/class_o_n___layer-members.html | 14 +- 6/d5/d2c/class_o_n___material_ref.html | 14 +- .../class_o_n___fixed_size_pool-members.html | 14 +- 6/d5/d38/union_o_n___u.html | 14 +- .../class_o_n___mesh_curve_parameters.html | 20 +- 6/d5/d3c/class_o_n__3dm_goo.html | 14 +- 6/d5/d45/class_o_n__4d_point-members.html | 14 +- .../class_o_n___string_buffer-members.html | 14 +- ...struct_o_n___unicode_error_parameters.html | 17 +- 6/d5/d53/class_o_n___buffer-members.html | 14 +- 6/d5/d55/class_o_n___user_data.html | 24 +- .../class_o_n___function_list-members.html | 14 +- ...ennurbs__progress__reporter_8h_source.html | 16 +- 6/d5/d77/opennurbs__topology_8h_source.html | 16 +- 6/d5/d82/opennurbs__subd_8h_source.html | 47 +--- 6/d5/d8a/opennurbs__box_8h_source.html | 16 +- ...s_o_n___referenced_component_settings.html | 18 +- ...lass_o_n___polynomial_surface-members.html | 14 +- .../class_o_n___bounding_box_and_hash.html | 14 +- 6/d5/dab/opennurbs__group_8h_source.html | 16 +- .../class_o_n___brep_face_side-members.html | 14 +- 6/d5/dae/class_o_n__3d_vector.html | 22 +- 6/d5/db3/class_o_n___decode_base64.html | 14 +- 6/d5/db5/class_o_n__2f_point-members.html | 14 +- 6/d5/db7/class_o_n___file_iterator.html | 23 +- ...class_o_n___uncompress_stream-members.html | 14 +- 6/d5/dc9/opennurbs__userdata_8h_source.html | 32 +-- 6/d5/dcb/class_o_n___text_context.html | 14 +- 6/d5/dd4/class_o_n__2f_point_array.html | 14 +- 6/d5/dd7/class_o_n___offset_surface.html | 18 +- 6/d5/dd9/opennurbs__freetype_8h_source.html | 20 +- .../ddd/class_o_n___text_context-members.html | 14 +- 6/d5/df0/class_o_n___text_hash.html | 14 +- 6/d5/df5/class_o_n___mesh_ngon.html | 30 +-- .../class_o_n__4f_point_array-members.html | 14 +- .../class_o_n___mesh_partition-members.html | 14 +- 6/d6/d0b/class_o_n___tensor_product.html | 20 +- 6/d6/d0b/class_o_n___windows_bitmap_ex.html | 18 +- ...s_o_n___bounding_box_and_hash-members.html | 14 +- 6/d6/d10/class_o_n___mesh_ngon_iterator.html | 14 +- 6/d6/d10/class_o_n___poly_edge_curve.html | 14 +- 6/d6/d11/class_o_n___number_formatter.html | 18 +- 6/d6/d13/struct_o_n__3_d_m___c_h_u_n_k.html | 14 +- 6/d6/d17/struct_o_n___mesh_topology_edge.html | 14 +- 6/d6/d1e/opennurbs__gl_8h_source.html | 16 +- 6/d6/d24/opennurbs__mapchan_8h_source.html | 16 +- .../opennurbs__input__libsdir_8h_source.html | 16 +- ...ss_o_n___rendering_attributes-members.html | 14 +- ...ss_o_n___aerial_photo_camera_position.html | 14 +- ...model_component_type_iterator-members.html | 14 +- 6/d6/d4c/class_o_n___windows_bitmap.html | 21 +- ...o_n___offset_surface_function-members.html | 14 +- 6/d6/d60/class_o_n___parse_settings.html | 26 +-- ...__text_builder_1_1_text_props-members.html | 14 +- 6/d6/d66/class_o_n___compressed_buffer.html | 14 +- 6/d6/d78/class_o_n___layer.html | 33 ++- .../class_o_n___offset_surface-members.html | 14 +- 6/d6/d81/class_o_n___bezier_cage.html | 14 +- 6/d6/d82/class_o_n___mesh_face_list.html | 14 +- 6/d6/d95/opennurbs__object_8h_source.html | 16 +- 6/d6/d97/class_o_n___bitmap-members.html | 14 +- 6/d6/da0/class_o_n___bezier_cage-members.html | 14 +- .../opennurbs__file__utilities_8h_source.html | 18 +- .../class_o_n___texture_mapping-members.html | 14 +- 6/d6/dac/class_o_n_x___model___user_data.html | 14 +- 6/d6/dc1/class_o_n___localizer.html | 26 +-- 6/d6/dc3/opennurbs__nurbscurve_8h_source.html | 16 +- 6/d6/dc8/class_o_n___angle_value.html | 18 +- 6/d6/dcc/struct_o_n___mesh_part.html | 14 +- ...ass_o_n___instance_definition-members.html | 14 +- ...nnurbs__quacksort__template_8h_source.html | 16 +- 6/d6/dd8/class_o_n___ellipse.html | 14 +- 6/d6/dd8/class_o_n___mesh_cache-members.html | 14 +- 6/d6/dde/opennurbs__font_8h_source.html | 38 ++- .../de3/opennurbs__text__style_8h_source.html | 16 +- ...lass_o_n___obsolete_user_data-members.html | 14 +- 6/d6/de8/class_o_n___clipping_plane.html | 14 +- .../df2/class_o_n___offset_surface_value.html | 14 +- .../class_o_n___plane_equation-members.html | 14 +- 6/d6/df6/struct_o_n___r_tree_branch.html | 14 +- 6/d7/d08/opennurbs__date_8h_source.html | 16 +- 6/d7/d10/class_o_n___r_tree_mem_pool.html | 14 +- 6/d7/d14/class_o_n___uuid_pair.html | 14 +- .../class_o_n___text_iterator-members.html | 14 +- 6/d7/d16/class_o_n___uuid_ptr_list.html | 17 +- 6/d7/d1d/class_o_n___terminator-members.html | 14 +- 6/d7/d20/class_o_n___matrix.html | 14 +- 6/d7/d26/class_o_n___nurbs_cage.html | 17 +- 6/d7/d29/class_o_n___font_glyph.html | 29 ++- 6/d7/d2a/class_o_n___user_data-members.html | 14 +- 6/d7/d2c/class_o_n__3d_vector_array.html | 14 +- 6/d7/d2d/class_o_n___brep_trim-members.html | 14 +- 6/d7/d31/class_o_n___viewport-members.html | 14 +- .../class_o_n___poly_edge_curve-members.html | 14 +- 6/d7/d42/opennurbs__objref_8h_source.html | 16 +- ..._o_n___clipping_plane_surface-members.html | 14 +- 6/d7/d46/class_o_n__3dm_settings-members.html | 14 +- 6/d7/d4a/opennurbs__parse_8h_source.html | 18 +- ...ass_o_n___texture_coordinates-members.html | 14 +- 6/d7/d4f/opennurbs__curve_8h_source.html | 20 +- 6/d7/d51/class_o_n__3dm_view.html | 17 +- 6/d7/d53/class_o_n___material.html | 31 +-- 6/d7/d64/class_o_n___dim_radial.html | 26 +-- ...lass_o_n___mesh_ngon_iterator-members.html | 14 +- 6/d7/d6a/class_o_n___local_zero1.html | 14 +- .../d70/opennurbs__array__defs_8h_source.html | 20 +- ...s_o_n___user_data_item_filter-members.html | 14 +- 6/d7/d74/class_o_n___mesh-members.html | 14 +- ...class_o_n___unknown_user_data-members.html | 14 +- 6/d7/d8a/class_o_n___hatch-members.html | 14 +- ...r_map_1_1_s_n___e_l_e_m_e_n_t-members.html | 14 +- 6/d7/d8c/class_o_n___compress_stream.html | 20 +- ...class_o_n___bezier_cage_morph-members.html | 14 +- 6/d7/d91/class_o_n___texture-members.html | 14 +- 6/d7/d94/class_o_n___arrowhead.html | 22 +- 6/d7/da4/opennurbs__fpoint_8h_source.html | 18 +- 6/d7/da5/opennurbs__unicode_8h_source.html | 16 +- 6/d7/db4/opennurbs__polyline_8h_source.html | 16 +- 6/d7/dc7/class_o_n___bezier_surface.html | 14 +- 6/d7/dc7/opennurbs__lookup_8h_source.html | 16 +- 6/d7/dc7/opennurbs__version_8h_source.html | 16 +- .../dd2/class_o_n___instance_ref-members.html | 14 +- 6/d7/dd8/class_o_n___sphere.html | 14 +- .../class_o_n___file_system_path-members.html | 14 +- 6/d7/de0/opennurbs__system_8h_source.html | 16 +- 6/d7/de3/class_o_n___texture_mapping.html | 55 ++--- 6/d7/de3/class_o_n_x___error_counter.html | 21 +- .../opennurbs__pointgeometry_8h_source.html | 16 +- 6/d7/de6/class_o_n___cylinder.html | 14 +- .../class_o_n___decode_base64-members.html | 14 +- 6/d7/df0/class_o_n___sum.html | 17 +- .../df1/class_o_n___rendering_attributes.html | 18 +- 6/d7/df6/class_o_n___mapping_tag.html | 14 +- 6/d7/dfd/class_o_n__4d_rect-members.html | 14 +- 6/d7/dff/class_o_n___dimension-members.html | 14 +- 6/d8/d00/class_o_n___poly_curve.html | 58 ++--- ...ss_o_n___display_material_ref-members.html | 14 +- .../d05/class_o_n___base64_encode_stream.html | 21 +- 6/d8/d06/class_o_n___curve_array.html | 17 +- 6/d8/d07/class_o_n__4f_point_array.html | 14 +- 6/d8/d0d/opennurbs__leader_8h_source.html | 16 +- 6/d8/d13/class_o_n___progress_reporter.html | 35 +-- 6/d8/d15/class_o_n___sphere-members.html | 14 +- .../class_o_n___parse_settings-members.html | 14 +- ...___aerial_photo_image_frustum-members.html | 14 +- 6/d8/d1e/class_o_n___arrowhead-members.html | 14 +- 6/d8/d23/class_o_n___embedded_bitmap.html | 22 +- .../class_o_n__3_d_m___b_i_g___c_h_u_n_k.html | 17 +- ...__object_rendering_attributes-members.html | 14 +- .../opennurbs__nurbssurface_8h_source.html | 16 +- ..._n___font_glyph_outline_point-members.html | 14 +- .../class_o_n___linetype_segment-members.html | 14 +- .../class_o_n__3dm_construction_plane.html | 14 +- 6/d8/d49/class_o_n__2i_size.html | 14 +- 6/d8/d49/class_o_n___text_dot.html | 17 +- 6/d8/d4f/class_o_n___locale-members.html | 14 +- 6/d8/d57/opennurbs__rand_8h_source.html | 16 +- 6/d8/d6f/class_o_n___polyline_curve.html | 32 +-- 6/d8/d72/class_o_n___component_manifest.html | 17 +- 6/d8/d75/class_o_n___fixed_size_pool.html | 21 +- 6/d8/d7c/class_o_n___m_d5.html | 18 +- .../class_o_n__3dm_annotation_context.html | 14 +- 6/d8/d91/class_o_n___circle-members.html | 14 +- ...ass_o_n___mesh_ngon_allocator-members.html | 14 +- 6/d8/d95/opennurbs__line_8h_source.html | 16 +- ...ss_o_n___brep_face_side_array-members.html | 14 +- 6/d8/d9b/class_o_n__w_string_buffer.html | 14 +- .../class_o_n___text_run_array-members.html | 14 +- 6/d8/d9e/opennurbs__revsurface_8h_source.html | 16 +- 6/d8/d9f/class_o_n___workspace-members.html | 14 +- .../opennurbs__hsort__template_8h_source.html | 16 +- ...lass_o_n___component_manifest-members.html | 14 +- 6/d8/db3/class_o_n___surface_properties.html | 14 +- 6/d8/db4/struct_o_n___u_u_i_d__struct.html | 14 +- 6/d8/db7/class_o_n___poly_edge_segment.html | 23 +- 6/d8/db7/opennurbs__cpp__base_8h_source.html | 16 +- 6/d8/dbb/class_o_n___curve_proxy-members.html | 14 +- 6/d8/dc1/class_o_n___pick_point-members.html | 14 +- 6/d8/dc2/class_o_n___rtf_parser-members.html | 14 +- .../dcc/class_o_n___content_hash-members.html | 14 +- 6/d8/dd1/class_o_n___localizer-members.html | 14 +- 6/d8/dd2/class_o_n___leader-members.html | 14 +- .../opennurbs__dimensionstyle_8h_source.html | 30 ++- 6/d8/dd4/class_o_n___locale.html | 17 +- 6/d8/de3/class_o_n___glyph_map-members.html | 14 +- .../opennurbs__system__runtime_8h_source.html | 16 +- .../opennurbs__qsort__template_8h_source.html | 16 +- 6/d8/dea/class_o_n__2dex_map-members.html | 14 +- 6/d8/deb/class_o_n__3f_vector_array.html | 14 +- .../class_o_n___file_reference-members.html | 14 +- 6/d8/df2/class_o_n___dim_ordinate.html | 45 ++-- 6/d8/df5/class_o_n___font.html | 152 ++---------- 6/d8/df7/class_o_n___s_h_a1.html | 18 +- 6/d8/df7/class_o_n___scale_value.html | 18 +- ...i_t_m_a_p_f_i_l_e_h_e_a_d_e_r-members.html | 14 +- 6/d8/df8/class_o_n___dim_style.html | 65 +++--- 6/d8/dfd/class_o_n___brep_loop-members.html | 14 +- 6/d8/dfd/class_o_n___file_reference.html | 17 +- 6/d9/d0d/opennurbs__point_8h_source.html | 18 +- 6/d9/d12/class_o_n___component_status.html | 35 ++- 6/d9/d13/class_o_n__3d_point_array.html | 20 +- 6/d9/d15/examples_8h_source.html | 16 +- 6/d9/d27/opennurbs__crc_8h_source.html | 16 +- .../class_o_n__2f_point_array-members.html | 14 +- 6/d9/d2f/class_o_n___dim_style_context.html | 14 +- 6/d9/d33/class_o_n___quaternion.html | 18 +- .../class_o_n___mapping_channel-members.html | 14 +- .../class_o_n___rtf_first_char-members.html | 14 +- ...lass_o_n__3dm_render_settings-members.html | 14 +- 6/d9/d42/class_o_n___evaluator.html | 14 +- .../class_o_n___user_data_holder-members.html | 14 +- 6/d9/d4c/opennurbs__viewport_8h_source.html | 18 +- .../opennurbs__polyedgecurve_8h_source.html | 16 +- .../class_o_n___user_data_item_filter.html | 14 +- 6/d9/d55/class_o_n__3f_point-members.html | 14 +- ...___internal___font_glyph_pool-members.html | 14 +- .../class_o_n___mesh_face_list-members.html | 14 +- ...opennurbs__model__component_8h_source.html | 18 +- 6/d9/d5e/opennurbs__arccurve_8h_source.html | 16 +- ...o_n___component_manifest_item-members.html | 14 +- .../class_o_n___brep_edge_array-members.html | 14 +- .../class_o_n___hatch_pattern-members.html | 14 +- 6/d9/d6f/class_o_n___bezier_curve.html | 20 +- .../class_o_n___clipping_region_points.html | 17 +- .../class_o_n___clipping_plane_surface.html | 18 +- .../class_o_n__2d_point_array-members.html | 14 +- 6/d9/d7b/class_o_n___object.html | 50 ++-- 6/d9/d7d/class_o_n___aerial_photo_image.html | 14 +- ..._dim_style_1_1_dimstyle_field-members.html | 14 +- .../class_o_n___embedded_bitmap-members.html | 14 +- 6/d9/d96/class_o_n___brep.html | 29 +-- .../class_o_n___morph_control-members.html | 14 +- 6/d9/d9d/class_o_n___mapping_tag-members.html | 14 +- ...ct_o_n___r_tree_search_result-members.html | 14 +- 6/d9/da7/class_o_n__2d_size-members.html | 14 +- 6/d9/da8/class_o_n___brep_edge-members.html | 14 +- 6/d9/da9/class_o_n___terminator.html | 24 +- 6/d9/db1/class_o_n__4d_point.html | 14 +- ...ass_o_n___text_builder_1_1_text_props.html | 14 +- 6/d9/dba/class_o_n___material-members.html | 14 +- 6/d9/dbe/opennurbs__pointgrid_8h_source.html | 16 +- 6/d9/dc3/class_o_n___leader.html | 22 +- 6/d9/dc3/class_o_n___surface_array.html | 14 +- 6/d9/dcd/class_o_n___uuid_pair_list.html | 14 +- 6/d9/dce/class_o_n___brep_edge_array.html | 14 +- .../class_o_n___component_status-members.html | 14 +- .../class_o_n___face_name_key-members.html | 14 +- 6/d9/dd8/class_o_n___managed_fonts.html | 44 +++- 6/d9/ddd/opennurbs__dimension_8h_source.html | 18 +- 6/d9/ddd/opennurbs__instance_8h_source.html | 18 +- 6/d9/ddf/class_o_n___brep_vertex.html | 14 +- 6/d9/dec/class_o_n___dimension.html | 25 +- 6/d9/dec/class_o_n___instance_definition.html | 30 ++- ...class_o_n___dim_style_context-members.html | 14 +- .../opennurbs__curveonsurface_8h_source.html | 16 +- 6/d9/df6/class_o_n___manifest_map.html | 14 +- .../class_o_n___number_formatter-members.html | 14 +- 6/d9/df9/opennurbs__rtree_8h_source.html | 22 +- .../dfc/class_o_n___font_metrics-members.html | 14 +- 6/da/d04/class_o_n___space_morph.html | 17 +- 6/da/d08/class_o_n__2d_vector.html | 22 +- 6/da/d08/class_o_n___object_array.html | 22 +- 6/da/d13/class_o_n___unit_system-members.html | 14 +- 6/da/d2a/class_o_n___matrix-members.html | 14 +- ...lass_o_n___mesh_component_ref-members.html | 14 +- 6/da/d39/opennurbs__material_8h_source.html | 18 +- ..._n___unicode_error_parameters-members.html | 14 +- 6/da/d4f/class_o_n___function_list.html | 21 +- 6/da/d51/class_o_n___annotation.html | 23 +- ...t_o_n___windows_r_g_b_q_u_a_d-members.html | 14 +- 6/da/d53/opennurbs__quaternion_8h_source.html | 16 +- 6/da/d54/opennurbs__sphere_8h_source.html | 16 +- .../class_o_n___binary_archive_buffer.html | 14 +- 6/da/d5e/class_o_n__2i_point-members.html | 14 +- .../struct_o_n___r_tree_branch-members.html | 14 +- 6/da/d62/class_o_n__4f_point-members.html | 14 +- .../class_o_n___font_glyph_outline_point.html | 14 +- 6/da/d69/class_o_n___text_style.html | 18 +- 6/da/d6b/class_o_n___text_run_builder.html | 14 +- .../class_o_n___clipping_plane-members.html | 14 +- .../opennurbs__internal__glyph_8h_source.html | 28 +-- ...lass_o_n___surface_properties-members.html | 14 +- ...opennurbs__texture__mapping_8h_source.html | 24 +- 6/da/d8d/class_o_n___angle_unit_name.html | 14 +- 6/da/d8e/class_o_n___mesh_topology.html | 14 +- 6/da/d94/opennurbs__bitmap_8h_source.html | 19 +- .../opennurbs__dll__resource_8h_source.html | 16 +- 6/da/d96/class_o_n___sum-members.html | 14 +- 6/da/d97/class_o_n___dim_angular.html | 26 +-- 6/da/d99/class_o_n__3dm_render_settings.html | 18 +- .../d9a/class_o_n___hash32_table-members.html | 14 +- 6/da/d9f/class_o_n___uuid_index_list.html | 17 +- 6/da/da0/class_o_n___surface.html | 36 ++- 6/da/db3/class_o_n___clipping_region.html | 27 +-- .../class_o_n___uuid_pair_list-members.html | 14 +- 6/da/dce/struct_o_n___r_tree_b_box.html | 14 +- ...ss_o_n___mesh_vertex_face_map-members.html | 14 +- .../dd9/class_o_n___mesh_vertex_face_map.html | 14 +- 6/da/dda/struct_o_n___brep_trim_point.html | 14 +- 6/da/de3/class_o_n___name_hash.html | 14 +- 6/da/de3/class_o_n___r_tree-members.html | 14 +- 6/da/de3/opennurbs__texture_8h_source.html | 16 +- 6/da/dec/union_o_n___u-members.html | 14 +- 6/da/ded/opennurbs__sumsurface_8h_source.html | 16 +- .../ded/struct_o_n___r_tree_node-members.html | 14 +- 6/da/df1/opennurbs__geometry_8h_source.html | 16 +- 6/da/dfa/class_o_n___cone-members.html | 14 +- .../dfb/class_o_n___brep_region_topology.html | 14 +- 6/da/dff/class_o_n___m_d5___hash.html | 19 +- .../opennurbs__offsetsurface_8h_source.html | 16 +- 6/db/d0f/class_o_n___plane-members.html | 14 +- ..._3dm_construction_plane_grid_defaults.html | 14 +- 6/db/d11/opennurbs__text_8h_source.html | 16 +- 6/db/d13/class_o_n___content_hash.html | 28 +-- 6/db/d13/class_o_n___uuid_list-members.html | 14 +- 6/db/d16/class_o_n___binary_archive.html | 46 ++-- ...lass_o_n___rtf_string_builder-members.html | 14 +- 6/db/d2a/class_o_n___ellipse-members.html | 14 +- 6/db/d2a/opennurbs__color_8h_source.html | 16 +- 6/db/d2b/class_o_n__3d_vector-members.html | 14 +- .../class_o_n___nurbs_surface-members.html | 14 +- ...lass_o_n___internal___font_glyph_pool.html | 17 +- .../class_o_n___write3dm_buffer_archive.html | 14 +- 6/db/d3b/class_o_n___box.html | 18 +- .../class_o_n__3f_point_array-members.html | 14 +- 6/db/d41/class_o_n__2i_vector.html | 14 +- .../d49/struct_o_n___r_tree_leaf-members.html | 14 +- .../examples__linking__pragmas_8h_source.html | 16 +- 6/db/d4d/class_o_n___string_buffer.html | 14 +- ...class_o_n___compressed_buffer-members.html | 14 +- 6/db/d53/class_o_n___quaternion-members.html | 14 +- 6/db/d55/class_o_n___text_builder.html | 14 +- ...lass_o_n___bounding_box_cache-members.html | 14 +- 6/db/d60/opennurbs__bezier_8h_source.html | 16 +- 6/db/d65/opennurbs_8h_source.html | 16 +- 6/db/d66/struct_o_n___r_tree_leaf.html | 14 +- .../class_o_n___model_geometry_component.html | 27 +-- ...lass_o_n___aerial_photo_image-members.html | 14 +- 6/db/d70/class_o_n___file_system.html | 17 +- .../struct_o_n___r_tree_b_box-members.html | 14 +- ...pennurbs__freetype__include_8h_source.html | 16 +- 6/db/d80/class_o_n__3f_vector.html | 22 +- 6/db/d87/opennurbs__md5_8h_source.html | 16 +- 6/db/d8b/class_o_n___mesh_face-members.html | 14 +- 6/db/d8c/class_o_n__4f_point.html | 14 +- 6/db/d8d/class_o_n_x___model-members.html | 14 +- 6/db/d93/class_o_n___m_d5___hash-members.html | 14 +- 6/db/da1/class_o_n___length_unit_name.html | 14 +- .../class_o_n___length_unit_name-members.html | 14 +- 6/db/da6/class_o_n___uncompress_stream.html | 20 +- 6/db/dac/opennurbs__polycurve_8h_source.html | 16 +- .../class_o_n___managed_fonts-members.html | 25 +- 6/db/db0/class_o_n___r_tree_iterator.html | 14 +- ...lass_o_n_x___model_component_iterator.html | 14 +- 6/db/db4/opennurbs__ellipse_8h_source.html | 16 +- 6/db/dbc/class_o_n___uuid_list.html | 14 +- 6/db/dbd/class_o_n__2i_size-members.html | 14 +- 6/db/dbf/class_o_n__2d_vector-members.html | 14 +- 6/db/dc0/class_o_n__3d_point-members.html | 14 +- 6/db/dc1/class_o_n___dim_linear.html | 26 +-- 6/db/dc7/class_o_n___text_run-members.html | 14 +- 6/db/dca/class_o_n___hatch_loop.html | 21 +- 6/db/dcf/class_o_n___text_iterator.html | 14 +- ...class_o_n___surface_curvature-members.html | 14 +- ..._x___model_component_iterator-members.html | 14 +- .../opennurbs__bounding__box_8h_source.html | 18 +- 6/db/df7/opennurbs__mesh_8h_source.html | 27 +-- 6/db/df8/class_o_n___surface-members.html | 14 +- 6/db/df9/class_o_n__2f_vector.html | 22 +- 6/db/dfc/opennurbs__hatch_8h_source.html | 18 +- ...struction_plane_grid_defaults-members.html | 14 +- 6/dc/d06/class_o_n___text_dot-members.html | 14 +- ...ass_o_n___clipping_plane_info-members.html | 14 +- 6/dc/d0f/class_o_n___mesh_ngon-members.html | 14 +- .../class_o_n___read3dm_buffer_archive.html | 18 +- .../class_o_n___text_log_indent-members.html | 14 +- 6/dc/d12/opennurbs__circle_8h_source.html | 16 +- 6/dc/d18/opennurbs__cylinder_8h_source.html | 16 +- 6/dc/d1c/class_o_n___sum_surface.html | 34 ++- 6/dc/d1d/class_o_n___user_string-members.html | 14 +- 6/dc/d27/class_rtf_composer.html | 14 +- ...struct_o_n__3_d_m___c_h_u_n_k-members.html | 14 +- 6/dc/d39/class_o_n___length_value.html | 18 +- 6/dc/d3b/class_o_n___brep_region-members.html | 14 +- 6/dc/d3e/class_o_n___r_tree.html | 14 +- .../class_o_n___brep_trim_array-members.html | 14 +- .../opennurbs__annotationbase_8h_source.html | 16 +- 6/dc/d5c/class_o_n___model_component.html | 51 ++-- .../class_o_n___compress_stream-members.html | 14 +- .../class_o_n__3d_vector_array-members.html | 14 +- .../class_o_n__3dm_application-members.html | 14 +- 6/dc/d67/class_o_n___dim_radial-members.html | 14 +- ...ss_o_n___offset_surface_value-members.html | 14 +- 6/dc/d6b/class_o_n__3dm_page_settings.html | 14 +- 6/dc/d70/class_o_n___file_stream-members.html | 14 +- .../class_o_n___standard_display_mode_id.html | 14 +- ..._obj_ref_evaluation_parameter-members.html | 14 +- 6/dc/d81/opennurbs__extensions_8h_source.html | 16 +- 6/dc/d83/class_o_n___arc_curve.html | 34 +-- 6/dc/d87/opennurbs__public_8h_source.html | 16 +- .../class_o_n___mesh_parameters-members.html | 14 +- 6/dc/d8c/class_o_n___dim_linear-members.html | 14 +- 6/dc/d9a/class_o_n__3dm_goo-members.html | 14 +- ...__internal___v5__annotation_8h_source.html | 34 +-- 6/dc/daa/opennurbs__light_8h_source.html | 16 +- 6/dc/db0/class_o_n___hatch_pattern.html | 22 +- .../class_o_n___r_tree_mem_pool-members.html | 14 +- 6/dc/dbb/class_o_n___mapping_ref-members.html | 14 +- .../class_o_n__3d_point_list_ref-members.html | 14 +- .../dc1/class_o_n___brep_face_side_array.html | 14 +- 6/dc/dc7/class_o_n___interval.html | 14 +- ..._aerial_photo_camera_position-members.html | 14 +- .../opennurbs__version__number_8h_source.html | 16 +- 6/dc/dd6/opennurbs__curveproxy_8h_source.html | 16 +- 6/dc/dd9/struct_o_n___mesh_topology_face.html | 14 +- 6/dc/dda/class_o_n___curve_proxy.html | 38 ++- .../de2/opennurbs__textcontext_8h_source.html | 16 +- 6/dc/dec/class_o_n___text_box.html | 17 +- ...class_o_n___serial_number_map-members.html | 14 +- 6/dc/df4/opennurbs__layer_8h_source.html | 16 +- 6/dc/dfc/class_o_n___brep_face_array.html | 14 +- ...s_o_n___arithmetic_calculator-members.html | 14 +- 6/dc/dfe/class_o_n___simple_array.html | 86 +++---- .../class_o_n__3dm_i_o_settings-members.html | 14 +- 6/dd/d05/class_o_n___point_grid.html | 22 +- 6/dd/d09/class_o_n___arc_curve-members.html | 14 +- 6/dd/d0b/class_o_n___text_box-members.html | 14 +- 6/dd/d11/opennurbs__compstat_8h_source.html | 16 +- .../class_o_n__3dm_view_position-members.html | 14 +- 6/dd/d15/class_o_n___mesh_component_ref.html | 14 +- 6/dd/d1b/class_o_n___cylinder-members.html | 14 +- 6/dd/d1f/class_o_n___rev_surface-members.html | 14 +- ...ber_map_1_1_m_a_p___v_a_l_u_e-members.html | 14 +- 6/dd/d25/class_o_n__2i_bounding_box.html | 14 +- 6/dd/d26/class_o_n___point-members.html | 14 +- 6/dd/d29/class_o_n___font_metrics.html | 17 +- 6/dd/d2f/opennurbs__locale_8h_source.html | 18 +- 6/dd/d31/class_o_n___texture_coordinates.html | 14 +- .../class_o_n___mesh_ngon_buffer-members.html | 14 +- 6/dd/d40/class_o_n___class_array.html | 68 ++---- 6/dd/d42/class_o_n__3dm_properties.html | 14 +- .../d4e/class_o_n___stacked_text-members.html | 14 +- .../opennurbs__model__geometry_8h_source.html | 18 +- 6/dd/d50/class_o_n___check_sum.html | 18 +- 6/dd/d51/class_o_n___history_record.html | 25 +- ...n___model_component_reference-members.html | 14 +- 6/dd/d5b/class_o_n___obsolete_user_data.html | 14 +- 6/dd/d5c/opennurbs__textglyph_8h_source.html | 16 +- 6/dd/d60/class_o_n___mapping_channel.html | 20 +- .../d60/class_o_n_x___model_test-members.html | 14 +- .../struct_o_n___r_tree_capsule-members.html | 14 +- .../class_o_n___angle_unit_name-members.html | 14 +- .../class_o_n___bezier_surface-members.html | 14 +- 6/dd/d73/class_o_n___cage_morph-members.html | 14 +- .../class_o_n___windows_bitmap-members.html | 14 +- 6/dd/d7c/opennurbs__workspace_8h_source.html | 16 +- 6/dd/d7d/class_o_n__2d_vector_array.html | 14 +- ...opennurbs__public__examples_8h_source.html | 16 +- 6/dd/d88/class_o_n___point_grid-members.html | 14 +- 6/dd/d89/class_o_n___plane_equation.html | 17 +- 6/dd/d8a/class_o_n___poly_curve-members.html | 14 +- .../class_o_n___mesh_face_side-members.html | 14 +- 6/dd/d8f/class_o_n__2d_point-members.html | 14 +- ...o_n___simple_fixed_size_pool_iterator.html | 14 +- ...s_o_n___mesh_curve_parameters-members.html | 14 +- ...opennurbs__system__compiler_8h_source.html | 16 +- ...lass_o_n___earth_anchor_point-members.html | 14 +- .../class_o_n___uuid_ptr_list-members.html | 14 +- 6/dd/da7/class_o_n___file_stream.html | 17 +- 6/dd/da8/class_o_n___polyline.html | 18 +- 6/dd/da8/opennurbs__3dm_8h_source.html | 16 +- .../dbe/opennurbs__hash__table_8h_source.html | 16 +- .../struct_o_n___windows_r_g_b_q_u_a_d.html | 14 +- .../class_o_n__2f_vector_array-members.html | 14 +- 6/dd/dd9/class_o_n__2d_point.html | 22 +- .../class_o_n___arithmetic_calculator.html | 21 +- 6/dd/ddf/class_o_n___s_h_a1___hash.html | 17 +- 6/dd/de8/class_o_n___brep_edge.html | 17 +- 6/dd/df2/class_o_n__3dm_settings.html | 14 +- 6/dd/df6/class_o_n_x___model_test.html | 22 +- .../dfc/class_o_n___manifest_map-members.html | 14 +- .../class_o_n___brep_face_array-members.html | 14 +- 6/de/d00/class_o_n___nurbs_cage-members.html | 14 +- 6/de/d04/class_o_n__3f_vector-members.html | 14 +- .../class_o_n__2d_vector_array-members.html | 14 +- 6/de/d18/struct_o_n___r_tree_node.html | 14 +- ...class_o_n___document_user_string_list.html | 18 +- 6/de/d23/class_o_n__3dm_i_o_settings.html | 14 +- 6/de/d23/class_o_n__w_string-members.html | 14 +- 6/de/d29/class_o_n__3dm_wallpaper_image.html | 14 +- .../class_o_n___component_manifest_item.html | 14 +- 6/de/d36/class_o_n___binary_file.html | 17 +- ...ss_o_n___dim_style_1_1_dimstyle_field.html | 14 +- 6/de/d42/class_o_n___rtf_parser.html | 14 +- ..._model_component_content_mark-members.html | 14 +- .../opennurbs__textiterator_8h_source.html | 218 +----------------- 6/de/d5b/class_o_n__2f_point.html | 22 +- 6/de/d5d/class_o_n___obj_ref___i_ref_i_d.html | 20 +- ...ss_o_n___obj_ref_evaluation_parameter.html | 18 +- .../struct_o_n___mesh_topology_vertex.html | 14 +- 6/de/d67/opennurbs__matrix_8h_source.html | 16 +- .../opennurbs__object__history_8h_source.html | 16 +- 6/de/d84/openurbs__public_8h_source.html | 16 +- .../opennurbs__photogrammetry_8h_source.html | 16 +- ...class_o_n___windows_bitmap_ex-members.html | 14 +- 6/de/d88/class_o_n___class_id-members.html | 14 +- .../class_o_n__2i_bounding_box-members.html | 14 +- 6/de/d91/class_o_n___mesh_face.html | 14 +- 6/de/d92/opennurbs__base32_8h_source.html | 16 +- 6/de/d9b/class_o_n___bezier_cage_morph.html | 14 +- 6/de/d9f/class_o_n___bitmap.html | 28 +-- .../class_o_n___fixed_size_pool_iterator.html | 14 +- 6/de/da2/class_o_n___hash32_table_item.html | 18 +- 6/de/da2/opennurbs__ipoint_8h_source.html | 16 +- ...ruct_o_n___mesh_topology_edge-members.html | 14 +- ...ass_o_n_x___model___user_data-members.html | 14 +- 6/de/db8/class_o_n___group-members.html | 14 +- 6/de/db9/class_o_n___evaluator-members.html | 14 +- 6/de/dc7/class_o_n___brep-members.html | 14 +- 6/de/dcf/class_o_n___extrusion.html | 38 ++- 6/de/dd1/opennurbs__linetype_8h_source.html | 18 +- 6/de/dd6/class_o_n__2i_point.html | 20 +- 6/de/ddc/class_o_n___nurbs_surface.html | 28 +-- .../de7/opennurbs__std__string_8h_source.html | 16 +- 6/de/de8/class_o_n___instance_ref.html | 18 +- .../class_o_n___s_h_a1___hash-members.html | 14 +- 6/de/dfb/opennurbs__lock_8h_source.html | 16 +- 6/de/dfd/opennurbs__intersect_8h_source.html | 16 +- ...ennurbs__windows__targetver_8h_source.html | 16 +- 6/df/d02/class_o_n__4i_rect.html | 14 +- ...al_number_map_1_1_s_n___e_l_e_m_e_n_t.html | 14 +- 6/df/d05/class_o_n___buffer.html | 17 +- ...ss_o_n___brep_region_topology-members.html | 14 +- .../class_o_n__3dm_annotation_settings.html | 14 +- 6/df/d10/class_o_n___lock.html | 25 +- 6/df/d11/class_o_n___mesh.html | 67 ++---- .../opennurbs__public__version_8h_source.html | 18 +- 6/df/d19/class_rtf_composer-members.html | 14 +- 6/df/d28/class_o_n___brep_face_side.html | 18 +- 6/df/d2d/class_o_n___font-members.html | 158 ++++++------- 6/df/d2e/class_o_n__2f_vector_array.html | 14 +- 6/df/d32/class_o_n__2d_size.html | 14 +- 6/df/d35/class_o_n___mesh_ngon_buffer.html | 14 +- ...ass_o_n__3dm_revision_history-members.html | 14 +- 6/df/d40/class_o_n___local_zero1-members.html | 14 +- 6/df/d43/class_o_n___arc-members.html | 14 +- 6/df/d45/class_o_n___text_log-members.html | 14 +- 6/df/d46/struct_o_n___r_tree_capsule.html | 14 +- 6/df/d4e/class_o_n___polynomial_surface.html | 14 +- 6/df/d54/class_o_n___plug_in_ref.html | 21 +- .../class_o_n___bump_function-members.html | 14 +- .../class_o_n___history_record-members.html | 14 +- .../class_o_n__3dm_units_and_tolerances.html | 26 +-- 6/df/d6f/class_o_n___poly_edge_history.html | 14 +- 6/df/d78/structtag_font_key.html | 14 +- 6/df/d7f/class_o_n___s_h_a1-members.html | 14 +- 6/df/d95/class_o_n___obj_ref-members.html | 14 +- 6/df/d97/class_o_n__2i_vector-members.html | 14 +- ...ass_o_n___debug_write_archive-members.html | 14 +- 6/df/dae/class_o_n___color-members.html | 14 +- 6/df/dbc/class_o_n___mesh_parameters.html | 20 +- .../class_o_n__3dm_properties-members.html | 14 +- 6/df/dc4/class_o_n___hatch_line.html | 17 +- 6/df/dc9/class_o_n___bounding_box_cache.html | 14 +- ...ass_rtf_composer_1_1_run_info-members.html | 14 +- ..._n__3_d_m___b_i_g___c_h_u_n_k-members.html | 14 +- ...i_t_m_a_p_i_n_f_o_h_e_a_d_e_r-members.html | 14 +- 6/df/dd4/class_o_n___light-members.html | 14 +- 6/df/dd4/class_o_n___text_hash-members.html | 14 +- 6/df/ddb/class_o_n___curve-members.html | 14 +- 6/df/dde/class_o_n___mesh_partition.html | 14 +- 6/df/de0/class_o_n___geometry.html | 27 +-- 6/df/de4/class_o_n___box-members.html | 14 +- ...class_o_n___model_component_reference.html | 14 +- 6/df/df1/opennurbs__wip_8h_source.html | 16 +- 6/df/df2/class_o_n___point_cloud.html | 20 +- 6/df/df5/opennurbs__torus_8h_source.html | 16 +- .../class_o_n__w_string_buffer-members.html | 14 +- 6/df/dfd/class_o_n___text_mask-members.html | 14 +- ...__windows_b_i_t_m_a_p_i_n_f_o-members.html | 14 +- 6/dir_2ea30aa2956a8db99dd22aa5e597f384.html | 16 +- 6/dir_7a6cfee8d318bd47c162fe536aecd3a7.html | 16 +- 6/doxygen.css | 2 +- 6/dynsections.js | 33 +-- 6/functions.html | 35 ++- 6/functions_0x7e.html | 14 +- 6/functions_b.html | 14 +- 6/functions_c.html | 71 +++--- 6/functions_d.html | 14 +- 6/functions_e.html | 14 +- 6/functions_enum.html | 14 +- 6/functions_eval.html | 17 +- 6/functions_f.html | 14 +- 6/functions_func.html | 14 +- 6/functions_func_0x7e.html | 14 +- 6/functions_func_b.html | 14 +- 6/functions_func_c.html | 61 +++-- 6/functions_func_d.html | 14 +- 6/functions_func_e.html | 14 +- 6/functions_func_f.html | 14 +- 6/functions_func_g.html | 25 +- 6/functions_func_h.html | 14 +- 6/functions_func_i.html | 14 +- 6/functions_func_j.html | 14 +- 6/functions_func_k.html | 14 +- 6/functions_func_l.html | 14 +- 6/functions_func_m.html | 14 +- 6/functions_func_n.html | 14 +- 6/functions_func_o.html | 14 +- 6/functions_func_p.html | 14 +- 6/functions_func_q.html | 14 +- 6/functions_func_r.html | 14 +- 6/functions_func_s.html | 50 ++-- 6/functions_func_t.html | 14 +- 6/functions_func_u.html | 14 +- 6/functions_func_v.html | 14 +- 6/functions_func_w.html | 14 +- 6/functions_func_x.html | 14 +- 6/functions_func_y.html | 14 +- 6/functions_func_z.html | 14 +- 6/functions_g.html | 21 +- 6/functions_h.html | 14 +- 6/functions_i.html | 14 +- 6/functions_j.html | 14 +- 6/functions_k.html | 14 +- 6/functions_l.html | 14 +- 6/functions_m.html | 14 +- 6/functions_n.html | 14 +- 6/functions_o.html | 14 +- 6/functions_p.html | 14 +- 6/functions_q.html | 14 +- 6/functions_r.html | 30 ++- 6/functions_rela.html | 14 +- 6/functions_s.html | 46 ++-- 6/functions_t.html | 14 +- 6/functions_type.html | 14 +- 6/functions_u.html | 14 +- 6/functions_v.html | 14 +- 6/functions_vars.html | 14 +- 6/functions_vars_b.html | 14 +- 6/functions_vars_c.html | 14 +- 6/functions_vars_d.html | 14 +- 6/functions_vars_e.html | 14 +- 6/functions_vars_f.html | 14 +- 6/functions_vars_g.html | 14 +- 6/functions_vars_h.html | 14 +- 6/functions_vars_i.html | 14 +- 6/functions_vars_j.html | 14 +- 6/functions_vars_k.html | 14 +- 6/functions_vars_l.html | 14 +- 6/functions_vars_m.html | 14 +- 6/functions_vars_n.html | 14 +- 6/functions_vars_o.html | 14 +- 6/functions_vars_p.html | 14 +- 6/functions_vars_q.html | 14 +- 6/functions_vars_r.html | 14 +- 6/functions_vars_s.html | 14 +- 6/functions_vars_t.html | 14 +- 6/functions_vars_u.html | 14 +- 6/functions_vars_v.html | 14 +- 6/functions_vars_w.html | 14 +- 6/functions_vars_x.html | 14 +- 6/functions_vars_y.html | 14 +- 6/functions_vars_z.html | 14 +- 6/functions_w.html | 14 +- 6/functions_x.html | 14 +- 6/functions_y.html | 14 +- 6/functions_z.html | 14 +- 6/hierarchy.html | 132 ++++++----- 6/index.html | 14 +- 6/jquery.js | 32 +-- 6/menu.js | 24 -- 6/menudata.js | 23 -- 6/search/all_0.html | 6 +- 6/search/all_0.js | 1 - 6/search/all_1.html | 6 +- 6/search/all_10.html | 6 +- 6/search/all_11.html | 6 +- 6/search/all_11.js | 2 +- 6/search/all_12.html | 6 +- 6/search/all_12.js | 6 +- 6/search/all_13.html | 6 +- 6/search/all_13.js | 4 +- 6/search/all_14.html | 6 +- 6/search/all_14.js | 2 +- 6/search/all_15.html | 6 +- 6/search/all_16.html | 6 +- 6/search/all_17.html | 6 +- 6/search/all_17.js | 2 +- 6/search/all_18.html | 6 +- 6/search/all_18.js | 2 +- 6/search/all_19.html | 6 +- 6/search/all_19.js | 2 +- 6/search/all_1a.html | 6 +- 6/search/all_2.html | 6 +- 6/search/all_2.js | 3 +- 6/search/all_3.html | 6 +- 6/search/all_4.html | 6 +- 6/search/all_5.html | 6 +- 6/search/all_6.html | 6 +- 6/search/all_6.js | 3 +- 6/search/all_7.html | 6 +- 6/search/all_8.html | 6 +- 6/search/all_9.html | 6 +- 6/search/all_a.html | 6 +- 6/search/all_b.html | 6 +- 6/search/all_c.html | 6 +- 6/search/all_d.html | 6 +- 6/search/all_e.html | 6 +- 6/search/all_f.html | 6 +- 6/search/all_f.js | 2 +- 6/search/classes_0.html | 6 +- 6/search/classes_1.html | 6 +- 6/search/classes_2.html | 6 +- 6/search/classes_3.html | 6 +- 6/search/classes_4.html | 6 +- 6/search/classes_5.html | 6 +- 6/search/enums_0.html | 6 +- 6/search/enums_1.html | 6 +- 6/search/enums_2.html | 6 +- 6/search/enums_3.html | 6 +- 6/search/enums_4.html | 6 +- 6/search/enums_5.html | 6 +- 6/search/enums_6.html | 6 +- 6/search/enums_7.html | 6 +- 6/search/enums_8.html | 6 +- 6/search/enums_9.html | 6 +- 6/search/enums_a.html | 6 +- 6/search/enums_b.html | 6 +- 6/search/enums_c.html | 6 +- 6/search/enums_c.js | 2 +- 6/search/enums_d.html | 6 +- 6/search/enums_e.html | 6 +- 6/search/enumvalues_0.html | 6 +- 6/search/enumvalues_0.js | 1 - 6/search/enumvalues_1.html | 6 +- 6/search/enumvalues_10.html | 6 +- 6/search/enumvalues_11.html | 6 +- 6/search/enumvalues_12.html | 6 +- 6/search/enumvalues_12.js | 2 +- 6/search/enumvalues_13.html | 6 +- 6/search/enumvalues_14.html | 6 +- 6/search/enumvalues_14.js | 2 +- 6/search/enumvalues_15.html | 6 +- 6/search/enumvalues_16.html | 6 +- 6/search/enumvalues_17.html | 6 +- 6/search/enumvalues_18.html | 6 +- 6/search/enumvalues_2.html | 6 +- 6/search/enumvalues_3.html | 6 +- 6/search/enumvalues_4.html | 6 +- 6/search/enumvalues_5.html | 6 +- 6/search/enumvalues_6.html | 6 +- 6/search/enumvalues_7.html | 6 +- 6/search/enumvalues_8.html | 6 +- 6/search/enumvalues_9.html | 6 +- 6/search/enumvalues_a.html | 6 +- 6/search/enumvalues_b.html | 6 +- 6/search/enumvalues_c.html | 6 +- 6/search/enumvalues_d.html | 6 +- 6/search/enumvalues_e.html | 6 +- 6/search/enumvalues_f.html | 6 +- 6/search/functions_0.html | 6 +- 6/search/functions_1.html | 6 +- 6/search/functions_10.html | 6 +- 6/search/functions_11.html | 6 +- 6/search/functions_12.html | 6 +- 6/search/functions_12.js | 4 +- 6/search/functions_13.html | 6 +- 6/search/functions_14.html | 6 +- 6/search/functions_15.html | 6 +- 6/search/functions_16.html | 6 +- 6/search/functions_17.html | 6 +- 6/search/functions_18.html | 6 +- 6/search/functions_19.html | 6 +- 6/search/functions_1a.html | 6 +- 6/search/functions_2.html | 6 +- 6/search/functions_2.js | 3 +- 6/search/functions_3.html | 6 +- 6/search/functions_4.html | 6 +- 6/search/functions_5.html | 6 +- 6/search/functions_6.html | 6 +- 6/search/functions_6.js | 3 +- 6/search/functions_7.html | 6 +- 6/search/functions_8.html | 6 +- 6/search/functions_9.html | 6 +- 6/search/functions_a.html | 6 +- 6/search/functions_b.html | 6 +- 6/search/functions_c.html | 6 +- 6/search/functions_d.html | 6 +- 6/search/functions_e.html | 6 +- 6/search/functions_f.html | 6 +- 6/search/related_0.html | 6 +- 6/search/search.js | 25 +- 6/search/typedefs_0.html | 6 +- 6/search/variables_0.html | 6 +- 6/search/variables_1.html | 6 +- 6/search/variables_10.html | 6 +- 6/search/variables_11.html | 6 +- 6/search/variables_12.html | 6 +- 6/search/variables_13.html | 6 +- 6/search/variables_14.html | 6 +- 6/search/variables_15.html | 6 +- 6/search/variables_16.html | 6 +- 6/search/variables_17.html | 6 +- 6/search/variables_17.js | 2 +- 6/search/variables_18.html | 6 +- 6/search/variables_19.html | 6 +- 6/search/variables_19.js | 2 +- 6/search/variables_2.html | 6 +- 6/search/variables_3.html | 6 +- 6/search/variables_4.html | 6 +- 6/search/variables_5.html | 6 +- 6/search/variables_6.html | 6 +- 6/search/variables_7.html | 6 +- 6/search/variables_8.html | 6 +- 6/search/variables_9.html | 6 +- 6/search/variables_a.html | 6 +- 6/search/variables_b.html | 6 +- 6/search/variables_c.html | 6 +- 6/search/variables_d.html | 6 +- 6/search/variables_e.html | 6 +- 6/search/variables_f.html | 6 +- 1111 files changed, 7129 insertions(+), 10641 deletions(-) diff --git a/6/annotated.html b/6/annotated.html index 43cf75d4..ceea7939 100644 --- a/6/annotated.html +++ b/6/annotated.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + + @@ -199,7 +197,7 @@ $(function() {  CON_DimOrdinate  CON_DimRadial
- CON_DimStyle + CON_DimStyle  CDimstyleField  CON_DimStyleContext  CON_DisplayMaterialRef @@ -328,10 +326,10 @@ $(function() {  CON_ReferencedComponentSettings  CON_RenderingAttributes  CON_RevSurfaceSurface of revolution - CON_RtfFirstChar + CON_RtfFirstChar  CTextRun  CON_RtfParser - CON_RtfStringBuilder + CON_RtfStringBuilder  CTextRun  CON_RTree  CON_RTreeBBox @@ -344,7 +342,7 @@ $(function() {  CON_RTreeSearchResult  CON_RTreeSphere  CON_ScaleValue - CON_SerialNumberMap + CON_SerialNumberMap  CMAP_VALUE  CSN_ELEMENT  CON_SHA1 @@ -369,7 +367,7 @@ $(function() {  CON_Terminator  CON_TextON_Table class  CON_TextBox - CON_TextBuilder + CON_TextBuilder  CTextProps  CON_TextContent  CON_TextContext
@@ -422,7 +420,7 @@ $(function() {  CONX_Model_UserData  CONX_ModelComponentIterator  CONX_ModelTest - CRtfComposer + CRtfComposer  CRunInfo  CtagFontKey @@ -430,9 +428,9 @@ $(function() { diff --git a/6/classes.html b/6/classes.html index da4447e8..50d06a0a 100644 --- a/6/classes.html +++ b/6/classes.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Index @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + + @@ -153,9 +151,9 @@ $(function() { diff --git a/6/d0/d00/class_o_n___binary_archive_buffer-members.html b/6/d0/d00/class_o_n___binary_archive_buffer-members.html index 397357d4..8e3433b2 100644 --- a/6/d0/d00/class_o_n___binary_archive_buffer-members.html +++ b/6/d0/d00/class_o_n___binary_archive_buffer-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d01/class_rtf_composer_1_1_run_info.html b/6/d0/d01/class_rtf_composer_1_1_run_info.html index 764a2012..6370be51 100644 --- a/6/d0/d01/class_rtf_composer_1_1_run_info.html +++ b/6/d0/d01/class_rtf_composer_1_1_run_info.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: RtfComposer::RunInfo Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d04/class_o_n___group.html b/6/d0/d04/class_o_n___group.html index c5e61b31..42e43fd1 100644 --- a/6/d0/d04/class_o_n___group.html +++ b/6/d0/d04/class_o_n___group.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Group Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
Type::HistoryRecord = 13, Type::Mixed = 0xFE
- } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
+ } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
+   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
@@ -520,9 +518,7 @@ Additional Inherited Members

Detailed Description

NoKeywords
-


-/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
-/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

+

/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

Constructor & Destructor Documentation

◆ ON_Group() [1/2]

@@ -676,9 +672,9 @@ Additional Inherited Members
diff --git a/6/d0/d05/class_o_n_x___error_counter-members.html b/6/d0/d05/class_o_n_x___error_counter-members.html index 1f44a930..70708201 100644 --- a/6/d0/d05/class_o_n_x___error_counter-members.html +++ b/6/d0/d05/class_o_n_x___error_counter-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d09/class_o_n___pick_point.html b/6/d0/d09/class_o_n___pick_point.html index d937f7bd..3b736884 100644 --- a/6/d0/d09/class_o_n___pick_point.html +++ b/6/d0/d09/class_o_n___pick_point.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_PickPoint Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d16/class_o_n___texture.html b/6/d0/d16/class_o_n___texture.html index f4b054cb..8b10671d 100644 --- a/6/d0/d16/class_o_n___texture.html +++ b/6/d0/d16/class_o_n___texture.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Texture Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
MAPPING_CHANNEL::srfp_channel = 0xFFFFFFFEU, MAPPING_CHANNEL::emap_channel = 0xFFFFFFFFU
- } - list of pre-defined channel ids More...
+ } list of pre-defined channel ids More...
+   enum  MODE : unsigned int { MODE::no_texture_mode = 0, MODE::modulate_texture = 1, @@ -346,13 +344,7 @@ Static Public Attributes

Detailed Description

NoKeywords
-


-
-
-/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
-
-
-/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

+

/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

defines ON_Color and ON_Material

Class ON_Texture

Member Enumeration Documentation

@@ -1279,8 +1271,8 @@ Static Public Attributes
-

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
- The default implementation of this virtual function returns false and does nothing.

+

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

+

The default implementation of this virtual function returns false and does nothing.

Reimplemented from ON_Object.

@@ -1717,9 +1709,9 @@ Static Public Attributes
diff --git a/6/d0/d19/class_o_n___centermark-members.html b/6/d0/d19/class_o_n___centermark-members.html index fc7c63ad..b34b00e1 100644 --- a/6/d0/d19/class_o_n___centermark-members.html +++ b/6/d0/d19/class_o_n___centermark-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d1c/class_o_n___brep_loop.html b/6/d0/d1c/class_o_n___brep_loop.html index dbd45add..c5ac2b43 100644 --- a/6/d0/d1c/class_o_n___brep_loop.html +++ b/6/d0/d1c/class_o_n___brep_loop.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepLoop Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
-

Expert interface
-Description: Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. Parameters: bDelete - [in] if true, any cached information is properly deleted. If false, any cached information is simply discarded. This is useful when the cached information may be in alternate memory pools that are managed in nonstandard ways.

+

Expert interface Description: Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. Parameters: bDelete - [in] if true, any cached information is properly deleted. If false, any cached information is simply discarded. This is useful when the cached information may be in alternate memory pools that are managed in nonstandard ways.

Reimplemented from ON_Object.

@@ -476,8 +473,7 @@ Description: Expert user function. If you are using openNURBS in its default con
-

virtual ON_Geometry overrides A loop is derived from ON_Geometry so that is can be passed around to things that expect ON_Geometry pointers. It is not a very useful stand-alone object.
-Description: virtual ON_Geometry::Dimension() override. Returns: 2

+

virtual ON_Geometry overrides A loop is derived from ON_Geometry so that is can be passed around to things that expect ON_Geometry pointers. It is not a very useful stand-alone object. Description: virtual ON_Geometry::Dimension() override. Returns: 2

Reimplemented from ON_Geometry.

@@ -851,8 +847,8 @@ Description: virtual -

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
- The default implementation of this virtual function returns false and does nothing.

+

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

+

The default implementation of this virtual function returns false and does nothing.

Reimplemented from ON_Object.

@@ -1007,9 +1003,9 @@ Description: virtual diff --git a/6/d0/d29/class_o_n___torus-members.html b/6/d0/d29/class_o_n___torus-members.html index 61dcb9ad..71a805f3 100644 --- a/6/d0/d29/class_o_n___torus-members.html +++ b/6/d0/d29/class_o_n___torus-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@
- + +
diff --git a/6/d0/d30/class_o_n___hatch.html b/6/d0/d30/class_o_n___hatch.html index a16ecceb..cc7ccf6c 100644 --- a/6/d0/d30/class_o_n___hatch.html +++ b/6/d0/d30/class_o_n___hatch.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Hatch Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
-

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
- The default implementation of this virtual function returns false and does nothing.

+

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

+

The default implementation of this virtual function returns false and does nothing.

Reimplemented from ON_Object.

@@ -1223,9 +1221,9 @@ Additional Inherited Members
diff --git a/6/d0/d31/opennurbs__3dm__properties_8h_source.html b/6/d0/d31/opennurbs__3dm__properties_8h_source.html index 91d53b16..287bdd7b 100644 --- a/6/d0/d31/opennurbs__3dm__properties_8h_source.html +++ b/6/d0/d31/opennurbs__3dm__properties_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_3dm_properties.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_3dm_properties.h Source File @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d37/class_o_n__3dm_archive_table_status-members.html b/6/d0/d37/class_o_n__3dm_archive_table_status-members.html index 06b2a0ce..ffb7abdb 100644 --- a/6/d0/d37/class_o_n__3dm_archive_table_status-members.html +++ b/6/d0/d37/class_o_n__3dm_archive_table_status-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d39/class_o_n__3dm_revision_history.html b/6/d0/d39/class_o_n__3dm_revision_history.html index b858aa84..bc27d88d 100644 --- a/6/d0/d39/class_o_n__3dm_revision_history.html +++ b/6/d0/d39/class_o_n__3dm_revision_history.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmRevisionHistory Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +

Detailed Description

NoKeywords
-


-/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
-/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

+

/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

Constructor & Destructor Documentation

◆ ON_3dmRevisionHistory() [1/2]

@@ -499,9 +495,9 @@ Static Public Attributes
diff --git a/6/d0/d3b/class_o_n___dim_angular-members.html b/6/d0/d3b/class_o_n___dim_angular-members.html index 55dd7437..ae6b5d73 100644 --- a/6/d0/d3b/class_o_n___dim_angular-members.html +++ b/6/d0/d3b/class_o_n___dim_angular-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d41/class_o_n___simple_fixed_size_pool.html b/6/d0/d41/class_o_n___simple_fixed_size_pool.html index 0164ea2e..da5c17ca 100644 --- a/6/d0/d41/class_o_n___simple_fixed_size_pool.html +++ b/6/d0/d41/class_o_n___simple_fixed_size_pool.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SimpleFixedSizePool< T > Class Template Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +

construction ////////////////////////////////////////////////////////

NoKeywords
-


-/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
-/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

+

/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

@@ -373,9 +369,9 @@ template<class T > diff --git a/6/d0/d43/opennurbs__pluginlist_8h_source.html b/6/d0/d43/opennurbs__pluginlist_8h_source.html index 04c1dbae..dc31d8e8 100644 --- a/6/d0/d43/opennurbs__pluginlist_8h_source.html +++ b/6/d0/d43/opennurbs__pluginlist_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_pluginlist.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_pluginlist.h Source File @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d4a/class_o_n__4i_rect-members.html b/6/d0/d4a/class_o_n__4i_rect-members.html index 7a8395df..96062134 100644 --- a/6/d0/d4a/class_o_n__4i_rect-members.html +++ b/6/d0/d4a/class_o_n__4i_rect-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d4c/class_o_n___brep_face.html b/6/d0/d4c/class_o_n___brep_face.html index 192740e5..cd649c01 100644 --- a/6/d0/d4c/class_o_n___brep_face.html +++ b/6/d0/d4c/class_o_n___brep_face.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepFace Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
N_iso = 6, iso_count = 7
- } - pure virtual class for surface objects More...
+ } pure virtual class for surface objects More...
+   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
@@ -747,8 +745,7 @@ Additional Inherited Members
-

Expert interface
-Description: Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. Parameters: bDelete - [in] if true, any cached information is properly deleted. If false, any cached information is simply discarded. This is useful when the cached information may be in alternate memory pools that are managed in nonstandard ways.

+

Expert interface Description: Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. Parameters: bDelete - [in] if true, any cached information is properly deleted. If false, any cached information is simply discarded. This is useful when the cached information may be in alternate memory pools that are managed in nonstandard ways.

Reimplemented from ON_Object.

@@ -1272,8 +1269,8 @@ Description: Expert user function. If you are using openNURBS in its default con
-

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
- The default implementation of this virtual function returns false and does nothing.

+

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

+

The default implementation of this virtual function returns false and does nothing.

Reimplemented from ON_Object.

@@ -1448,9 +1445,9 @@ Description: Expert user function. If you are using openNURBS in its default con
diff --git a/6/d0/d51/class_o_n___cone.html b/6/d0/d51/class_o_n___cone.html index 42457dcb..4a18c8b5 100644 --- a/6/d0/d51/class_o_n___cone.html +++ b/6/d0/d51/class_o_n___cone.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Cone Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d52/class_o_n__3dm_object_attributes.html b/6/d0/d52/class_o_n__3dm_object_attributes.html index ca2af759..ae3048c4 100644 --- a/6/d0/d52/class_o_n__3dm_object_attributes.html +++ b/6/d0/d52/class_o_n__3dm_object_attributes.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmObjectAttributes Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +

Detailed Description

NoKeywords
-


-
-
-/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
-
-
-/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

-

defines ON_3dmObjectAttributes
-Description: Top level OpenNURBS objects have geometry and attributes. The geometry is stored in some class derived from ON_Geometry and the attributes are stored in an ON_3dmObjectAttributes class. Examples of attributes are object name, object id, display attributes, group membership, layer membership, and so on.

+

/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

+

defines ON_3dmObjectAttributes Description: Top level OpenNURBS objects have geometry and attributes. The geometry is stored in some class derived from ON_Geometry and the attributes are stored in an ON_3dmObjectAttributes class. Examples of attributes are object name, object id, display attributes, group membership, layer membership, and so on.

Remarks: 7 January 2003 Dale Lear Derived from ON_Object so ON_UserData can be attached to ON_3dmObjectAttributes.

Constructor & Destructor Documentation

@@ -897,8 +888,7 @@ Description: Top level OpenNURBS objects have geometry and attributes. The geome
-

END: Per object mesh parameter support
-Description: Determine if the simple material should come from the object or from it's layer. High quality rendering plug-ins should use m_rendering_attributes. Returns: Where to get material information if you do are too lazy to look in m_rendering_attributes.m_materials[].

+

END: Per object mesh parameter support Description: Determine if the simple material should come from the object or from it's layer. High quality rendering plug-ins should use m_rendering_attributes. Returns: Where to get material information if you do are too lazy to look in m_rendering_attributes.m_materials[].

@@ -1180,8 +1170,7 @@ Description: Determine if the simple material should come from the object or fro
-

BEGIN: Per object mesh parameter support
-Parameters: mp - [in] per object mesh parameters Returns: True if successful.

+

BEGIN: Per object mesh parameter support Parameters: mp - [in] per object mesh parameters Returns: True if successful.

@@ -1714,8 +1703,7 @@ Parameters: mp - [in] per object mesh parameters Returns: True if successful.
-

If m_viewport_id is nil, the object is active in all viewports. If m_viewport_id is not nil, then this object is only active in a specific view.
-This field is primarily used to assign page space objects to a specific page, but it can also be used to restrict model space to a specific view.

+

If m_viewport_id is nil, the object is active in all viewports. If m_viewport_id is not nil, then this object is only active in a specific view. This field is primarily used to assign page space objects to a specific page, but it can also be used to restrict model space to a specific view.

@@ -1760,9 +1748,9 @@ This field is primarily used to assign page space objects to a specific page, bu diff --git a/6/d0/d52/class_o_n___nurbs_curve-members.html b/6/d0/d52/class_o_n___nurbs_curve-members.html index a6f70e9a..b7d93f38 100644 --- a/6/d0/d52/class_o_n___nurbs_curve-members.html +++ b/6/d0/d52/class_o_n___nurbs_curve-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d5b/class_o_n___curve_on_surface-members.html b/6/d0/d5b/class_o_n___curve_on_surface-members.html index 5a88f505..dfa81119 100644 --- a/6/d0/d5b/class_o_n___curve_on_surface-members.html +++ b/6/d0/d5b/class_o_n___curve_on_surface-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d5f/class_o_n___progress_reporter-members.html b/6/d0/d5f/class_o_n___progress_reporter-members.html index c0feab68..511aab14 100644 --- a/6/d0/d5f/class_o_n___progress_reporter-members.html +++ b/6/d0/d5f/class_o_n___progress_reporter-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d67/opennurbs__function__list_8h_source.html b/6/d0/d67/opennurbs__function__list_8h_source.html index 8159f5d3..c8ccd89c 100644 --- a/6/d0/d67/opennurbs__function__list_8h_source.html +++ b/6/d0/d67/opennurbs__function__list_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_function_list.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_function_list.h Source File @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d6c/class_o_n___surface_curvature.html b/6/d0/d6c/class_o_n___surface_curvature.html index 91977b66..8a0cad6c 100644 --- a/6/d0/d6c/class_o_n___surface_curvature.html +++ b/6/d0/d6c/class_o_n___surface_curvature.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SurfaceCurvature Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d77/opennurbs__zlib_8h_source.html b/6/d0/d77/opennurbs__zlib_8h_source.html index 620faed8..e6651dc8 100644 --- a/6/d0/d77/opennurbs__zlib_8h_source.html +++ b/6/d0/d77/opennurbs__zlib_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_zlib.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_zlib.h Source File @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
1 /* $NoKeywords: $ */
2 /*
3 //
4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6 // McNeel & Associates.
7 //
8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
11 //
12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
13 //
14 ////////////////////////////////////////////////////////////////
15 */
16 
17 #if !defined(OPENNURBS_ZLIB_INC_)
18 #define OPENNURBS_ZLIB_INC_
19 
20 // If you are using opennurbs as a statically linked library, then
21 // you may make calls to the same zlib that opennurbs uses. This
22 // zlib is compiled with z_ symbol projectection. All the necessary
23 // header files are included by opennurbs.h.
24 //
25 // If you are using opennurbs as a DLL or writing a Rhino plug-in
26 // and you want to use the same zlib that opennurbs uses, then
27 // compile opennurbs_zlib_memory.cpp into your application
28 // and statically link with the zlib library. All the necessary
29 // header files are included by opennurbs.h.
30 
31 
32 #if !defined(Z_PREFIX)
33 /* decorates zlib functions with a "z_" prefix to prevent symbol collision. */
34 #define Z_PREFIX
35 #endif
36 
37 #if !defined(MY_ZCALLOC)
38 /* have zlib use oncalloc() and onfree() for memory managment*/
39 #define MY_ZCALLOC
40 #endif
41 
42 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
43 #include "./zlib/zlib.h"
44 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
45 
46 ON_BEGIN_EXTERNC
47 voidpf zcalloc(voidpf, unsigned, unsigned);
48 void zcfree(voidpf, voidpf);
49 ON_END_EXTERNC
50 
51 #endif
diff --git a/6/d0/d7b/class_o_n___brep_vertex-members.html b/6/d0/d7b/class_o_n___brep_vertex-members.html index 170218e7..49e9dcf7 100644 --- a/6/d0/d7b/class_o_n___brep_vertex-members.html +++ b/6/d0/d7b/class_o_n___brep_vertex-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d82/class_o_n___user_string.html b/6/d0/d82/class_o_n___user_string.html index 82049f70..55de99dd 100644 --- a/6/d0/d82/class_o_n___user_string.html +++ b/6/d0/d82/class_o_n___user_string.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UserString Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d85/class_o_n___r_tree_iterator-members.html b/6/d0/d85/class_o_n___r_tree_iterator-members.html index 5c6f31ba..3a019119 100644 --- a/6/d0/d85/class_o_n___r_tree_iterator-members.html +++ b/6/d0/d85/class_o_n___r_tree_iterator-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d89/class_o_n___bump_function.html b/6/d0/d89/class_o_n___bump_function.html index 10db3dfa..2ce0e22f 100644 --- a/6/d0/d89/class_o_n___bump_function.html +++ b/6/d0/d89/class_o_n___bump_function.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BumpFunction Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +

Detailed Description

NoKeywords
-


-/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
-/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

+

/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

Constructor & Destructor Documentation

◆ ON_BumpFunction() [1/2]

@@ -393,9 +389,9 @@ Public Attributes
diff --git a/6/d0/d89/class_o_n___model_component_type_iterator.html b/6/d0/d89/class_o_n___model_component_type_iterator.html index 7ad6d990..d8251dc2 100644 --- a/6/d0/d89/class_o_n___model_component_type_iterator.html +++ b/6/d0/d89/class_o_n___model_component_type_iterator.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ModelComponentTypeIterator Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d8a/class_o_n__3d_point_list_ref.html b/6/d0/d8a/class_o_n__3d_point_list_ref.html index be1a0da3..6482275c 100644 --- a/6/d0/d8a/class_o_n__3d_point_list_ref.html +++ b/6/d0/d8a/class_o_n__3d_point_list_ref.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dPointListRef Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d8a/class_o_n__3dm_view-members.html b/6/d0/d8a/class_o_n__3dm_view-members.html index 0fd5810e..cfb86e18 100644 --- a/6/d0/d8a/class_o_n__3dm_view-members.html +++ b/6/d0/d8a/class_o_n__3dm_view-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/d8b/opennurbs__textdraw_8h_source.html b/6/d0/d8b/opennurbs__textdraw_8h_source.html index 5db0af85..79942080 100644 --- a/6/d0/d8b/opennurbs__textdraw_8h_source.html +++ b/6/d0/d8b/opennurbs__textdraw_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_textdraw.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_textdraw.h Source File @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
1 
2 /* $NoKeywords: $ */
3 /*
4 //
5 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
6 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
7 // McNeel & Associates.
8 //
9 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
10 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
11 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
12 //
13 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
14 //
15 ////////////////////////////////////////////////////////////////
16 */
17 //#if !defined(OPENNURBS_TEXTDRAW_INC_)
18 //#define OPENNURBS_TEXTDRAW_INC_
19 //
20 //#ifndef OPENNURBS_TEXT_H_INCLUDED
21 //#error Include opennurbs_text.h first
22 //#endif
23 //
24 //#ifdef RHRICHTEXT
25 //
26 //
27 ////typedef bool (*TestG)(int);
28 //
29 //class ON_TextDraw
30 //{
31 //public:
32 // ON_TextDraw() {}
33 //
34 // //static
35 // //bool DrawOnText(const ON_Text& text);
36 // //static
37 // //bool DrawTextRun(const ON_TextRun* run);
38 //
39 // //bool GetExtents(const wchar_t* string, const ON_Font* pFont, ON_2dex& minpt, ON_2dex& maxpt, ON_2dex& lastpt);
40 //
41 // //typedef bool (*TestF)(int);
42 // //static TestG testg;
43 // //static TestF testf;
44 //
45 // //ON_StringExtentsFunc StringExtentsFunc;
46 // //void* StringExtentsData;
47 // //static
48 // //ON_FontInitFunc FontInitFunc;
49 // //static
50 // //void* FontInitData;
51 //};
52 //
53 //
54 //
55 //#endif // RHRICHTEXT
56 //#endif // OPENNURBS_TEXTDRAW_INC_w
diff --git a/6/d0/d8d/class_o_n___point.html b/6/d0/d8d/class_o_n___point.html index 314e9fb3..406dae41 100644 --- a/6/d0/d8d/class_o_n___point.html +++ b/6/d0/d8d/class_o_n___point.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Point Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +

Detailed Description

NoKeywords
-


-
-/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
-
-/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////NOTE: ON_3dPoint is much more efficient than ON_Point. Use ON_Point when you need a polymorphic 3d point that is derived from ON_Geometry or ON_Object.

+

/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////NOTE: ON_3dPoint is much more efficient than ON_Point. Use ON_Point when you need a polymorphic 3d point that is derived from ON_Geometry or ON_Object.

Constructor & Destructor Documentation

◆ ON_Point() [1/4]

@@ -624,7 +618,7 @@ Additional Inherited Members
-

◆ operator const ON_3dPoint &()

+

◆ operator const ON_3dPoint &()

@@ -675,7 +669,7 @@ Additional Inherited Members
-

◆ operator ON_3dPoint &()

+

◆ operator ON_3dPoint &()

@@ -885,8 +879,8 @@ Additional Inherited Members
-

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
- The default implementation of this virtual function returns false and does nothing.

+

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

+

The default implementation of this virtual function returns false and does nothing.

Parameters
@@ -916,9 +910,9 @@ Additional Inherited Members diff --git a/6/d0/d93/struct_o_n___windows_b_i_t_m_a_p_f_i_l_e_h_e_a_d_e_r.html b/6/d0/d93/struct_o_n___windows_b_i_t_m_a_p_f_i_l_e_h_e_a_d_e_r.html index 39d909dd..d090a10b 100644 --- a/6/d0/d93/struct_o_n___windows_b_i_t_m_a_p_f_i_l_e_h_e_a_d_e_r.html +++ b/6/d0/d93/struct_o_n___windows_b_i_t_m_a_p_f_i_l_e_h_e_a_d_e_r.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: ON_WindowsBITMAPFILEHEADER Struct Reference @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
binary_archiveserialize definition to binary archive
openNURBS SDK Help +  6.0
- + +
diff --git a/6/d0/da0/struct_o_n___r_a_n_d_o_m___n_u_m_b_e_r___c_o_n_t_e_x_t-members.html b/6/d0/da0/struct_o_n___r_a_n_d_o_m___n_u_m_b_e_r___c_o_n_t_e_x_t-members.html index 1eef1517..a374c0e7 100644 --- a/6/d0/da0/struct_o_n___r_a_n_d_o_m___n_u_m_b_e_r___c_o_n_t_e_x_t-members.html +++ b/6/d0/da0/struct_o_n___r_a_n_d_o_m___n_u_m_b_e_r___c_o_n_t_e_x_t-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@
- + +
diff --git a/6/d0/da3/class_o_n___centermark.html b/6/d0/da3/class_o_n___centermark.html index b48fb2fc..a87f690b 100644 --- a/6/d0/da3/class_o_n___centermark.html +++ b/6/d0/da3/class_o_n___centermark.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Centermark Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
enum  ForceArrow : unsigned int { ForceArrow::Auto = 0, ForceArrow::Inside = 1, ForceArrow::Outside = 2 - } - Arrowheads forced Inside, or Outside of extension lines, or moved to fit. More...
+ } Arrowheads forced Inside, or Outside of extension lines, or moved to fit. More...
+   enum  ForceText : unsigned int { ForceText::Auto = 0, ForceText::Inside = 1, ForceText::Right = 2, ForceText::Left = 3 - } - Text forced Inside, Right or Left of extension lines, or moved to fit (Auto). More...
+ } Text forced Inside, Right or Left of extension lines, or moved to fit (Auto). More...
+   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
@@ -1504,8 +1502,8 @@ Additional Inherited Members
-

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
- The default implementation of this virtual function returns false and does nothing.

+

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

+

The default implementation of this virtual function returns false and does nothing.

Parameters
@@ -1543,9 +1541,9 @@ Additional Inherited Members diff --git a/6/d0/daa/class_o_n___geometry-members.html b/6/d0/daa/class_o_n___geometry-members.html index 5c8baa24..73f4d21f 100644 --- a/6/d0/daa/class_o_n___geometry-members.html +++ b/6/d0/daa/class_o_n___geometry-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
binary_archiveserialize definition to binary archive
openNURBS SDK Help +  6.0
- + +
diff --git a/6/d0/dad/class_o_n___text_log_indent.html b/6/d0/dad/class_o_n___text_log_indent.html index 89798fed..a2c33d2d 100644 --- a/6/d0/dad/class_o_n___text_log_indent.html +++ b/6/d0/dad/class_o_n___text_log_indent.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextLogIndent Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/db8/class_o_n__3dm_construction_plane-members.html b/6/d0/db8/class_o_n__3dm_construction_plane-members.html index 2098fb06..37a8fbfb 100644 --- a/6/d0/db8/class_o_n__3dm_construction_plane-members.html +++ b/6/d0/db8/class_o_n__3dm_construction_plane-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/dbb/class_o_n___linetype.html b/6/d0/dbb/class_o_n___linetype.html index eca91e40..b5c52afa 100644 --- a/6/d0/dbb/class_o_n___linetype.html +++ b/6/d0/dbb/class_o_n___linetype.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Linetype Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
Type::HistoryRecord = 13, Type::Mixed = 0xFE
- } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
+ } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
+   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
@@ -1173,9 +1171,9 @@ Additional Inherited Members
diff --git a/6/d0/dc4/opennurbs__fsp__defs_8h_source.html b/6/d0/dc4/opennurbs__fsp__defs_8h_source.html index 21d9e493..17961276 100644 --- a/6/d0/dc4/opennurbs__fsp__defs_8h_source.html +++ b/6/d0/dc4/opennurbs__fsp__defs_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_fsp_defs.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_fsp_defs.h Source File @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/dcd/class_o_n__2d_point_array.html b/6/d0/dcd/class_o_n__2d_point_array.html index c96f56ec..db3da762 100644 --- a/6/d0/dcd/class_o_n__2d_point_array.html +++ b/6/d0/dcd/class_o_n__2d_point_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2dPointArray Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/dd3/struct_o_n___mesh_topology_face-members.html b/6/d0/dd3/struct_o_n___mesh_topology_face-members.html index 9121811c..29a38c76 100644 --- a/6/d0/dd3/struct_o_n___mesh_topology_face-members.html +++ b/6/d0/dd3/struct_o_n___mesh_topology_face-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/ddd/class_o_n__3f_vector_array-members.html b/6/d0/ddd/class_o_n__3f_vector_array-members.html index e2885c85..8c5500bf 100644 --- a/6/d0/ddd/class_o_n__3f_vector_array-members.html +++ b/6/d0/ddd/class_o_n__3f_vector_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/ddd/class_o_n___line_curve.html b/6/d0/ddd/class_o_n___line_curve.html index 54237904..f4384b14 100644 --- a/6/d0/ddd/class_o_n___line_curve.html +++ b/6/d0/ddd/class_o_n___line_curve.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_LineCurve Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
-

Description: Where possible, analytically extends curve to include domain. Parameters: domain - [in] if domain is not included in curve domain, curve will be extended so that its domain includes domain.
- Original curve is identical to the restriction of the resulting curve to the original curve domain, Returns: true if successful.

+

Description: Where possible, analytically extends curve to include domain. Parameters: domain - [in] if domain is not included in curve domain, curve will be extended so that its domain includes domain. Original curve is identical to the restriction of the resulting curve to the original curve domain, Returns: true if successful.

Reimplemented from ON_Curve.

@@ -1938,8 +1935,8 @@ Additional Inherited Members
-

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
- The default implementation of this virtual function returns false and does nothing.

+

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

+

The default implementation of this virtual function returns false and does nothing.

Parameters
@@ -2003,9 +2000,9 @@ Additional Inherited Members diff --git a/6/d0/ddd/class_o_n___polyline-members.html b/6/d0/ddd/class_o_n___polyline-members.html index f878a578..756b5016 100644 --- a/6/d0/ddd/class_o_n___polyline-members.html +++ b/6/d0/ddd/class_o_n___polyline-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
binary_archiveopen binary file
openNURBS SDK Help +  6.0
- + +
diff --git a/6/d0/de9/class_o_n___debug_write_archive.html b/6/d0/de9/class_o_n___debug_write_archive.html index a6dc1ddc..153abe70 100644 --- a/6/d0/de9/class_o_n___debug_write_archive.html +++ b/6/d0/de9/class_o_n___debug_write_archive.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_DebugWriteArchive Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/dec/class_o_n__3f_point.html b/6/d0/dec/class_o_n__3f_point.html index dbac4992..0aa97bea 100644 --- a/6/d0/dec/class_o_n__3f_point.html +++ b/6/d0/dec/class_o_n__3f_point.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3fPoint Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
-

◆ operator<()

+

◆ operator<()

@@ -1500,7 +1498,7 @@ Static Public Attributes
-

◆ operator<=()

+

◆ operator<=()

@@ -1768,7 +1766,7 @@ Static Public Attributes
-

◆ operator>()

+

◆ operator>()

@@ -1786,7 +1784,7 @@ Static Public Attributes
-

◆ operator>=()

+

◆ operator>=()

@@ -2119,9 +2117,9 @@ Static Public Attributes
diff --git a/6/d0/dec/class_o_n___mesh_ngon_allocator.html b/6/d0/dec/class_o_n___mesh_ngon_allocator.html index 2e5e9151..335b598c 100644 --- a/6/d0/dec/class_o_n___mesh_ngon_allocator.html +++ b/6/d0/dec/class_o_n___mesh_ngon_allocator.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshNgonAllocator Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@
- + +
diff --git a/6/d0/df3/class_o_n___light.html b/6/d0/df3/class_o_n___light.html index 49a05d5d..2ce00ad7 100644 --- a/6/d0/df3/class_o_n___light.html +++ b/6/d0/df3/class_o_n___light.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Light Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +

Detailed Description

NoKeywords
-


-/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
-/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

+

/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

Constructor & Destructor Documentation

◆ ON_Light() [1/2]

@@ -2145,9 +2141,9 @@ Additional Inherited Members
diff --git a/6/d0/df3/struct_o_n___serial_number_map_1_1_m_a_p___v_a_l_u_e.html b/6/d0/df3/struct_o_n___serial_number_map_1_1_m_a_p___v_a_l_u_e.html index c9fb0ff2..0e241cc7 100644 --- a/6/d0/df3/struct_o_n___serial_number_map_1_1_m_a_p___v_a_l_u_e.html +++ b/6/d0/df3/struct_o_n___serial_number_map_1_1_m_a_p___v_a_l_u_e.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SerialNumberMap::MAP_VALUE Struct Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/df6/class_o_n__3dm_notes.html b/6/d0/df6/class_o_n__3dm_notes.html index 5fdd50ab..c65a753f 100644 --- a/6/d0/df6/class_o_n__3dm_notes.html +++ b/6/d0/df6/class_o_n__3dm_notes.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmNotes Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d0/df8/opennurbs__surface_8h_source.html b/6/d0/df8/opennurbs__surface_8h_source.html index 4e6be5ab..64af8e1b 100644 --- a/6/d0/df8/opennurbs__surface_8h_source.html +++ b/6/d0/df8/opennurbs__surface_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_surface.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_surface.h Source File @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
opennurbs_surface.h
-
1 /* $NoKeywords: $ */
2 /*
3 //
4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6 // McNeel & Associates.
7 //
8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
11 //
12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
13 //
14 ////////////////////////////////////////////////////////////////
15 */
16 
17 ////////////////////////////////////////////////////////////////
18 //
19 // Definition of virtual parametric surface
20 //
21 ////////////////////////////////////////////////////////////////
22 
23 #if !defined(OPENNURBS_SURFACE_INC_)
24 #define OPENNURBS_SURFACE_INC_
25 
26 class ON_Curve;
27 class ON_NurbsSurface;
28 class ON_SurfaceTree;
29 
30 ////////////////////////////////////////////////////////////////
31 //
32 // Definition of virtual parametric surface
33 //
34 ////////////////////////////////////////////////////////////////
35 
36 class ON_Mesh;
37 class ON_MeshParameters;
38 class ON_PolyCurve;
39 class ON_CurveProxy;
40 class ON_Surface;
41 
42 
43 /* Return codes to be used in operations that attempt to fit to a tolerance.
44  For example ON_Surface::Pullback() and ON_Surface::PushUp().
45 */
46 
47 enum class ON_FitResult: unsigned int
48 
49 {
50  unknown=0,
51  in_tolerance=1,
52  not_in_tolerance=2
53 };
54 
55 
56 class ON_CLASS ON_Surface : public ON_Geometry
57 {
58  ON_OBJECT_DECLARE(ON_Surface);
59 
60 public:
61  // virtual ON_Object::DestroyRuntimeCache override
62  void DestroyRuntimeCache( bool bDelete = true ) override;
63 
64  // pure virtual class for surface objects
65 public:
66 
67  // flags for isoparametric curves
68  // note: odd values are all "x" = constant
69  // and even values > 0 are all "y" = constant
70  // ON_BrepTrim::m_iso uses these flags
71  enum ISO
72  {
73  not_iso = 0, // curve is not an isoparameteric curve
74  x_iso = 1, // curve is a "x" = constant (vertical) isoparametric
75  // curve in the interior of the surface's domain
76  y_iso = 2, // curve is a "y" = constant (horizontal) isoparametric
77  // curve in the interior of the surface's domain
78  W_iso = 3, // curve is a "x" = constant isoparametric curve
79  // along the west side of the surface's domain
80  S_iso = 4, // curve is a "y" = constant isoparametric curve
81  // along the south side of the surface's domain
82  E_iso = 5, // curve is a "x" = constant isoparametric curve
83  // along the east side of the surface's domain
84  N_iso = 6, // curve is a "y" = constant isoparametric curve
85  // along the north side of the surface's domain
86  iso_count = 7
87  };
88 
89 public:
90  ON_Surface();
91  ON_Surface(const ON_Surface&);
93  virtual ~ON_Surface();
94 
95  // virtual ON_Object::SizeOf override
96  unsigned int SizeOf() const override;
97 
98  // virtual ON_Geometry override
99  bool EvaluatePoint( const class ON_ObjRef& objref, ON_3dPoint& P ) const override;
100 
101  /*
102  Description:
103  Get a duplicate of the surface.
104  Returns:
105  A duplicate of the surface.
106  Remarks:
107  The caller must delete the returned surface.
108  For non-ON_SurfaceProxy objects, this simply duplicates the surface using
109  ON_Object::Duplicate.
110  For ON_SurfaceProxy objects, this duplicates the actual proxy surface
111  geometry and, if necessary, transposes the result to that
112  the returned surfaces's parameterization and locus match the proxy surface's.
113  */
114  virtual
115  ON_Surface* DuplicateSurface() const;
116 
117  //////////
118  // override ON_Object::ObjectType() - returns ON::surface_object
119  ON::object_type ObjectType() const override;
120 
121 
122  /////////////////////////////
123  //
124  // virtual ON_Geometry functions
125  //
126 
127  /*
128  Description:
129  Overrides virtual ON_Geometry::HasBrepForm and returns true.
130  Result:
131  Returns true.
132  See Also:
133  ON_Brep::Create( ON_Surface&* )
134  */
135  bool HasBrepForm() const override;
136 
137  /*
138  Description:
139  Overrides virtual ON_Geometry::HasBrepForm.
140  Uses ON_Brep::Create( ON_Surface&* ) to create a brep
141  form. The surface is copied for use in the returned
142  brep.
143  Parameters:
144  brep - [in] if not nullptr, brep is used to store the brep
145  form of the surface.
146  Result:
147  Returns a pointer to on ON_Brep or nullptr. If the brep
148  parameter is not nullptr, then brep is returned if the
149  surface has a brep form and nullptr is returned if the
150  geometry does not have a brep form.
151  Remarks:
152  The caller is responsible for managing the brep memory.
153  */
154  ON_Brep* BrepForm( ON_Brep* brep = nullptr ) const override;
155 
156  ////////////////////////////////////////////////////////////////////
157  // surface interface
158 
159 
160  bool GetDomain(
161  int dir, // 0 gets first parameter, 1 gets second parameter
162  double* t0,
163  double* t1
164  ) const;
165 
166  bool SetDomain(
167  int dir, // 0 sets first parameter's domain, 1 gets second parameter's domain
168  ON_Interval domain
169  );
170 
171  virtual
172  bool SetDomain(
173  int dir, // 0 sets first parameter's domain, 1 gets second parameter's domain
174  double t0,
175  double t1
176  );
177 
178  virtual
179  ON_Interval Domain(
180  int dir // 0 gets first parameter's domain, 1 gets second parameter's domain
181  ) const = 0;
182 
183  /*
184  Description:
185  Get an estimate of the size of the rectangle that would
186  be created if the 3d surface where flattened into a rectangle.
187  Parameters:
188  width - [out] (corresponds to the first surface parameter)
189  height - [out] (corresponds to the first surface parameter)
190  Example:
191 
192  // Reparameterize a surface to minimize distortion
193  // in the map from parameter space to 3d.
194  ON_Surface* surf = ...;
195  double width, height;
196  if ( surf->GetSurfaceSize( &width, &height ) )
197  {
198  srf->SetDomain( 0, ON_Interval( 0.0, width ) );
199  srf->SetDomain( 1, ON_Interval( 0.0, height ) );
200  }
201 
202  Returns:
203  true if successful.
204  */
205  virtual
206  bool GetSurfaceSize(
207  double* width,
208  double* height
209  ) const;
210 
211 
212  virtual
213  int SpanCount(
214  int dir // 0 gets first parameter's domain, 1 gets second parameter's domain
215  ) const = 0; // number of smooth nonempty spans in the parameter direction
216 
217  virtual
218  bool GetSpanVector( // span "knots"
219  int dir, // 0 gets first parameter's domain, 1 gets second parameter's domain
220  double* span_vector // array of length SpanCount() + 1
221  ) const = 0; //
222 
223  //////////
224  // If t is in the domain of the surface, GetSpanVectorIndex() returns the
225  // span vector index "i" such that span_vector[i] <= t <= span_vector[i+1].
226  // The "side" parameter determines which span is selected when t is at the
227  // end of a span.
228  virtual
229  bool GetSpanVectorIndex(
230  int dir , // 0 gets first parameter's domain, 1 gets second parameter's domain
231  double t, // [IN] t = evaluation parameter
232  int side, // [IN] side 0 = default, -1 = from below, +1 = from above
233  int* span_vector_index, // [OUT] span vector index
234  ON_Interval* span_interval // [OUT] domain of the span containing "t"
235  ) const;
236 
237  virtual
238  int Degree( // returns maximum algebraic degree of any span
239  // ( or a good estimate if curve spans are not algebraic )
240  int dir // 0 gets first parameter's domain, 1 gets second parameter's domain
241  ) const = 0;
242 
243  virtual bool GetParameterTolerance( // returns tminus < tplus: parameters tminus <= s <= tplus
244  int dir, // 0 gets first parameter, 1 gets second parameter
245  double t, // t = parameter in domain
246  double* tminus, // tminus
247  double* tplus // tplus
248  ) const;
249 
250  /*
251  Description:
252  Test a 2d curve to see if it is iso parameteric in the surface's
253  parameter space.
254  Parameters:
255  curve - [in] curve to test
256  curve_domain = [in] optional sub domain of the curve
257  Returns:
258  Isoparametric status of the curve.
259  Remarks:
260  Because it may transpose domains, ON_SurfaceProxy overrides
261  this function. All other surface classes just use
262  the base class implementation.
263  */
264  virtual
265  ISO IsIsoparametric(
266  const ON_Curve& curve,
267  const ON_Interval* curve_domain = nullptr
268  ) const;
269 
270  /*
271  Description:
272  Test a 2d bounding box to see if it is iso parameteric in the surface's
273  parameter space.
274  Parameters:
275  bbox - [in] bounding box to test
276  Returns:
277  Isoparametric status of the bounding box.
278  Remarks:
279  Because it may transpose domains, ON_SurfaceProxy overrides
280  this function. All other surface classes just use
281  the base class implementation.
282  */
283  virtual
284  ISO IsIsoparametric(
285  const ON_BoundingBox& bbox
286  ) const;
287 
288  /*
289  Description:
290  Test a surface to see if it is planar.
291  Parameters:
292  plane - [out] if not nullptr and true is returned,
293  the plane parameters are filled in.
294  tolerance - [in] tolerance to use when checking
295  Returns:
296  true if there is a plane such that the maximum distance from
297  the surface to the plane is <= tolerance.
298  */
299  virtual
300  bool IsPlanar(
301  ON_Plane* plane = nullptr,
302  double tolerance = ON_ZERO_TOLERANCE
303  ) const;
304 
305  /*
306  Description:
307  Determine if the surface is a portion of a sphere.
308  Parameters:
309  sphere - [out] if not nullptr and true is returned,
310  then the sphere definition is returned.
311  tolerance - [in]
312  tolerance to use when checking
313  Returns:
314  True if the surface is a portion of a sphere.
315  */
316  bool IsSphere(
317  ON_Sphere* sphere = nullptr,
318  double tolerance = ON_ZERO_TOLERANCE
319  ) const;
320 
321  /*
322  Description:
323  Determine if the surface is a portion of a cylinder.
324  Parameters:
325  cylinder - [out] if not nullptr and true is returned,
326  then the cylinder definition is returned.
327  tolerance - [in]
328  tolerance to use when checking
329  Returns:
330  True if the surface is a portion of a cylinder.
331  */
332  bool IsCylinder(
333  ON_Cylinder* cylinder = nullptr,
334  double tolerance = ON_ZERO_TOLERANCE
335  ) const;
336 
337  /*
338  Description:
339  Determine if the surface is a portion of a cone.
340  Parameters:
341  cone - [out] if not nullptr and true is returned,
342  then the cone definition is returned.
343  tolerance - [in]
344  tolerance to use when checking
345  Returns:
346  True if the surface is a portion of a cone.
347  */
348  bool IsCone(
349  ON_Cone* cone = nullptr,
350  double tolerance = ON_ZERO_TOLERANCE
351  ) const;
352 
353  /*
354  Description:
355  Determine if the surface is a portion of a torus.
356  Parameters:
357  torus - [out] if not nullptr and true is returned,
358  then the torus definition is returned.
359  tolerance - [in]
360  tolerance to use when checking
361  Returns:
362  True if the surface is a portion of a torus.
363  */
364  bool IsTorus(
365  ON_Torus* torus = nullptr,
366  double tolerance = ON_ZERO_TOLERANCE
367  ) const;
368 
369  virtual
370  bool IsClosed( // true if surface is closed in direction
371  int // dir 0 = "s", 1 = "t"
372  ) const;
373 
374  virtual
375  bool IsPeriodic( // true if surface is periodic in direction (default is false)
376  int // dir 0 = "s", 1 = "t"
377  ) const;
378 
379  virtual
380  bool IsSingular( // true if surface side is collapsed to a point
381  int // side of parameter space to test
382  // 0 = south, 1 = east, 2 = north, 3 = west
383  ) const;
384 
385  /*
386  Returns:
387  True if the surface defines a solid, like a sphere or torus.
388  False if the surface does not define a solid, like a plane or cone.
389  */
390  bool IsSolid() const;
391 
392  /*
393  Description:
394  Test if a surface parameter value is at a singularity.
395  Parameters:
396  s - [in] surface parameter to test
397  t - [in] surface parameter to test
398  bExact - [in] if true, test if s,t is exactly at a singularity
399  if false, test if close enough to cause numerical problems.
400  Returns:
401  true if surface is singular at (s,t)
402  */
403  bool IsAtSingularity(
404  double s,
405  double t,
406  bool bExact = true
407  ) const;
408 
409  /*
410  Description:
411  Test if a surface parameter value is at a seam.
412  Parameters:
413  s - [in] surface parameter to test
414  t - [in] surface parameter to test
415  Returns:
416  0 if not a seam,
417  1 if s == Domain(0)[i] and srf(s, t) == srf(Domain(0)[1-i], t)
418  2 if t == Domain(1)[i] and srf(s, t) == srf(s, Domain(1)[1-i])
419  3 if 1 and 2 are true.
420  */
421  int IsAtSeam(
422  double s,
423  double t
424  ) const;
425 
426  /*
427  Description:
428  Search for a derivatitive, tangent, or curvature
429  discontinuity.
430  Parameters:
431  dir - [in] If 0, then "u" parameter is checked. If 1, then
432  the "v" parameter is checked.
433  c - [in] type of continity to test for.
434  t0 - [in] Search begins at t0. If there is a discontinuity
435  at t0, it will be ignored. This makes it
436  possible to repeatedly call GetNextDiscontinuity
437  and step through the discontinuities.
438  t1 - [in] (t0 != t1) If there is a discontinuity at t1 is
439  will be ingored unless c is a locus discontinuity
440  type and t1 is at the start or end of the curve.
441  t - [out] if a discontinuity is found, then *t reports the
442  parameter at the discontinuity.
443  hint - [in/out] if GetNextDiscontinuity will be called
444  repeatedly, passing a "hint" with initial value *hint=0
445  will increase the speed of the search.
446  dtype - [out] if not nullptr, *dtype reports the kind of
447  discontinuity found at *t. A value of 1 means the first
448  derivative or unit tangent was discontinuous. A value
449  of 2 means the second derivative or curvature was
450  discontinuous. A value of 0 means teh curve is not
451  closed, a locus discontinuity test was applied, and
452  t1 is at the start of end of the curve.
453  cos_angle_tolerance - [in] default = cos(1 degree) Used only
454  when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the
455  cosine of the angle between two tangent vectors is
456  <= cos_angle_tolerance, then a G1 discontinuity is reported.
457  curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used
458  only when c is ON::continuity::G2_continuous. If K0 and K1 are
459  curvatures evaluated from above and below and
460  |K0 - K1| > curvature_tolerance, then a curvature
461  discontinuity is reported.
462  Returns:
463  Parametric continuity tests c = (C0_continuous, ..., G2_continuous):
464 
465  true if a parametric discontinuity was found strictly
466  between t0 and t1. Note well that all curves are
467  parametrically continuous at the ends of their domains.
468 
469  Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous):
470 
471  true if a locus discontinuity was found strictly between
472  t0 and t1 or at t1 is the at the end of a curve.
473  Note well that all open curves (IsClosed()=false) are locus
474  discontinuous at the ends of their domains. All closed
475  curves (IsClosed()=true) are at least C0_locus_continuous at
476  the ends of their domains.
477  */
478  virtual
479  bool GetNextDiscontinuity(
480  int dir,
481  ON::continuity c,
482  double t0,
483  double t1,
484  double* t,
485  int* hint=nullptr,
486  int* dtype=nullptr,
487  double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE,
488  double curvature_tolerance=ON_SQRT_EPSILON
489  ) const;
490 
491  /*
492  Description:
493  Test continuity at a surface parameter value.
494  Parameters:
495  c - [in] continuity to test for
496  s - [in] surface parameter to test
497  t - [in] surface parameter to test
498  hint - [in] evaluation hint
499  point_tolerance - [in] if the distance between two points is
500  greater than point_tolerance, then the surface is not C0.
501  d1_tolerance - [in] if the difference between two first derivatives is
502  greater than d1_tolerance, then the surface is not C1.
503  d2_tolerance - [in] if the difference between two second derivatives is
504  greater than d2_tolerance, then the surface is not C2.
505  cos_angle_tolerance - [in] default = cos(1 degree) Used only when
506  c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine
507  of the angle between two normal vectors
508  is <= cos_angle_tolerance, then a G1 discontinuity is reported.
509  curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when
510  c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated
511  from above and below and |K0 - K1| > curvature_tolerance,
512  then a curvature discontinuity is reported.
513  Returns:
514  true if the surface has at least the c type continuity at the parameter t.
515  */
516  virtual
517  bool IsContinuous(
518  ON::continuity c,
519  double s,
520  double t,
521  int* hint = nullptr,
522  double point_tolerance=ON_ZERO_TOLERANCE,
523  double d1_tolerance=ON_ZERO_TOLERANCE,
524  double d2_tolerance=ON_ZERO_TOLERANCE,
525  double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE,
526  double curvature_tolerance=ON_SQRT_EPSILON
527  ) const;
528 
529  virtual
530  bool Reverse( // reverse parameterizatrion, Domain changes from [a,b] to [-b,-a]
531  int // dir 0 = "s", 1 = "t"
532  ) = 0;
533 
534  virtual
535  bool Transpose() = 0; // transpose surface parameterization (swap "s" and "t")
536 
537  // simple evaluation interface - no error handling
538  ON_3dPoint PointAt( double, double ) const;
539  ON_3dVector NormalAt( double, double ) const;
540  bool FrameAt( double u, double v, ON_Plane& frame) const;
541 
542  bool EvPoint( // returns false if unable to evaluate
543  double u, double v, // evaluation parameters
544  ON_3dPoint& point, // returns value of surface
545  int quadrant = 0, // optional - determines which side to evaluate from
546  // 0 = default
547  // 1 from NE quadrant
548  // 2 from NW quadrant
549  // 3 from SW quadrant
550  // 4 from SE quadrant
551  int* hint = 0 // optional - evaluation hint (int[2]) used to speed
552  // repeated evaluations
553  ) const;
554 
555  bool Ev1Der( // returns false if unable to evaluate
556  double u, double v, // evaluation parameters (s,t)
557  ON_3dPoint& point, // returns value of surface
558  ON_3dVector& du, // first partial derivatives (Ds)
559  ON_3dVector& dv, // (Dt)
560  int quadrant = 0, // optional - determines which side to evaluate from
561  // 0 = default
562  // 1 from NE quadrant
563  // 2 from NW quadrant
564  // 3 from SW quadrant
565  // 4 from SE quadrant
566  int* hint = 0 // optional - evaluation hint (int[2]) used to speed
567  // repeated evaluations
568  ) const;
569 
570  bool Ev2Der( // returns false if unable to evaluate
571  double u, double v, // evaluation parameters (s,t)
572  ON_3dPoint& point, // returns value of surface
573  ON_3dVector& du, // first partial derivatives (Ds)
574  ON_3dVector& dv, // (Dt)
575  ON_3dVector& duu, // second partial derivatives (Dss)
576  ON_3dVector& duv, // (Dst)
577  ON_3dVector& dvv, // (Dtt)
578  int quadrant= 0, // optional - determines which side to evaluate from
579  // 0 = default
580  // 1 from NE quadrant
581  // 2 from NW quadrant
582  // 3 from SW quadrant
583  // 4 from SE quadrant
584  int* hint = 0 // optional - evaluation hint (int[2]) used to speed
585  // repeated evaluations
586  ) const;
587 
588  bool EvNormal( // returns false if unable to evaluate
589  double u, double v, // evaluation parameters (s,t)
590  ON_3dPoint& point, // returns value of surface
591  ON_3dVector& normal, // unit normal
592  int quadrant = 0, // optional - determines which side to evaluate from
593  // 0 = default
594  // 1 from NE quadrant
595  // 2 from NW quadrant
596  // 3 from SW quadrant
597  // 4 from SE quadrant
598  int* hint = 0 // optional - evaluation hint (int[2]) used to speed
599  // repeated evaluations
600  ) const;
601 
602  bool EvNormal( // returns false if unable to evaluate
603  double u, double v, // evaluation parameters (s,t)
604  ON_3dVector& normal, // unit normal
605  int quadrant = 0, // optional - determines which side to evaluate from
606  // 0 = default
607  // 1 from NE quadrant
608  // 2 from NW quadrant
609  // 3 from SW quadrant
610  // 4 from SE quadrant
611  int* hint = 0 // optional - evaluation hint (int[2]) used to speed
612  // repeated evaluations
613  ) const;
614 
615  bool EvNormal( // returns false if unable to evaluate
616  double u, double v, // evaluation parameters (s,t)
617  ON_3dPoint& point, // returns value of surface
618  ON_3dVector& du, // first partial derivatives (Ds)
619  ON_3dVector& dv, // (Dt)
620  ON_3dVector& normal, // unit normal
621  int = 0, // optional - determines which side to evaluate from
622  // 0 = default
623  // 1 from NE quadrant
624  // 2 from NW quadrant
625  // 3 from SW quadrant
626  // 4 from SE quadrant
627  int* = 0 // optional - evaluation hint (int[2]) used to speed
628  // repeated evaluations
629  ) const;
630 
631  // work horse evaluator
632  virtual
633  bool Evaluate( // returns false if unable to evaluate
634  double u, double v, // evaluation parameters
635  int num_der, // number of derivatives (>=0)
636  int array_stride, // array stride (>=Dimension())
637  double* der_array, // array of length stride*(ndir+1)*(ndir+2)/2
638  int quadrant = 0, // optional - determines which quadrant to evaluate from
639  // 0 = default
640  // 1 from NE quadrant
641  // 2 from NW quadrant
642  // 3 from SW quadrant
643  // 4 from SE quadrant
644  int* hint = 0 // optional - evaluation hint (int[2]) used to speed
645  // repeated evaluations
646  ) const = 0;
647 
648  /*
649  Description:
650  Get isoparametric curve.
651  Parameters:
652  dir - [in] 0 first parameter varies and second parameter is constant
653  e.g., point on IsoCurve(0,c) at t is srf(t,c)
654  This is a horizontal line from left to right
655  1 first parameter is constant and second parameter varies
656  e.g., point on IsoCurve(1,c) at t is srf(c,t
657  This is a vertical line from bottom to top
658 
659  c - [in] value of constant parameter
660  Returns:
661  Isoparametric curve.
662  Remarks:
663  In this function "dir" indicates which direction the resulting
664  curve runs. 0: horizontal, 1: vertical
665  In the other ON_Surface functions that take a "dir"
666  argument, "dir" indicates if "c" is a "u" or "v" parameter.
667  */
668  virtual
669  ON_Curve* IsoCurve(
670  int dir,
671  double c
672  ) const;
673 
674 
675  /*
676  Description:
677  Removes the portions of the surface outside of the specified interval.
678 
679  Parameters:
680  dir - [in] 0 The domain specifies an sub-interval of Domain(0)
681  (the first surface parameter).
682  1 The domain specifies an sub-interval of Domain(1)
683  (the second surface parameter).
684  domain - [in] interval of the surface to keep. If dir is 0, then
685  the portions of the surface with parameters (s,t) satisfying
686  s < Domain(0).Min() or s > Domain(0).Max() are trimmed away.
687  If dir is 1, then the portions of the surface with parameters
688  (s,t) satisfying t < Domain(1).Min() or t > Domain(1).Max()
689  are trimmed away.
690  */
691  virtual
692  bool Trim(
693  int dir,
694  const ON_Interval& domain
695  );
696 
697  /*
698  Description:
699  Pure virtual function. Default returns false.
700  Where possible, analytically extends surface to include domain.
701  Parameters:
702  dir - [in] 0 new Domain(0) will include domain.
703  (the first surface parameter).
704  1 new Domain(1) will include domain.
705  (the second surface parameter).
706  domain - [in] if domain is not included in surface domain,
707  surface will be extended so that its domain includes domain.
708  Will not work if surface is closed in direction dir.
709  Original surface is identical to the restriction of the
710  resulting surface to the original surface domain,
711  Returns:
712  true if successful.
713  */
714  virtual
715  bool Extend(
716  int dir,
717  const ON_Interval& domain
718  );
719 
720 
721  /*
722  Description:
723  Splits (divides) the surface into two parts at the
724  specified parameter.
725 
726  Parameters:
727  dir - [in] 0 The surface is split vertically. The "west" side
728  is returned in "west_or_south_side" and the "east"
729  side is returned in "east_or_north_side".
730  1 The surface is split horizontally. The "south" side
731  is returned in "west_or_south_side" and the "north"
732  side is returned in "east_or_north_side".
733  c - [in] value of constant parameter in interval returned
734  by Domain(dir)
735  west_or_south_side - [out] west/south portion of surface returned here
736  east_or_north_side - [out] east/north portion of surface returned here
737 
738  Example:
739 
740  ON_NurbsSurface srf = ...;
741  int dir = 1;
742  ON_NurbsSurface* south_side = 0;
743  ON_NurbsSurface* north_side = 0;
744  srf.Split( dir, srf.Domain(dir).Mid() south_side, north_side );
745 
746  */
747  virtual
748  bool Split(
749  int dir,
750  double c,
751  ON_Surface*& west_or_south_side,
752  ON_Surface*& east_or_north_side
753  ) const;
754 
755 
756  /*
757  Description:
758  Get a NURBS surface representation of this surface.
759  Parameters:
760  nurbs_surface - [out] NURBS representation returned here
761  tolerance - [in] tolerance to use when creating NURBS
762  representation.
763  s_subdomain - [in] if not nullptr, then the NURBS representation
764  for this portion of the surface is returned.
765  t_subdomain - [in] if not nullptr, then the NURBS representation
766  for this portion of the surface is returned.
767  Returns:
768  0 unable to create NURBS representation
769  with desired accuracy.
770  1 success - returned NURBS parameterization
771  matches the surface's to wthe desired accuracy
772  2 success - returned NURBS point locus matches
773  the surface's to the desired accuracy and the
774  domain of the NURBS surface is correct. On
775  However, This surface's parameterization and
776  the NURBS surface parameterization may not
777  match to the desired accuracy. This situation
778  happens when getting NURBS representations of
779  surfaces that have a transendental parameterization
780  like spheres, cylinders, and cones.
781  Remarks:
782  This is a low-level virtual function. If you do not need
783  the parameterization information provided by the return code,
784  then ON_Surface::NurbsSurface may be easier to use.
785  See Also:
786  ON_Surface::NurbsSurface
787  */
788  virtual
789  int GetNurbForm(
790  ON_NurbsSurface& nurbs_surface,
791  double tolerance = 0.0
792  ) const;
793 
794 
795  /*
796  Description:
797  Is there a NURBS surface representation of this surface.
798  Parameters:
799  Returns:
800  0 unable to create NURBS representation
801  with desired accuracy.
802  1 success - NURBS parameterization
803  matches the surface's
804  2 success - NURBS point locus matches
805  the surface's and the
806  domain of the NURBS surface is correct.
807  However, This surface's parameterization and
808  the NURBS surface parameterization may not
809  match. This situation
810  happens when getting NURBS representations of
811  surfaces that have a transendental parameterization
812  like spheres, cylinders, and cones.
813  Remarks:
814  This is a low-level virtual function.
815  See Also:
816  ON_Surface::GetNurbForm
817  ON_Surface::NurbsSurface
818  */
819  virtual
820  int HasNurbForm() const;
821 
822  // Description:
823  // Get a NURBS surface representation of this surface.
824  // Parameters:
825  // pNurbsSurface - [in/out] if not nullptr, this pNurbsSurface
826  // will be used to store the NURBS representation
827  // of the surface and will be returned.
828  // tolerance - [in] tolerance to use when creating NURBS
829  // surface representation.
830  // s_subdomain - [in] if not nullptr, then the NURBS representation
831  // for this portion of the surface is returned.
832  // t_subdomain - [in] if not nullptr, then the NURBS representation
833  // for this portion of the surface is returned.
834  // Returns:
835  // nullptr or a NURBS representation of the surface.
836  // Remarks:
837  // See ON_Surface::GetNurbForm for important details about
838  // the NURBS surface parameterization.
839  // See Also:
840  // ON_Surface::GetNurbForm
841  ON_NurbsSurface* NurbsSurface(
842  ON_NurbsSurface* pNurbsSurface = nullptr,
843  double tolerance = 0.0,
844  const ON_Interval* s_subdomain = nullptr,
845  const ON_Interval* t_subdomain = nullptr
846  ) const;
847 
848  virtual
849  bool GetSurfaceParameterFromNurbFormParameter(
850  double nurbs_s, double nurbs_t,
851  double* surface_s, double* surface_t
852  ) const;
853 
854  virtual
855  bool GetNurbFormParameterFromSurfaceParameter(
856  double surface_s, double surface_t,
857  double* nurbs_s, double* nurbs_t
858  ) const;
859 
860 
861  // If the geometry surface is modified in any way, then
862  // call DestroySurfaceTree().
863  void DestroySurfaceTree();
864 
865 
866 private:
867 
868 public:
869 
870 protected:
871 };
872 
873 class ON_CLASS ON_SurfaceProperties
874 {
875  // Surface properties
876 public:
877  // The constructor sets all fields to zero.
879 
880  /*
881  Parameters:
882  surface - [in]
883  If surface is not null, then it is used to set the surface properties.
884  If surface is null, then all surface properties are set to to zero.
885  Remarks:
886  Does not modify the value of m_tag.
887  */
888  void Set( const ON_Surface* surface );
889 
890  bool m_bIsSet; // True if Set() has been callled with a non-null surface.
891 
892  bool m_bHasSingularity; // true if at least one m_bSingular[] setting is true.
893  bool m_bIsSingular[4]; // m_bSingular[i] = ON_Surface::IsSingular(i)
894 
895  bool m_bHasSeam; // true if at least one m_bClosed[] setting is true.
896  bool m_bIsClosed[2]; // m_bClosed[i] = ON_Surface::IsClosed(i)
897 
898 private:
899  bool m_bReserved[7];
900 
901 public:
902  ON_Interval m_domain[2]; // m_domain[i] = ON_Surface.Domain(i)
903 
904 private:
905  unsigned char m_reserved[16];
906 
907 public:
908  // Last pointer passed to ON_SurfaceProperties::Set().
910 
911  // The constructor sets this value to zero.
912  // Nothing in opennurbs modifies or uses this value.
913  ON__INT_PTR m_tag;
914 };
915 
916 #if defined(ON_DLL_TEMPLATE)
917 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Surface*>;
918 #endif
919 
921 {
922 public:
923  ON_SurfaceArray( int = 0 );
924  ~ON_SurfaceArray();
925 
926  bool Write( ON_BinaryArchive& ) const;
927  bool Read( ON_BinaryArchive& );
928 
929  void Destroy(); // deletes surfaces in array and sets count to 0
930 
931  bool Duplicate( ON_SurfaceArray& ) const; // operator= copies the pointer values
932  // duplicate copies the surfaces themselves
933 };
934 
935 #endif
bool m_bHasSingularity
true if at least one m_bSingular[] setting is true.
Definition: opennurbs_surface.h:892
+
1 /* $NoKeywords: $ */
2 /*
3 //
4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6 // McNeel & Associates.
7 //
8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
11 //
12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
13 //
14 ////////////////////////////////////////////////////////////////
15 */
16 
17 ////////////////////////////////////////////////////////////////
18 //
19 // Definition of virtual parametric surface
20 //
21 ////////////////////////////////////////////////////////////////
22 
23 #if !defined(OPENNURBS_SURFACE_INC_)
24 #define OPENNURBS_SURFACE_INC_
25 
26 class ON_Curve;
27 class ON_NurbsSurface;
28 class ON_SurfaceTree;
29 
30 ////////////////////////////////////////////////////////////////
31 //
32 // Definition of virtual parametric surface
33 //
34 ////////////////////////////////////////////////////////////////
35 
36 class ON_Mesh;
37 class ON_MeshParameters;
38 class ON_PolyCurve;
39 class ON_CurveProxy;
40 class ON_Surface;
41 
42 
43 /* Return codes to be used in operations that attempt to fit to a tolerance.
44  For example ON_Surface::Pullback() and ON_Surface::PushUp().
45 */
46 
47 enum class ON_FitResult: unsigned int
48 
49 {
50  unknown=0,
51  in_tolerance=1,
52  not_in_tolerance=2
53 };
54 
55 
56 class ON_CLASS ON_Surface : public ON_Geometry
57 {
58  ON_OBJECT_DECLARE(ON_Surface);
59 
60 public:
61  // virtual ON_Object::DestroyRuntimeCache override
62  void DestroyRuntimeCache( bool bDelete = true ) override;
63 
64  // pure virtual class for surface objects
65 public:
66 
67  // flags for isoparametric curves
68  // note: odd values are all "x" = constant
69  // and even values > 0 are all "y" = constant
70  // ON_BrepTrim::m_iso uses these flags
71  enum ISO
72  {
73  not_iso = 0, // curve is not an isoparameteric curve
74  x_iso = 1, // curve is a "x" = constant (vertical) isoparametric
75  // curve in the interior of the surface's domain
76  y_iso = 2, // curve is a "y" = constant (horizontal) isoparametric
77  // curve in the interior of the surface's domain
78  W_iso = 3, // curve is a "x" = constant isoparametric curve
79  // along the west side of the surface's domain
80  S_iso = 4, // curve is a "y" = constant isoparametric curve
81  // along the south side of the surface's domain
82  E_iso = 5, // curve is a "x" = constant isoparametric curve
83  // along the east side of the surface's domain
84  N_iso = 6, // curve is a "y" = constant isoparametric curve
85  // along the north side of the surface's domain
86  iso_count = 7
87  };
88 
89 public:
90  ON_Surface();
91  ON_Surface(const ON_Surface&);
92  ON_Surface& operator=(const ON_Surface&);
93  virtual ~ON_Surface();
94 
95  // virtual ON_Object::SizeOf override
96  unsigned int SizeOf() const override;
97 
98  // virtual ON_Geometry override
99  bool EvaluatePoint( const class ON_ObjRef& objref, ON_3dPoint& P ) const override;
100 
101  /*
102  Description:
103  Get a duplicate of the surface.
104  Returns:
105  A duplicate of the surface.
106  Remarks:
107  The caller must delete the returned surface.
108  For non-ON_SurfaceProxy objects, this simply duplicates the surface using
109  ON_Object::Duplicate.
110  For ON_SurfaceProxy objects, this duplicates the actual proxy surface
111  geometry and, if necessary, transposes the result to that
112  the returned surfaces's parameterization and locus match the proxy surface's.
113  */
114  virtual
115  ON_Surface* DuplicateSurface() const;
116 
117  //////////
118  // override ON_Object::ObjectType() - returns ON::surface_object
119  ON::object_type ObjectType() const override;
120 
121 
122  /////////////////////////////
123  //
124  // virtual ON_Geometry functions
125  //
126 
127  /*
128  Description:
129  Overrides virtual ON_Geometry::HasBrepForm and returns true.
130  Result:
131  Returns true.
132  See Also:
133  ON_Brep::Create( ON_Surface&* )
134  */
135  bool HasBrepForm() const override;
136 
137  /*
138  Description:
139  Overrides virtual ON_Geometry::HasBrepForm.
140  Uses ON_Brep::Create( ON_Surface&* ) to create a brep
141  form. The surface is copied for use in the returned
142  brep.
143  Parameters:
144  brep - [in] if not nullptr, brep is used to store the brep
145  form of the surface.
146  Result:
147  Returns a pointer to on ON_Brep or nullptr. If the brep
148  parameter is not nullptr, then brep is returned if the
149  surface has a brep form and nullptr is returned if the
150  geometry does not have a brep form.
151  Remarks:
152  The caller is responsible for managing the brep memory.
153  */
154  ON_Brep* BrepForm( ON_Brep* brep = nullptr ) const override;
155 
156  ////////////////////////////////////////////////////////////////////
157  // surface interface
158 
159 
160  bool GetDomain(
161  int dir, // 0 gets first parameter, 1 gets second parameter
162  double* t0,
163  double* t1
164  ) const;
165 
166  bool SetDomain(
167  int dir, // 0 sets first parameter's domain, 1 gets second parameter's domain
168  ON_Interval domain
169  );
170 
171  virtual
172  bool SetDomain(
173  int dir, // 0 sets first parameter's domain, 1 gets second parameter's domain
174  double t0,
175  double t1
176  );
177 
178  virtual
179  ON_Interval Domain(
180  int dir // 0 gets first parameter's domain, 1 gets second parameter's domain
181  ) const = 0;
182 
183  /*
184  Description:
185  Get an estimate of the size of the rectangle that would
186  be created if the 3d surface where flattened into a rectangle.
187  Parameters:
188  width - [out] (corresponds to the first surface parameter)
189  height - [out] (corresponds to the first surface parameter)
190  Example:
191 
192  // Reparameterize a surface to minimize distortion
193  // in the map from parameter space to 3d.
194  ON_Surface* surf = ...;
195  double width, height;
196  if ( surf->GetSurfaceSize( &width, &height ) )
197  {
198  srf->SetDomain( 0, ON_Interval( 0.0, width ) );
199  srf->SetDomain( 1, ON_Interval( 0.0, height ) );
200  }
201 
202  Returns:
203  true if successful.
204  */
205  virtual
206  bool GetSurfaceSize(
207  double* width,
208  double* height
209  ) const;
210 
211 
212  virtual
213  int SpanCount(
214  int dir // 0 gets first parameter's domain, 1 gets second parameter's domain
215  ) const = 0; // number of smooth nonempty spans in the parameter direction
216 
217  virtual
218  bool GetSpanVector( // span "knots"
219  int dir, // 0 gets first parameter's domain, 1 gets second parameter's domain
220  double* span_vector // array of length SpanCount() + 1
221  ) const = 0; //
222 
223  //////////
224  // If t is in the domain of the surface, GetSpanVectorIndex() returns the
225  // span vector index "i" such that span_vector[i] <= t <= span_vector[i+1].
226  // The "side" parameter determines which span is selected when t is at the
227  // end of a span.
228  virtual
229  bool GetSpanVectorIndex(
230  int dir , // 0 gets first parameter's domain, 1 gets second parameter's domain
231  double t, // [IN] t = evaluation parameter
232  int side, // [IN] side 0 = default, -1 = from below, +1 = from above
233  int* span_vector_index, // [OUT] span vector index
234  ON_Interval* span_interval // [OUT] domain of the span containing "t"
235  ) const;
236 
237  virtual
238  int Degree( // returns maximum algebraic degree of any span
239  // ( or a good estimate if curve spans are not algebraic )
240  int dir // 0 gets first parameter's domain, 1 gets second parameter's domain
241  ) const = 0;
242 
243  virtual bool GetParameterTolerance( // returns tminus < tplus: parameters tminus <= s <= tplus
244  int dir, // 0 gets first parameter, 1 gets second parameter
245  double t, // t = parameter in domain
246  double* tminus, // tminus
247  double* tplus // tplus
248  ) const;
249 
250  /*
251  Description:
252  Test a 2d curve to see if it is iso parameteric in the surface's
253  parameter space.
254  Parameters:
255  curve - [in] curve to test
256  curve_domain = [in] optional sub domain of the curve
257  Returns:
258  Isoparametric status of the curve.
259  Remarks:
260  Because it may transpose domains, ON_SurfaceProxy overrides
261  this function. All other surface classes just use
262  the base class implementation.
263  */
264  virtual
265  ISO IsIsoparametric(
266  const ON_Curve& curve,
267  const ON_Interval* curve_domain = nullptr
268  ) const;
269 
270  /*
271  Description:
272  Test a 2d bounding box to see if it is iso parameteric in the surface's
273  parameter space.
274  Parameters:
275  bbox - [in] bounding box to test
276  Returns:
277  Isoparametric status of the bounding box.
278  Remarks:
279  Because it may transpose domains, ON_SurfaceProxy overrides
280  this function. All other surface classes just use
281  the base class implementation.
282  */
283  virtual
284  ISO IsIsoparametric(
285  const ON_BoundingBox& bbox
286  ) const;
287 
288  /*
289  Description:
290  Test a surface to see if it is planar.
291  Parameters:
292  plane - [out] if not nullptr and true is returned,
293  the plane parameters are filled in.
294  tolerance - [in] tolerance to use when checking
295  Returns:
296  true if there is a plane such that the maximum distance from
297  the surface to the plane is <= tolerance.
298  */
299  virtual
300  bool IsPlanar(
301  ON_Plane* plane = nullptr,
302  double tolerance = ON_ZERO_TOLERANCE
303  ) const;
304 
305  /*
306  Description:
307  Determine if the surface is a portion of a sphere.
308  Parameters:
309  sphere - [out] if not nullptr and true is returned,
310  then the sphere definition is returned.
311  tolerance - [in]
312  tolerance to use when checking
313  Returns:
314  True if the surface is a portion of a sphere.
315  */
316  bool IsSphere(
317  ON_Sphere* sphere = nullptr,
318  double tolerance = ON_ZERO_TOLERANCE
319  ) const;
320 
321  /*
322  Description:
323  Determine if the surface is a portion of a cylinder.
324  Parameters:
325  cylinder - [out] if not nullptr and true is returned,
326  then the cylinder definition is returned.
327  tolerance - [in]
328  tolerance to use when checking
329  Returns:
330  True if the surface is a portion of a cylinder.
331  */
332  bool IsCylinder(
333  ON_Cylinder* cylinder = nullptr,
334  double tolerance = ON_ZERO_TOLERANCE
335  ) const;
336 
337  /*
338  Description:
339  Determine if the surface is a portion of a cone.
340  Parameters:
341  cone - [out] if not nullptr and true is returned,
342  then the cone definition is returned.
343  tolerance - [in]
344  tolerance to use when checking
345  Returns:
346  True if the surface is a portion of a cone.
347  */
348  bool IsCone(
349  ON_Cone* cone = nullptr,
350  double tolerance = ON_ZERO_TOLERANCE
351  ) const;
352 
353  /*
354  Description:
355  Determine if the surface is a portion of a torus.
356  Parameters:
357  torus - [out] if not nullptr and true is returned,
358  then the torus definition is returned.
359  tolerance - [in]
360  tolerance to use when checking
361  Returns:
362  True if the surface is a portion of a torus.
363  */
364  bool IsTorus(
365  ON_Torus* torus = nullptr,
366  double tolerance = ON_ZERO_TOLERANCE
367  ) const;
368 
369  virtual
370  bool IsClosed( // true if surface is closed in direction
371  int // dir 0 = "s", 1 = "t"
372  ) const;
373 
374  virtual
375  bool IsPeriodic( // true if surface is periodic in direction (default is false)
376  int // dir 0 = "s", 1 = "t"
377  ) const;
378 
379  virtual
380  bool IsSingular( // true if surface side is collapsed to a point
381  int // side of parameter space to test
382  // 0 = south, 1 = east, 2 = north, 3 = west
383  ) const;
384 
385  /*
386  Returns:
387  True if the surface defines a solid, like a sphere or torus.
388  False if the surface does not define a solid, like a plane or cone.
389  */
390  bool IsSolid() const;
391 
392  /*
393  Description:
394  Test if a surface parameter value is at a singularity.
395  Parameters:
396  s - [in] surface parameter to test
397  t - [in] surface parameter to test
398  bExact - [in] if true, test if s,t is exactly at a singularity
399  if false, test if close enough to cause numerical problems.
400  Returns:
401  true if surface is singular at (s,t)
402  */
403  bool IsAtSingularity(
404  double s,
405  double t,
406  bool bExact = true
407  ) const;
408 
409  /*
410  Description:
411  Test if a surface parameter value is at a seam.
412  Parameters:
413  s - [in] surface parameter to test
414  t - [in] surface parameter to test
415  Returns:
416  0 if not a seam,
417  1 if s == Domain(0)[i] and srf(s, t) == srf(Domain(0)[1-i], t)
418  2 if t == Domain(1)[i] and srf(s, t) == srf(s, Domain(1)[1-i])
419  3 if 1 and 2 are true.
420  */
421  int IsAtSeam(
422  double s,
423  double t
424  ) const;
425 
426  /*
427  Description:
428  Search for a derivatitive, tangent, or curvature
429  discontinuity.
430  Parameters:
431  dir - [in] If 0, then "u" parameter is checked. If 1, then
432  the "v" parameter is checked.
433  c - [in] type of continity to test for.
434  t0 - [in] Search begins at t0. If there is a discontinuity
435  at t0, it will be ignored. This makes it
436  possible to repeatedly call GetNextDiscontinuity
437  and step through the discontinuities.
438  t1 - [in] (t0 != t1) If there is a discontinuity at t1 is
439  will be ingored unless c is a locus discontinuity
440  type and t1 is at the start or end of the curve.
441  t - [out] if a discontinuity is found, then *t reports the
442  parameter at the discontinuity.
443  hint - [in/out] if GetNextDiscontinuity will be called
444  repeatedly, passing a "hint" with initial value *hint=0
445  will increase the speed of the search.
446  dtype - [out] if not nullptr, *dtype reports the kind of
447  discontinuity found at *t. A value of 1 means the first
448  derivative or unit tangent was discontinuous. A value
449  of 2 means the second derivative or curvature was
450  discontinuous. A value of 0 means teh curve is not
451  closed, a locus discontinuity test was applied, and
452  t1 is at the start of end of the curve.
453  cos_angle_tolerance - [in] default = cos(1 degree) Used only
454  when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the
455  cosine of the angle between two tangent vectors is
456  <= cos_angle_tolerance, then a G1 discontinuity is reported.
457  curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used
458  only when c is ON::continuity::G2_continuous. If K0 and K1 are
459  curvatures evaluated from above and below and
460  |K0 - K1| > curvature_tolerance, then a curvature
461  discontinuity is reported.
462  Returns:
463  Parametric continuity tests c = (C0_continuous, ..., G2_continuous):
464 
465  true if a parametric discontinuity was found strictly
466  between t0 and t1. Note well that all curves are
467  parametrically continuous at the ends of their domains.
468 
469  Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous):
470 
471  true if a locus discontinuity was found strictly between
472  t0 and t1 or at t1 is the at the end of a curve.
473  Note well that all open curves (IsClosed()=false) are locus
474  discontinuous at the ends of their domains. All closed
475  curves (IsClosed()=true) are at least C0_locus_continuous at
476  the ends of their domains.
477  */
478  virtual
479  bool GetNextDiscontinuity(
480  int dir,
481  ON::continuity c,
482  double t0,
483  double t1,
484  double* t,
485  int* hint=nullptr,
486  int* dtype=nullptr,
487  double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE,
488  double curvature_tolerance=ON_SQRT_EPSILON
489  ) const;
490 
491  /*
492  Description:
493  Test continuity at a surface parameter value.
494  Parameters:
495  c - [in] continuity to test for
496  s - [in] surface parameter to test
497  t - [in] surface parameter to test
498  hint - [in] evaluation hint
499  point_tolerance - [in] if the distance between two points is
500  greater than point_tolerance, then the surface is not C0.
501  d1_tolerance - [in] if the difference between two first derivatives is
502  greater than d1_tolerance, then the surface is not C1.
503  d2_tolerance - [in] if the difference between two second derivatives is
504  greater than d2_tolerance, then the surface is not C2.
505  cos_angle_tolerance - [in] default = cos(1 degree) Used only when
506  c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine
507  of the angle between two normal vectors
508  is <= cos_angle_tolerance, then a G1 discontinuity is reported.
509  curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when
510  c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated
511  from above and below and |K0 - K1| > curvature_tolerance,
512  then a curvature discontinuity is reported.
513  Returns:
514  true if the surface has at least the c type continuity at the parameter t.
515  */
516  virtual
517  bool IsContinuous(
518  ON::continuity c,
519  double s,
520  double t,
521  int* hint = nullptr,
522  double point_tolerance=ON_ZERO_TOLERANCE,
523  double d1_tolerance=ON_ZERO_TOLERANCE,
524  double d2_tolerance=ON_ZERO_TOLERANCE,
525  double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE,
526  double curvature_tolerance=ON_SQRT_EPSILON
527  ) const;
528 
529  virtual
530  bool Reverse( // reverse parameterizatrion, Domain changes from [a,b] to [-b,-a]
531  int // dir 0 = "s", 1 = "t"
532  ) = 0;
533 
534  virtual
535  bool Transpose() = 0; // transpose surface parameterization (swap "s" and "t")
536 
537  // simple evaluation interface - no error handling
538  ON_3dPoint PointAt( double, double ) const;
539  ON_3dVector NormalAt( double, double ) const;
540  bool FrameAt( double u, double v, ON_Plane& frame) const;
541 
542  bool EvPoint( // returns false if unable to evaluate
543  double u, double v, // evaluation parameters
544  ON_3dPoint& point, // returns value of surface
545  int quadrant = 0, // optional - determines which side to evaluate from
546  // 0 = default
547  // 1 from NE quadrant
548  // 2 from NW quadrant
549  // 3 from SW quadrant
550  // 4 from SE quadrant
551  int* hint = 0 // optional - evaluation hint (int[2]) used to speed
552  // repeated evaluations
553  ) const;
554 
555  bool Ev1Der( // returns false if unable to evaluate
556  double u, double v, // evaluation parameters (s,t)
557  ON_3dPoint& point, // returns value of surface
558  ON_3dVector& du, // first partial derivatives (Ds)
559  ON_3dVector& dv, // (Dt)
560  int quadrant = 0, // optional - determines which side to evaluate from
561  // 0 = default
562  // 1 from NE quadrant
563  // 2 from NW quadrant
564  // 3 from SW quadrant
565  // 4 from SE quadrant
566  int* hint = 0 // optional - evaluation hint (int[2]) used to speed
567  // repeated evaluations
568  ) const;
569 
570  bool Ev2Der( // returns false if unable to evaluate
571  double u, double v, // evaluation parameters (s,t)
572  ON_3dPoint& point, // returns value of surface
573  ON_3dVector& du, // first partial derivatives (Ds)
574  ON_3dVector& dv, // (Dt)
575  ON_3dVector& duu, // second partial derivatives (Dss)
576  ON_3dVector& duv, // (Dst)
577  ON_3dVector& dvv, // (Dtt)
578  int quadrant= 0, // optional - determines which side to evaluate from
579  // 0 = default
580  // 1 from NE quadrant
581  // 2 from NW quadrant
582  // 3 from SW quadrant
583  // 4 from SE quadrant
584  int* hint = 0 // optional - evaluation hint (int[2]) used to speed
585  // repeated evaluations
586  ) const;
587 
588  bool EvNormal( // returns false if unable to evaluate
589  double u, double v, // evaluation parameters (s,t)
590  ON_3dPoint& point, // returns value of surface
591  ON_3dVector& normal, // unit normal
592  int quadrant = 0, // optional - determines which side to evaluate from
593  // 0 = default
594  // 1 from NE quadrant
595  // 2 from NW quadrant
596  // 3 from SW quadrant
597  // 4 from SE quadrant
598  int* hint = 0 // optional - evaluation hint (int[2]) used to speed
599  // repeated evaluations
600  ) const;
601 
602  bool EvNormal( // returns false if unable to evaluate
603  double u, double v, // evaluation parameters (s,t)
604  ON_3dVector& normal, // unit normal
605  int quadrant = 0, // optional - determines which side to evaluate from
606  // 0 = default
607  // 1 from NE quadrant
608  // 2 from NW quadrant
609  // 3 from SW quadrant
610  // 4 from SE quadrant
611  int* hint = 0 // optional - evaluation hint (int[2]) used to speed
612  // repeated evaluations
613  ) const;
614 
615  bool EvNormal( // returns false if unable to evaluate
616  double u, double v, // evaluation parameters (s,t)
617  ON_3dPoint& point, // returns value of surface
618  ON_3dVector& du, // first partial derivatives (Ds)
619  ON_3dVector& dv, // (Dt)
620  ON_3dVector& normal, // unit normal
621  int = 0, // optional - determines which side to evaluate from
622  // 0 = default
623  // 1 from NE quadrant
624  // 2 from NW quadrant
625  // 3 from SW quadrant
626  // 4 from SE quadrant
627  int* = 0 // optional - evaluation hint (int[2]) used to speed
628  // repeated evaluations
629  ) const;
630 
631  // work horse evaluator
632  virtual
633  bool Evaluate( // returns false if unable to evaluate
634  double u, double v, // evaluation parameters
635  int num_der, // number of derivatives (>=0)
636  int array_stride, // array stride (>=Dimension())
637  double* der_array, // array of length stride*(ndir+1)*(ndir+2)/2
638  int quadrant = 0, // optional - determines which quadrant to evaluate from
639  // 0 = default
640  // 1 from NE quadrant
641  // 2 from NW quadrant
642  // 3 from SW quadrant
643  // 4 from SE quadrant
644  int* hint = 0 // optional - evaluation hint (int[2]) used to speed
645  // repeated evaluations
646  ) const = 0;
647 
648  /*
649  Description:
650  Get isoparametric curve.
651  Parameters:
652  dir - [in] 0 first parameter varies and second parameter is constant
653  e.g., point on IsoCurve(0,c) at t is srf(t,c)
654  This is a horizontal line from left to right
655  1 first parameter is constant and second parameter varies
656  e.g., point on IsoCurve(1,c) at t is srf(c,t
657  This is a vertical line from bottom to top
658 
659  c - [in] value of constant parameter
660  Returns:
661  Isoparametric curve.
662  Remarks:
663  In this function "dir" indicates which direction the resulting
664  curve runs. 0: horizontal, 1: vertical
665  In the other ON_Surface functions that take a "dir"
666  argument, "dir" indicates if "c" is a "u" or "v" parameter.
667  */
668  virtual
669  ON_Curve* IsoCurve(
670  int dir,
671  double c
672  ) const;
673 
674 
675  /*
676  Description:
677  Removes the portions of the surface outside of the specified interval.
678 
679  Parameters:
680  dir - [in] 0 The domain specifies an sub-interval of Domain(0)
681  (the first surface parameter).
682  1 The domain specifies an sub-interval of Domain(1)
683  (the second surface parameter).
684  domain - [in] interval of the surface to keep. If dir is 0, then
685  the portions of the surface with parameters (s,t) satisfying
686  s < Domain(0).Min() or s > Domain(0).Max() are trimmed away.
687  If dir is 1, then the portions of the surface with parameters
688  (s,t) satisfying t < Domain(1).Min() or t > Domain(1).Max()
689  are trimmed away.
690  */
691  virtual
692  bool Trim(
693  int dir,
694  const ON_Interval& domain
695  );
696 
697  /*
698  Description:
699  Pure virtual function. Default returns false.
700  Where possible, analytically extends surface to include domain.
701  Parameters:
702  dir - [in] 0 new Domain(0) will include domain.
703  (the first surface parameter).
704  1 new Domain(1) will include domain.
705  (the second surface parameter).
706  domain - [in] if domain is not included in surface domain,
707  surface will be extended so that its domain includes domain.
708  Will not work if surface is closed in direction dir.
709  Original surface is identical to the restriction of the
710  resulting surface to the original surface domain,
711  Returns:
712  true if successful.
713  */
714  virtual
715  bool Extend(
716  int dir,
717  const ON_Interval& domain
718  );
719 
720 
721  /*
722  Description:
723  Splits (divides) the surface into two parts at the
724  specified parameter.
725 
726  Parameters:
727  dir - [in] 0 The surface is split vertically. The "west" side
728  is returned in "west_or_south_side" and the "east"
729  side is returned in "east_or_north_side".
730  1 The surface is split horizontally. The "south" side
731  is returned in "west_or_south_side" and the "north"
732  side is returned in "east_or_north_side".
733  c - [in] value of constant parameter in interval returned
734  by Domain(dir)
735  west_or_south_side - [out] west/south portion of surface returned here
736  east_or_north_side - [out] east/north portion of surface returned here
737 
738  Example:
739 
740  ON_NurbsSurface srf = ...;
741  int dir = 1;
742  ON_NurbsSurface* south_side = 0;
743  ON_NurbsSurface* north_side = 0;
744  srf.Split( dir, srf.Domain(dir).Mid() south_side, north_side );
745 
746  */
747  virtual
748  bool Split(
749  int dir,
750  double c,
751  ON_Surface*& west_or_south_side,
752  ON_Surface*& east_or_north_side
753  ) const;
754 
755 
756  /*
757  Description:
758  Get a NURBS surface representation of this surface.
759  Parameters:
760  nurbs_surface - [out] NURBS representation returned here
761  tolerance - [in] tolerance to use when creating NURBS
762  representation.
763  s_subdomain - [in] if not nullptr, then the NURBS representation
764  for this portion of the surface is returned.
765  t_subdomain - [in] if not nullptr, then the NURBS representation
766  for this portion of the surface is returned.
767  Returns:
768  0 unable to create NURBS representation
769  with desired accuracy.
770  1 success - returned NURBS parameterization
771  matches the surface's to wthe desired accuracy
772  2 success - returned NURBS point locus matches
773  the surface's to the desired accuracy and the
774  domain of the NURBS surface is correct. On
775  However, This surface's parameterization and
776  the NURBS surface parameterization may not
777  match to the desired accuracy. This situation
778  happens when getting NURBS representations of
779  surfaces that have a transendental parameterization
780  like spheres, cylinders, and cones.
781  Remarks:
782  This is a low-level virtual function. If you do not need
783  the parameterization information provided by the return code,
784  then ON_Surface::NurbsSurface may be easier to use.
785  See Also:
786  ON_Surface::NurbsSurface
787  */
788  virtual
789  int GetNurbForm(
790  ON_NurbsSurface& nurbs_surface,
791  double tolerance = 0.0
792  ) const;
793 
794 
795  /*
796  Description:
797  Is there a NURBS surface representation of this surface.
798  Parameters:
799  Returns:
800  0 unable to create NURBS representation
801  with desired accuracy.
802  1 success - NURBS parameterization
803  matches the surface's
804  2 success - NURBS point locus matches
805  the surface's and the
806  domain of the NURBS surface is correct.
807  However, This surface's parameterization and
808  the NURBS surface parameterization may not
809  match. This situation
810  happens when getting NURBS representations of
811  surfaces that have a transendental parameterization
812  like spheres, cylinders, and cones.
813  Remarks:
814  This is a low-level virtual function.
815  See Also:
816  ON_Surface::GetNurbForm
817  ON_Surface::NurbsSurface
818  */
819  virtual
820  int HasNurbForm() const;
821 
822  // Description:
823  // Get a NURBS surface representation of this surface.
824  // Parameters:
825  // pNurbsSurface - [in/out] if not nullptr, this pNurbsSurface
826  // will be used to store the NURBS representation
827  // of the surface and will be returned.
828  // tolerance - [in] tolerance to use when creating NURBS
829  // surface representation.
830  // s_subdomain - [in] if not nullptr, then the NURBS representation
831  // for this portion of the surface is returned.
832  // t_subdomain - [in] if not nullptr, then the NURBS representation
833  // for this portion of the surface is returned.
834  // Returns:
835  // nullptr or a NURBS representation of the surface.
836  // Remarks:
837  // See ON_Surface::GetNurbForm for important details about
838  // the NURBS surface parameterization.
839  // See Also:
840  // ON_Surface::GetNurbForm
841  ON_NurbsSurface* NurbsSurface(
842  ON_NurbsSurface* pNurbsSurface = nullptr,
843  double tolerance = 0.0,
844  const ON_Interval* s_subdomain = nullptr,
845  const ON_Interval* t_subdomain = nullptr
846  ) const;
847 
848  virtual
849  bool GetSurfaceParameterFromNurbFormParameter(
850  double nurbs_s, double nurbs_t,
851  double* surface_s, double* surface_t
852  ) const;
853 
854  virtual
855  bool GetNurbFormParameterFromSurfaceParameter(
856  double surface_s, double surface_t,
857  double* nurbs_s, double* nurbs_t
858  ) const;
859 
860 
861  // If the geometry surface is modified in any way, then
862  // call DestroySurfaceTree().
863  void DestroySurfaceTree();
864 
865 
866 private:
867 
868 public:
869 
870 protected:
871 };
872 
873 class ON_CLASS ON_SurfaceProperties
874 {
875  // Surface properties
876 public:
877  // The constructor sets all fields to zero.
879 
880  /*
881  Parameters:
882  surface - [in]
883  If surface is not null, then it is used to set the surface properties.
884  If surface is null, then all surface properties are set to to zero.
885  Remarks:
886  Does not modify the value of m_tag.
887  */
888  void Set( const ON_Surface* surface );
889 
890  bool m_bIsSet; // True if Set() has been callled with a non-null surface.
891 
892  bool m_bHasSingularity; // true if at least one m_bSingular[] setting is true.
893  bool m_bIsSingular[4]; // m_bSingular[i] = ON_Surface::IsSingular(i)
894 
895  bool m_bHasSeam; // true if at least one m_bClosed[] setting is true.
896  bool m_bIsClosed[2]; // m_bClosed[i] = ON_Surface::IsClosed(i)
897 
898 private:
899  bool m_bReserved[7];
900 
901 public:
902  ON_Interval m_domain[2]; // m_domain[i] = ON_Surface.Domain(i)
903 
904 private:
905  unsigned char m_reserved[16];
906 
907 public:
908  // Last pointer passed to ON_SurfaceProperties::Set().
910 
911  // The constructor sets this value to zero.
912  // Nothing in opennurbs modifies or uses this value.
913  ON__INT_PTR m_tag;
914 };
915 
916 #if defined(ON_DLL_TEMPLATE)
917 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Surface*>;
918 #endif
919 
921 {
922 public:
923  ON_SurfaceArray( int = 0 );
924  ~ON_SurfaceArray();
925 
926  bool Write( ON_BinaryArchive& ) const;
927  bool Read( ON_BinaryArchive& );
928 
929  void Destroy(); // deletes surfaces in array and sets count to 0
930 
931  bool Duplicate( ON_SurfaceArray& ) const; // operator= copies the pointer values
932  // duplicate copies the surfaces themselves
933 };
934 
935 #endif
bool m_bHasSingularity
true if at least one m_bSingular[] setting is true.
Definition: opennurbs_surface.h:892
const ON_Surface * m_surface
Last pointer passed to ON_SurfaceProperties::Set().
Definition: opennurbs_surface.h:909
bool m_bIsSet
True if Set() has been callled with a non-null surface.
Definition: opennurbs_surface.h:890
Definition: opennurbs_nurbssurface.h:62
ON__INT_PTR m_tag
Definition: opennurbs_surface.h:913
bool m_bHasSeam
true if at least one m_bClosed[] setting is true.
Definition: opennurbs_surface.h:895
Definition: opennurbs_array.h:36
-
virtual void DestroyRuntimeCache(bool bDelete=true)
-
virtual bool EvaluatePoint(const class ON_ObjRef &objref, ON_3dPoint &P) const
Definition: opennurbs_cone.h:26
Definition: opennurbs_curve.h:91
Definition: opennurbs_cylinder.h:28
-
virtual ON::object_type ObjectType() const
Definition: opennurbs_geometry.h:36
-
virtual bool HasBrepForm() const
Definition: opennurbs_surface.h:920
-
virtual unsigned int SizeOf() const
Definition: opennurbs_bounding_box.h:25
Definition: opennurbs_mesh.h:24
Definition: opennurbs_polycurve.h:36
@@ -94,23 +87,21 @@ $(function() {
Definition: opennurbs_mesh.h:2241
Definition: opennurbs_surface.h:873
Definition: opennurbs_brep.h:1513
-
ON_Geometry & operator=(const ON_Geometry &)=default
Definition: opennurbs_torus.h:29
< use for generic serialization of binary data
Definition: opennurbs_archive.h:1866
Definition: opennurbs_objref.h:163
Definition: opennurbs_point.h:480
Definition: opennurbs_plane.h:20
Definition: opennurbs_surface.h:56
-
virtual class ON_Brep * BrepForm(class ON_Brep *brep=nullptr) const
Definition: opennurbs_point.h:1182
Definition: opennurbs_point.h:46
Definition: opennurbs_sphere.h:22
diff --git a/6/d0/df9/class_o_n___color.html b/6/d0/df9/class_o_n___color.html index 75fecc7e..2d18e917 100644 --- a/6/d0/df9/class_o_n___color.html +++ b/6/d0/df9/class_o_n___color.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Color Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@
- + +

Detailed Description

NoKeywords
-


-
-/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
-
-/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

+

/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

Class ON_Color

Member Enumeration Documentation

@@ -1322,9 +1316,9 @@ Static Public Attributes
diff --git a/6/d1/d08/opennurbs__textrun_8h_source.html b/6/d1/d08/opennurbs__textrun_8h_source.html index 2d8bf14f..b733b80e 100644 --- a/6/d1/d08/opennurbs__textrun_8h_source.html +++ b/6/d1/d08/opennurbs__textrun_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_textrun.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_textrun.h Source File @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
opennurbs_textrun.h
-
1 
2 /* $NoKeywords: $ */
3 /*
4 //
5 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
6 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
7 // McNeel & Associates.
8 //
9 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
10 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
11 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
12 //
13 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
14 //
15 ////////////////////////////////////////////////////////////////
16 */
17 
18 #ifndef OPENNURBS_TEXTRUN_H_INCLUDED
19 #define OPENNURBS_TEXTRUN_H_INCLUDED
20 
21 class ON_CLASS ON_StackedText
22 {
23 public:
24  static const ON_StackedText Empty;
25 
26 public:
27  ON_StackedText() = default;
28  ~ON_StackedText();
29  ON_StackedText(const ON_StackedText& src);
30 
31  // Sets m_parent_run = nullptr.
32  // You must set m_parent_run after calling operator=().
33  ON_StackedText& operator=(const ON_StackedText& src);
34 
35  class ON_TextRun* m_top_run = nullptr;
36  class ON_TextRun* m_bottom_run = nullptr;
37  const ON_TextRun* m_parent_run = nullptr;
38  wchar_t m_separator = ON_wString::Slash;
39 
40  enum class StackStyle : unsigned char
41  {
42  kUnset = 0,
43  kHorizontalToScreen = 1,
44  kSlanted = 2,
45  };
46 
47  static ON_StackedText::StackStyle StackStyleFromUnsigned(
48  unsigned int stack_style_as_unsigned
49  );
50 
51 private:
52  friend class ON_TextRun;
53 
54  //bool WriteNested(
55  // unsigned int nested_depth,
56  // ON_BinaryArchive& archive
57  // ) const;
58 
59  //bool ReadNested(
60  // unsigned int nested_depth,
61  // ON_BinaryArchive& archive
62  // );
63 };
64 
65 // A range of text with all the same attributes
66 class ON_CLASS ON_TextRun
67 {
68 public:
69  static const ON_TextRun Empty;
70 
71  /*
72  Description:
73  ON_TextRun::NewTextRun() gets a text run from an efficiently managed pool.
74  Returns:
75  A pointer to a text run. (never nullptr).
76  */
77  static ON_TextRun* GetManagedTextRun();
78 
79 
80  /*
81  Description:
82  ON_TextRun::NewTextRun() gets a text run from an efficiently managed pool
83  and copies src
84  Returns:
85  A pointer to a text run. (never nullptr).
86  */
87  static ON_TextRun* GetManagedTextRun(
88  const ON_TextRun& src
89  );
90 
91  /*
92  Description:
93  Return a managed ON_TextRun.
94  */
95  static bool ReturnManagedTextRun(
96  ON_TextRun* managed_text_run
97  );
98 
99  /*
100  Returns:
101  True if the memory for this ON_TextRun is managed.
102  It was created by calling ON_TextRun::GetManagedTextRun(). If it is active,
103  then is must be deleted by calling ON_TextRun::ReturnManagedTextRun();
104  */
105  bool IsManagedTextRun() const;
106 
107  /*
108  Returns:
109  True if the memory for this ON_TextRun is managed and the text run is active.
110  It was created by calling ON_TextRun::GetManagedTextRun() and should be
111  deleted by calling ON_TextRun::ReturnManagedTextRun();
112  */
113  bool IsActiveManagedTextRun() const;
114 
115 public:
116  ON_TextRun() = default;
117  ~ON_TextRun();
118  ON_TextRun(const ON_TextRun& src);
119  ON_TextRun& operator=(const ON_TextRun& src);
120 
121 private:
122  ON_TextRun(bool bManagedTextRun);
123 
124 public:
125  enum class RunType : unsigned char
126  {
127  kNone = 0,
128  kText = 1,
129  kNewline = 2,
130  kSoftreturn = 3,
131  kParagraph = 4,
132  kColumn = 5,
133  kField = 6,
134  kFieldValue = 7,
135  kFontdef = 8,
136  kHeader = 9,
137  kFonttbl = 10,
138  kColortbl = 11,
139  };
140 
141  static ON_TextRun::RunType RunTypeFromUnsigned(
142  unsigned int run_type_as_unsigned
143  );
144 
145  enum class Stacked : unsigned char
146  {
147  kNone = 0,
148  kStacked = 1,
149  kTop = 2,
150  kBottom = 3
151  };
152 
153  static ON_TextRun::Stacked StackedFromUnsigned(
154  unsigned int stacked_as_unsigned
155  );
156 
157  enum class RunDirection : unsigned char
158  {
159  kLtR = 0,
160  kRtL = 1,
161  };
162 
163  static ON_TextRun::RunDirection RunDirectionFromUnsigned(
164  unsigned int run_direction_as_unsigned
165  );
166 
167 public:
168 
169  ON_SHA1_Hash TextRunContentHash() const;
170  ON_SHA1_Hash TextRunContentHash(
171  bool bEvaluateFields
172  ) const;
173 
174 
175  void Init(
176  const class ON_Font* managed_font,
177  double height,
178  double stackscale,
179  ON_Color color,
180  bool bold,
181  bool italic,
182  bool underlined,
183  bool strikethrough,
184  bool deletedisplay = true);
185 
186  bool IsText() const;
187  bool IsNewline() const;
188  bool IsColumn() const;
189  bool IsValid() const;
190 
191  RunType Type() const;
192  void SetType(ON_TextRun::RunType);
193  RunDirection FlowDirection() const;
194 
195  Stacked IsStacked() const;
196  void SetStacked(Stacked stacked);
197  void SetStackedOff();
198 
199  // Set or get the WCS model unit height of the text
200  // not including any annotatition scaling
201  double TextHeight() const;
202 
203  void SetTextHeight(double h);
204 
205  ON_Color Color() const;
206  void SetColor(ON_Color color);
207 
208  void SetFont(const ON_Font* font);
209  const ON_Font* Font() const;
210 
211  // bbox is stored as ON_BoundingBox, but is always 2d. z=0
212  const ON_BoundingBox& BoundingBox() const;
213  void SetBoundingBox(ON_2dPoint pmin, ON_2dPoint pmax);
214 
215  const ON_2dVector& Offset() const;
216  void SetOffset(ON_2dVector offset);
217 
218  const ON_2dVector& Advance() const;
219  void SetAdvance(ON_2dVector advance);
220 
221  // This returns the scale of m_height / HeightOfI.
222  // It doesn't take into account anything about annotation scaling
223  // This is the scale for converting ON_TextRun bounding boxes and
224  // offsets to basic model units
225  double HeightScale(const ON_Font* font) const;
226 
227  void SetStackFractionHeight(double stackscale);
228  double StackHeightFraction() const;
229  static double DefaultStackFractionHeight();
230 
231  //bool Write(
232  // ON_BinaryArchive&
233  // ) const;
234  //bool Read(
235  // ON_BinaryArchive&
236  // );
237 
238  void Get2dCorners(ON_2dPoint corners[4]) const;
239 
240 private:
241  static
242  void SetUnicodeString(ON__UINT32*& dest, size_t count, const ON__UINT32* cp);
243 
244 public:
245  void SetUnicodeString(size_t count, const ON__UINT32* cp);
246  static size_t CodepointCount(const ON__UINT32* cp);
247 
248  // Returns string in m_display_string, which may be the result of parsing text fields
249  void SetDisplayString(const wchar_t* str);
250 
251  // The display string is the TextString() with formulae evaluated.
252  const wchar_t* DisplayString() const;
253 
254  // Returns the string in m_text_string, which is a wchar_t version of the basic text for this run,
255  // and may contain unevaluated field formulae
256  const wchar_t* TextString() const;
257 
258  const ON__UINT32* UnicodeString() const;
259 
260  bool GetGlyphContours(
261  const ON_Font* text_font,
262  bool bSingleStrokeFont,
263  const ON_Xform& text_xform,
265  ) const;
266 
267  friend class ON_TextBuilder;
268 
269  // Wrap text to a specified width in model space
270  int WrapTextRun(
271  int call_count,
272  int start_char_offset,
273  double width,
274  double &y_offset,
275  double& currentwidth,
276  class ON_TextRunArray& newruns) const;
277 
278  const ON_Font* m_managed_font = nullptr; // Font used to draw, pick, or otherwise evaluate this
279  // ON_TextRun. This pointer is run-time only and must be
280  // set and point to a valid ON_Font for any font related
281  // operations to work.
282 
283 // ON_UUID m_Font_id = ON_nil_uuid;
284 private:
285  ON__UINT32* m_codepoints = nullptr; // Parsed text as UTF32
286 
287  // Set from m_codepoints when required.
288  // Always use TextString() to get this value
289  mutable ON_wString m_text_string = ON_wString::EmptyString;
290  // Parsed text as wchar_t*
291  // If this string is non-empty, it is valid and can be used
292  // instead of m_codepoints
293  // This string may have unevaluated field definitions - %<field_name>%
294 
295  mutable ON_wString m_display_string = ON_wString::EmptyString;
296  // Text to display when this is drawn.
297  // If this text has field definitions, m_display_string will have the
298  // evaluation results to display
299  // This string may change often if there are fields to evaluate.
300 
301  mutable ON_SHA1_Hash m_text_run_hash = ON_SHA1_Hash::ZeroDigest;
302  mutable ON_SHA1_Hash m_text_run_display_hash = ON_SHA1_Hash::ZeroDigest;
303 
304  ON_TextRun::Stacked m_text_stacked = ON_TextRun::Stacked::kNone; // 0: Normal text, 1: Run is stacked container, 2: Run is top of stacked fraction, 3: Run is bottom of stacked fraction
305 
306 private:
307  void Internal_ContentChanged() const;
308 public:
309  ON_StackedText* m_stacked_text = nullptr; // pointers to runs for the top and bottom parts
310 
312 private:
315 
316 private:
317 
318  // This value of m_managed_status is not copied
319  // 0: Not managed
320  // 1: Managed by GetManagedTextRun() / ReturnManagedTextRun()
321  const unsigned char m_managed_status = 0;
322  unsigned char m_active_status = 0; // 0: active, 1: inactive managed text_run
323 
324 private:
325  double m_run_text_height = 1.0; // (ECS) text height in model units or page units
326 
327 public:
328  ON_2dVector m_offset = ON_2dVector::ZeroVector; // (ECS) offset to lower left of bounding box from ON_TextContent plane origin
329 
330  ON_2dVector m_advance = ON_2dVector::ZeroVector; // (ECS) distance and direction from m_offset to start of next run
331 
332 private:
333  ON_BoundingBox m_bbox = ON_BoundingBox::EmptyBoundingBox; // (ECS) 3d Bounding box oriented to ON_TextContent object's plane (z == 0) with run offset already included
334 
335 public:
336  double m_height_scale = -1.0; // Font HeightOfI / text height - Converts from font units to model units or page units
337  double m_stackscale = 0.7; // fraction for scaling textheight in stacked text
338 
339  // indent and margins are in model units or page units
340  // These apply to Paragraph type runs (m_type == rtParagraph)
341  double m_indent = 0.0; // First line indentation for this paragraph
342  double m_left_margin = 0.0; // left margin in formatting rect for this paragraph
343  double m_right_margin = 0.0; // right margin in formatting rect for this paragraph
344 
345  int m_line_index = -1; // line position in ON_TextContent
346 
347 private:
348  ON__UINT_PTR m_reserved=0;
349 
350 private:
351  friend class ON_StackedText;
352  //bool WriteNested(
353  // unsigned int nested_depth,
354  // ON_BinaryArchive& archive
355  // ) const;
356  //bool ReadNested(
357  // unsigned int nested_depth,
358  // ON_BinaryArchive& archive
359  // );
360 private:
361  void Internal_Destroy();
362  void Internal_CopyFrom(const ON_TextRun& src);
363 };
364 
365 
366 class ON_CLASS ON_TextRunArray : private ON_SimpleArray< ON_TextRun* >
367 {
368  //ON_TextRun*& AppendNew();
369  //void Append(int, ON_TextRun* const *);
370  //void Append(ON_TextRun* const);
371 
372 public:
374 
375  ON_TextRunArray() = default;
376 
377  // Calls Destroy(true,true)
378  ~ON_TextRunArray();
379 
380  // Duplicate runs are managed text runs
382 
383  // Duplicate runs are managed text runs
384  ON_TextRunArray(const ON_TextRunArray& src);
385 
386 public:
387 
388  /*
389  Returns:
390  A hash of the information that determines the text content with evaluated fields.
391  */
392  ON_SHA1_Hash TextRunArrayContentHash() const;
393 
394  /*
395  Parameters:
396  bEvaluateFields - [in]
397  true - hash text with fields evaluated
398  false - hash text with fields unevaluated
399  Returns:
400  A hash of the information that determines the text content
401  without evaluating the fields.
402  */
403  ON_SHA1_Hash TextRunArrayContentHash(
404  bool bEvaluateFields
405  ) const;
406 
407  // Run must be a managed run or on the heap.
408  // The destructor will return managed runs and delete unmanaged runs.
409  void InsertRun(int i, ON_TextRun*& run);
410 
411  void RemoveRun(int i);
412 
413  // Run must be a managed run or on the heap.
414  // The destructor will return managed runs and delete unmanaged runs.
415  void AppendRun(ON_TextRun*& run);
416 
417  bool Get2dCorners(ON_2dPoint corners[4]) const;
418 
419  const ON_TextRun* operator[](int i) const;
420  ON_TextRun* operator[](int i);
421  int Count() const;
422  unsigned int UnsignedCount() const;
423  ON_TextRun*const* Array() const;
424 
425  /*
426  Parameters:
427  bReturnManagedRuns - [in]
428  True: Managed runs will be returned.
429  False: Caller must explicityly handle managed runs.
430  bDeleteUnmanagedRuns - [in]
431  True: Unmanaged runs are deleted.
432  False: Caller must explicityly handle unmanaged runs.
433  */
434  void SetTextHeight(double height);
435 
436 private:
437  void Internal_Destroy();
438  void Internal_CopyFrom(const ON_TextRunArray& src);
439 };
440 
441 
442 #endif
+
1 
2 /* $NoKeywords: $ */
3 /*
4 //
5 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
6 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
7 // McNeel & Associates.
8 //
9 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
10 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
11 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
12 //
13 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
14 //
15 ////////////////////////////////////////////////////////////////
16 */
17 
18 #ifndef OPENNURBS_TEXTRUN_H_INCLUDED
19 #define OPENNURBS_TEXTRUN_H_INCLUDED
20 
21 class ON_CLASS ON_StackedText
22 {
23 public:
24  static const ON_StackedText Empty;
25 
26 public:
27  ON_StackedText() = default;
28  ~ON_StackedText();
29  ON_StackedText(const ON_StackedText& src);
30 
31  // Sets m_parent_run = nullptr.
32  // You must set m_parent_run after calling operator=().
33  ON_StackedText& operator=(const ON_StackedText& src);
34 
35  class ON_TextRun* m_top_run = nullptr;
36  class ON_TextRun* m_bottom_run = nullptr;
37  const ON_TextRun* m_parent_run = nullptr;
38  wchar_t m_separator = ON_wString::Slash;
39 
40  enum class StackStyle : unsigned char
41  {
42  kUnset = 0,
43  kHorizontalToScreen = 1,
44  kSlanted = 2,
45  };
46 
47  static ON_StackedText::StackStyle StackStyleFromUnsigned(
48  unsigned int stack_style_as_unsigned
49  );
50 
51 private:
52  friend class ON_TextRun;
53 
54  //bool WriteNested(
55  // unsigned int nested_depth,
56  // ON_BinaryArchive& archive
57  // ) const;
58 
59  //bool ReadNested(
60  // unsigned int nested_depth,
61  // ON_BinaryArchive& archive
62  // );
63 };
64 
65 // A range of text with all the same attributes
66 class ON_CLASS ON_TextRun
67 {
68 public:
69  static const ON_TextRun Empty;
70 
71  /*
72  Description:
73  ON_TextRun::NewTextRun() gets a text run from an efficiently managed pool.
74  Returns:
75  A pointer to a text run. (never nullptr).
76  */
77  static ON_TextRun* GetManagedTextRun();
78 
79 
80  /*
81  Description:
82  ON_TextRun::NewTextRun() gets a text run from an efficiently managed pool
83  and copies src
84  Returns:
85  A pointer to a text run. (never nullptr).
86  */
87  static ON_TextRun* GetManagedTextRun(
88  const ON_TextRun& src
89  );
90 
91  /*
92  Description:
93  Return a managed ON_TextRun.
94  */
95  static bool ReturnManagedTextRun(
96  ON_TextRun* managed_text_run
97  );
98 
99  /*
100  Returns:
101  True if the memory for this ON_TextRun is managed.
102  It was created by calling ON_TextRun::GetManagedTextRun(). If it is active,
103  then is must be deleted by calling ON_TextRun::ReturnManagedTextRun();
104  */
105  bool IsManagedTextRun() const;
106 
107  /*
108  Returns:
109  True if the memory for this ON_TextRun is managed and the text run is active.
110  It was created by calling ON_TextRun::GetManagedTextRun() and should be
111  deleted by calling ON_TextRun::ReturnManagedTextRun();
112  */
113  bool IsActiveManagedTextRun() const;
114 
115 public:
116  ON_TextRun() = default;
117  ~ON_TextRun();
118  ON_TextRun(const ON_TextRun& src);
119  ON_TextRun& operator=(const ON_TextRun& src);
120 
121 private:
122  ON_TextRun(bool bManagedTextRun);
123 
124 public:
125  enum class RunType : unsigned char
126  {
127  kNone = 0,
128  kText = 1,
129  kNewline = 2,
130  kSoftreturn = 3,
131  kParagraph = 4,
132  kColumn = 5,
133  kField = 6,
134  kFieldValue = 7,
135  kFontdef = 8,
136  kHeader = 9,
137  kFonttbl = 10,
138  kColortbl = 11,
139  };
140 
141  static ON_TextRun::RunType RunTypeFromUnsigned(
142  unsigned int run_type_as_unsigned
143  );
144 
145  enum class Stacked : unsigned char
146  {
147  kNone = 0,
148  kStacked = 1,
149  kTop = 2,
150  kBottom = 3
151  };
152 
153  static ON_TextRun::Stacked StackedFromUnsigned(
154  unsigned int stacked_as_unsigned
155  );
156 
157  enum class RunDirection : unsigned char
158  {
159  kLtR = 0,
160  kRtL = 1,
161  };
162 
163  static ON_TextRun::RunDirection RunDirectionFromUnsigned(
164  unsigned int run_direction_as_unsigned
165  );
166 
167 public:
168 
169  ON_SHA1_Hash TextRunContentHash() const;
170  ON_SHA1_Hash TextRunContentHash(
171  bool bEvaluateFields
172  ) const;
173 
174 
175  void Init(
176  const class ON_Font* managed_font,
177  double height,
178  double stackscale,
179  ON_Color color,
180  bool bold,
181  bool italic,
182  bool underlined,
183  bool strikethrough,
184  bool deletedisplay = true);
185 
186  bool IsText() const;
187  bool IsNewline() const;
188  bool IsColumn() const;
189  bool IsValid() const;
190 
191  RunType Type() const;
192  void SetType(ON_TextRun::RunType);
193  RunDirection FlowDirection() const;
194 
195  Stacked IsStacked() const;
196  void SetStacked(Stacked stacked);
197  void SetStackedOff();
198 
199  // Set or get the WCS model unit height of the text
200  // not including any annotatition scaling
201  double TextHeight() const;
202 
203  void SetTextHeight(double h);
204 
205  ON_Color Color() const;
206  void SetColor(ON_Color color);
207 
208  void SetFont(const ON_Font* font);
209  const ON_Font* Font() const;
210 
211  // bbox is stored as ON_BoundingBox, but is always 2d. z=0
212  const ON_BoundingBox& BoundingBox() const;
213  void SetBoundingBox(ON_2dPoint pmin, ON_2dPoint pmax);
214 
215  const ON_2dVector& Offset() const;
216  void SetOffset(ON_2dVector offset);
217 
218  const ON_2dVector& Advance() const;
219  void SetAdvance(ON_2dVector advance);
220 
221  // This returns the scale of m_height / HeightOfI.
222  // It doesn't take into account anything about annotation scaling
223  // This is the scale for converting ON_TextRun bounding boxes and
224  // offsets to basic model units
225  double HeightScale(const ON_Font* font) const;
226 
227  void SetStackFractionHeight(double stackscale);
228  double StackHeightFraction() const;
229  static double DefaultStackFractionHeight();
230 
231  //bool Write(
232  // ON_BinaryArchive&
233  // ) const;
234  //bool Read(
235  // ON_BinaryArchive&
236  // );
237 
238  void Get2dCorners(ON_2dPoint corners[4]) const;
239 
240 private:
241  static
242  void SetUnicodeString(ON__UINT32*& dest, size_t count, const ON__UINT32* cp);
243 
244 public:
245  void SetUnicodeString(size_t count, const ON__UINT32* cp);
246  static size_t CodepointCount(const ON__UINT32* cp);
247 
248  // Returns string in m_display_string, which may be the result of parsing text fields
249  void SetDisplayString(const wchar_t* str);
250 
251  // The display string is the TextString() with formulae evaluated.
252  const wchar_t* DisplayString() const;
253 
254  // Returns the string in m_text_string, which is a wchar_t version of the basic text for this run,
255  // and may contain unevaluated field formulae
256  const wchar_t* TextString() const;
257 
258  const ON__UINT32* UnicodeString() const;
259 
260  bool GetGlyphContours(
261  const ON_Font* text_font,
262  bool bSingleStrokeFont,
263  const ON_Xform& text_xform,
265  ) const;
266 
267  friend class ON_TextBuilder;
268 
269  // Wrap text to a specified width in model space
270  int WrapTextRun(
271  int call_count,
272  int start_char_offset,
273  double width,
274  double &y_offset,
275  double& currentwidth,
276  class ON_TextRunArray& newruns) const;
277 
278  const ON_Font* m_managed_font = nullptr; // Font used to draw, pick, or otherwise evaluate this
279  // ON_TextRun. This pointer is run-time only and must be
280  // set and point to a valid ON_Font for any font related
281  // operations to work.
282 
283 // ON_UUID m_Font_id = ON_nil_uuid;
284 private:
285  ON__UINT32* m_codepoints = nullptr; // Parsed text as UTF32
286 
287  // Set from m_codepoints when required.
288  // Always use TextString() to get this value
289  mutable ON_wString m_text_string = ON_wString::EmptyString;
290  // Parsed text as wchar_t*
291  // If this string is non-empty, it is valid and can be used
292  // instead of m_codepoints
293  // This string may have unevaluated field definitions - %<field_name>%
294 
295  mutable ON_wString m_display_string = ON_wString::EmptyString;
296  // Text to display when this is drawn.
297  // If this text has field definitions, m_display_string will have the
298  // evaluation results to display
299  // This string may change often if there are fields to evaluate.
300 
301  mutable ON_SHA1_Hash m_text_run_hash = ON_SHA1_Hash::ZeroDigest;
302  mutable ON_SHA1_Hash m_text_run_display_hash = ON_SHA1_Hash::ZeroDigest;
303 
304  ON_TextRun::Stacked m_text_stacked = ON_TextRun::Stacked::kNone; // 0: Normal text, 1: Run is stacked container, 2: Run is top of stacked fraction, 3: Run is bottom of stacked fraction
305 
306 private:
307  void Internal_ContentChanged() const;
308 public:
309  ON_StackedText* m_stacked_text = nullptr; // pointers to runs for the top and bottom parts
310 
312 private:
315 
316 private:
317 
318  // This value of m_managed_status is not copied
319  // 0: Not managed
320  // 1: Managed by GetManagedTextRun() / ReturnManagedTextRun()
321  const unsigned char m_managed_status = 0;
322  unsigned char m_active_status = 0; // 0: active, 1: inactive managed text_run
323 
324 private:
325  double m_run_text_height = 1.0; // (ECS) text height in model units or page units
326 
327 public:
328  ON_2dVector m_offset = ON_2dVector::ZeroVector; // (ECS) offset to lower left of bounding box from ON_TextContent plane origin
329 
330  ON_2dVector m_advance = ON_2dVector::ZeroVector; // (ECS) distance and direction from m_offset to start of next run
331 
332 private:
333  ON_BoundingBox m_bbox = ON_BoundingBox::EmptyBoundingBox; // (ECS) 3d Bounding box oriented to ON_TextContent object's plane (z == 0) with run offset already included
334 
335 public:
336  double m_height_scale = -1.0; // Font HeightOfI / text height - Converts from font units to model units or page units
337  double m_stackscale = 0.7; // fraction for scaling textheight in stacked text
338 
339  // indent and margins are in model units or page units
340  // These apply to Paragraph type runs (m_type == rtParagraph)
341  double m_indent = 0.0; // First line indentation for this paragraph
342  double m_left_margin = 0.0; // left margin in formatting rect for this paragraph
343  double m_right_margin = 0.0; // right margin in formatting rect for this paragraph
344 
345  int m_line_index = -1; // line position in ON_TextContent
346 
347 private:
348  ON__UINT_PTR m_reserved=0;
349 
350 private:
351  friend class ON_StackedText;
352  //bool WriteNested(
353  // unsigned int nested_depth,
354  // ON_BinaryArchive& archive
355  // ) const;
356  //bool ReadNested(
357  // unsigned int nested_depth,
358  // ON_BinaryArchive& archive
359  // );
360 private:
361  void Internal_Destroy();
362  void Internal_CopyFrom(const ON_TextRun& src);
363 };
364 
365 
366 class ON_CLASS ON_TextRunArray : private ON_SimpleArray< ON_TextRun* >
367 {
368  //ON_TextRun*& AppendNew();
369  //void Append(int, ON_TextRun* const *);
370  //void Append(ON_TextRun* const);
371 
372 public:
374 
375  ON_TextRunArray() = default;
376 
377  // Calls Destroy(true,true)
378  ~ON_TextRunArray();
379 
380  // Duplicate runs are managed text runs
381  ON_TextRunArray& operator=(const ON_TextRunArray& src);
382 
383  // Duplicate runs are managed text runs
384  ON_TextRunArray(const ON_TextRunArray& src);
385 
386 public:
387 
388  /*
389  Returns:
390  A hash of the information that determines the text content with evaluated fields.
391  */
392  ON_SHA1_Hash TextRunArrayContentHash() const;
393 
394  /*
395  Parameters:
396  bEvaluateFields - [in]
397  true - hash text with fields evaluated
398  false - hash text with fields unevaluated
399  Returns:
400  A hash of the information that determines the text content
401  without evaluating the fields.
402  */
403  ON_SHA1_Hash TextRunArrayContentHash(
404  bool bEvaluateFields
405  ) const;
406 
407  // Run must be a managed run or on the heap.
408  // The destructor will return managed runs and delete unmanaged runs.
409  void InsertRun(int i, ON_TextRun*& run);
410 
411  void RemoveRun(int i);
412 
413  // Run must be a managed run or on the heap.
414  // The destructor will return managed runs and delete unmanaged runs.
415  void AppendRun(ON_TextRun*& run);
416 
417  bool Get2dCorners(ON_2dPoint corners[4]) const;
418 
419  const ON_TextRun* operator[](int i) const;
420  ON_TextRun* operator[](int i);
421  int Count() const;
422  unsigned int UnsignedCount() const;
423  ON_TextRun*const* Array() const;
424 
425  /*
426  Parameters:
427  bReturnManagedRuns - [in]
428  True: Managed runs will be returned.
429  False: Caller must explicityly handle managed runs.
430  bDeleteUnmanagedRuns - [in]
431  True: Unmanaged runs are deleted.
432  False: Caller must explicityly handle unmanaged runs.
433  */
434  void SetTextHeight(double height);
435 
436 private:
437  void Internal_Destroy();
438  void Internal_CopyFrom(const ON_TextRunArray& src);
439 };
440 
441 
442 #endif
static const ON_StackedText Empty
Definition: opennurbs_textrun.h:24
static const ON_BoundingBox EmptyBoundingBox
((1.0,0.0,0.0),(-1.0,0.0,0.0))
Definition: opennurbs_bounding_box.h:28
static const wchar_t Slash
Unicode SOLIDUS U+002F.
Definition: opennurbs_string.h:2105
A range of text with all the same attributes.
Definition: opennurbs_textrun.h:66
-
ON_SimpleArray< T > & operator=(const ON_SimpleArray< T > &)
Definition: opennurbs_array_defs.h:96
Definition: opennurbs_sha1.h:19
@@ -87,29 +84,25 @@ $(function() {
Definition: opennurbs_point.h:292
Definition: opennurbs_bounding_box.h:25
static const ON_TextRunArray EmptyArray
Definition: opennurbs_textrun.h:373
-
unsigned int UnsignedCount() const
Definition: opennurbs_array_defs.h:167
RunDirection
Definition: opennurbs_textrun.h:157
Definition: opennurbs_xform.h:28
An ON_Font is a face in a font family. It corresponds to a Windows LOGFONT, a .NET System...
Definition: opennurbs_font.h:225
StackStyle
Definition: opennurbs_textrun.h:40
RunType
Definition: opennurbs_textrun.h:125
Definition: opennurbs_textiterator.h:99
-
T & operator[](int)
Definition: opennurbs_array_defs.h:198
Definition: opennurbs_array.h:412
static const ON_wString EmptyString
Definition: opennurbs_string.h:2095
static const ON_TextRun Empty
Definition: opennurbs_textrun.h:69
static const ON_2dVector ZeroVector
(0.0,0.0)
Definition: opennurbs_point.h:881
-
int Count() const
query ///////////////////////////////////////////////////////////////
Definition: opennurbs_array_defs.h:161
static const ON_SHA1_Hash ZeroDigest
all digest bytes are zero
Definition: opennurbs_sha1.h:22
-
T * Array()
The Array() function return the.
Definition: opennurbs_array_defs.h:337
Definition: opennurbs_point.h:868
Definition: opennurbs_textrun.h:21
diff --git a/6/d1/d0f/class_o_n___unknown_user_data.html b/6/d1/d0f/class_o_n___unknown_user_data.html index 840d509b..3716b242 100644 --- a/6/d1/d0f/class_o_n___unknown_user_data.html +++ b/6/d1/d0f/class_o_n___unknown_user_data.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UnknownUserData Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@
- + +
-

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
- The default implementation of this virtual function returns false and does nothing.

+

Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

+

The default implementation of this virtual function returns false and does nothing.

Reimplemented from ON_Object.

@@ -633,9 +631,9 @@ Additional Inherited Members
diff --git a/6/d1/d11/class_o_n__w_string.html b/6/d1/d11/class_o_n__w_string.html index 40ab7c2a..b0a20248 100644 --- a/6/d1/d11/class_o_n__w_string.html +++ b/6/d1/d11/class_o_n__w_string.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_wString Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
-

Description: Compare this string and other_name as a name attribute of an object like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on. These comparisons ignore case and use appropriate string normalization.
-Parameters: other_name - [in] null terminated string

+

Description: Compare this string and other_name as a name attribute of an object like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on. These comparisons ignore case and use appropriate string normalization. Parameters: other_name - [in] null terminated string

@@ -1409,8 +1406,7 @@ Parameters: other_name - [in] null terminated string

-

Description: Compare this string and other_name as a name attribute of an object like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on. These comparisons ignore case and use appropriate string normalization.
-Parameters: name1 - [in] null terminated string name2 - [in] null terminated string

+

Description: Compare this string and other_name as a name attribute of an object like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on. These comparisons ignore case and use appropriate string normalization. Parameters: name1 - [in] null terminated string name2 - [in] null terminated string

@@ -2953,8 +2949,7 @@ Parameters: name1 - [in] null terminated string name2 - [in] null terminated str
-

Description: A platform independent, secure, culture invariant way to format a wchar_t string with support for positional format parameters. This function is provide to be used when it is critical that the formatting be platform independent, secure and culture invarient. Parameters: buffer - [out] not null buffer_capacity - [in] > 0 Number of wchar_t elements in buffer. format - [in] Avoid using S (capital S). See the Remarks for details. ... - [in] Returns: >= 0: The number of wchar_t elements written to buffer[], not including the null terminator. A null terminator is always added (buffer[returned value] = 0). The last element of buffer[] is always set to zero (buffer[buffer_capacity-1] = 0). < 0: failure: If buffer is not null and buffer_capacity > 0, then buffer[0] = 0 and buffer[buffer_capacity-1] = 0; Remarks: The way Windows handles the S (capital S) format parameter depends on locale and code page settings. It is strongly reccommended that you never use S to include any string that may possibly contain elements with values > 127.
- The following examples illustrate a way to predictably use UTF-8 and wchar_t parameters in buffers of the other element type.

 const char* utf8_string = ...;
+

Description: A platform independent, secure, culture invariant way to format a wchar_t string with support for positional format parameters. This function is provide to be used when it is critical that the formatting be platform independent, secure and culture invarient. Parameters: buffer - [out] not null buffer_capacity - [in] > 0 Number of wchar_t elements in buffer. format - [in] Avoid using S (capital S). See the Remarks for details. ... - [in] Returns: >= 0: The number of wchar_t elements written to buffer[], not including the null terminator. A null terminator is always added (buffer[returned value] = 0). The last element of buffer[] is always set to zero (buffer[buffer_capacity-1] = 0). < 0: failure: If buffer is not null and buffer_capacity > 0, then buffer[0] = 0 and buffer[buffer_capacity-1] = 0; Remarks: The way Windows handles the S (capital S) format parameter depends on locale and code page settings. It is strongly reccommended that you never use S to include any string that may possibly contain elements with values > 127. The following examples illustrate a way to predictably use UTF-8 and wchar_t parameters in buffers of the other element type.

 const char* utf8_string = ...;
 

/ UNRELIABLE ///< ON_wString::Format(buffer,buffer_capacity,"%S",utf8_string); wchar_t wchar_buffer[...]; const size_t wchar_buffer_capacity= sizeof(buffer)/sizeof(buffer[0]); ON_wString::Format(wchar_buffer, wchar_buffer_capacity, "%s", ON_wString(utf8_string));

const wchar_t* wide_string = ...; / UNRELIABLE ///< ON_wString::Format(buffer,buffer_capacity,"%S",char_string); char char_buffer[...]; const size_t char_buffer_capacity = sizeof(buffer)/sizeof(buffer[0]); ON_String::Format(char_buffer, char_buffer_capacity, "%s", ON_String(wide_string));

@@ -3957,8 +3952,8 @@ Parameters: name1 - [in] null terminated string name2 - [in] null terminated str

If element_count < 1, then string[] must be null terminated and ON_wString::Length(string)+1 elements are mapped. The +1 insures the output is null terminated.

mapped_string - [out] The result of the mapping is returned in mapped_string[].

mapped_string_capacity - [in] Number of wchar_t elements available in mapped_string[] or 0 to calculate the minimum number of elements needed for the mapping.

-

Returns: If mapped_string_capacity > 0, then the number elements set in mapped_string[] is returned.
- If mapped_string_capacity == 0, then the number elements required to perform the mapping is returned.

+

Returns: If mapped_string_capacity > 0, then the number elements set in mapped_string[] is returned.

+

If mapped_string_capacity == 0, then the number elements required to perform the mapping is returned.

When there is room, mapped_string[] is null terminated.

0: Failure.

@@ -6322,9 +6317,9 @@ Parameters: name1 - [in] null terminated string name2 - [in] null terminated str
diff --git a/6/d1/d13/class_o_n___polynomial_curve-members.html b/6/d1/d13/class_o_n___polynomial_curve-members.html index 26af6c7c..d8cb791c 100644 --- a/6/d1/d13/class_o_n___polynomial_curve-members.html +++ b/6/d1/d13/class_o_n___polynomial_curve-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d1/d17/class_o_n___bounding_box.html b/6/d1/d17/class_o_n___bounding_box.html index 0c4edb4f..806b92fc 100644 --- a/6/d1/d17/class_o_n___bounding_box.html +++ b/6/d1/d17/class_o_n___bounding_box.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BoundingBox Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +

Detailed Description

NoKeywords
-


-
-/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
-
-/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

+

/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

ON_BoundingBox - axis aligned bounding box

Constructor & Destructor Documentation

@@ -2129,9 +2123,9 @@ Static Public Attributes
diff --git a/6/d1/d1b/class_o_n___circle.html b/6/d1/d1b/class_o_n___circle.html index b898dc26..d0fa0605 100644 --- a/6/d1/d1b/class_o_n___circle.html +++ b/6/d1/d1b/class_o_n___circle.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Circle Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +

Detailed Description

Description: ON_Circle is a circle in 3d. The cirle is represented by a radius and an orthonormal frame of the plane containing the circle, with origin at the center.

An Is_Valid() circle has positive radius and an Is_ Valid() plane defining the frame.

-

The circle is parameterized by radians from 0 to 2 Pi given by t -> center + cos(t)*radius*xaxis + sin(t)*radius*yaxis
- where center, xaxis and yaxis define the orthonormal frame of the circle's plane.

+

The circle is parameterized by radians from 0 to 2 Pi given by t -> center + cos(t)*radius*xaxis + sin(t)*radius*yaxis where center, xaxis and yaxis define the orthonormal frame of the circle's plane.

Constructor & Destructor Documentation

◆ ON_Circle() [1/7]

@@ -864,8 +861,7 @@ Static Public Attributes
-

Description: Get a four span rational degree 2 NURBS circle representation of the circle. Returns: 2 for success, 0 for failure Remarks: Note that the parameterization of NURBS curve does not match circle's transcendental paramaterization.
- Use ON_Circle::GetRadianFromNurbFormParameter() and ON_Circle::GetParameterFromRadian() to convert between the NURBS curve parameter and the transcendental parameter.

+

Description: Get a four span rational degree 2 NURBS circle representation of the circle. Returns: 2 for success, 0 for failure Remarks: Note that the parameterization of NURBS curve does not match circle's transcendental paramaterization. Use ON_Circle::GetRadianFromNurbFormParameter() and ON_Circle::GetParameterFromRadian() to convert between the NURBS curve parameter and the transcendental parameter.

@@ -978,8 +974,7 @@ Static Public Attributes
-

Description: Get tight bounding box. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false)
- If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the arc's tight bounding box. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed arc is calculated. The arc is not modified. Returns: True if a valid tight_bbox is returned.

+

Description: Get tight bounding box. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false) If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the arc's tight bounding box. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed arc is calculated. The arc is not modified. Returns: True if a valid tight_bbox is returned.

@@ -1415,9 +1410,9 @@ Static Public Attributes diff --git a/6/d1/d31/class_o_n___offset_surface_function.html b/6/d1/d31/class_o_n___offset_surface_function.html index d54d7a16..d6345423 100644 --- a/6/d1/d31/class_o_n___offset_surface_function.html +++ b/6/d1/d31/class_o_n___offset_surface_function.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_OffsetSurfaceFunction Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d1/d37/class_o_n___rev_surface.html b/6/d1/d37/class_o_n___rev_surface.html index 63796c11..b3812522 100644 --- a/6/d1/d37/class_o_n___rev_surface.html +++ b/6/d1/d37/class_o_n___rev_surface.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RevSurface Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
N_iso = 6, iso_count = 7
- } - pure virtual class for surface objects More...
+ } pure virtual class for surface objects More...
+   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
@@ -426,11 +424,7 @@ Additional Inherited Members

Detailed Description

surface of revolution

NoKeywords
-


-
-/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
-
-/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

+

/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

Constructor & Destructor Documentation

◆ ON_RevSurface() [1/2]

@@ -507,8 +501,8 @@ Additional Inherited Members
-

Description: Some objects cache bounding box information. If you modify an object, then call ClearBoundingBox() to inform the object that any cached bounding boxes are invalid.
- Remarks: Generally, ClearBoundingBox() overrides simply invalidate a cached bounding box and then wait for a call to GetBBox() before recomputing the bounding box.

+

Description: Some objects cache bounding box information. If you modify an object, then call ClearBoundingBox() to inform the object that any cached bounding boxes are invalid.

+

Remarks: Generally, ClearBoundingBox() overrides simply invalidate a cached bounding box and then wait for a call to GetBBox() before recomputing the bounding box.

The default implementation does nothing.

Reimplemented from ON_Geometry.

@@ -821,8 +815,7 @@ Additional Inherited Members
-

Description: Where possible, analytically extends surface to include domain. Parameters: dir - [in] 0 new Domain(0) will include domain. (the first surface parameter). 1 new Domain(1) will include domain. (the second surface parameter). domain - [in] if domain is not included in surface domain, surface will be extended so that its domain includes domain.
- Will not work if surface is closed in direction dir. Original surface is identical to the restriction of the resulting surface to the original surface domain, Returns: true if successful.

+

Description: Where possible, analytically extends surface to include domain. Parameters: dir - [in] 0 new Domain(0) will include domain. (the first surface parameter). 1 new Domain(1) will include domain. (the second surface parameter). domain - [in] if domain is not included in surface domain, surface will be extended so that its domain includes domain. Will not work if surface is closed in direction dir. Original surface is identical to the restriction of the resulting surface to the original surface domain, Returns: true if successful.

Reimplemented from ON_Surface.

@@ -949,8 +942,7 @@ Additional Inherited Members
-

Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search.
- dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

+

Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search. dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

true if a parametric discontinuity was found strictly between t0 and t1. Note well that all curves are parametrically continuous at the ends of their domains.

Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous):

true if a locus discontinuity was found strictly between t0 and t1 or at t1 is the at the end of a curve. Note well that all open curves (IsClosed()=false) are locus discontinuous at the ends of their domains. All closed curves (IsClosed()=true) are at least C0_locus_continuous at the ends of their domains.

@@ -1253,8 +1245,7 @@ Additional Inherited Members
-

Description: Is there a NURBS surface representation of this surface. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the surface's 2 success - NURBS point locus matches the surface's and the domain of the NURBS surface is correct.
- However, This surface's parameterization and the NURBS surface parameterization may not match. This situation happens when getting NURBS representations of surfaces that have a transendental parameterization like spheres, cylinders, and cones. Remarks: This is a low-level virtual function. See Also: ON_Surface::GetNurbForm ON_Surface::NurbsSurface

+

Description: Is there a NURBS surface representation of this surface. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the surface's 2 success - NURBS point locus matches the surface's and the domain of the NURBS surface is correct. However, This surface's parameterization and the NURBS surface parameterization may not match. This situation happens when getting NURBS representations of surfaces that have a transendental parameterization like spheres, cylinders, and cones. Remarks: This is a low-level virtual function. See Also: ON_Surface::GetNurbForm ON_Surface::NurbsSurface

Reimplemented from ON_Surface.

@@ -2167,8 +2158,7 @@ Additional Inherited Members
-

If false, the "u" parameter is the angle parameter and the "v" parameter is the curve parameter.
-If true, the "u" parameter is the curve parameter and the "v" parameter is the angle parameter.

+

If false, the "u" parameter is the angle parameter and the "v" parameter is the curve parameter. If true, the "u" parameter is the curve parameter and the "v" parameter is the angle parameter.

@@ -2205,9 +2195,9 @@ If true, the "u" parameter is the curve parameter and the "v" parameter is the a diff --git a/6/d1/d3c/opennurbs__rendering_8h_source.html b/6/d1/d3c/opennurbs__rendering_8h_source.html index 50df280a..3b8ea192 100644 --- a/6/d1/d3c/opennurbs__rendering_8h_source.html +++ b/6/d1/d3c/opennurbs__rendering_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_rendering.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_rendering.h Source File @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d1/d44/class_o_n___dim_ordinate-members.html b/6/d1/d44/class_o_n___dim_ordinate-members.html index 0da76969..4365ae2b 100644 --- a/6/d1/d44/class_o_n___dim_ordinate-members.html +++ b/6/d1/d44/class_o_n___dim_ordinate-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d1/d44/class_o_n___rtf_first_char_1_1_text_run.html b/6/d1/d44/class_o_n___rtf_first_char_1_1_text_run.html index bcb38a0d..b46a860f 100644 --- a/6/d1/d44/class_o_n___rtf_first_char_1_1_text_run.html +++ b/6/d1/d44/class_o_n___rtf_first_char_1_1_text_run.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RtfFirstChar::TextRun Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d1/d4b/class_o_n___line-members.html b/6/d1/d4b/class_o_n___line-members.html index 4887a661..23732ab7 100644 --- a/6/d1/d4b/class_o_n___line-members.html +++ b/6/d1/d4b/class_o_n___line-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d1/d54/class_o_n___mesh_triangle-members.html b/6/d1/d54/class_o_n___mesh_triangle-members.html index 0d30f68c..b8bbda5b 100644 --- a/6/d1/d54/class_o_n___mesh_triangle-members.html +++ b/6/d1/d54/class_o_n___mesh_triangle-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d1/d57/class_o_n___dim_style-members.html b/6/d1/d57/class_o_n___dim_style-members.html index e129173c..fcffa4f3 100644 --- a/6/d1/d57/class_o_n___dim_style-members.html +++ b/6/d1/d57/class_o_n___dim_style-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d1/d65/struct_o_n___mesh_topology_vertex-members.html b/6/d1/d65/struct_o_n___mesh_topology_vertex-members.html index b0b41c12..b251a6eb 100644 --- a/6/d1/d65/struct_o_n___mesh_topology_vertex-members.html +++ b/6/d1/d65/struct_o_n___mesh_topology_vertex-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d1/d69/class_o_n___mesh_topology-members.html b/6/d1/d69/class_o_n___mesh_topology-members.html index fa878f58..95e203a0 100644 --- a/6/d1/d69/class_o_n___mesh_topology-members.html +++ b/6/d1/d69/class_o_n___mesh_topology-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d1/d6c/class_o_n___workspace.html b/6/d1/d6c/class_o_n___workspace.html index d7aa5085..669ef3c6 100644 --- a/6/d1/d6c/class_o_n___workspace.html +++ b/6/d1/d6c/class_o_n___workspace.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Workspace Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +

Detailed Description

NoKeywords
-


-
-/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
-
-/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////
-Description: Use ON_Workspace classes on the stack to efficiently get and automatically clean up workspace memory and scratch files.

+

/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// Description: Use ON_Workspace classes on the stack to efficiently get and automatically clean up workspace memory and scratch files.

Constructor & Destructor Documentation

◆ ON_Workspace()

@@ -593,9 +586,9 @@ Description: Use ON
diff --git a/6/d1/d6e/class_o_n___file_system_path.html b/6/d1/d6e/class_o_n___file_system_path.html index 8c69163e..eb33e524 100644 --- a/6/d1/d6e/class_o_n___file_system_path.html +++ b/6/d1/d6e/class_o_n___file_system_path.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_FileSystemPath Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
PathId::DesktopDirectory = 1, PathId::DocumentsDirectory = 2, PathId::DownloadsDirectory = 3 - } - ids used by ON_FileSystemPath::GetPath() More...
+ } ids used by ON_FileSystemPath::GetPath() More...
+   diff --git a/6/d1/d7e/class_o_n___object-members.html b/6/d1/d7e/class_o_n___object-members.html index 4bcc18b8..eb08884a 100644 --- a/6/d1/d7e/class_o_n___object-members.html +++ b/6/d1/d7e/class_o_n___object-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@

@@ -1473,9 +1471,9 @@ Static Public Attributes

openNURBS SDK Help +  6.0
- + +
diff --git a/6/d1/d82/class_o_n__3dm_object_attributes-members.html b/6/d1/d82/class_o_n__3dm_object_attributes-members.html index 1629baef..f0578389 100644 --- a/6/d1/d82/class_o_n__3dm_object_attributes-members.html +++ b/6/d1/d82/class_o_n__3dm_object_attributes-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
diff --git a/6/d1/d90/opennurbs__string_8h_source.html b/6/d1/d90/opennurbs__string_8h_source.html index 6c0ab6df..c306e73d 100644 --- a/6/d1/d90/opennurbs__string_8h_source.html +++ b/6/d1/d90/opennurbs__string_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_string.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_string.h Source File @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
opennurbs_string.h
-
1 /* $NoKeywords: $ */
2 /*
3 //
4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6 // McNeel & Associates.
7 //
8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
11 //
12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
13 //
14 ////////////////////////////////////////////////////////////////
15 */
16 
17 #if !defined(ON_STRING_INC_)
18 #define ON_STRING_INC_
19 
20 
21 /*
22 Description:
23  Sort an index array.
24 Parameters
25  method - [in]
26  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort.
27  Use ON::sort_algorithm::heap_sort only after doing meaningful performance
28  testing using optimized release builds that demonstrate
29  ON::sort_algorithm::heap_sort is significantly better.
30  index - [out]
31  Pass in an array of count integers. The returned
32  index[] is a permutation of (0,1,..,count-1)
33  such that compare(B[index[i]],B[index[i+1]) <= 0
34  where B[i] = base + i*sizeof_element
35  base - [in]
36  array of count elements
37  count - [in]
38  number of elements in the index[] and base[] arrays
39  sizeof_element - [in]
40  number of bytes between consecutive elements in the
41  base[] array.
42  compare - [in]
43  Comparison function a la qsort().
44 */
45 ON_DECL
46 void ON_Sort(
47  ON::sort_algorithm method,
48  int* index,
49  const void* base,
50  size_t count,
51  size_t sizeof_element,
52  int (*compare)(const void*,const void*) // int compar(const void*,const void*)
53  );
54 
55 ON_DECL
56 void ON_Sort(
57  ON::sort_algorithm method,
58  unsigned int* index,
59  const void* base,
60  size_t count,
61  size_t sizeof_element,
62  int(*compare)(const void*, const void*) // int compar(const void*,const void*)
63  );
64 
65 
66 /*
67 Description:
68  Sort an index array using a compare function
69  that takes an additional pointer that can be used to
70  pass extra informtation.
71 Parameters
72  method - [in]
73  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort.
74  Use ON::sort_algorithm::heap_sort only after doing meaningful performance
75  testing using optimized release builds that demonstrate
76  ON::sort_algorithm::heap_sort is significantly better.
77  index - [out]
78  Pass in an array of count integers. The returned
79  index[] is a permutation of (0,1,..,count-1)
80  such that compare(B[index[i]],B[index[i+1]) <= 0
81  where B[i] = base + i*sizeof_element
82  base - [in]
83  array of count elements
84  count - [in]
85  number of elements in the index[] and base[] arrays
86  sizeof_element - [in]
87  number of bytes between consecutive elements in the
88  base[] array.
89  compare - [in]
90  Comparison function a la qsort(). The context parameter
91  is pass as the third argument.
92  context - [in]
93  pointer passed as the third argument to compare().
94 */
95 ON_DECL
96 void ON_Sort(
97  ON::sort_algorithm method,
98  int* index,
99  const void* base,
100  size_t count,
101  size_t sizeof_element,
102  int (*compare)(const void*,const void*,void*), // int compar(const void* a,const void* b, void* ptr)
103  void* context
104  );
105 
106 ON_DECL
107 void ON_Sort(
108  ON::sort_algorithm method,
109  unsigned int* index,
110  const void* base,
111  size_t count,
112  size_t sizeof_element,
113  int(*compare)(const void*, const void*, void*), // int compar(const void* a,const void* b, void* ptr)
114  void* context
115  );
116 
117 /*
118 Description:
119  Various sorts. When in doubt, use ON_qsort().
120  ON_qsort - quick sort.
121  ON_hsort = hearp sort.
122 Parameters
123  base - [in]
124  array of count elements
125  count - [in]
126  number of elements in the index[] and base[] arrays
127  sizeof_element - [in]
128  number of bytes between consecutive elements in the
129  base[] array.
130  compare - [in]
131  Comparison function a la qsort(). The context parameter
132  is pass as the third argument.
133  context - [in]
134  pointer passed as the third argument to compare().
135 Remarks:
136  As a rule, use quick sort unless extensive tests in your case
137  prove that heap sort is faster.
138 
139  This implementation of quick sort is generally faster than
140  heap sort, even when the input arrays are nearly sorted.
141  The only common case when heap sort is faster occurs when
142  the arrays are strictly "chevron" (3,2,1,2,3) or "carat"
143  (1,2,3,2,1) ordered, and in these cases heap sort is about
144  50% faster. If the "chevron" or "caret" ordered arrays
145  have a little randomness added, the two algorithms have
146  the same speed.
147 */
148 ON_DECL
149 void ON_hsort(
150  void* base,
151  size_t count,
152  size_t sizeof_element,
153  int (*compare)(const void*,const void*)
154  );
155 
156 ON_DECL
157 void ON_qsort(
158  void* base,
159  size_t count,
160  size_t sizeof_element,
161  int (*compare)(const void*,const void*)
162  );
163 
164 ON_DECL
165 void ON_hsort(
166  void* base,
167  size_t count,
168  size_t sizeof_element,
169  int (*compare)(void*,const void*,const void*),
170  void* context
171  );
172 
173 ON_DECL
174 void ON_qsort(
175  void* base,
176  size_t count,
177  size_t sizeof_element,
178  int (*compare)(void*,const void*,const void*),
179  void* context
180  );
181 
182 /*
183 Description:
184  Sort an array of doubles in increasing order in place.
185 Parameters:
186  sort_algorithm - [in]
187  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
188  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
189  optimized release builds and are confident heap sort is
190  significantly faster in your case.
191  a - [in / out]
192  The values in a[] are sorted so that a[i] <= a[i+1].
193  a[] cannot contain NaNs.
194  nel - [in]
195  length of array a[]
196 */
197 ON_DECL
198 void ON_SortDoubleArray(
199  ON::sort_algorithm sort_algorithm,
200  double* a,
201  size_t nel
202  );
203 
204 
205 /*
206 Description:
207  Sort an array of doubles in increasing order in place.
208 Parameters:
209  a - [in / out]
210  The values in a[] are sorted so that a[i] <= a[i+1].
211  a[] cannot contain NaNs.
212  nel - [in]
213  length of array a[]
214 */
215 ON_DECL
216 void ON_SortDoubleArrayIncreasing(
217  double* a,
218  size_t nel
219  );
220 
221 /*
222 Description:
223  Sort an array of doubles in increasing order in place.
224 Parameters:
225  a - [in / out]
226  The values in a[] are sorted so that a[i] >= a[i+1].
227  a[] cannot contain NaNs.
228  nel - [in]
229  length of array a[]
230 */
231 ON_DECL
232 void ON_SortDoubleArrayDecreasing(
233  double* a,
234  size_t nel
235  );
236 
237 /*
238 Description:
239  Sort an array of ints in place.
240 Parameters:
241  sort_algorithm - [in]
242  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
243  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
244  optimized release builds and are confident heap sort is
245  significantly faster in your case.
246  a - [in / out]
247  The values in a[] are sorted so that a[i] <= a[i+1].
248  nel - [in]
249  length of array a[]
250 */
251 ON_DECL
252 void ON_SortIntArray(
253  ON::sort_algorithm sort_algorithm,
254  int* a,
255  size_t nel
256  );
257 
258 /*
259 Description:
260  Sort an array of unsigned ints in place.
261 Parameters:
262  sort_algorithm - [in]
263  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
264  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
265  optimized release builds and are confident heap sort is
266  significantly faster in your case.
267  a - [in / out]
268  The values in a[] are sorted so that a[i] <= a[i+1].
269  nel - [in]
270  length of array a[]
271 */
272 ON_DECL
273 void ON_SortUnsignedIntArray(
274  ON::sort_algorithm sort_algorithm,
275  unsigned int* a,
276  size_t nel
277  );
278 
279 /*
280 Description:
281  Sort an array of unsigned 64-bit ints in place.
282 Parameters:
283  sort_algorithm - [in]
284  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
285  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
286  optimized release builds and are confident heap sort is
287  significantly faster in your case.
288  a - [in / out]
289  The values in a[] are sorted so that a[i] <= a[i+1].
290  nel - [in]
291  length of array a[]
292 */
293 ON_DECL
294 void ON_SortUINT64Array(
295  ON::sort_algorithm sort_algorithm,
296  ON__UINT64* a,
297  size_t nel
298 );
299 
300 
301 
302 /*
303 Description:
304  Sort an array of unsigned null terminated char strings in place.
305 Parameters:
306  sort_algorithm - [in]
307  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
308  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
309  optimized release builds and are confident heap sort is
310  significantly faster in your case.
311  a - [in / out]
312  The values in a[] are sorted so that strcmp(a[i],a[i+1]) <= 0.
313  nel - [in]
314  length of array a[]
315 */
316 ON_DECL
317 void ON_SortStringArray(
318  ON::sort_algorithm sort_algorithm,
319  char** a,
320  size_t nel
321  );
322 
323 ON_DECL
324 const int* ON_BinarySearchIntArray(
325  int key,
326  const int* base,
327  size_t nel
328  );
329 
330 ON_DECL
331 const unsigned int* ON_BinarySearchUnsignedIntArray(
332  unsigned int key,
333  const unsigned int* base,
334  size_t nel
335  );
336 
337 ON_DECL
338 const void* ON_BinarySearchArrayForUnsingedInt(
339  unsigned int key,
340  const void* base,
341  size_t count,
342  size_t sizeof_element,
343  size_t key_offset
344  );
345 
346 ON_DECL
347 const double* ON_BinarySearchDoubleArray(
348  double key,
349  const double* base,
350  size_t nel
351  );
352 
353 /*
354  This class is intended to be used to determine if a file's
355  contents have changed.
356 */
357 class ON_CLASS ON_CheckSum
358 {
359 public:
360  ON_CheckSum();
361  ~ON_CheckSum();
362 
364 
365  // zeros all fields.
366  void Zero();
367 
368  /*
369  Returns:
370  True if checksum is set.
371  */
372  bool IsSet() const;
373 
374  // C++ default operator=, operator==,
375  // and copy constructor work fine.
376 
377  /*
378  Descripton:
379  Set check sum values for a buffer
380  Parameters:
381  size - [in]
382  number of bytes in buffer
383  buffer - [in]
384  time - [in]
385  last modified time in seconds since Jan 1, 1970, UCT
386  Returns:
387  True if checksum is set.
388  */
389  bool SetBufferCheckSum(
390  size_t size,
391  const void* buffer,
392  time_t time
393  );
394 
395  /*
396  Descripton:
397  Set check sum values for a file.
398  Parameters:
399  fp - [in] pointer to a file opened with ON:FileOpen(...,"rb")
400  Returns:
401  True if checksum is set.
402  */
403  bool SetFileCheckSum(
404  FILE* fp
405  );
406 
407  /*
408  Descripton:
409  Set check sum values for a file.
410  Parameters:
411  filename - [in] name of file.
412  Returns:
413  True if checksum is set.
414  */
415  bool SetFileCheckSum(
416  const wchar_t* filename
417  );
418 
419  /*
420  Description:
421  Test buffer to see if it has a matching checksum.
422  Paramters:
423  size - [in] size in bytes
424  buffer - [in]
425  Returns:
426  True if the buffer has a matching checksum.
427  */
428  bool CheckBuffer(
429  size_t size,
430  const void* buffer
431  ) const;
432 
433  /*
434  Description:
435  Test buffer to see if it has a matching checksum.
436  Paramters:
437  fp - [in] pointer to file opened with ON::OpenFile(...,"rb")
438  bSkipTimeCheck - [in] if true, the time of last
439  modification is not checked.
440  Returns:
441  True if the file has a matching checksum.
442  */
443  bool CheckFile(
444  FILE* fp,
445  bool bSkipTimeCheck = false
446  ) const;
447 
448  /*
449  Description:
450  Test buffer to see if it has a matching checksum.
451  Paramters:
452  filename - [in]
453  bSkipTimeCheck - [in] if true, the time of last
454  modification is not checked.
455  Returns:
456  True if the file has a matching checksum.
457  */
458  bool CheckFile(
459  const wchar_t* filename,
460  bool bSkipTimeCheck = false
461  ) const;
462 
463  bool Write(class ON_BinaryArchive&) const;
464  bool Read(class ON_BinaryArchive&);
465 
466  void Dump(class ON_TextLog&) const;
467 
468 public:
469  size_t m_size; // bytes in the file.
470  time_t m_time; // last modified time in seconds since Jan 1, 1970, UCT
471  ON__UINT32 m_crc[8]; // crc's
472 };
473 
474 
475 /*
476 Description:
477  Get the length of a UTF-8 encoded char string.
478 Parameters:
479  string - [in]
480  null terminated char string.
481 Returns:
482  Number of nonzero char elements before the null terminator.
483  If string is nullptr, then 0 is returned.
484 */
485 ON_DECL
486 int ON_StringLengthUTF8(
487  const char* string
488  );
489 
490 /*
491 Description:
492  Get the length of a UTF-16 encoded ON__UINT16 string.
493 Parameters:
494  string - [in]
495  null terminated ON__UINT16 string.
496 Returns:
497  Number of nonzero ON__UINT16 elements before the null terminator.
498  If string is nullptr, then 0 is returned.
499 */
500 ON_DECL
501 int ON_StringLengthUTF16(
502  const ON__UINT16* string
503  );
504 
505 /*
506 Description:
507  Get the length of a UTF-32 encoded ON__UINT32 string.
508 Parameters:
509  string - [in]
510  null terminated ON__UINT32 string.
511 Returns:
512  Number of nonzero ON__UINT32 elements before the null terminator.
513  If string is nullptr, then 0 is returned.
514 */
515 ON_DECL
516 int ON_StringLengthUTF32(
517  const ON__UINT32* string
518  );
519 
520 /*
521 Description:
522  Get the length of a wchar_t string.
523 Parameters:
524  string - [in]
525  null terminated wchar_t string.
526 Returns:
527  Number of nonzero wchar_t elements before the null terminator.
528  If string is nullptr, then 0 is returned.
529 */
530 ON_DECL
531 int ON_StringLengthWideChar(
532  const wchar_t* string
533  );
534 
535 /*
536 Description:
537  Get the length of a UTF-8 encoded char string.
538 Parameters:
539  string - [in]
540  null terminated char string.
541  string_capacity - [in]
542  maximum number of string[] elements to test.
543 Returns:
544  If string is nullptr or string_capacity <=0, then 0 is returned.
545  If a null terminator is not found, then string_capacity is returned.
546  Otherwise, the number of nonzero char elements before the null terminator is returned.
547 */
548 ON_DECL
549 int ON_StringLengthUTF8(
550  const char* string,
551  size_t string_capacity
552  );
553 
554 /*
555 Description:
556  Get the length of a UTF-16 encoded ON__UINT16 string.
557 Parameters:
558  string - [in]
559  null terminated ON__UINT16 string.
560  string_capacity - [in]
561  maximum number of string[] elements to test.
562 Returns:
563  If string is nullptr or string_capacity <=0, then 0 is returned.
564  If a null terminator is not found, then string_capacity is returned.
565  Otherwise, the number of nonzero char elements before the null terminator is returned.
566 */
567 ON_DECL
568 int ON_StringLengthUTF16(
569  const ON__UINT16* string,
570  size_t string_capacity
571  );
572 
573 /*
574 Description:
575  Get the length of a UTF-32 encoded ON__UINT32 string.
576 Parameters:
577  string - [in]
578  null terminated ON__UINT32 string.
579  string_capacity - [in]
580  maximum number of string[] elements to test.
581 Returns:
582  If string is nullptr or string_capacity <=0, then 0 is returned.
583  If a null terminator is not found, then string_capacity is returned.
584  Otherwise, the number of nonzero char elements before the null terminator is returned.
585 */
586 ON_DECL
587 int ON_StringLengthUTF32(
588  const ON__UINT32* string,
589  size_t string_capacity
590  );
591 
592 /*
593 Description:
594  Get the length of a wchar_t string.
595 Parameters:
596  string - [in]
597  null terminated wchar_t string.
598  string_capacity - [in]
599  maximum number of string[] elements to test.
600 Returns:
601  If string is nullptr or string_capacity <=0, then 0 is returned.
602  If a null terminator is not found, then string_capacity is returned.
603  Otherwise, the number of nonzero char elements before the null terminator is returned.
604 */
605 ON_DECL
606 int ON_StringLengthWideChar(
607  const wchar_t* string,
608  size_t string_capacity
609  );
610 
611 /*
612 Description:
613  Compare of UTF-8 encoded char strings element by element.
614 Parameters:
615  string1 - [in]
616  element_count1 - [in]
617  If element_count1 < 0, then string1 must be null terminated and element_count1
618  will be set to the length of string1.
619  If element_count1 >= 0, then that number of elements are compared in string1[].
620  string2 - [in]
621  element_count2 - [in]
622  If element_count2 < 0, then string2 must be null terminated and element_count2
623  will be set to the length of string2.
624  If element_count2 >= 0, then that number of elements are compared in string2[].
625  bOrdinalIgnoreCase - [in]
626  If bOrdinalIgnoreCase, then letters with a capital and small codepoint value <= 127
627  are compared using the smallest codepoint value. This amounts to converting the
628  letters a-z to A-Z before comparing.
629 Returns:
630  0: the strings are the same
631  <0: string1 < string2
632  >0: string1 > string2
633 Remarks:
634  1) If linguistic issues are important, then this function is not appropriate.
635  2) nullptr values are handled.
636  3) There are lists of Unicode code point values such that the results of
637  ON_StringCompareOrdinalUTF8, ON_StringCompareOrdinalUTF16 and ON_StringCompareOrdinalUTF32
638  are different when applied to UTF-8, UTF-16 and UTF-32 encodings.
639  4) This function does not compare Unicode code point values the strings have eny elements with values > 127.
640 */
641 ON_DECL
642 int ON_StringCompareOrdinalUTF8(
643  const char* string1,
644  int element_count1,
645  const char* string2,
646  int element_count2,
647  bool bOrdinalIgnoreCase
648  );
649 
650 /*
651 Description:
652  Compare of UTF-16 encoded ON__UINT16 strings element by element.
653 Parameters:
654  string1 - [in]
655  element_count1 - [in]
656  If element_count1 < 0, then string1 must be null terminated and element_count1
657  will be set to the length of string1.
658  If element_count1 >= 0, then that number of elements are compared in string1[].
659  string2 - [in]
660  element_count2 - [in]
661  If element_count2 < 0, then string2 must be null terminated and element_count2
662  will be set to the length of string2.
663  If element_count2 >= 0, then that number of elements are compared in string2[].
664  bOrdinalIgnoreCase - [in]
665  If bOrdinalIgnoreCase, then letters with a capital and small codepoint value <= 127
666  are compared using the smallest codepoint value. This amounts to converting the
667  letters a-z to A-Z before comparing.
668 Returns:
669  0: the strings are the same
670  <0: string1 < string2
671  >0: string1 > string2
672 Remarks:
673  1) If linguistic issues are important, then this function is not appropriate.
674  2) nullptr values are handled.
675  3) There are lists of Unicode code point values such that the results of
676  ON_StringCompareOrdinalUTF8, ON_StringCompareOrdinalUTF16 and ON_StringCompareOrdinalUTF32
677  are different when applied to UTF-8, UTF-16 and UTF-32 encodings.
678  4) This function does not compare Unicode code point values if the strings have any surrogate pairs.
679 */
680 ON_DECL
681 int ON_StringCompareOrdinalUTF16(
682  const ON__UINT16* string1,
683  int element_count1,
684  const ON__UINT16* string2,
685  int element_count2,
686  bool bOrdinalIgnoreCase
687  );
688 
689 /*
690 Description:
691  Compare of UTF-32 encoded ON__UINT32 strings element by element.
692 Parameters:
693  string1 - [in]
694  element_count1 - [in]
695  If element_count1 < 0, then string1 must be null terminated and element_count1
696  will be set to the length of string1.
697  If element_count1 >= 0, then that number of elements are compared in string1[].
698  string2 - [in]
699  element_count2 - [in]
700  If element_count2 < 0, then string2 must be null terminated and element_count2
701  will be set to the length of string2.
702  If element_count2 >= 0, then that number of elements are compared in string2[].
703  bOrdinalIgnoreCase - [in]
704  If bOrdinalIgnoreCase, then letters with a capital and small codepoint value <= 127
705  are compared using the smallest codepoint value. This amounts to converting the
706  letters a-z to A-Z before comparing.
707 Returns:
708  0: the strings are the same
709  <0: string1 < string2
710  >0: string1 > string2
711 Remarks:
712  1) If linguistic issues are important, then this function is not appropriate.
713  2) nullptr values are handled.
714  3) There are lists of Unicode code point values such that the results of
715  ON_StringCompareOrdinalUTF8, ON_StringCompareOrdinalUTF16 and ON_StringCompareOrdinalUTF32
716  are different when applied to UTF-8, UTF-16 and UTF-32 encodings.
717 */
718 ON_DECL
719 int ON_StringCompareOrdinalUTF32(
720  const ON__UINT32* string1,
721  int element_count1,
722  const ON__UINT32* string2,
723  int element_count2,
724  bool bOrdinalIgnoreCase
725  );
726 
727 /*
728 Description:
729  Compare wchar_t strings element by element.
730 Parameters:
731  string1 - [in]
732  element_count1 - [in]
733  If element_count1 < 0, then string1 must be null terminated and element_count1
734  will be set to the length of string1.
735  If element_count1 >= 0, then that number of elements are compared in string1[].
736  string2 - [in]
737  element_count2 - [in]
738  If element_count2 < 0, then string2 must be null terminated and element_count2
739  will be set to the length of string2.
740  If element_count2 >= 0, then that number of elements are compared in string2[].
741  bOrdinalIgnoreCase - [in]
742  If bOrdinalIgnoreCase, then letters with a capital and small codepoint value <= 127
743  are compared using the smallest codepoint value. This amounts to converting the
744  letters a-z to A-Z before comparing.
745 Returns:
746  0: the strings are the same
747  <0: string1 < string2
748  >0: string1 > string2
749 Remarks:
750  1) If linguistic issues are important, then this function is not appropriate.
751  2) nullptr values are handled.
752  3) There are lists of Unicode code point values such that the results of
753  ON_StringCompareOrdinalUTF8, ON_StringCompareOrdinalUTF16 and ON_StringCompareOrdinalUTF32
754  are different when applied to UTF-8, UTF-16 and UTF-32 encodings.
755  4) This function assumes the sizeof(wchar_t) is 1, 2 or 4,
756  that 1 bytes wchar_t strings are UTF-8 encoded, 2 byte wchar_t strings are UTF-16 encoded
757  and 4 bytes wchar_t strings are UTF-32 encoded.
758 */
759 ON_DECL
760 int ON_StringCompareOrdinalWideChar(
761  const wchar_t* string1,
762  int element_count1,
763  const wchar_t* string2,
764  int element_count2,
765  bool bOrdinalIgnoreCase
766  );
767 
768 /////////////////////////////////////////////////////////////////////////////
769 //
770 // ON_String is a UTF-8 char string on all platforms
771 // ON_wString is a UTF-16 encoded wchar_t string on Windows platforms
772 // ON_wString is a UTF-32 encoded wchar_t string on Windows platforms
773 //
774 
775 class ON_CLASS ON_StringBuffer
776 {
777 public:
778  ON_StringBuffer();
779 
781  char* stack_buffer,
782  size_t stack_buffer_capacity
783  );
784 
785  ~ON_StringBuffer();
786 
787  bool GrowBuffer(
788  size_t buffer_capacity
789  );
790 
791  char* m_buffer;
793 
794 private:
796  ON_StringBuffer& operator=(const ON_StringBuffer&);
797  char* m_heap_buffer;
798  size_t m_heap_buffer_capacity;
799 };
800 
801 class ON_CLASS ON_wStringBuffer
802 {
803 public:
805 
807  wchar_t* stack_buffer,
808  size_t stack_buffer_capacity
809  );
810 
811  ~ON_wStringBuffer();
812 
813  bool GrowBuffer(
814  size_t buffer_capacity
815  );
816 
817  wchar_t* m_buffer;
819 
820 private:
822  ON_wStringBuffer& operator=(const ON_wStringBuffer&);
823  wchar_t* m_heap_buffer;
824  size_t m_heap_buffer_capacity;
825 };
826 
827 ON_DECL
828 ON__UINT32 ON_UnicodeMapCodePointOrdinal(
829  ON_StringMapOrdinalType map_type,
830  ON__UINT32 unicode_code_point
831  );
832 
833 ON_DECL
834 ON__UINT32 ON_UnicodeMapCodePoint(
835  const ON_Locale& locale,
836  ON_StringMapType map_type,
837  ON__UINT32 unicode_code_point
838  );
839 
840 /*
841 Parameters:
842  sUTF8 - [in]
843  pointer to a UTF-8 encoded string.
844  element_count - [in]
845  number of char elements to parse.
846  if element_count < 0, then sUTF8 must be null terminated
847  mapping - [in]
848  mapping to apply to unicode code points
849 Returns:
850  A SHA-1 value of the sequence of unicode code points. This value is independent
851  of platform endian or UTF encoding.
852 */
853 const ON_SHA1_Hash ON_StringContentHash(
854  const char* sUTF8,
855  int element_count,
856  ON_StringMapOrdinalType mapping
857 );
858 
859 /*
860 Parameters:
861  sUTF8 - [in]
862  pointer to a UTF-8 encoded string.
863  element_count - [in]
864  number of char elements to parse.
865  if element_count < 0, then sUTF8 must be null terminated
866  mapping - [in]
867  mapping to apply to unicode code points
868 Returns:
869  A SHA-1 value of the sequence of unicode code points. This value is independent
870  of platform endian or UTF encoding.
871 */
872 const ON_SHA1_Hash ON_StringContentHash(
873  const wchar_t* sWideString,
874  int element_count,
875  ON_StringMapOrdinalType mapping
876 );
877 
878 class ON_CLASS ON_String
879 {
880 public:
881 
882 // Constructors
883  ON_String() ON_NOEXCEPT;
884  ON_String( const ON_String& );
885 
886  // ON_String::EmptyString has length 0.
887  // const char* s = ON_String::EmptyString sets s to "".
888  static const ON_String EmptyString;
889 
890  static const char Backspace; // Unicode BACKSPACE control U+0008
891  static const char Tab; // Unicode CHARACTER TABULATION control U+0009
892  static const char LineFeed; // Unicode LINE FEED control U+000A
893  static const char VerticalTab; // Unicode LINE TABULATION control U+000B
894  static const char FormFeed; // Unicode FORM FEED control U+000C
895  static const char CarriageReturn; // Unicode CHARACTER TABULATION control U+000D
896  static const char Escape; // Unicode CARRIAGE RETURN control U+001B
897  static const char Space; // Unicode SPACE U+0020
898  static const char Slash; // Unicode SOLIDUS U+002F
899  static const char Backslash; // Unicode REVERSE SOLIDUS U+005C
900  static const char Pipe; // Unicode VERTICAL LINE U+007C
901 
902 private:
903  // Use IsEmpty() or IsNotEmpty() when you want a bool
904  // to test for the empty string.
905  explicit operator bool() const { return IsNotEmpty(); }
906 public:
907 
908 #if defined(ON_HAS_RVALUEREF)
909  // Clone constructor
910  ON_String( ON_String&& ) ON_NOEXCEPT;
911 
912  // Clone Assignment operator
913  ON_String& operator=( ON_String&& ) ON_NOEXCEPT;
914 #endif
915 
916  ON_String( const char* );
917  ON_String( const char*, int /*length*/ ); // from substring
918  ON_String( char, int = 1 /* repeat count */ );
919 
920  ON_String( const unsigned char* );
921  ON_String( const unsigned char*, int /*length*/ ); // from substring
922  ON_String( unsigned char, int = 1 /* repeat count */ );
923 
924  // construct a UTF-8 string string from a UTF-16 string.
925  ON_String( const wchar_t* src ); // src = UTF-16 string
926  ON_String( const wchar_t* src, int length ); // from a UTF-16 substring
927  ON_String( const ON_wString& src ); // src = UTF-16 string
928 
929 #if defined(ON_RUNTIME_WIN)
930  // Windows support
931  bool LoadResourceString( HINSTANCE, UINT); // load from Windows string resource
932  // 2047 chars max
933 #endif
934 
935  void Create();
936  void Destroy(); // releases any memory and initializes to default empty string
937  void EmergencyDestroy();
938 
939  /*
940  Description:
941  Enables reference counting. I limited cases, this is useful
942  for large strings or strings that are frequently passed around.
943  Reference counted strings must be carefully managed in
944  when multi-threading is used.
945  Parameters:
946  If EnableReferenceCounting()
947  is not called, then the string will not be referanceThe default is to not use
948  reference counted strings.
949  */
950  void EnableReferenceCounting( bool bEnable );
951 
952  /*
953  Returns:
954  True if the string is reference counted.
955  */
956  bool IsReferenceCounted() const;
957 
958 
959  // Attributes & Operations
960 
961  /*
962  Returns:
963  number of nonzero elements in string.
964  */
965  int Length() const;
966 
967  /*
968  Returns:
969  number of nonzero elements in the string.
970  */
971  unsigned int UnsignedLength() const;
972 
973  /*
974  Returns:
975  number of nonzero elements in string before the first null terminator.
976  If string is nullptr, 0 is returned.
977  */
978  static int Length(
979  const char* string
980  );
981 
982  /*
983  Returns:
984  number of nonzero elements in string before the first null terminator.
985  If string is nullptr, 0 is returned.
986  */
987  static unsigned int UnsignedLength(
988  const char* string
989  );
990 
991  bool IsEmpty() const; // returns true if length == 0
992  bool IsNotEmpty() const; // returns true if length > 0
993  void Empty(); // sets length to zero - if possible, memory is retained
994 
995  char& operator[](int);
996  char operator[](int) const;
997  char GetAt(int) const;
998  void SetAt(int, char);
999  void SetAt(int, unsigned char);
1000 
1001  operator const char*() const;
1002 
1003  // overloaded assignment
1004  ON_String& operator=(const ON_String&);
1005  ON_String& operator=(char);
1006  ON_String& operator=(const char*);
1007  ON_String& operator=(unsigned char);
1008  ON_String& operator=(const unsigned char*);
1009  ON_String& operator=(const wchar_t* src); // src = Wide char string, result is a UTF-8 string
1010  ON_String& operator=(const ON_wString& src); // src = Wide char string, result is a UTF-8 string
1011 
1012  // operator+()
1013  ON_String operator+(const ON_String&) const;
1014  ON_String operator+(char) const;
1015  ON_String operator+(unsigned char) const;
1016  ON_String operator+(const char*) const;
1017  ON_String operator+(const unsigned char*) const;
1018 
1019  // string concatenation
1020  void Append( const char*, int ); // append specified number of characters
1021  void Append( const unsigned char*, int ); // append specified number of characters
1022  const ON_String& operator+=(const ON_String&);
1023  const ON_String& operator+=(char);
1024  const ON_String& operator+=(unsigned char);
1025  const ON_String& operator+=(const char*);
1026  const ON_String& operator+=(const unsigned char*);
1027 
1028  ON_DEPRECATED_MSG("Use CompareOrdinal(), ComparePath(), CompareAttributeName(), or a test that is linguistically apprropriate")
1029  int Compare( const char* ) const;
1030 
1031  ON_DEPRECATED_MSG("Use CompareOrdinal(), ComparePath(), CompareAttributeName(), or a test that is linguistically apprropriate")
1032  int Compare( const unsigned char* ) const;
1033 
1034  ON_DEPRECATED_MSG("Use CompareOrdinal(), ComparePath(), CompareAttributeName(), or a test that is linguistically apprropriate")
1035  int CompareNoCase( const char* ) const;
1036 
1037  ON_DEPRECATED_MSG("Use CompareOrdinal(), ComparePath(), CompareAttributeName(), or a test that is linguistically apprropriate")
1038  int CompareNoCase( const unsigned char* ) const;
1039 
1040  bool Equal(
1041  const ON_String& other_string,
1042  const class ON_Locale& locale,
1043  bool bIgnoreCase
1044  ) const;
1045 
1046  bool Equal(
1047  const char* other_string,
1048  const class ON_Locale& locale,
1049  bool bIgnoreCase
1050  ) const;
1051 
1052  static bool Equal(
1053  const char* string1,
1054  const char* string2,
1055  const class ON_Locale& locale,
1056  bool bIgnoreCase
1057  );
1058 
1059  static bool Equal(
1060  const char* string1,
1061  int element_count1,
1062  const char* string2,
1063  int element_count2,
1064  const class ON_Locale& locale,
1065  bool bOrdinalIgnoreCase
1066  );
1067 
1068  /*
1069  Description:
1070  Compare this string and other_string by normalizing (NFC)
1071  and using invariant culture ordering.
1072  Parameters:
1073  other_string - [in]
1074  bIgnoreCase - [in]
1075  Remarks:
1076  1) Ordinal compares are the fastest.
1077  2) Equal(...) is faster than Compare(...)
1078  */
1079  int Compare(
1080  const ON_String& other_string,
1081  const class ON_Locale& locale,
1082  bool bIgnoreCase
1083  ) const;
1084 
1085  int Compare(
1086  const char* other_string,
1087  const class ON_Locale& locale,
1088  bool bIgnoreCase
1089  ) const;
1090 
1091  /*
1092  Description:
1093  Compare string1 and string2 by normalizing (NFC) and using invariant culture ordering.
1094  Parameters:
1095  string1 - [in]
1096  string2 - [in]
1097  bIgnoreCase - [in]
1098  Remarks:
1099  1) Ordinal compares are the fastest.
1100  2) Equal(...) is faster than Compare(...)
1101  */
1102  static int Compare(
1103  const char* string1,
1104  const char* string2,
1105  const class ON_Locale& locale,
1106  bool bIgnoreCase
1107  );
1108 
1109  /*
1110  Description:
1111  Compare string1 and string2 by normalizing (NFC) and using invariant culture ordering.
1112  Parameters:
1113  string1 - [in]
1114  element_count1 - [in]
1115  The number of string1[] elements to compare.
1116  If element_count1 < 0, then string1 must be null terminated.
1117  string2 - [in]
1118  element_count2 - [in]
1119  The number of string2[] elements to compare.
1120  If element_count2 < 0, then string2 must be null terminated.
1121  locale - [in]
1122  Typically ON_Locale::Ordinal, ON_Locale::InvariantCulture, or
1123  ON_Locale::CurrentCulture.
1124  bIgnoreCase - [in]
1125  Remarks:
1126  1) Ordinal compares are the fastest.
1127  2) Equal(...) is faster than Compare(...)
1128  */
1129  static int Compare(
1130  const char* string1,
1131  int element_count1,
1132  const char* string2,
1133  int element_count2,
1134  const class ON_Locale& locale,
1135  bool bIgnoreCase
1136  );
1137 
1138  bool EqualOrdinal(
1139  const ON_String& other_string,
1140  bool bOrdinalIgnoreCase
1141  ) const;
1142 
1143  bool EqualOrdinal(
1144  const char* other_string,
1145  bool bOrdinalIgnoreCase
1146  ) const;
1147 
1148  static bool EqualOrdinal(
1149  const char* string1,
1150  const char* string2,
1151  bool bOrdinalIgnoreCase
1152  );
1153 
1154  static bool EqualOrdinal(
1155  const char* string1,
1156  int element_count1,
1157  const char* string2,
1158  int element_count2,
1159  bool bOrdinalIgnoreCase
1160  );
1161 
1162  /*
1163  Description:
1164  Compare this string and other_string unsigned byte by unsigned byte.
1165  Parameters:
1166  other_string - [in]
1167  bIgnoreCase - [in]
1168  Remarks:
1169  1) If the string is UTF-8 encoded and bOrdinalIgnoreCase is true, only
1170  small latin a - z and capital latin A - Z are considered equal. It is
1171  imposible to ignore case for any other values in an ordinal compare.
1172 
1173  2) If you are comparing file system paths, you should use ComparePath().
1174 
1175  3) If locale, linguistic issues, UTF-8 encoding issues or unicode normalization
1176  or collation issues need to be considered, then CompareOrdinal() is
1177  the wrong function to use.
1178  */
1179  int CompareOrdinal(
1180  const ON_String& other_string,
1181  bool bIgnoreCase
1182  ) const;
1183 
1184  int CompareOrdinal(
1185  const char* other_string,
1186  bool bIgnoreCase
1187  ) const;
1188 
1189  /*
1190  Description:
1191  Compare string1 and string2 unsigned byte by unsigned byte.
1192  Parameters:
1193  string1 - [in]
1194  string2 - [in]
1195  bIgnoreCase - [in]
1196  Remarks:
1197  1) If the string is UTF-8 encoded and bOrdinalIgnoreCase is true, only
1198  small latin a - z and capital latin A - Z are considered equal. It is
1199  imposible to ignore case for any other values in a UTF-8 ordinal compare.
1200 
1201  2) If you are comparing file system paths, you should use ComparePath().
1202 
1203  3) If locale, linguistic issues, UTF-8 encoding issues or unicode normalization
1204  or collation issues need to be considered, then CompareOrdinal() is
1205  the wrong function to use.
1206  */
1207  static int CompareOrdinal(
1208  const char* string1,
1209  const char* string2,
1210  bool bIgnoreCase
1211  );
1212 
1213  /*
1214  Description:
1215  Compare string1 and string2 unsigned byte by unsigned byte.
1216  Parameters:
1217  string1 - [in]
1218  element_count1 - [in]
1219  The number of elements in string1[] to compare.
1220  If element_count1 < 1, string1 must be null terminated and every element
1221  before the null terminator will be compared.
1222  string2 - [in]
1223  element_count2 - [in]
1224  The number of elements in string2[] to compare.
1225  If element_count2 < 1, string2 must be null terminated and every element
1226  before the null terminator will be compared.
1227  bOrdinalIgnoreCase - [in]
1228  If true, elements with values a-z are compared as if they had values A-Z.
1229  Remarks:
1230  1) If the string is UTF-8 encoded and bOrdinalIgnoreCase is true, only
1231  small latin a - z and capital latin A - Z are considered equal. It is
1232  imposible to ignore case for any other values in a UTF-8 ordinal compare.
1233 
1234  2) If you are comparing file system paths, you should use ComparePath().
1235 
1236  3) If locale, linguistic issues, UTF-8 encoding issues or unicode normalization
1237  or collation issues need to be considered, then CompareOrdinal() is
1238  the wrong function to use.
1239  */
1240  static int CompareOrdinal(
1241  const char* string1,
1242  int element_count1,
1243  const char* string2,
1244  int element_count2,
1245  bool bOrdinalIgnoreCase
1246  );
1247 
1248  /*
1249  Description:
1250  Compare this string and other_path as file system paths using
1251  appropriate tests for the current operating system.
1252  Parameters:
1253  other_path - [in]
1254  Remarks:
1255  1) Windows and UNIX directory separators (/ and \) are considered equal.
1256 
1257  2) Case is ignored when the file system is not case sensitive, like Windows.
1258 
1259  3) String normalization appropriate for the current operating system
1260  is performed.
1261  */
1262  int ComparePath(
1263  const char* other_path
1264  ) const;
1265 
1266  bool EqualPath(
1267  const char* other_path
1268  ) const;
1269 
1270  /*
1271  Description:
1272  Compare sPath1 and sPath2 as file system paths using
1273  appropriate tests for the current operating system.
1274  Parameters:
1275  path1 - [in]
1276  null terminated string
1277  path2 - [in]
1278  null terminated string
1279  Remarks:
1280  1) Windows and UNIX directory separators (/ and \) are considered equal.
1281 
1282  2) Case is ignored when the file system is not case sensitive, like Windows.
1283 
1284  3) String normalization appropriate for the current operating system
1285  is performed.
1286  */
1287  static int ComparePath(
1288  const char* path1,
1289  const char* path2
1290  );
1291 
1292  static bool EqualPath(
1293  const char* path1,
1294  const char* path2
1295  );
1296 
1297  /*
1298  Description:
1299  Compare sPath1 and sPath2 as file system paths using
1300  appropriate tests for the current operating system.
1301  Parameters:
1302  path1 - [in]
1303  maximum_element_count1 - [in]
1304  path2 - [in]
1305  maximum_element_count2 - [in]
1306  Remarks:
1307  1) Windows and UNIX directory separators (/ and \) are considered equal.
1308 
1309  2) Case is ignored when the file system is not case sensitive, like Windows.
1310 
1311  3) String normalization appropriate for the current operating system
1312  is performed.
1313  */
1314  static int ComparePath(
1315  const char* path1,
1316  int element_count1,
1317  const char* path2,
1318  int element_count2
1319  );
1320 
1321  static bool EqualPath(
1322  const char* path1,
1323  int element_count1,
1324  const char* path2,
1325  int element_count2
1326  );
1327 
1328  /*
1329  Description:
1330  Compare this string and other_name as a name attribute of an object
1331  like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on.
1332  These comparisons ignore case and use appropriate string normalization.
1333  Parameters:
1334  other_name - [in]
1335  null terminated string
1336  */
1337  int CompareAttributeName(
1338  const char* other_name
1339  ) const;
1340  bool EqualAttributeName(
1341  const char* other_name
1342  ) const;
1343 
1344  /*
1345  Description:
1346  Compare this string and other_name as a name attribute of an object
1347  like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on.
1348  These comparisons ignore case and use appropriate string normalization.
1349  Parameters:
1350  name1 - [in]
1351  null terminated string
1352  name2 - [in]
1353  null terminated string
1354  */
1355  static int CompareAttributeName(
1356  const char* name1,
1357  const char* name2
1358  );
1359  static bool EqualAttributeName(
1360  const char* name1,
1361  const char* name2
1362  );
1363 
1364  // Description:
1365  // Simple case sensitive wildcard matching. A question mark (?) in the
1366  // pattern matches a single character. An asterisk (*) in the pattern
1367  // mathes zero or more occurances of any character.
1368  //
1369  // Parameters:
1370  // pattern - [in] pattern string where ? and * are wild cards.
1371  //
1372  // Returns:
1373  // true if the string mathes the wild card pattern.
1374  bool WildCardMatch( const char* ) const;
1375  bool WildCardMatch( const unsigned char* ) const;
1376 
1377  // Description:
1378  // Simple case insensitive wildcard matching. A question mark (?) in the
1379  // pattern matches a single character. An asterisk (*) in the pattern
1380  // mathes zero or more occurances of any character.
1381  //
1382  // Parameters:
1383  // pattern - [in] pattern string where ? and * are wild cards.
1384  //
1385  // Returns:
1386  // true if the string mathes the wild card pattern.
1387  bool WildCardMatchNoCase( const char* ) const;
1388  bool WildCardMatchNoCase( const unsigned char* ) const;
1389 
1390  /*
1391  Description:
1392  Replace all substrings that match token1 with token2
1393  Parameters:
1394  token1 - [in]
1395  token2 - [in]
1396  Returns:
1397  Number of times token1 was replaced with token2.
1398  */
1399  int Replace( const char* token1, const char* token2 );
1400  int Replace( const unsigned char* token1, const unsigned char* token2 );
1401  int Replace(char utf8_single_byte_c1, char utf8_single_byte_c2);
1402  int Replace(unsigned char utf8_single_byte_c1, unsigned char utf8_single_byte_c2);
1403 
1404 
1405  // simple sub-string extraction
1406  ON_String Mid(
1407  int, // index of first char
1408  int // count
1409  ) const;
1410  ON_String Mid(
1411  int // index of first char
1412  ) const;
1413  ON_String Left(
1414  int // number of chars to keep
1415  ) const;
1416  ON_String Right(
1417  int // number of chars to keep
1418  ) const;
1419 
1420  /*
1421  Description:
1422  Map a single byte UTF-8 element to upper or lower case.
1423  Parameters:
1424  c - [in]
1425  If c is in the range A to Z or a to z, the map specified
1426  by map_type is applied. All other values of c are
1427  unchanged.
1428  Remarks:
1429  MapCharacterOrdinal is not appropriate for general string mapping.
1430  */
1431  static char MapCharacterOrdinal(
1432  ON_StringMapOrdinalType map_type,
1433  char c
1434  );
1435 
1436  ON_String MapStringOrdinal(
1437  ON_StringMapOrdinalType map_type
1438  ) const;
1439 
1440 
1441  /*
1442  Description:
1443  Map a wchar_t string.
1444  Parameters:
1445  map_type - [in]
1446  string - [in]
1447  element_count - [in]
1448  number of string[] elements to map.
1449  If element_count < 0, then ON_wString::Length(string) elements are mapped.
1450  mapped_string - [out]
1451  mapped_string_capacity - [in]
1452  number of available elements in mapped_string[].
1453  map_type - [in]
1454  Returns:
1455  Number of mapped_string[] elements that were mapped from string[].
1456 
1457  When the number of string[] input elements is >= mapped_string_capacity,
1458  mapped_string_capacity mapped_string[] elements are set and
1459  mapped_string_capacity is returned.
1460 
1461  When the return value is < mapped_string_capacity, a null terminator
1462  is appended after the last mapped element.
1463  */
1464  static int MapStringOrdinal(
1465  ON_StringMapOrdinalType map_type,
1466  const char* string,
1467  int element_count,
1468  char* mapped_string,
1469  int mapped_string_capacity
1470  );
1471 
1472  ON_String MapString(
1473  const class ON_Locale& locale,
1474  ON_StringMapType map_type
1475  ) const;
1476 
1477  static ON_String MapString(
1478  const class ON_Locale& locale,
1479  ON_StringMapType map_type,
1480  const char* string,
1481  int element_count
1482  );
1483 
1484  /*
1485  Description:
1486  Maps element_count elements of string[] to mapped_string[].
1487 
1488  Parameters:
1489  locale - [in]
1490  Locale to use when converting case. It is common to pass one of
1491  the preset locales ON_Locale::Ordinal, ON_Locale::InvariantCulture,
1492  or ON_Locale::m_CurrentCulture.
1493 
1494  map_type - [in]
1495  selects the mapping
1496 
1497  string - [in]
1498  input string to map.
1499 
1500  element_count - [in]
1501  The number of char elements to map from input string[].
1502 
1503  If element_count < 1, then string[] must be null terminated and
1504  ON_wString::Length(string)+1 elements are mapped.
1505  The +1 insures the output is null terminated.
1506 
1507  mapped_string - [out]
1508  The result of the mapping is returned in mapped_string[].
1509 
1510  mapped_string_capacity - [in]
1511  Number of char elements available in mapped_string[]
1512  or 0 to calculate the minimum number of elements needed
1513  for the mapping.
1514 
1515  Returns:
1516  If mapped_string_capacity > 0, then the number elements set in mapped_string[]
1517  is returned.
1518 
1519  If mapped_string_capacity == 0, then the number elements required to perform
1520  the mapping is returned.
1521 
1522  When there is room, mapped_string[] is null terminated.
1523 
1524  0: Failure.
1525  */
1526  static int MapString(
1527  const class ON_Locale& locale,
1528  ON_StringMapType map_type,
1529  const char* string,
1530  int element_count,
1531  char* mapped_string,
1532  int mapped_string_capacity
1533  );
1534 
1535  // upper/lower/reverse conversion
1536  /*ON_DEPRECATED */ void MakeUpper();
1537  /*ON_DEPRECATED */void MakeLower();
1538  void MakeUpperOrdinal();
1539  void MakeLowerOrdinal();
1540 
1541  const ON_SHA1_Hash ContentHash(
1542  ON_StringMapOrdinalType mapping
1543  ) const;
1544 
1545  ON_String Reverse() const;
1546 
1547  static char* Reverse(
1548  char* string,
1549  int element_count
1550  );
1551 
1552  void MakeReverse();
1553 
1554  void TrimLeft(const char* = nullptr);
1555  void TrimRight(const char* = nullptr);
1556  void TrimLeftAndRight(const char* = nullptr);
1557 
1558  // remove occurrences of chRemove
1559  int Remove(const char utf8_single_byte_c);
1560 
1561  // searching (return starting index, or -1 if not found)
1562  // look for a single character match
1563  int Find(
1564  char utf8_single_byte_c
1565  ) const;
1566  int Find(
1567  unsigned char utf8_single_byte_c
1568  ) const;
1569  int ReverseFind(
1570  char utf8_single_byte_c
1571  ) const;
1572  int ReverseFind(
1573  unsigned char utf8_single_byte_c
1574  ) const;
1575 
1576  // look for a specific sub-string
1577  int Find(
1578  const char*
1579  ) const;
1580  int Find(
1581  const unsigned char*
1582  ) const;
1583  int Find(
1584  const char*,
1585  int start_index
1586  ) const;
1587  int Find(
1588  const unsigned char*,
1589  int start_index
1590  ) const;
1591  int ReverseFind(
1592  const char*
1593  ) const;
1594  int ReverseFind(
1595  const unsigned char*
1596  ) const;
1597 
1598  // It is common to format single numbers into strings
1599  // and the FromNumber and FromDouble functions are
1600  // the fastest way to do this and provide consistent results.
1601  // They return a pointer to their buffer so the can be used
1602  // as function parameters.
1603  static const ON_String FromNumber(
1604  char n
1605  );
1606  static const ON_String FromNumber(
1607  unsigned char n
1608  );
1609  static const ON_String FromNumber(
1610  short n
1611  );
1612  static const ON_String FromNumber(
1613  unsigned short n
1614  );
1615  static const ON_String FromNumber(
1616  int n
1617  );
1618  static const ON_String FromNumber(
1619  unsigned int n
1620  );
1621  static const ON_String FromNumber(
1622  ON__INT64 n
1623  );
1624  static const ON_String FromNumber(
1625  ON__UINT64 n
1626  );
1627  static const ON_String FromNumber(
1628  double d // "%g" format
1629  );
1630  static const ON_String ApproximateFromNumber(
1631  double d // "%f" when possible, otherwise "%g"
1632  );
1633  static const ON_String PreciseFromNumber(
1634  double d // "%.17g"
1635  );
1636 
1637 
1638  /*
1639  Description:
1640  Each byte value is converted to 2 hexadecimal digits.
1641  Parameters:
1642  bytes - [in]
1643  list of byte values
1644  byte_count - [in]
1645  Number of byte values in bytes[] array.
1646  bCapitalDigits - [in]
1647  false: Use 0-9, a - b
1648  true: Use 0-9, A - F
1649  bReverse - [in]
1650  false:
1651  The digist in the string will be in the order
1652  bytes[0], bytes[1], ..., bytes[byte_count-1].
1653  true:
1654  The digist in the string will be in the order
1655  bytes[byte_count-1], ..., bytes[1], bytes[0].
1656  */
1657  static const ON_String HexadecimalFromBytes(
1658  const ON__UINT8* bytes,
1659  size_t byte_count,
1660  bool bCapitalDigits,
1661  bool bReverse
1662  );
1663 
1664  /*
1665  Parameters:
1666  format - [in]
1667  Format control.
1668  Positional paramters of the form %N$x where N >= 1 and x
1669  is the standard format specification are supported.
1670  Avoid using %S (capital S). See the Remarks for details.
1671  ... - [in]
1672  arguments for replacable items in the format string.
1673  Returns:
1674  True if successful.
1675  False if the string is too long or the format string is not valid.
1676  Remarks:
1677  When using Microsoft's compiler and other compilers that provide similar
1678  locale support, the locale is the invariant culture locale returned by
1679  ON_Locale::InvariantCulture::LocalePtr().
1680 
1681  The way Windows handles the %S (capital S) format parameter depends on locale
1682  and code page settings. It is strongly reccommended that you never use %S to
1683  include any string that may possibly contain elements with values > 127.
1684  The following examples illustrate a way to predictably use UTF-8 and wchar_t
1685  parameters in buffers of the other element type.
1686 
1687  const char* utf8_string = ...;
1688  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",utf8_string);
1689  // The code below will treat utf8_string as a UTF-8 encoded string.
1690  wchar_t wchar_buffer[...];
1691  const size_t wchar_buffer_capacity= sizeof(buffer)/sizeof(buffer[0]);
1692  ON_wString::Format(wchar_buffer, wchar_buffer_capacity, "%s", ON_wString(utf8_string));
1693 
1694  const wchar_t* wide_string = ...;
1695  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",char_string);
1696  // The code below will include wide_string as a UTF-8 encoded string.
1697  char char_buffer[...];
1698  const size_t char_buffer_capacity = sizeof(buffer)/sizeof(buffer[0]);
1699  ON_String::Format(char_buffer, char_buffer_capacity, "%s", ON_String(wide_string));
1700  */
1701  bool ON_VARGS_FUNC_CDECL Format(
1702  const char* format,
1703  ...
1704  );
1705 
1706  bool ON_VARGS_FUNC_CDECL Format(
1707  const unsigned char* format,
1708  ...
1709  );
1710 
1711  static const ON_wString ON_VARGS_FUNC_CDECL FormatToString(
1712  const char* format,
1713  ...
1714  );
1715 
1716  bool FormatVargs(
1717  const char* format,
1718  va_list args
1719  );
1720 
1721  bool FormatVargs(
1722  const unsigned char* format,
1723  va_list args
1724  );
1725 
1726  /*
1727  Description:
1728  A platform independent, secure, culture invariant way to format a char string.
1729  This function is provide to be used when it is critical that
1730  the formatting be platform independent, secure and culture invarient.
1731  Parameters:
1732  buffer - [out]
1733  not null
1734  buffer_capacity - [in]
1735  > 0
1736  Number of char elements in buffer.
1737  sFormat - [in]
1738  Avoid using %S (capital S). See the Remarks for details.
1739  ... - [in]
1740  Returns:
1741  >= 0:
1742  The number of char elements written to buffer[], not including the null terminator.
1743  A null terminator is always added (buffer[returned value] = 0).
1744  The last element of buffer[] is always set to zero (buffer[buffer_capacity-1] = 0).
1745  < 0: failure:
1746  If buffer is not null and buffer_capacity > 0, then buffer[0] = 0 and buffer[buffer_capacity-1] = 0;
1747  Remarks:
1748  The way Windows handles the %S (capital S) format parameter depends on locale
1749  and code page settings. It is strongly reccommended that you never use %S to
1750  include any string that may possibly contain elements with values > 127.
1751  The following examples illustrate a way to predictably use UTF-8 and wchar_t
1752  parameters in buffers of the other element type.
1753 
1754  const char* utf8_string = ...;
1755  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",utf8_string);
1756  wchar_t wchar_buffer[...];
1757  const size_t wchar_buffer_capacity= sizeof(buffer)/sizeof(buffer[0]);
1758  ON_wString::Format(wchar_buffer, wchar_buffer_capacity, "%s", ON_wString(utf8_string));
1759 
1760  const wchar_t* wide_string = ...;
1761  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",char_string);
1762  char char_buffer[...];
1763  const size_t char_buffer_capacity = sizeof(buffer)/sizeof(buffer[0]);
1764  ON_String::Format(char_buffer, char_buffer_capacity, "%s", ON_String(wide_string));
1765  */
1766  static int ON_VARGS_FUNC_CDECL FormatIntoBuffer(
1767  char* buffer,
1768  size_t buffer_capacity,
1769  const char* format,
1770  ...
1771  );
1772 
1773  static int ON_VARGS_FUNC_CDECL FormatIntoBuffer(
1774  ON_StringBuffer& buffer,
1775  const char* format,
1776  ...
1777  );
1778 
1779  static int FormatVargsIntoBuffer(
1780  char* buffer,
1781  size_t buffer_capacity,
1782  const char* format,
1783  va_list args
1784  );
1785 
1786  static int FormatVargsIntoBuffer(
1787  ON_StringBuffer& buffer,
1788  const char* format,
1789  va_list args
1790  );
1791 
1792  /*
1793  Returns:
1794  >= 0:
1795  Number of char elements in the formatted string, not including the null terminator.
1796  < 0:
1797  Invalid input
1798  */
1799  static int FormatVargsOutputCount(
1800  const char* format,
1801  va_list args
1802  );
1803 
1804  /*
1805  Parameters:
1806  format - [in]
1807  null terminated string to scan
1808  ... - [out]
1809  pointers to elements to assign.
1810  Returns:
1811  >= 0: number of fields successfully converted and assigned.
1812  <0: failure
1813  */
1814  int ON_VARGS_FUNC_CDECL Scan(
1815  const char* format,
1816  ...
1817  );
1818 
1819  int ON_VARGS_FUNC_CDECL Scan(
1820  const unsigned char* format,
1821  ...
1822  );
1823 
1824  static int ON_VARGS_FUNC_CDECL ScanBuffer(
1825  const char* buffer,
1826  const char* format,
1827  ...
1828  );
1829 
1830  static int ON_VARGS_FUNC_CDECL ScanBuffer(
1831  const unsigned char* buffer,
1832  const unsigned char* format,
1833  ...
1834  );
1835 
1836  static int ScanBufferVargs(
1837  const char* buffer,
1838  const char* format,
1839  va_list args
1840  );
1841 
1842  static int ScanBufferVargs(
1843  const unsigned char* buffer,
1844  const unsigned char* format,
1845  va_list args
1846  );
1847 
1848 
1849  /*
1850  Parameters:
1851  buffer - [in]
1852  decimal number
1853  Returns:
1854  not zero:
1855  pointer to the first character that was not scanned
1856  nullptr:
1857  failure
1858  */
1859  static const char* ToNumber(
1860  const char* buffer,
1861  char value_on_failure,
1862  char* value
1863  );
1864  static const char* ToNumber(
1865  const char* buffer,
1866  unsigned char value_on_failure,
1867  unsigned char* value
1868  );
1869  static const char* ToNumber(
1870  const char* buffer,
1871  short value_on_failure,
1872  short* value
1873  );
1874  static const char* ToNumber(
1875  const char* buffer,
1876  unsigned short value_on_failure,
1877  unsigned short* value
1878  );
1879  static const char* ToNumber(
1880  const char* buffer,
1881  int value_on_failure,
1882  int* value
1883  );
1884  static const char* ToNumber(
1885  const char* buffer,
1886  unsigned int value_on_failure,
1887  unsigned int* value
1888  );
1889  static const char* ToNumber(
1890  const char* buffer,
1891  ON__INT64 value_on_failure,
1892  ON__INT64* value
1893  );
1894  static const char* ToNumber(
1895  const char* buffer,
1896  ON__UINT64 value_on_failure,
1897  ON__UINT64* value
1898  );
1899  static const char* ToNumber(
1900  const char* buffer,
1901  double value_on_failure,
1902  double* value
1903  );
1904 
1905 
1906  // Low level access to string contents as character array
1907  char* ReserveArray(size_t); // make sure internal array has at least
1908  // the requested capacity.
1909  void ShrinkArray(); // shrink internal storage to minimum size
1910  char* SetLength(size_t); // set length (<=capacity)
1911  char* Array();
1912  const char* Array() const;
1913 
1914  /*
1915  Returns:
1916  Total number of bytes of memory used by this class.
1917  (For use in ON_Object::SizeOf() overrides.
1918  */
1919  unsigned int SizeOf() const;
1920 
1921  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
1922 
1923  /*
1924  OBSOLETE - use ON_FileSystemPath::SplitPath
1925  */
1926  static void SplitPath(
1927  const char* path,
1928  ON_String* drive,
1929  ON_String* dir,
1930  ON_String* fname,
1931  ON_String* ext
1932  );
1933 
1934 public:
1935  ~ON_String();
1936 
1937 protected:
1938  // Implementation
1939  char* m_s; // pointer to ref counted string array
1940  // m_s - 12 bytes points at the string's ON_aStringHeader
1941 
1942  // implementation helpers
1943  struct ON_aStringHeader* Header() const;
1944  char* CreateArray(int);
1945  void CopyArray();
1946  void CopyToArray( const ON_String& );
1947  void CopyToArray( int, const char* );
1948  void CopyToArray( int, const unsigned char* );
1949  void CopyToArray( int, const wchar_t* );
1950  void AppendToArray( const ON_String& );
1951  void AppendToArray( int, const char* );
1952  void AppendToArray( int, const unsigned char* );
1953 };
1954 
1955 /*
1956 Returns:
1957  True if lhs and rhs are identical as arrays of char elements.
1958 */
1959 ON_DECL
1960 bool operator==( const ON_String& lhs, const ON_String& rhs );
1961 
1962 /*
1963 Returns:
1964  True if lhs and rhs are not identical as arrays of char elements.
1965 */
1966 ON_DECL
1967 bool operator!=(const ON_String& lhs, const ON_String& rhs);
1968 
1969 /*
1970 Returns:
1971  True if lhs is less than rhs as an array of unsigned bytes.
1972 */
1973 ON_DECL
1974 bool operator<(const ON_String& lhs, const ON_String& rhs);
1975 
1976 /*
1977 Returns:
1978  True if lhs is greater than rhs as an array of unsigned bytes.
1979 */
1980 ON_DECL
1981 bool operator>(const ON_String& lhs, const ON_String& rhs);
1982 
1983 /*
1984 Returns:
1985  True if lhs is less than or equal to rhs as an array of unsigned bytes.
1986 */
1987 ON_DECL
1988 bool operator<=(const ON_String& lhs, const ON_String& rhs);
1989 
1990 /*
1991 Returns:
1992  True if lhs is greater than or equal to rhs as an array of unsigned bytes.
1993 */
1994 ON_DECL
1995 bool operator>=(const ON_String& lhs, const ON_String& rhs);
1996 
1997 /*
1998 Returns:
1999  True if lhs and rhs are identical as arrays of char elements.
2000 */
2001 ON_DECL
2002 bool operator==( const ON_String& lhs, const char* rhs );
2003 
2004 /*
2005 Returns:
2006  True if lhs and rhs are not identical as arrays of char elements.
2007 */
2008 ON_DECL
2009 bool operator!=(const ON_String& lhs, const char* rhs);
2010 
2011 /*
2012 Returns:
2013  True if lhs is less than rhs as an array of unsigned bytes.
2014 */
2015 ON_DECL
2016 bool operator<(const ON_String& lhs, const char* rhs);
2017 
2018 /*
2019 Returns:
2020  True if lhs is greater than rhs as an array of unsigned bytes.
2021 */
2022 ON_DECL
2023 bool operator>(const ON_String& lhs, const char* rhs);
2024 
2025 /*
2026 Returns:
2027  True if lhs is less than or equal to rhs as an array of unsigned bytes.
2028 */
2029 ON_DECL
2030 bool operator<=(const ON_String& lhs, const char* rhs);
2031 
2032 /*
2033 Returns:
2034  True if lhs is greater than or equal to rhs as an array of unsigned bytes.
2035 */
2036 ON_DECL
2037 bool operator>=(const ON_String& lhs, const char* rhs);
2038 
2039 /*
2040 Returns:
2041  True if lhs and rhs are identical as arrays of char elements.
2042 */
2043 ON_DECL
2044 bool operator==( const char* lhs, const ON_String& rhs );
2045 
2046 /*
2047 Returns:
2048  True if lhs and rhs are not identical as arrays of char elements.
2049 */
2050 ON_DECL
2051 bool operator!=(const char* lhs, const ON_String& rhs);
2052 
2053 /*
2054 Returns:
2055  True if lhs is less than rhs as an array of unsigned bytes.
2056 */
2057 ON_DECL
2058 bool operator<(const char* lhs, const ON_String& rhs);
2059 
2060 /*
2061 Returns:
2062  True if lhs is greater than rhs as an array of unsigned bytes.
2063 */
2064 ON_DECL
2065 bool operator>(const char* lhs, const ON_String& rhs);
2066 
2067 /*
2068 Returns:
2069  True if lhs is less than or equal to rhs as an array of unsigned bytes.
2070 */
2071 ON_DECL
2072 bool operator<=(const char* lhs, const ON_String& rhs);
2073 
2074 /*
2075 Returns:
2076  True if lhs is greater than or equal to rhs as an array of unsigned bytes.
2077 */
2078 ON_DECL
2079 bool operator>=(const char* lhs, const ON_String& rhs);
2080 
2081 /////////////////////////////////////////////////////////////////////////////
2082 /////////////////////////////////////////////////////////////////////////////
2083 /////////////////////////////////////////////////////////////////////////////
2084 /////////////////////////////////////////////////////////////////////////////
2085 //
2086 // ON_wString
2087 //
2088 
2089 class ON_CLASS ON_wString
2090 {
2091 public:
2092 
2093  // ON_String::EmptyString has length 0.
2094  // const char* s = ON_String::EmptyString sets s to L"".
2095  static const ON_wString EmptyString;
2096 
2097  static const wchar_t Backspace; // Unicode BACKSPACE control U+0008
2098  static const wchar_t Tab; // Unicode CHARACTER TABULATION control U+0009
2099  static const wchar_t LineFeed; // Unicode LINE FEED control U+000A
2100  static const wchar_t VerticalTab; // Unicode LINE TABULATION control U+000B
2101  static const wchar_t FormFeed; // Unicode FORM FEED control U+000C
2102  static const wchar_t CarriageReturn; // Unicode CARRIAGE RETURN control U+000D
2103  static const wchar_t Escape; // Unicode CARRIAGE RETURN control U+001B
2104  static const wchar_t Space; // Unicode SPACE U+0020
2105  static const wchar_t Slash; // Unicode SOLIDUS U+002F
2106  static const wchar_t Backslash; // Unicode REVERSE SOLIDUS U+005C
2107  static const wchar_t Pipe; // Unicode VERTICAL LINE U+007C
2108 
2109 #if defined(ON_SIZEOF_WCHAR_T) && ON_SIZEOF_WCHAR_T >= 2
2110  // Never cast these values as "char"
2111  // The UTF-8 representation of any Unicode code point with value > 127
2112  // requires multiple bytes.
2113  static const wchar_t RadiusSymbol; // Unicode LATIN CAPITAL LETTER R U+0052
2114  static const wchar_t DegreeSymbol; // Unicode DEGREE SIGN U+00B0
2115  static const wchar_t PlusMinusSymbol; // Unicode PLUS-MINUS SIGN U+00B1
2116  static const wchar_t DiameterSymbol; // Unicode LATIN CAPITAL LETTER O WITH STROKE U+00D8
2117  static const wchar_t RecyclingSymbol; // Unicode UNIVERSAL RECYCLING SYMBOL U+2672 (decimal 9842)
2118  static const wchar_t ReplacementCharacter; // Unicode REPLACEMENT CHARACTER U+FFFD
2119  static const wchar_t NextLine; // Unicode NEXT LINE (NEL) U+0085
2120  static const wchar_t LineSeparator; // LINE SEPARATOR U+2028 unambiguous line separator
2121  static const wchar_t ParagraphSeparator; // PARAGRAPH SEPARATOR U+2028 unambiguous paragraph separator
2122  static const wchar_t NoBreakSpace; // NO-BREAK SPACE (NBSP)
2123  static const wchar_t NarrowNoBreakSpace; // NARROW NO-BREAK SPACE (NNBSP)
2124  static const wchar_t ZeroWidthSpace; // ZERO WIDTH SPACE (ZWSP)
2125 #endif
2126 
2127 private:
2128  // Use IsEmpty() or IsNotEmpty() when you want a bool
2129  // to test for the empty string.
2130  explicit operator bool() const { return IsNotEmpty(); }
2131 public:
2132 
2133 // Constructors
2134  ON_wString() ON_NOEXCEPT;
2135  ON_wString( const ON_wString& );
2136 
2137 #if defined(ON_HAS_RVALUEREF)
2138  // Clone constructor
2139  ON_wString( ON_wString&& ) ON_NOEXCEPT;
2140 
2141  // Clone Assignment operator
2142  ON_wString& operator=( ON_wString&& ) ON_NOEXCEPT;
2143 #endif
2144 
2145  ON_wString( const ON_String& src ); // src = UTF-8 string
2146 
2147  ON_wString( const char* src ); // src = nul; terminated UTF-8 string
2148  ON_wString( const char* src, int /*length*/ ); // from UTF-8 substring
2149  ON_wString( char, int = 1 /* repeat count */ );
2150 
2151  ON_wString( const unsigned char* src); // src = nul; terminated UTF-8 string
2152  ON_wString( const unsigned char*src, int /*length*/ ); // from UTF-8 substring
2153  ON_wString( unsigned char, int = 1 /* repeat count */ );
2154 
2155  ON_wString( const wchar_t* );
2156  ON_wString( const wchar_t*, int /*length*/ ); // from substring
2157  ON_wString( wchar_t, int = 1 /* repeat count */ );
2158 
2159 #if defined(ON_RUNTIME_WIN)
2160  // Windows support
2161  bool LoadResourceString(HINSTANCE, UINT); // load from string resource
2162  // 2047 characters max
2163 #endif
2164 
2165  void Create();
2166  void Destroy(); // releases any memory and initializes to default empty string
2167  void EmergencyDestroy();
2168 
2169  /*
2170  Description:
2171  Enables reference counting. I limited cases, this is useful
2172  for large strings or strings that are frequently passed around.
2173  Reference counted strings must be carefully managed in
2174  when multi-threading is used.
2175  Parameters:
2176  If EnableReferenceCounting()
2177  is not called, then the string will not be referanceThe default is to not use
2178  reference counted strings.
2179  */
2180  void EnableReferenceCounting( bool bEnable );
2181 
2182  /*
2183  Returns:
2184  True if the string is reference counted.
2185  */
2186  bool IsReferenceCounted() const;
2187 
2188  // Attributes & Operations
2189 
2190  /*
2191  Returns:
2192  number of nonzero elements in string.
2193  */
2194  int Length() const;
2195 
2196  /*
2197  Returns:
2198  number of nonzero elements in the string.
2199  */
2200  unsigned int UnsignedLength() const;
2201 
2202  /*
2203  Returns:
2204  number of nonzero elements in string before the first null terminator.
2205  If string is nullptr, 0 is returned.
2206  */
2207  static int Length(
2208  const wchar_t* string
2209  );
2210 
2211  /*
2212  Returns:
2213  number of nonzero elements in string before the first null terminator.
2214  If string is nullptr, 0 is returned.
2215  */
2216  static unsigned int UnsignedLength(
2217  const wchar_t* string
2218  );
2219 
2220  bool IsEmpty() const;
2221  bool IsNotEmpty() const; // returns true if length > 0
2222  void Empty(); // sets length to zero - if possible, memory is retained
2223 
2224  wchar_t& operator[](int);
2225  wchar_t operator[](int) const;
2226  wchar_t GetAt(int) const;
2227  void SetAt(int, char);
2228  void SetAt(int, unsigned char);
2229  void SetAt(int, wchar_t);
2230 
2231  operator const wchar_t*() const;
2232 
2233  // overloaded assignment
2234  const ON_wString& operator=(const ON_wString&);
2235  const ON_wString& operator=(const ON_String& src); // src = UTF-8 string
2236  const ON_wString& operator=(char);
2237  const ON_wString& operator=(const char* src); // src = UTF-8 string
2238  const ON_wString& operator=(unsigned char);
2239  const ON_wString& operator=(const unsigned char* src); // src = UTF-8 string
2240  const ON_wString& operator=(wchar_t);
2241  const ON_wString& operator=(const wchar_t*);
2242 
2243  // string concatenation
2244  void Append( const char* sUTF8, int ); // append specified number of elements from a UTF-8 string
2245  void Append( const unsigned char* sUTF8, int ); // append specified number of elements from a UTF-8 string
2246  void Append( const wchar_t*, int ); // append specified number of elements
2247  const ON_wString& operator+=(const ON_wString&);
2248  const ON_wString& operator+=(const ON_String& sUTF8); // append UTF-8 string
2249  const ON_wString& operator+=(char);
2250  const ON_wString& operator+=(unsigned char);
2251  const ON_wString& operator+=(wchar_t);
2252  const ON_wString& operator+=(const char* sUTF8); // append UTF-8 string
2253  const ON_wString& operator+=(const unsigned char* sUTF8); // append UTF-8 string
2254  const ON_wString& operator+=(const wchar_t*);
2255 
2256  // operator+()
2257  ON_wString operator+(const ON_wString&) const;
2258  ON_wString operator+(const ON_String& sUTF8) const; // concatinate with a UTF-8 string
2259  ON_wString operator+(char) const;
2260  ON_wString operator+(unsigned char) const;
2261  ON_wString operator+(wchar_t) const;
2262  ON_wString operator+(const char* sUTF8) const; // concatinate with a UTF-8 string
2263  ON_wString operator+(const unsigned char* sUTF8) const; // concatinate with a UTF-8 string
2264  ON_wString operator+(const wchar_t*) const;
2265 
2266  // Use CompareOrdinal(), ComparePath(), CompareAttributeName(), or a test that is linguistically apprropriate
2267  //ON_DEPRECATED // deprecation in progress
2268  int Compare( const wchar_t* ) const;
2269 
2270  // Use CompareOrdinal(), ComparePath(), CompareAttributeName(), or a test that is linguistically apprropriate
2271  // ON_DEPRECATED // deprecation in progress
2272  int CompareNoCase( const wchar_t* ) const;
2273 
2274  bool Equal(
2275  const ON_wString& other_string,
2276  const class ON_Locale& locale,
2277  bool bIgnoreCase
2278  ) const;
2279 
2280  bool Equal(
2281  const wchar_t* other_string,
2282  const class ON_Locale& locale,
2283  bool bIgnoreCase
2284  ) const;
2285 
2286  static bool Equal(
2287  const wchar_t* string1,
2288  const wchar_t* string2,
2289  const class ON_Locale& locale,
2290  bool bIgnoreCase
2291  );
2292 
2293  /*
2294  Description:
2295  Determine if string 1 and string2 are equal.
2296  Parameters:
2297  string1 - [in]
2298  element_count1 - [in]
2299  The number of string1[] elements to test.
2300  If element_count1 < 0, then string1 must nullptr or be null terminated.
2301  string2 - [in]
2302  element_count2 - [in]
2303  The number of string2[] elements to test.
2304  If element_count1 < 0, then string2 must nullptr or be null terminated.
2305  locale - [in]
2306  Typically ON_Locale::Ordinal, ON_Locale::InvariantCulture, or
2307  ON_Locale::CurrentCulture.
2308  bIgnoreCase - [in]
2309  Remarks:
2310  1) Ordinal compares are the fastest.
2311  2) Equal(...) is faster than Compare(...)
2312  */
2313  static bool Equal(
2314  const wchar_t* string1,
2315  int element_count1,
2316  const wchar_t* string2,
2317  int element_count2,
2318  const class ON_Locale& locale,
2319  bool bIgnoreCase
2320  );
2321 
2322  /*
2323  Description:
2324  Compare this string and other_string by normalizing (NFC)
2325  and using invariant culture ordering.
2326  Parameters:
2327  other_string - [in]
2328  bIgnoreCase - [in]
2329  Remarks:
2330  1) Ordinal compares are the fastest.
2331  2) Equal(...) is faster than Compare(...)
2332  */
2333  int Compare(
2334  const ON_wString& other_string,
2335  const class ON_Locale& locale,
2336  bool bIgnoreCase
2337  ) const;
2338 
2339  int Compare(
2340  const wchar_t* other_string,
2341  const class ON_Locale& locale,
2342  bool bIgnoreCase
2343  ) const;
2344 
2345  /*
2346  Description:
2347  Compare string1 and string2 by normalizing (NFC) and using invariant culture ordering.
2348  Parameters:
2349  string1 - [in]
2350  string2 - [in]
2351  bIgnoreCase - [in]
2352  Remarks:
2353  1) Ordinal compares are the fastest.
2354  2) Equal(...) is faster than Compare(...)
2355  */
2356  static int Compare(
2357  const wchar_t* string1,
2358  const wchar_t* string2,
2359  const class ON_Locale& locale,
2360  bool bIgnoreCase
2361  );
2362 
2363  /*
2364  Description:
2365  Compare string1 and string2 by normalizing (NFC) and using invariant culture ordering.
2366  Parameters:
2367  string1 - [in]
2368  element_count1 - [in]
2369  The number of string1[] elements to compare.
2370  If element_count1 < 0, then string1 must be null terminated.
2371  string2 - [in]
2372  element_count2 - [in]
2373  The number of string2[] elements to compare.
2374  If element_count2 < 0, then string2 must be null terminated.
2375  locale - [in]
2376  Typically ON_Locale::Ordinal, ON_Locale::InvariantCulture, or
2377  ON_Locale::CurrentCulture.
2378  bIgnoreCase - [in]
2379  Remarks:
2380  1) Ordinal compares are the fastest.
2381  2) Equal(...) is faster than Compare(...)
2382  */
2383  static int Compare(
2384  const wchar_t* string1,
2385  int element_count1,
2386  const wchar_t* string2,
2387  int element_count2,
2388  const class ON_Locale& locale,
2389  bool bIgnoreCase
2390  );
2391 
2392  bool EqualOrdinal(
2393  const ON_wString& other_string,
2394  bool bOrdinalIgnoreCase
2395  ) const;
2396 
2397  bool EqualOrdinal(
2398  const wchar_t* other_string,
2399  bool bOrdinalIgnoreCase
2400  ) const;
2401 
2402  static bool EqualOrdinal(
2403  const wchar_t* string1,
2404  const wchar_t* string2,
2405  bool bOrdinalIgnoreCase
2406  );
2407 
2408  static bool EqualOrdinal(
2409  const wchar_t* string1,
2410  int element_count1,
2411  const wchar_t* string2,
2412  int element_count2,
2413  bool bOrdinalIgnoreCase
2414  );
2415 
2416 
2417  /*
2418  Description:
2419  Compare this string and other_string wchar_t element by wchar_t element.
2420  Parameters:
2421  other_string - [in]
2422  bOrdinalIgnoreCase - [in]
2423  Remarks:
2424  1) If the string is UTF-8 encoded and bOrdinalIgnoreCase is true, only
2425  small latin a - z and capital latin A - Z are considered equal. It is
2426  imposible to ignore case for any other values in an ordinal compare.
2427 
2428  2) If you are comparing file system paths, you should use ComparePath().
2429 
2430  3) If locale, linguistic issues, UTF-8 encoding issues or unicode normalization
2431  or collation issues need to be considered, then CompareOrdinal() is
2432  the wrong function to use.
2433  */
2434  int CompareOrdinal(
2435  const ON_wString& other_string,
2436  bool bOrdinalIgnoreCase
2437  ) const;
2438 
2439  int CompareOrdinal(
2440  const wchar_t* other_string,
2441  bool bOrdinalIgnoreCase
2442  ) const;
2443 
2444  /*
2445  Description:
2446  Compare this string1 and string2 wchar_t element by wchar_t element.
2447  Parameters:
2448  string1 - [in]
2449  string2 - [in]
2450  bOrdinalIgnoreCase - [in]
2451  If true, elements with values a-z are compared as if they had values A-Z.
2452  Remarks:
2453  1) If the string is UTF-8 encoded and bOrdinalIgnoreCase is true, only
2454  small latin a - z and capital latin A - Z are considered equal. It is
2455  imposible to ignore case for any other values in an ordinal compare.
2456 
2457  2) If you are comparing file system paths, you should use ComparePath().
2458 
2459  3) If locale, linguistic issues, UTF-8 encoding issues or unicode normalization
2460  or collation issues need to be considered, then CompareOrdinal() is
2461  the wrong function to use.
2462  */
2463  static int CompareOrdinal(
2464  const wchar_t* string1,
2465  const wchar_t* string2,
2466  bool bOrdinalIgnoreCase
2467  );
2468 
2469  /*
2470  Description:
2471  Compare this string1 and string2 wchar_t element by wchar_t element.
2472  Parameters:
2473  string1 - [in]
2474  maximum_element_count1 - [in]
2475  maximum number of elements to compare
2476  string2 - [in]
2477  maximum_element_count2 - [in]
2478  maximum number of elements to compare
2479  bOrdinalIgnoreCase - [in]
2480  If true, elements with values a-z are compared as if they had values A-Z.
2481  Remarks:
2482  1) If the string is UTF-8 encoded and bOrdinalIgnoreCase is true, only
2483  small latin a - z and capital latin A - Z are considered equal. It is
2484  imposible to ignore case for any other values in an ordinal compare.
2485 
2486  2) If you are comparing file system paths, you should use ComparePath().
2487 
2488  3) If locale, linguistic issues, UTF-8 encoding issues or unicode normalization
2489  or collation issues need to be considered, then CompareOrdinal() is
2490  the wrong function to use.
2491  */
2492  static int CompareOrdinal(
2493  const wchar_t* string1,
2494  int element_count1,
2495  const wchar_t* string2,
2496  int element_count2,
2497  bool bOrdinalIgnoreCase
2498  );
2499 
2500  /*
2501  Description:
2502  Compare this string and other_path as file system paths using
2503  appropriate tests for the current operating system.
2504  Parameters:
2505  other_path - [in]
2506  null terminated string
2507  Remarks:
2508  1) Windows and UNIX directory separators (/ and \) are considered equal.
2509 
2510  2) Case is ignored when the file system is not case sensitive, like Windows.
2511 
2512  3) String normalization appropriate for the current operating system
2513  is performed.
2514  */
2515  int ComparePath(
2516  const wchar_t* other_path
2517  ) const;
2518  bool EqualPath(
2519  const wchar_t* other_path
2520  ) const;
2521 
2522  /*
2523  Description:
2524  Compare sPath1 and sPath2 as file system paths using
2525  appropriate tests for the current operating system.
2526  Parameters:
2527  path1 - [in]
2528  null terminated string
2529  path2 - [in]
2530  null terminated string
2531  Remarks:
2532  1) Windows and UNIX directory separators (/ and \) are considered equal.
2533 
2534  2) Case is ignored when the file system is not case sensitive, like Windows.
2535 
2536  3) String normalization appropriate for the current operating system
2537  is performed.
2538  */
2539  static int ComparePath(
2540  const wchar_t* path1,
2541  const wchar_t* path2
2542  );
2543  static bool EqualPath(
2544  const wchar_t* path1,
2545  const wchar_t* path2
2546  );
2547 
2548  /*
2549  Description:
2550  Compare sPath1 and sPath2 as file system paths using
2551  appropriate tests for the current operating system.
2552  Parameters:
2553  path1 - [in]
2554  maximum_element_count1 - [in]
2555  path2 - [in]
2556  maximum_element_count2 - [in]
2557  Remarks:
2558  1) Windows and UNIX directory separators (/ and \) are considered equal.
2559 
2560  2) Case is ignored when the file system is not case sensitive, like Windows.
2561 
2562  3) String normalization appropriate for the current operating system
2563  is performed.
2564  */
2565  static int ComparePath(
2566  const wchar_t* path1,
2567  int element_count1,
2568  const wchar_t* path2,
2569  int element_count2
2570  );
2571  static bool EqualPath(
2572  const wchar_t* path1,
2573  int element_count1,
2574  const wchar_t* path2,
2575  int element_count2
2576  );
2577 
2578  /*
2579  Description:
2580  Compare this string and other_name as a name attribute of an object
2581  like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on.
2582  These comparisons ignore case and use appropriate string normalization.
2583  Parameters:
2584  other_name - [in]
2585  null terminated string
2586  */
2587  int CompareAttributeName(
2588  const wchar_t* other_name
2589  ) const;
2590  bool EqualAttributeName(
2591  const wchar_t* other_name
2592  ) const;
2593 
2594  /*
2595  Description:
2596  Compare this string and other_name as a name attribute of an object
2597  like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on.
2598  These comparisons ignore case and use appropriate string normalization.
2599  Parameters:
2600  name1 - [in]
2601  null terminated string
2602  name2 - [in]
2603  null terminated string
2604  */
2605  static int CompareAttributeName(
2606  const wchar_t* name1,
2607  const wchar_t* name2
2608  );
2609  static bool EqualAttributeName(
2610  const wchar_t* name1,
2611  const wchar_t* name2
2612  );
2613 
2614 
2615  // Description:
2616  // Simple case sensitive wildcard matching. A question mark (?) in the
2617  // pattern matches a single character. An asterisk (*) in the pattern
2618  // mathes zero or more occurances of any character.
2619  //
2620  // Parameters:
2621  // pattern - [in] pattern string where ? and * are wild cards.
2622  //
2623  // Returns:
2624  // true if the string mathes the wild card pattern.
2625  bool WildCardMatch( const wchar_t* ) const;
2626 
2627  // Description:
2628  // Simple case insensitive wildcard matching. A question mark (?) in the
2629  // pattern matches a single character. An asterisk (*) in the pattern
2630  // mathes zero or more occurances of any character.
2631  //
2632  // Parameters:
2633  // pattern - [in] pattern string where ? and * are wild cards.
2634  //
2635  // Returns:
2636  // true if the string mathes the wild card pattern.
2637  bool WildCardMatchNoCase( const wchar_t* ) const;
2638 
2639  /*
2640  Description:
2641  Replace all substrings that match token1 with token2
2642  Parameters:
2643  token1 - [in]
2644  token2 - [in]
2645  Returns:
2646  Number of times toke1 was replaced with token2
2647  */
2648  int Replace( const wchar_t* token1, const wchar_t* token2 );
2649  int Replace( wchar_t token1, wchar_t token2 );
2650 
2651  /*
2652  Description:
2653  Replaces all characters in the string whose values are
2654  not '0-9', 'A-Z', or 'a-z' with a percent sign followed
2655  by a 2 digit hex value.
2656  */
2657  void UrlEncode();
2658 
2659  /*
2660  Description:
2661  Replaces all %xx where xx a two digit hexadecimal number,
2662  with a single character. Returns false if the orginal
2663  string contained
2664  */
2665  bool UrlDecode();
2666 
2667  /*
2668  Description:
2669  Replace all white-space characters with the token.
2670  If token is zero, the string will end up with
2671  internal 0's
2672  Parameters:
2673  token - [in]
2674  whitespace - [in] if not null, this is a 0 terminated
2675  string that lists the characters considered to be
2676  white space. If null, then (1,2,...,32,127) is used.
2677  Returns:
2678  Number of whitespace characters replaced.
2679  See Also:
2680  ON_wString::RemoveWhiteSpace
2681  */
2682  int ReplaceWhiteSpace( wchar_t token, const wchar_t* whitespace = 0 );
2683 
2684  /*
2685  Description:
2686  Removes all white-space characters with the token.
2687  Parameters:
2688  whitespace - [in] if not null, this is a 0 terminated
2689  string that lists the characters considered to be
2690  white space. If null, then (1,2,...,32,127) is used.
2691  Returns:
2692  Number of whitespace characters removed.
2693  See Also:
2694  ON_wString::ReplaceWhiteSpace
2695  */
2696  int RemoveWhiteSpace( const wchar_t* whitespace = 0 );
2697 
2698  /*
2699  Parameters:
2700  prefix - [in]
2701  locale - [in]
2702  When no local is available, pass ON_Locale::Ordinal.
2703  bIgnoreCase - [in]
2704  true to ignore case.
2705  Returns:
2706  If the string begins with prefix, the returned string has prefix removed.
2707  Otherwise the returned string is identical to the string.
2708  */
2709  const ON_wString RemovePrefix(
2710  const wchar_t* prefix,
2711  const class ON_Locale& locale,
2712  bool bIgnoreCase
2713  ) const;
2714 
2715  /*
2716  Parameters:
2717  suffix - [in]
2718  locale - [in]
2719  When no local is available, pass ON_Locale::Ordinal.
2720  bIgnoreCase - [in]
2721  true to ignore case.
2722  Returns:
2723  If the string ends with suffix, the returned string has suffix removed.
2724  Otherwise the returned string is identical to the string.
2725  */
2726  const ON_wString RemoveSuffix(
2727  const wchar_t* suffix,
2728  const class ON_Locale& locale,
2729  bool bIgnoreCase
2730  ) const;
2731 
2732  // simple sub-string extraction
2733  ON_wString Mid(
2734  int, // index of first char
2735  int // count
2736  ) const;
2737  ON_wString Mid(
2738  int // index of first char
2739  ) const;
2740  ON_wString Left(
2741  int // number of chars to keep
2742  ) const;
2743  ON_wString Right(
2744  int // number of chars to keep
2745  ) const;
2746  const ON_wString SubString(
2747  int start_index
2748  ) const;
2749  const ON_wString SubString(
2750  int start_index,
2751  int count
2752  ) const;
2753 
2754  /*
2755  Description:
2756  Map a single wchar_t element to upper or lower case.
2757  Parameters:
2758  c - [in]
2759  If sizeof(wchar_t) >= 2 and c is not a value used int surrogate pairs,
2760  the map specified by map_type is applied. If c is a value used in
2761  surrogate pairs, the value is not changed.
2762  Remarks:
2763  1) MapCharacterOrdinal is not appropriate for general string mapping
2764  because it does not correctly handle surrogate pairs.
2765  2) If sizeof(wchar_t) == sizeof(char), ON_String::MapCharacterOrdinal()
2766  and ON_wString::MapCharacterOrdinal() are identical.
2767  */
2768  static wchar_t MapCharacterOrdinal(
2769  ON_StringMapOrdinalType map_type,
2770  wchar_t c
2771  );
2772 
2773  ON_wString MapStringOrdinal(
2774  ON_StringMapOrdinalType map_type
2775  ) const;
2776 
2777  /*
2778  Description:
2779  Map a wchar_t string.
2780  Parameters:
2781  map_type - [in]
2782  string - [in]
2783  element_count - [in]
2784  number of string[] elements to map.
2785  If element_count < 0, then ON_wString::Length(string) elements are mapped.
2786  mapped_string - [out]
2787  mapped_string_capacity - [in]
2788  number of available elements in mapped_string[].
2789  mapped_string_capacity must be >= mapped_element_count where
2790  mapped_element_count = (element_count >= 0) element_count ? ON_wString::Length(string).
2791  map_type - [in]
2792  Returns:
2793  Number of mapped_string[] elements that were mapped from string[].
2794 
2795  When the return value is < mapped_string_capacity, a null terminator
2796  is appended after the last mapped element.
2797  */
2798  static int MapStringOrdinal(
2799  ON_StringMapOrdinalType map_type,
2800  const wchar_t* string,
2801  int element_count,
2802  wchar_t* mapped_string,
2803  int mapped_string_capacity
2804  );
2805 
2806  ON_wString MapString(
2807  const class ON_Locale& locale,
2808  ON_StringMapType map_type
2809  ) const;
2810 
2811  static ON_wString MapString(
2812  const class ON_Locale& locale,
2813  ON_StringMapType map_type,
2814  const wchar_t* string,
2815  int element_count
2816  );
2817 
2818  /*
2819  Description:
2820  Maps element_count elements of string[] to mapped_string[].
2821  Parameters:
2822  locale - [in]
2823  Locale to use when converting case. It is common to pass one of
2824  the preset locales ON_Locale::Ordinal, ON_Locale::InvariantCulture,
2825  or ON_Locale::m_CurrentCulture.
2826 
2827  map_type - [in]
2828  selects the mapping
2829 
2830  string - [in]
2831  input string to map.
2832 
2833  element_count - [in]
2834  The number of wchar_t elements to map from input string[].
2835 
2836  If element_count < 1, then string[] must be null terminated and
2837  ON_wString::Length(string)+1 elements are mapped.
2838  The +1 insures the output is null terminated.
2839 
2840  mapped_string - [out]
2841  The result of the mapping is returned in mapped_string[].
2842 
2843  mapped_string_capacity - [in]
2844  Number of wchar_t elements available in mapped_string[]
2845  or 0 to calculate the minimum number of elements needed
2846  for the mapping.
2847 
2848  Returns:
2849  If mapped_string_capacity > 0, then the number elements set in mapped_string[]
2850  is returned.
2851 
2852  If mapped_string_capacity == 0, then the number elements required to perform
2853  the mapping is returned.
2854 
2855  When there is room, mapped_string[] is null terminated.
2856 
2857  0: Failure.
2858  */
2859  static int MapString(
2860  const class ON_Locale& locale,
2861  ON_StringMapType map_type,
2862  const wchar_t* string,
2863  int element_count,
2864  wchar_t* mapped_string,
2865  int mapped_string_capacity
2866  );
2867 
2868  /*
2869  Returns:
2870  A platform independed SHA-1 of the string content. Independent of platform endian or platform wide string UTF encoding.
2871  */
2872  const ON_SHA1_Hash ContentHash(
2873  ON_StringMapOrdinalType mapping
2874  ) const;
2875 
2876 
2877  // upper/lower/reverse conversion
2878  /*ON_DEPRECATED */ void MakeUpper();
2879  /*ON_DEPRECATED */ void MakeLower();
2880 
2881  ON_wString Reverse() const;
2882 
2883  static wchar_t* Reverse(
2884  wchar_t* string,
2885  int element_count
2886  );
2887 
2888  void MakeUpperOrdinal();
2889  void MakeLowerOrdinal();
2890  void MakeReverse();
2891 
2892  /*
2893  Description:
2894  Removes leading elements from the string.
2895  Parameters:
2896  s - [in]
2897  All leading wchar_t elements with a value that it found in s[] are removed.
2898  If s is nullptr, All leading wchar_t element with a value between 1 and space are removed.
2899  */
2900  void TrimLeft(const wchar_t* s = nullptr);
2901 
2902  /*
2903  Description:
2904  Removes trailing elements from the string.
2905  Parameters:
2906  s - [in]
2907  All trailing wchar_t elements with a value that it found in s[] are removed.
2908  If s is nullptr, All trailing wchar_t elements with a value between 1 and space are removed.
2909  */
2910  void TrimRight(const wchar_t* s = nullptr);
2911 
2912  void TrimLeftAndRight(const wchar_t* s = nullptr);
2913 
2914  /*
2915  Description:
2916  Remove all occurrences of the input character.
2917  Parameters:
2918  c - [in]
2919  utf8_single_byte_ct must have a value between 0 and 0x7F.
2920  When w is a 2 byte UTF-16 wchar_t value (like Microsoft's wchar_t),
2921  it must be in the range 0 to 0xD7FF or 0xE000 to 0xFFFF.
2922  When w is a 4 byte UTF-32 wchar_t value (like Apple's wchar_t),
2923  it must be in the range 0 to 0xD7FF or 0xE000 to 0x10FFFF.
2924  Returns:
2925  Number of characters removed.
2926  */
2927  int Remove(
2928  char utf8_single_byte_c
2929  );
2930  int Remove(
2931  unsigned char utf8_single_byte_c
2932  );
2933  int Remove(
2934  wchar_t w
2935  );
2936 
2937  /*
2938  Description:
2939  Find the first occurrence of a character or substring.
2940  Parameters:
2941  utf8_single_byte_c - [in]
2942  utf8_single_byte_c must have a value between 0 and 0x7F.
2943  w - [in]
2944  When w is a 2 byte UTF-16 wchar_t value (like Microsoft's wchar_t),
2945  it must be in the range 0 to 0xD7FF or 0xE000 to 0xFFFF.
2946  When w is a 4 byte UTF-32 wchar_t value (like Apple's wchar_t),
2947  it must be in the range 0 to 0xD7FF or 0xE000 to 0x10FFFF.
2948  sTUF8 - [in]
2949  A null terminated UTF-8 string.
2950  wcharString - [in]
2951  A null terminated wchar_t string.
2952  start_index - [in]
2953  Index where search should begin.
2954  Returns:
2955  -1: invalid input or character is not in the string.
2956  >=0: Index of the first instance of the character.
2957  */
2958  int Find(
2959  char utf8_single_byte_c
2960  ) const;
2961  int Find(
2962  unsigned char utf8_single_byte_c
2963  ) const;
2964  int Find(
2965  wchar_t w
2966  ) const;
2967  int Find(
2968  const char* sUTF8
2969  ) const;
2970  int Find(
2971  const unsigned char* sUTF8
2972  ) const;
2973  int Find(
2974  const wchar_t* wcharString
2975  ) const;
2976  int Find(
2977  char utf8_single_byte_c,
2978  size_t start_index
2979  ) const;
2980  int Find(
2981  unsigned char utf8_single_byte_c,
2982  size_t start_index
2983  ) const;
2984  int Find(
2985  wchar_t w,
2986  size_t start_index
2987  ) const;
2988  int Find(
2989  wchar_t w,
2990  int start_index
2991  ) const;
2992  int Find(
2993  const char* sUTF8,
2994  size_t start_index
2995  ) const;
2996  int Find(
2997  const unsigned char* sUTF8,
2998  size_t start_index
2999  ) const;
3000  int Find(
3001  const wchar_t* wcharString,
3002  size_t start_index
3003  ) const;
3004  int Find(
3005  const wchar_t* wcharString,
3006  int start_index
3007  ) const;
3008  int FindOneOf(
3009  const wchar_t* character_set
3010  ) const;
3011 
3012 
3013  /*
3014  Description:
3015  Find the last occurrence of a character or substring.
3016  Parameters:
3017  utf8_single_byte_c - [in]
3018  utf8_single_byte_c must have a value between 0 and 0x7F.
3019  w - [in]
3020  When w is a 2 byte UTF-16 wchar_t value (like Microsoft's wchar_t),
3021  it must be in the range 0 to 0xD7FF or 0xE000 to 0xFFFF.
3022  When w is a 4 byte UTF-32 wchar_t value (like Apple's wchar_t),
3023  it must be in the range 0 to 0xD7FF or 0xE000 to 0x10FFFF.
3024  sUTF8 - [in]
3025  wideString - [in]
3026  Returns:
3027  -1: Invalid input or character or substring was not found.
3028  >=0: Index of the final occurrence of the character or substring.
3029  */
3030  int ReverseFind(
3031  char utf8_single_byte_c
3032  ) const;
3033  int ReverseFind(
3034  unsigned char utf8_single_byte_c
3035  ) const;
3036  int ReverseFind(
3037  wchar_t w
3038  ) const;
3039  int ReverseFind(
3040  const char* sUTF8
3041  ) const;
3042 
3043  int ReverseFind(
3044  const wchar_t* wideString
3045  ) const;
3046 
3047 
3048  // It is common to format single numbers into strings
3049  // and the FromNumber and FromDouble functions are
3050  // the fastest way to do this and provide consistent results.
3051  // They return a pointer to their buffer so the can be used
3052  // as function parameters.
3053  static const ON_wString FromNumber(
3054  char n
3055  );
3056  static const ON_wString FromNumber(
3057  unsigned char n
3058  );
3059  static const ON_wString FromNumber(
3060  short n
3061  );
3062  static const ON_wString FromNumber(
3063  unsigned short n
3064  );
3065  static const ON_wString FromNumber(
3066  int n
3067  );
3068  static const ON_wString FromNumber(
3069  unsigned int n
3070  );
3071  static const ON_wString FromNumber(
3072  ON__INT64 n
3073  );
3074  static const ON_wString FromNumber(
3075  ON__UINT64 n
3076  );
3077  static const ON_wString FromNumber(
3078  double d // "%g" format
3079  );
3080  static const ON_wString ApproximateFromNumber(
3081  double d // "%f" when possible, otherwise "%g"
3082  );
3083  static const ON_wString PreciseFromNumber(
3084  double d // "%.17g"
3085  );
3086 
3087  /*
3088  Description:
3089  Convert a list of Unicode code points into a wide string.
3090  Parameters:
3091  code_points - [in]
3092  array of Unicode code points
3093  code_point_count - [in]
3094  number of code points.
3095  -1 indicates code_points[] is terminated by a 0 value.
3096  error_code_point - [in]
3097  If error_code_point is a valid Unicode code point,
3098  then error_code_point will be used in place of invalid values in code_points[].
3099  Otherwise, conversion will terminate if code_points[] contains an invalid value.
3100  The values ON_UnicodeCodePoint::ON_ReplacementCharacter and
3101  ON_UnicodeCodePoint::ON_InvalidCodePoint are commonly used for this parameter.
3102  Returns:
3103  A wide string encoding of the Unicode code points.
3104  Remarks:
3105  If more control over the conversion process is required,
3106  then use ON_ConvertUTF32ToWideChar().
3107  */
3108  static const ON_wString FromUnicodeCodePoints(
3109  const ON__UINT32* code_points,
3110  int code_point_count,
3111  ON__UINT32 error_code_point
3112  );
3113 
3114  /*
3115  Description:
3116  Each byte value is converted to 2 hexadecimal digits.
3117  Parameters:
3118  bytes - [in]
3119  list of byte values
3120  byte_count - [in]
3121  Number of byte values in bytes[] array.
3122  bCapitalDigits - [in]
3123  false: Use 0-9, a - b
3124  true: Use 0-9, A - F
3125  bReverse - [in]
3126  false:
3127  The digist in the string will be in the order
3128  bytes[0], bytes[1], ..., bytes[byte_count-1].
3129  true:
3130  The digist in the string will be in the order
3131  bytes[byte_count-1], ..., bytes[1], bytes[0].
3132  */
3133  static const ON_wString HexadecimalFromBytes(
3134  const ON__UINT8* bytes,
3135  size_t byte_count,
3136  bool bCapitalDigits,
3137  bool bReverse
3138  );
3139 
3140 
3141  /*
3142  Parameters:
3143  format - [in]
3144  Format control.
3145  Positional paramters of the form %N$x where N >= 1 and x
3146  is the standard format specification are supported.
3147  Avoid using %S (capital S). See the Remarks for details.
3148  ... - [in]
3149  arguments for replacable items in the format string.
3150  Returns:
3151  True if successful.
3152  False if the string is too long or the format string is not valid.
3153  Remarks:
3154  When using Microsoft's compiler and other compilers that provide similar
3155  locale support, the locale is the invariant culture locale returned by
3156  ON_Locale::InvariantCulture::LocalePtr().
3157 
3158  The way Windows handles the %S (capital S) format parameter depends on locale
3159  and code page settings. It is strongly reccommended that you never use %S to
3160  include any string that may possibly contain elements with values > 127.
3161  The following examples illustrate a way to predictably use UTF-8 and wchar_t
3162  parameters in buffers of the other element type.
3163 
3164  const char* utf8_string = ...;
3165  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",utf8_string);
3166  // The code below will treat utf8_string as a UTF-8 encoded string.
3167  wchar_t wchar_buffer[...];
3168  const size_t wchar_buffer_capacity= sizeof(buffer)/sizeof(buffer[0]);
3169  ON_wString::Format(wchar_buffer, wchar_buffer_capacity, "%s", ON_wString(utf8_string));
3170 
3171  const wchar_t* wide_string = ...;
3172  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",char_string);
3173  // The code below will include wide_string as a UTF-8 encoded string.
3174  char char_buffer[...];
3175  const size_t char_buffer_capacity = sizeof(buffer)/sizeof(buffer[0]);
3176  ON_String::Format(char_buffer, char_buffer_capacity, "%s", ON_String(wide_string));
3177  */
3178  bool ON_VARGS_FUNC_CDECL Format(
3179  const wchar_t* format,
3180  ...
3181  );
3182 
3183  static const ON_wString ON_VARGS_FUNC_CDECL FormatToString(
3184  const wchar_t* format,
3185  ...
3186  );
3187 
3188  bool FormatVargs(
3189  const wchar_t* format,
3190  va_list args
3191  );
3192 
3193  /*
3194  Description:
3195  A platform independent, secure, culture invariant way to format a wchar_t string
3196  with support for positional format parameters.
3197  This function is provide to be used when it is critical that
3198  the formatting be platform independent, secure and culture invarient.
3199  Parameters:
3200  buffer - [out]
3201  not null
3202  buffer_capacity - [in]
3203  > 0
3204  Number of wchar_t elements in buffer.
3205  format - [in]
3206  Avoid using %S (capital S). See the Remarks for details.
3207  ... - [in]
3208  Returns:
3209  >= 0:
3210  The number of wchar_t elements written to buffer[], not including the null terminator.
3211  A null terminator is always added (buffer[returned value] = 0).
3212  The last element of buffer[] is always set to zero (buffer[buffer_capacity-1] = 0).
3213  < 0: failure:
3214  If buffer is not null and buffer_capacity > 0, then buffer[0] = 0 and buffer[buffer_capacity-1] = 0;
3215  Remarks:
3216  The way Windows handles the %S (capital S) format parameter depends on locale
3217  and code page settings. It is strongly reccommended that you never use %S to
3218  include any string that may possibly contain elements with values > 127.
3219  The following examples illustrate a way to predictably use UTF-8 and wchar_t
3220  parameters in buffers of the other element type.
3221 
3222  const char* utf8_string = ...;
3223  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",utf8_string);
3224  wchar_t wchar_buffer[...];
3225  const size_t wchar_buffer_capacity= sizeof(buffer)/sizeof(buffer[0]);
3226  ON_wString::Format(wchar_buffer, wchar_buffer_capacity, "%s", ON_wString(utf8_string));
3227 
3228  const wchar_t* wide_string = ...;
3229  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",char_string);
3230  char char_buffer[...];
3231  const size_t char_buffer_capacity = sizeof(buffer)/sizeof(buffer[0]);
3232  ON_String::Format(char_buffer, char_buffer_capacity, "%s", ON_String(wide_string));
3233  */
3234  static int ON_VARGS_FUNC_CDECL FormatIntoBuffer(
3235  wchar_t* buffer,
3236  size_t buffer_capacity,
3237  const wchar_t* format,
3238  ...
3239  );
3240 
3241  static int ON_VARGS_FUNC_CDECL FormatIntoBuffer(
3242  ON_wStringBuffer& buffer,
3243  const wchar_t* format,
3244  ...
3245  );
3246 
3247  static int FormatVargsIntoBuffer(
3248  ON_wStringBuffer& buffer,
3249  const wchar_t* format,
3250  va_list args
3251  );
3252 
3253  static int FormatVargsIntoBuffer(
3254  wchar_t* buffer,
3255  size_t buffer_capacity,
3256  const wchar_t* format,
3257  va_list args
3258  );
3259 
3260  /*
3261  Returns:
3262  >= 0:
3263  Number of char elements in the formatted string, not including the null terminator.
3264  < 0:
3265  Invalid input
3266  */
3267  static int FormatVargsOutputCount(
3268  const wchar_t* format,
3269  va_list args
3270  );
3271 
3272  /*
3273  Parameters:
3274  format - [in]
3275  null terminated string to scan
3276  ... - [out]
3277  pointers to elements to assign.
3278  Returns:
3279  >= 0: number of fields successfully converted and assigned.
3280  <0: failure
3281  */
3282  int ON_VARGS_FUNC_CDECL Scan(
3283  const wchar_t* format,
3284  ...
3285  ) const;
3286 
3287  static int ON_VARGS_FUNC_CDECL ScanBuffer(
3288  const wchar_t* buffer,
3289  const wchar_t* format,
3290  ...
3291  );
3292 
3293  static int ScanBufferVargs(
3294  const wchar_t* buffer,
3295  const wchar_t* format,
3296  va_list args
3297  );
3298 
3299  /*
3300  Returns:
3301  not zero:
3302  pointer to the first character that was not scanned
3303  nullptr:
3304  failure
3305  */
3306  static const wchar_t* ToNumber(
3307  const wchar_t* buffer,
3308  char value_on_failure,
3309  char* value
3310  );
3311  static const wchar_t* ToNumber(
3312  const wchar_t* buffer,
3313  unsigned char value_on_failure,
3314  unsigned char* value
3315  );
3316  static const wchar_t* ToNumber(
3317  const wchar_t* buffer,
3318  short value_on_failure,
3319  short* value
3320  );
3321  static const wchar_t* ToNumber(
3322  const wchar_t* buffer,
3323  unsigned short value_on_failure,
3324  unsigned short* value
3325  );
3326  static const wchar_t* ToNumber(
3327  const wchar_t* buffer,
3328  int value_on_failure,
3329  int* value
3330  );
3331  static const wchar_t* ToNumber(
3332  const wchar_t* buffer,
3333  unsigned int value_on_failure,
3334  unsigned int* value
3335  );
3336  static const wchar_t* ToNumber(
3337  const wchar_t* buffer,
3338  ON__INT64 value_on_failure,
3339  ON__INT64* value
3340  );
3341  static const wchar_t* ToNumber(
3342  const wchar_t* buffer,
3343  ON__UINT64 value_on_failure,
3344  ON__UINT64* value
3345  );
3346  static const wchar_t* ToNumber(
3347  const wchar_t* buffer,
3348  double value_on_failure,
3349  double* value
3350  );
3351 
3352 
3353  // Low level access to string contents as character array
3354  wchar_t* ReserveArray(size_t); // make sure internal array has at least
3355  // the requested capacity.
3356  void ShrinkArray(); // shrink internal storage to minimum size
3357  wchar_t* SetLength(size_t); // set length (<=capacity)
3358  wchar_t* Array();
3359  const wchar_t* Array() const;
3360 
3361  /*
3362  Returns:
3363  Total number of bytes of memory used by this class.
3364  (For use in ON_Object::SizeOf() overrides.
3365  */
3366  unsigned int SizeOf() const;
3367 
3368  /*
3369  Returns:
3370  CRC of the string.
3371  */
3372  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
3373 
3374  /*
3375  Returns:
3376  CRC of the lower case version of the string. Useful
3377  for case insensitive CRCs and hash codes.
3378  */
3379  ON__UINT32 DataCRCLower(ON__UINT32 current_remainder) const;
3380 
3381  /*
3382  OBSOLETE - Use ON_FileSystemPath::SplitPath
3383  */
3384  static void SplitPath(
3385  const char* path,
3386  ON_wString* drive,
3387  ON_wString* dir,
3388  ON_wString* fname,
3389  ON_wString* ext
3390  );
3391 
3392  static void SplitPath(
3393  const wchar_t* path,
3394  ON_wString* drive,
3395  ON_wString* dir,
3396  ON_wString* fname,
3397  ON_wString* ext
3398  );
3399 
3400 public:
3401  ~ON_wString();
3402 
3403 protected:
3404  // Implementation
3405  wchar_t* m_s; // pointer to ref counted string array
3406  // m_s - 12 bytes points at the string's ON_wStringHeader
3407 
3408  // implementation helpers
3409  struct ON_wStringHeader* Header() const;
3410  wchar_t* CreateArray(int);
3411  void CopyArray();
3412  void CopyToArray( const ON_wString& );
3413  void CopyToArray( int, const char* );
3414  void CopyToArray( int, const unsigned char* );
3415  void CopyToArray( int, const wchar_t* );
3416  void AppendToArray( const ON_wString& );
3417  void AppendToArray( int, const char* );
3418  void AppendToArray( int, const unsigned char* );
3419  void AppendToArray( int, const wchar_t* );
3420 };
3421 
3422 /*
3423 Returns:
3424  True if lhs and rhs are identical as arrays of wchar_t elements.
3425 */
3426 ON_DECL
3427 bool operator==( const ON_wString& lhs, const ON_wString& rhs );
3428 
3429 /*
3430 Returns:
3431  True if lhs and rhs are not identical as arrays of wchar_t elements.
3432 */
3433 ON_DECL
3434 bool operator!=(const ON_wString& lhs, const ON_wString& rhs);
3435 
3436 /*
3437 Returns:
3438  True if lhs is less than rhs as an array of wchar_t elements.
3439 */
3440 ON_DECL
3441 bool operator<(const ON_wString& lhs, const ON_wString& rhs);
3442 
3443 /*
3444 Returns:
3445  True if lhs is greater than rhs as an array of wchar_t elements.
3446 */
3447 ON_DECL
3448 bool operator>(const ON_wString& lhs, const ON_wString& rhs);
3449 
3450 /*
3451 Returns:
3452  True if lhs is less than or equal to rhs as an array of wchar_t elements.
3453 */
3454 ON_DECL
3455 bool operator<=(const ON_wString& lhs, const ON_wString& rhs);
3456 
3457 /*
3458 Returns:
3459  True if lhs is greater than or equal to rhs as an array of wchar_t elements.
3460 */
3461 ON_DECL
3462 bool operator>=(const ON_wString& lhs, const ON_wString& rhs);
3463 
3464 /*
3465 Returns:
3466  True if lhs and rhs are identical as arrays of wchar_t elements.
3467 */
3468 ON_DECL
3469 bool operator==( const ON_wString& lhs, const wchar_t* rhs );
3470 
3471 /*
3472 Returns:
3473  True if lhs and rhs are not identical as arrays of wchar_t elements.
3474 */
3475 ON_DECL
3476 bool operator!=(const ON_wString& lhs, const wchar_t* rhs);
3477 
3478 /*
3479 Returns:
3480  True if lhs is less than rhs as an array of wchar_t elements.
3481 */
3482 ON_DECL
3483 bool operator<(const ON_wString& lhs, const wchar_t* rhs);
3484 
3485 /*
3486 Returns:
3487  True if lhs is greater than rhs as an array of wchar_t elements.
3488 */
3489 ON_DECL
3490 bool operator>(const ON_wString& lhs, const wchar_t* rhs);
3491 
3492 /*
3493 Returns:
3494  True if lhs is less than or equal to rhs as an array of wchar_t elements.
3495 */
3496 ON_DECL
3497 bool operator<=(const ON_wString& lhs, const wchar_t* rhs);
3498 
3499 /*
3500 Returns:
3501  True if lhs is greater than or equal to rhs as an array of wchar_t elements.
3502 */
3503 ON_DECL
3504 bool operator>=(const ON_wString& lhs, const wchar_t* rhs);
3505 
3506 /*
3507 Returns:
3508  True if lhs and rhs are identical as arrays of wchar_t elements.
3509 */
3510 ON_DECL
3511 bool operator==( const wchar_t* lhs, const ON_wString& rhs );
3512 
3513 /*
3514 Returns:
3515  True if lhs and rhs are not identical as arrays of wchar_t elements.
3516 */
3517 ON_DECL
3518 bool operator!=(const wchar_t* lhs, const ON_wString& rhs);
3519 
3520 /*
3521 Returns:
3522  True if lhs is less than rhs as an array of wchar_t elements.
3523 */
3524 ON_DECL
3525 bool operator<(const wchar_t* lhs, const ON_wString& rhs);
3526 
3527 /*
3528 Returns:
3529  True if lhs is greater than rhs as an array of wchar_t elements.
3530 */
3531 ON_DECL
3532 bool operator>(const wchar_t* lhs, const ON_wString& rhs);
3533 
3534 /*
3535 Returns:
3536  True if lhs is less than or equal to rhs as an array of wchar_t elements.
3537 */
3538 ON_DECL
3539 bool operator<=(const wchar_t* lhs, const ON_wString& rhs);
3540 
3541 /*
3542 Returns:
3543  True if lhs is greater than or equal to rhs as an array of wchar_t elements.
3544 */
3545 ON_DECL
3546 bool operator>=(const wchar_t* lhs, const ON_wString& rhs);
3547 
3548 /*
3549 Description:
3550  An ON_NameHash is designed to help search for and compare attribute names
3551  like the ON_ModelComponent.Name() value.
3552 
3553  If a name is wchar_t encoded as wide_char_name and UTF-8 encoded as utf8_name,
3554  then ON_NameHash(wide_char_name) == ON_NameHash(utf8_name).
3555 
3556  Set:
3557  bool bEqualNameHash = ON_NameHash::Create(parent_id1,name1) == ON_NameHash::Create(parent_id2,name2);
3558  bool bEqualParentId = (parent_id1 == parent_id2)
3559  bool bEqualAttributeName = ON_String::EqualAttributeName(name1,name2);
3560 
3561  If (bEqualParentId && bEqualAttributeName) is true, then bEqualNameHash is true.
3562  If bEqualParentId is false, then bEqualNameHash is false.
3563  With probablity 1-epsilon, if bEqualAttributeName is false, then bEqualNameHash is false,
3564  where epsilon is an extremely tiny number.
3565 */
3566 class ON_CLASS ON_NameHash
3567 {
3568 public:
3569  /*
3570  Default conststruction creates ON_NameHash::UnsetNameHash.
3571  */
3572  ON_NameHash() = default;
3573  ~ON_NameHash() = default;
3574  ON_NameHash(const ON_NameHash&) = default;
3575  ON_NameHash& operator=(const ON_NameHash&) = default;
3576 
3579 
3580  /*
3581  Returns:
3582  True if the hash is for a valid non-empty name.
3583  */
3584  bool IsValidAndNotEmpty() const;
3585 
3586  /*
3587  Returns:
3588  True if the hash is for an empty name.
3589  */
3590  bool IsEmptyNameHash() const;
3591 
3592  /*
3593  Returns:
3594  True if the hash is for an invalid name.
3595  */
3596  bool IsInvalidNameHash() const;
3597 
3598  /*
3599  Returns:
3600  True if the hash is not empty and was set by calling CreateFilePathHash().
3601  */
3602  bool IsFilePathHash() const;
3603 
3604  /*
3605  Returns:
3606  True if hash is set and case is ignored
3607  */
3608  bool IgnoreCase() const;
3609 
3610  /*
3611  Returns:
3612  ON_NameHash::EmptyNameHash if name is empty.
3613  ON_NameHash::UnsetNameHash if name is not valid.
3614  */
3615  static ON_NameHash Create(
3616  const ON_wString& name
3617  );
3618  static ON_NameHash Create(
3619  const wchar_t* name
3620  );
3621  static ON_NameHash Create(
3622  size_t length,
3623  const wchar_t* name
3624  );
3625  static ON_NameHash Create(
3626  const ON_String& utf8_name
3627  );
3628  static ON_NameHash Create(
3629  const char* utf8_name
3630  );
3631  static ON_NameHash Create(
3632  size_t length,
3633  const char* utf8_name
3634  );
3635 
3636  static ON_NameHash Create(
3637  const ON_UUID& parent_id,
3638  const ON_wString& name
3639  );
3640  static ON_NameHash Create(
3641  const ON_UUID& parent_id,
3642  const wchar_t* name
3643  );
3644  static ON_NameHash Create(
3645  const ON_UUID& parent_id,
3646  size_t length,
3647  const wchar_t* name
3648  );
3649  static ON_NameHash Create(
3650  const ON_UUID& parent_id,
3651  const ON_String& name
3652  );
3653  static ON_NameHash Create(
3654  const ON_UUID& parent_id,
3655  const char* utf8_name
3656  );
3657  static ON_NameHash Create(
3658  const ON_UUID& parent_id,
3659  size_t length,
3660  const char* utf8_name
3661  );
3662 
3663  static ON_NameHash Create(
3664  const ON_wString& name,
3665  bool bIgnoreCase
3666  );
3667  static ON_NameHash Create(
3668  const wchar_t* name,
3669  bool bIgnoreCase
3670  );
3671  static ON_NameHash Create(
3672  size_t length,
3673  const wchar_t* name,
3674  bool bIgnoreCase
3675  );
3676  static ON_NameHash Create(
3677  const ON_String& name,
3678  bool bIgnoreCase
3679  );
3680  static ON_NameHash Create(
3681  const char* utf8_name,
3682  bool bIgnoreCase
3683  );
3684  static ON_NameHash Create(
3685  size_t length,
3686  const char* utf8_name,
3687  bool bIgnoreCase
3688  );
3689  static ON_NameHash Create(
3690  const ON_UUID& parent_id,
3691  const ON_wString& name,
3692  bool bIgnoreCase
3693  );
3694  static ON_NameHash Create(
3695  const ON_UUID& parent_id,
3696  const wchar_t* name,
3697  bool bIgnoreCase
3698  );
3699  static ON_NameHash Create(
3700  const ON_UUID& parent_id,
3701  size_t length,
3702  const wchar_t* name,
3703  bool bIgnoreCase
3704  );
3705  static ON_NameHash Create(
3706  const ON_UUID& parent_id,
3707  const ON_String& utf8_name,
3708  bool bIgnoreCase
3709  );
3710  static ON_NameHash Create(
3711  const ON_UUID& parent_id,
3712  const char* utf8_name,
3713  bool bIgnoreCase
3714  );
3715  static ON_NameHash Create(
3716  const ON_UUID& parent_id,
3717  size_t length,
3718  const char* utf8_name,
3719  bool bIgnoreCase
3720  );
3721 
3722  static ON_NameHash CreateIdAndEmptyName(
3723  const ON_UUID& parent_id
3724  );
3725 
3726  static ON_NameHash CreateIdAndUnsetName(
3727  const ON_UUID& parent_id
3728  );
3729 
3730  static ON_NameHash CreateFilePathHash(
3731  const class ON_FileReference& file_reference
3732  );
3733 
3734  static ON_NameHash CreateFilePathHash(
3735  const wchar_t* file_path
3736  );
3737 
3738  static ON_NameHash CreateFilePathHash(
3739  const char* file_path
3740  );
3741 
3742  static int CompareNameSHA1(
3743  const ON_NameHash& a,
3744  const ON_NameHash& b
3745  );
3746 
3747  static int CompareNameSHA1Ptr(
3748  const ON_NameHash* a,
3749  const ON_NameHash* b
3750  );
3751 
3752  static int CompareParentId(
3753  const ON_NameHash& a,
3754  const ON_NameHash& b
3755  );
3756 
3757  static int CompareParentIdPtr(
3758  const ON_NameHash* a,
3759  const ON_NameHash* b
3760  );
3761 
3762  /*
3763  Description:
3764  Compares id, then length, then SHA-1 digest.
3765  */
3766  static int Compare(
3767  const ON_NameHash& a,
3768  const ON_NameHash& b
3769  );
3770 
3771  /*
3772  Description:
3773  Compares id, then length, then SHA-1 digest.
3774  */
3775  static int ComparePtr(
3776  const ON_NameHash* a,
3777  const ON_NameHash* b
3778  );
3779 
3780  // Number of UTf-32 code point values in mapped name.
3781  // (0 for file path hashes)
3782  ON__UINT32 MappedNameCodePointCount() const;
3783 
3784  // SHA-1 hash of mapped name
3785  ON_SHA1_Hash MappedNameSha1Hash() const;
3786 
3787  // 32 bit hash of id and mapped name
3788  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
3789 
3790  // 32 bit hash of id
3791  ON__UINT32 IdCRC(ON__UINT32 current_remainder) const;
3792 
3793  // 32 bit hash of id and mapped name
3794  ON__UINT32 NameCRC(ON__UINT32 current_remainder) const;
3795 
3796  ON_UUID ParentId() const;
3797 
3798 private:
3799 
3800  enum : unsigned int
3801  {
3802  flags_length_mask = 0x0FFFFFFF,
3803  flags_case_sensitive = 0x80000000,
3804  flags_file_path = 0xFFFFFFFF
3805  };
3806  // m_flags = 0xFFFFFFFFU -> Hash is a file path hash
3807  // m_flags != 0
3808  // m_flags &0x0FFFFFFF = number of unicode (UTF-32) code points in name
3809  // m_flags &0x80000000 = 0 to ignore case, !=0 if case sensitive hash
3810  ON__UINT32 m_flags = 0;
3811 
3812  // m_sha1_hash = SHA-1 hash of ordinal minimum mapped unicode (UTF-32) code points
3813  // If the name is empty, m_length = 0 and m_sha1_hash = ON_SHA1_Hash::EmptyContentHash.
3814  // If the name is not valid, m_length = 0 and m_sha1_hash = ON_SHA1_Hash::ZeroDigest.
3815  ON_SHA1_Hash m_sha1_hash = ON_SHA1_Hash::ZeroDigest;
3816 
3817  // When names appear in a tree structure, m_parent_id identifies the
3818  // parent node.
3819  ON_UUID m_parent_id = ON_nil_uuid;
3820 
3821 public:
3822  /*
3823  Description:
3824  Internal_CreateFromDotNet() is public for technical reasons. It is used
3825  in Rhino Common p-invoke code that provides a .NET interface to the
3826  services ON_NameHash provided by the ON_NameHash class.
3827  This function should be ignored and never called from ordinary C++ code.
3828  If you choose to ignore the preceding admonition, you will have to read
3829  the source code for information about how this function works.
3830  */
3831  static ON_NameHash Internal_DotNetInterfaceSet(
3832  const ON_UUID&,
3833  const ON_SHA1_Hash&,
3834  const ON__UINT32
3835  );
3836 
3837  ON__UINT32 Internal_DotNetInterfaceGetFlags() const;
3838 };
3839 
3840 /*
3841 Compares id, then length, then SHA-1 digest
3842 */
3843 ON_DECL
3844 bool operator==(
3845  const ON_NameHash& a,
3846  const ON_NameHash& b
3847  );
3848 
3849 /*
3850 Compares id, then length, then SHA-1 digest
3851 */
3852 ON_DECL
3853 bool operator!=(
3854  const ON_NameHash& a,
3855  const ON_NameHash& b
3856  );
3857 
3858 /*
3859 Compares id, then length, then SHA-1 digest
3860 */
3861 ON_DECL
3862 bool operator<(
3863  const ON_NameHash& a,
3864  const ON_NameHash& b
3865  );
3866 
3867 /*
3868 Compares id, then length, then SHA-1 digest
3869 */
3870 ON_DECL
3871 bool operator<=(
3872  const ON_NameHash& a,
3873  const ON_NameHash& b
3874  );
3875 
3876 /*
3877 Compares id, then length, then SHA-1 digest
3878 */
3879 ON_DECL
3880 bool operator>(
3881  const ON_NameHash& a,
3882  const ON_NameHash& b
3883  );
3884 
3885 /*
3886 Compares id, then length, then SHA-1 digest
3887 */
3888 ON_DECL
3889 bool operator>=(
3890  const ON_NameHash& a,
3891  const ON_NameHash& b
3892  );
3893 
3894 class ON_CLASS ON_UnitSystem
3895 {
3896 public:
3897  // Default construction sets this to ON_UnitSystem::Meters
3898  ON_UnitSystem() = default;
3899 
3900  ~ON_UnitSystem() = default;
3901  ON_UnitSystem(const ON_UnitSystem&) = default;
3902  ON_UnitSystem& operator=(const ON_UnitSystem&) = default;
3903 
3904 public:
3905  ON_UnitSystem(
3906  ON::LengthUnitSystem length_unit_system
3907  );
3908 
3909  ON_UnitSystem& operator=(
3910  ON::LengthUnitSystem length_unit_system
3911  );
3912 
3913  /*
3914  Parameters:
3915  custom_unit_name - [in]
3916  length unit name (no spaces)
3917  meters_per_custom_unit - [in]
3918  a positive number
3919  Example:
3920  // 1 League = 5556 meters
3921  const ON_UnitSystem Leagues = ON_UnitSystem::CreateCustomUnitSystem(L"Leagues", 1.0/5556.0);
3922  */
3923  static ON_UnitSystem CreateCustomUnitSystem(
3924  const wchar_t* custom_unit_name,
3925  double meters_per_custom_unit
3926  );
3927 
3928 public:
3929  // unit system = ON::LengthUnitSystem::None. Scale to or from any valid unit = 1
3930  static const ON_UnitSystem None;
3931 
3932  static const ON_UnitSystem Angstroms;
3934  static const ON_UnitSystem Microns;
3935 
3936  // unit system = ON::LengthUnitSystem::Millimeters and meters/unit = 0.001 exactly
3938 
3941 
3942  // unit system = ON::LengthUnitSystem::Meters and meters/unit = 1
3943  static const ON_UnitSystem Meters;
3950  static const ON_UnitSystem Mils;
3951 
3952  // unit system = ON::LengthUnitSystem::Inches and meters/unit = 0.0254 exactly
3953  static const ON_UnitSystem Inches;
3954 
3955  // unit system = ON::LengthUnitSystem::Feet and meters/unit = 0.3048 exactly
3956  static const ON_UnitSystem Feet;
3957 
3958  static const ON_UnitSystem Yards;
3959  static const ON_UnitSystem Miles;
3965  static const ON_UnitSystem Parsecs;
3966 
3967  // unit system = ON::LengthUnitSystem::Unset and meters/unit = ON_DBL_QNAN
3968  static const ON_UnitSystem Unset;
3969 
3970 
3971 
3972 public:
3973  bool operator==(const ON_UnitSystem&) const;
3974  bool operator!=(const ON_UnitSystem&) const;
3975 
3976  /*
3977  Returns
3978  true if m_unit_system is a valid ON::LengthUnitSystem enum value,
3979  which may be ON::LengthUnitSystem::None. If m_unit_system is
3980  ON::LengthUnitSystem::CustomUnits, then IsValid() returns true
3981  if m_custom_unit_scale > 0.0 and false otherwise.
3982  The value of m_custom_unit_name is not tested.
3983  See Also:
3984  IsSet()
3985  */
3986  bool IsValid() const;
3987 
3988  bool Read( class ON_BinaryArchive& );
3989  bool Write( class ON_BinaryArchive& ) const;
3990  void Dump( class ON_TextLog& ) const;
3991 
3992  /*
3993  Returns
3994  true If the unit system is valid and set to something beside
3995  ON::no_unit_systm;
3996  */
3997  bool IsSet() const;
3998 
3999  /*
4000  Returns
4001  true If the unit system is ON::LengthUnitSystem::CustomUnits
4002  */
4003  bool IsCustomUnitSystem() const;
4004 
4005  void SetUnitSystem(
4006  ON::LengthUnitSystem us
4007  );
4008 
4009  /*
4010  Parameters:
4011  custom_unit_name - [in]
4012  length unit name (no spaces)
4013  meters_per_custom_unit - [in]
4014  a positive number
4015  Example:
4016  // 1 League = 5556 meters
4017  ON_UnitSystem Leagues;
4018  Leagues.SetCustomUnitSystem( L"Leagues", 1.0/5556.0);
4019  // or
4020  ON_UnitSystem Leagues = ON_UnitSystem::CreateCustomUnitSystem(L"Leagues", 1.0/5556.0);
4021  */
4022  void SetCustomUnitSystem(
4023  const wchar_t* custom_unit_name,
4024  double meters_per_custom_unit
4025  );
4026 
4027  /*
4028  Description:
4029  Changes the unit system to custom units and sets the custom unit scale.
4030  Remarks:
4031  Avoid using this function. Use SetCustomUnitSystem() or SetUnitSystem()
4032  instead.
4033  */
4034  void SetCustomUnitSystemName(
4035  const wchar_t* custom_unit_name
4036  );
4037 
4038  /*
4039  Description:
4040  Changes the unit system to custom units and sets the custom unit scale.
4041  Remarks:
4042  Avoid using this function. Use SetCustomUnitSystem() or SetUnitSystem()
4043  instead.
4044  */
4045  void SetCustomUnitSystemScale(
4046  double meters_per_custom_unit
4047  );
4048 
4049  double MetersPerUnit() const;
4050  ON::LengthUnitSystem UnitSystem() const;
4051  const ON_wString& UnitSystemName() const;
4052 
4053 
4054 private:
4055  ON::LengthUnitSystem m_unit_system = ON::LengthUnitSystem::Meters;
4056  unsigned int m_reserved = 0;
4057 
4058  // The m_custom_unit_... settings apply when m_unit_system = ON::LengthUnitSystem::CustomUnits
4059  double m_meters_per_unit = 1.0; // 1 meter = m_custom_unit_scale custom units
4060  ON_wString m_custom_unit_name; // name of custom units
4061 };
4062 #endif
static const ON_UnitSystem Mils
Definition: opennurbs_string.h:3950
+
1 /* $NoKeywords: $ */
2 /*
3 //
4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6 // McNeel & Associates.
7 //
8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
11 //
12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
13 //
14 ////////////////////////////////////////////////////////////////
15 */
16 
17 #if !defined(ON_STRING_INC_)
18 #define ON_STRING_INC_
19 
20 
21 /*
22 Description:
23  Sort an index array.
24 Parameters
25  method - [in]
26  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort.
27  Use ON::sort_algorithm::heap_sort only after doing meaningful performance
28  testing using optimized release builds that demonstrate
29  ON::sort_algorithm::heap_sort is significantly better.
30  index - [out]
31  Pass in an array of count integers. The returned
32  index[] is a permutation of (0,1,..,count-1)
33  such that compare(B[index[i]],B[index[i+1]) <= 0
34  where B[i] = base + i*sizeof_element
35  base - [in]
36  array of count elements
37  count - [in]
38  number of elements in the index[] and base[] arrays
39  sizeof_element - [in]
40  number of bytes between consecutive elements in the
41  base[] array.
42  compare - [in]
43  Comparison function a la qsort().
44 */
45 ON_DECL
46 void ON_Sort(
47  ON::sort_algorithm method,
48  int* index,
49  const void* base,
50  size_t count,
51  size_t sizeof_element,
52  int (*compare)(const void*,const void*) // int compar(const void*,const void*)
53  );
54 
55 ON_DECL
56 void ON_Sort(
57  ON::sort_algorithm method,
58  unsigned int* index,
59  const void* base,
60  size_t count,
61  size_t sizeof_element,
62  int(*compare)(const void*, const void*) // int compar(const void*,const void*)
63  );
64 
65 
66 /*
67 Description:
68  Sort an index array using a compare function
69  that takes an additional pointer that can be used to
70  pass extra informtation.
71 Parameters
72  method - [in]
73  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort.
74  Use ON::sort_algorithm::heap_sort only after doing meaningful performance
75  testing using optimized release builds that demonstrate
76  ON::sort_algorithm::heap_sort is significantly better.
77  index - [out]
78  Pass in an array of count integers. The returned
79  index[] is a permutation of (0,1,..,count-1)
80  such that compare(B[index[i]],B[index[i+1]) <= 0
81  where B[i] = base + i*sizeof_element
82  base - [in]
83  array of count elements
84  count - [in]
85  number of elements in the index[] and base[] arrays
86  sizeof_element - [in]
87  number of bytes between consecutive elements in the
88  base[] array.
89  compare - [in]
90  Comparison function a la qsort(). The context parameter
91  is pass as the third argument.
92  context - [in]
93  pointer passed as the third argument to compare().
94 */
95 ON_DECL
96 void ON_Sort(
97  ON::sort_algorithm method,
98  int* index,
99  const void* base,
100  size_t count,
101  size_t sizeof_element,
102  int (*compare)(const void*,const void*,void*), // int compar(const void* a,const void* b, void* ptr)
103  void* context
104  );
105 
106 ON_DECL
107 void ON_Sort(
108  ON::sort_algorithm method,
109  unsigned int* index,
110  const void* base,
111  size_t count,
112  size_t sizeof_element,
113  int(*compare)(const void*, const void*, void*), // int compar(const void* a,const void* b, void* ptr)
114  void* context
115  );
116 
117 /*
118 Description:
119  Various sorts. When in doubt, use ON_qsort().
120  ON_qsort - quick sort.
121  ON_hsort = hearp sort.
122 Parameters
123  base - [in]
124  array of count elements
125  count - [in]
126  number of elements in the index[] and base[] arrays
127  sizeof_element - [in]
128  number of bytes between consecutive elements in the
129  base[] array.
130  compare - [in]
131  Comparison function a la qsort(). The context parameter
132  is pass as the third argument.
133  context - [in]
134  pointer passed as the third argument to compare().
135 Remarks:
136  As a rule, use quick sort unless extensive tests in your case
137  prove that heap sort is faster.
138 
139  This implementation of quick sort is generally faster than
140  heap sort, even when the input arrays are nearly sorted.
141  The only common case when heap sort is faster occurs when
142  the arrays are strictly "chevron" (3,2,1,2,3) or "carat"
143  (1,2,3,2,1) ordered, and in these cases heap sort is about
144  50% faster. If the "chevron" or "caret" ordered arrays
145  have a little randomness added, the two algorithms have
146  the same speed.
147 */
148 ON_DECL
149 void ON_hsort(
150  void* base,
151  size_t count,
152  size_t sizeof_element,
153  int (*compare)(const void*,const void*)
154  );
155 
156 ON_DECL
157 void ON_qsort(
158  void* base,
159  size_t count,
160  size_t sizeof_element,
161  int (*compare)(const void*,const void*)
162  );
163 
164 ON_DECL
165 void ON_hsort(
166  void* base,
167  size_t count,
168  size_t sizeof_element,
169  int (*compare)(void*,const void*,const void*),
170  void* context
171  );
172 
173 ON_DECL
174 void ON_qsort(
175  void* base,
176  size_t count,
177  size_t sizeof_element,
178  int (*compare)(void*,const void*,const void*),
179  void* context
180  );
181 
182 /*
183 Description:
184  Sort an array of doubles in increasing order in place.
185 Parameters:
186  sort_algorithm - [in]
187  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
188  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
189  optimized release builds and are confident heap sort is
190  significantly faster in your case.
191  a - [in / out]
192  The values in a[] are sorted so that a[i] <= a[i+1].
193  a[] cannot contain NaNs.
194  nel - [in]
195  length of array a[]
196 */
197 ON_DECL
198 void ON_SortDoubleArray(
199  ON::sort_algorithm sort_algorithm,
200  double* a,
201  size_t nel
202  );
203 
204 
205 /*
206 Description:
207  Sort an array of doubles in increasing order in place.
208 Parameters:
209  a - [in / out]
210  The values in a[] are sorted so that a[i] <= a[i+1].
211  a[] cannot contain NaNs.
212  nel - [in]
213  length of array a[]
214 */
215 ON_DECL
216 void ON_SortDoubleArrayIncreasing(
217  double* a,
218  size_t nel
219  );
220 
221 /*
222 Description:
223  Sort an array of doubles in increasing order in place.
224 Parameters:
225  a - [in / out]
226  The values in a[] are sorted so that a[i] >= a[i+1].
227  a[] cannot contain NaNs.
228  nel - [in]
229  length of array a[]
230 */
231 ON_DECL
232 void ON_SortDoubleArrayDecreasing(
233  double* a,
234  size_t nel
235  );
236 
237 /*
238 Description:
239  Sort an array of ints in place.
240 Parameters:
241  sort_algorithm - [in]
242  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
243  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
244  optimized release builds and are confident heap sort is
245  significantly faster in your case.
246  a - [in / out]
247  The values in a[] are sorted so that a[i] <= a[i+1].
248  nel - [in]
249  length of array a[]
250 */
251 ON_DECL
252 void ON_SortIntArray(
253  ON::sort_algorithm sort_algorithm,
254  int* a,
255  size_t nel
256  );
257 
258 /*
259 Description:
260  Sort an array of unsigned ints in place.
261 Parameters:
262  sort_algorithm - [in]
263  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
264  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
265  optimized release builds and are confident heap sort is
266  significantly faster in your case.
267  a - [in / out]
268  The values in a[] are sorted so that a[i] <= a[i+1].
269  nel - [in]
270  length of array a[]
271 */
272 ON_DECL
273 void ON_SortUnsignedIntArray(
274  ON::sort_algorithm sort_algorithm,
275  unsigned int* a,
276  size_t nel
277  );
278 
279 /*
280 Description:
281  Sort an array of unsigned 64-bit ints in place.
282 Parameters:
283  sort_algorithm - [in]
284  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
285  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
286  optimized release builds and are confident heap sort is
287  significantly faster in your case.
288  a - [in / out]
289  The values in a[] are sorted so that a[i] <= a[i+1].
290  nel - [in]
291  length of array a[]
292 */
293 ON_DECL
294 void ON_SortUINT64Array(
295  ON::sort_algorithm sort_algorithm,
296  ON__UINT64* a,
297  size_t nel
298 );
299 
300 
301 
302 /*
303 Description:
304  Sort an array of unsigned null terminated char strings in place.
305 Parameters:
306  sort_algorithm - [in]
307  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
308  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
309  optimized release builds and are confident heap sort is
310  significantly faster in your case.
311  a - [in / out]
312  The values in a[] are sorted so that strcmp(a[i],a[i+1]) <= 0.
313  nel - [in]
314  length of array a[]
315 */
316 ON_DECL
317 void ON_SortStringArray(
318  ON::sort_algorithm sort_algorithm,
319  char** a,
320  size_t nel
321  );
322 
323 ON_DECL
324 const int* ON_BinarySearchIntArray(
325  int key,
326  const int* base,
327  size_t nel
328  );
329 
330 ON_DECL
331 const unsigned int* ON_BinarySearchUnsignedIntArray(
332  unsigned int key,
333  const unsigned int* base,
334  size_t nel
335  );
336 
337 ON_DECL
338 const void* ON_BinarySearchArrayForUnsingedInt(
339  unsigned int key,
340  const void* base,
341  size_t count,
342  size_t sizeof_element,
343  size_t key_offset
344  );
345 
346 ON_DECL
347 const double* ON_BinarySearchDoubleArray(
348  double key,
349  const double* base,
350  size_t nel
351  );
352 
353 /*
354  This class is intended to be used to determine if a file's
355  contents have changed.
356 */
357 class ON_CLASS ON_CheckSum
358 {
359 public:
360  ON_CheckSum();
361  ~ON_CheckSum();
362 
364 
365  // zeros all fields.
366  void Zero();
367 
368  /*
369  Returns:
370  True if checksum is set.
371  */
372  bool IsSet() const;
373 
374  // C++ default operator=, operator==,
375  // and copy constructor work fine.
376 
377  /*
378  Descripton:
379  Set check sum values for a buffer
380  Parameters:
381  size - [in]
382  number of bytes in buffer
383  buffer - [in]
384  time - [in]
385  last modified time in seconds since Jan 1, 1970, UCT
386  Returns:
387  True if checksum is set.
388  */
389  bool SetBufferCheckSum(
390  size_t size,
391  const void* buffer,
392  time_t time
393  );
394 
395  /*
396  Descripton:
397  Set check sum values for a file.
398  Parameters:
399  fp - [in] pointer to a file opened with ON:FileOpen(...,"rb")
400  Returns:
401  True if checksum is set.
402  */
403  bool SetFileCheckSum(
404  FILE* fp
405  );
406 
407  /*
408  Descripton:
409  Set check sum values for a file.
410  Parameters:
411  filename - [in] name of file.
412  Returns:
413  True if checksum is set.
414  */
415  bool SetFileCheckSum(
416  const wchar_t* filename
417  );
418 
419  /*
420  Description:
421  Test buffer to see if it has a matching checksum.
422  Paramters:
423  size - [in] size in bytes
424  buffer - [in]
425  Returns:
426  True if the buffer has a matching checksum.
427  */
428  bool CheckBuffer(
429  size_t size,
430  const void* buffer
431  ) const;
432 
433  /*
434  Description:
435  Test buffer to see if it has a matching checksum.
436  Paramters:
437  fp - [in] pointer to file opened with ON::OpenFile(...,"rb")
438  bSkipTimeCheck - [in] if true, the time of last
439  modification is not checked.
440  Returns:
441  True if the file has a matching checksum.
442  */
443  bool CheckFile(
444  FILE* fp,
445  bool bSkipTimeCheck = false
446  ) const;
447 
448  /*
449  Description:
450  Test buffer to see if it has a matching checksum.
451  Paramters:
452  filename - [in]
453  bSkipTimeCheck - [in] if true, the time of last
454  modification is not checked.
455  Returns:
456  True if the file has a matching checksum.
457  */
458  bool CheckFile(
459  const wchar_t* filename,
460  bool bSkipTimeCheck = false
461  ) const;
462 
463  bool Write(class ON_BinaryArchive&) const;
464  bool Read(class ON_BinaryArchive&);
465 
466  void Dump(class ON_TextLog&) const;
467 
468 public:
469  size_t m_size; // bytes in the file.
470  time_t m_time; // last modified time in seconds since Jan 1, 1970, UCT
471  ON__UINT32 m_crc[8]; // crc's
472 };
473 
474 
475 /*
476 Description:
477  Get the length of a UTF-8 encoded char string.
478 Parameters:
479  string - [in]
480  null terminated char string.
481 Returns:
482  Number of nonzero char elements before the null terminator.
483  If string is nullptr, then 0 is returned.
484 */
485 ON_DECL
486 int ON_StringLengthUTF8(
487  const char* string
488  );
489 
490 /*
491 Description:
492  Get the length of a UTF-16 encoded ON__UINT16 string.
493 Parameters:
494  string - [in]
495  null terminated ON__UINT16 string.
496 Returns:
497  Number of nonzero ON__UINT16 elements before the null terminator.
498  If string is nullptr, then 0 is returned.
499 */
500 ON_DECL
501 int ON_StringLengthUTF16(
502  const ON__UINT16* string
503  );
504 
505 /*
506 Description:
507  Get the length of a UTF-32 encoded ON__UINT32 string.
508 Parameters:
509  string - [in]
510  null terminated ON__UINT32 string.
511 Returns:
512  Number of nonzero ON__UINT32 elements before the null terminator.
513  If string is nullptr, then 0 is returned.
514 */
515 ON_DECL
516 int ON_StringLengthUTF32(
517  const ON__UINT32* string
518  );
519 
520 /*
521 Description:
522  Get the length of a wchar_t string.
523 Parameters:
524  string - [in]
525  null terminated wchar_t string.
526 Returns:
527  Number of nonzero wchar_t elements before the null terminator.
528  If string is nullptr, then 0 is returned.
529 */
530 ON_DECL
531 int ON_StringLengthWideChar(
532  const wchar_t* string
533  );
534 
535 /*
536 Description:
537  Get the length of a UTF-8 encoded char string.
538 Parameters:
539  string - [in]
540  null terminated char string.
541  string_capacity - [in]
542  maximum number of string[] elements to test.
543 Returns:
544  If string is nullptr or string_capacity <=0, then 0 is returned.
545  If a null terminator is not found, then string_capacity is returned.
546  Otherwise, the number of nonzero char elements before the null terminator is returned.
547 */
548 ON_DECL
549 int ON_StringLengthUTF8(
550  const char* string,
551  size_t string_capacity
552  );
553 
554 /*
555 Description:
556  Get the length of a UTF-16 encoded ON__UINT16 string.
557 Parameters:
558  string - [in]
559  null terminated ON__UINT16 string.
560  string_capacity - [in]
561  maximum number of string[] elements to test.
562 Returns:
563  If string is nullptr or string_capacity <=0, then 0 is returned.
564  If a null terminator is not found, then string_capacity is returned.
565  Otherwise, the number of nonzero char elements before the null terminator is returned.
566 */
567 ON_DECL
568 int ON_StringLengthUTF16(
569  const ON__UINT16* string,
570  size_t string_capacity
571  );
572 
573 /*
574 Description:
575  Get the length of a UTF-32 encoded ON__UINT32 string.
576 Parameters:
577  string - [in]
578  null terminated ON__UINT32 string.
579  string_capacity - [in]
580  maximum number of string[] elements to test.
581 Returns:
582  If string is nullptr or string_capacity <=0, then 0 is returned.
583  If a null terminator is not found, then string_capacity is returned.
584  Otherwise, the number of nonzero char elements before the null terminator is returned.
585 */
586 ON_DECL
587 int ON_StringLengthUTF32(
588  const ON__UINT32* string,
589  size_t string_capacity
590  );
591 
592 /*
593 Description:
594  Get the length of a wchar_t string.
595 Parameters:
596  string - [in]
597  null terminated wchar_t string.
598  string_capacity - [in]
599  maximum number of string[] elements to test.
600 Returns:
601  If string is nullptr or string_capacity <=0, then 0 is returned.
602  If a null terminator is not found, then string_capacity is returned.
603  Otherwise, the number of nonzero char elements before the null terminator is returned.
604 */
605 ON_DECL
606 int ON_StringLengthWideChar(
607  const wchar_t* string,
608  size_t string_capacity
609  );
610 
611 /*
612 Description:
613  Compare of UTF-8 encoded char strings element by element.
614 Parameters:
615  string1 - [in]
616  element_count1 - [in]
617  If element_count1 < 0, then string1 must be null terminated and element_count1
618  will be set to the length of string1.
619  If element_count1 >= 0, then that number of elements are compared in string1[].
620  string2 - [in]
621  element_count2 - [in]
622  If element_count2 < 0, then string2 must be null terminated and element_count2
623  will be set to the length of string2.
624  If element_count2 >= 0, then that number of elements are compared in string2[].
625  bOrdinalIgnoreCase - [in]
626  If bOrdinalIgnoreCase, then letters with a capital and small codepoint value <= 127
627  are compared using the smallest codepoint value. This amounts to converting the
628  letters a-z to A-Z before comparing.
629 Returns:
630  0: the strings are the same
631  <0: string1 < string2
632  >0: string1 > string2
633 Remarks:
634  1) If linguistic issues are important, then this function is not appropriate.
635  2) nullptr values are handled.
636  3) There are lists of Unicode code point values such that the results of
637  ON_StringCompareOrdinalUTF8, ON_StringCompareOrdinalUTF16 and ON_StringCompareOrdinalUTF32
638  are different when applied to UTF-8, UTF-16 and UTF-32 encodings.
639  4) This function does not compare Unicode code point values the strings have eny elements with values > 127.
640 */
641 ON_DECL
642 int ON_StringCompareOrdinalUTF8(
643  const char* string1,
644  int element_count1,
645  const char* string2,
646  int element_count2,
647  bool bOrdinalIgnoreCase
648  );
649 
650 /*
651 Description:
652  Compare of UTF-16 encoded ON__UINT16 strings element by element.
653 Parameters:
654  string1 - [in]
655  element_count1 - [in]
656  If element_count1 < 0, then string1 must be null terminated and element_count1
657  will be set to the length of string1.
658  If element_count1 >= 0, then that number of elements are compared in string1[].
659  string2 - [in]
660  element_count2 - [in]
661  If element_count2 < 0, then string2 must be null terminated and element_count2
662  will be set to the length of string2.
663  If element_count2 >= 0, then that number of elements are compared in string2[].
664  bOrdinalIgnoreCase - [in]
665  If bOrdinalIgnoreCase, then letters with a capital and small codepoint value <= 127
666  are compared using the smallest codepoint value. This amounts to converting the
667  letters a-z to A-Z before comparing.
668 Returns:
669  0: the strings are the same
670  <0: string1 < string2
671  >0: string1 > string2
672 Remarks:
673  1) If linguistic issues are important, then this function is not appropriate.
674  2) nullptr values are handled.
675  3) There are lists of Unicode code point values such that the results of
676  ON_StringCompareOrdinalUTF8, ON_StringCompareOrdinalUTF16 and ON_StringCompareOrdinalUTF32
677  are different when applied to UTF-8, UTF-16 and UTF-32 encodings.
678  4) This function does not compare Unicode code point values if the strings have any surrogate pairs.
679 */
680 ON_DECL
681 int ON_StringCompareOrdinalUTF16(
682  const ON__UINT16* string1,
683  int element_count1,
684  const ON__UINT16* string2,
685  int element_count2,
686  bool bOrdinalIgnoreCase
687  );
688 
689 /*
690 Description:
691  Compare of UTF-32 encoded ON__UINT32 strings element by element.
692 Parameters:
693  string1 - [in]
694  element_count1 - [in]
695  If element_count1 < 0, then string1 must be null terminated and element_count1
696  will be set to the length of string1.
697  If element_count1 >= 0, then that number of elements are compared in string1[].
698  string2 - [in]
699  element_count2 - [in]
700  If element_count2 < 0, then string2 must be null terminated and element_count2
701  will be set to the length of string2.
702  If element_count2 >= 0, then that number of elements are compared in string2[].
703  bOrdinalIgnoreCase - [in]
704  If bOrdinalIgnoreCase, then letters with a capital and small codepoint value <= 127
705  are compared using the smallest codepoint value. This amounts to converting the
706  letters a-z to A-Z before comparing.
707 Returns:
708  0: the strings are the same
709  <0: string1 < string2
710  >0: string1 > string2
711 Remarks:
712  1) If linguistic issues are important, then this function is not appropriate.
713  2) nullptr values are handled.
714  3) There are lists of Unicode code point values such that the results of
715  ON_StringCompareOrdinalUTF8, ON_StringCompareOrdinalUTF16 and ON_StringCompareOrdinalUTF32
716  are different when applied to UTF-8, UTF-16 and UTF-32 encodings.
717 */
718 ON_DECL
719 int ON_StringCompareOrdinalUTF32(
720  const ON__UINT32* string1,
721  int element_count1,
722  const ON__UINT32* string2,
723  int element_count2,
724  bool bOrdinalIgnoreCase
725  );
726 
727 /*
728 Description:
729  Compare wchar_t strings element by element.
730 Parameters:
731  string1 - [in]
732  element_count1 - [in]
733  If element_count1 < 0, then string1 must be null terminated and element_count1
734  will be set to the length of string1.
735  If element_count1 >= 0, then that number of elements are compared in string1[].
736  string2 - [in]
737  element_count2 - [in]
738  If element_count2 < 0, then string2 must be null terminated and element_count2
739  will be set to the length of string2.
740  If element_count2 >= 0, then that number of elements are compared in string2[].
741  bOrdinalIgnoreCase - [in]
742  If bOrdinalIgnoreCase, then letters with a capital and small codepoint value <= 127
743  are compared using the smallest codepoint value. This amounts to converting the
744  letters a-z to A-Z before comparing.
745 Returns:
746  0: the strings are the same
747  <0: string1 < string2
748  >0: string1 > string2
749 Remarks:
750  1) If linguistic issues are important, then this function is not appropriate.
751  2) nullptr values are handled.
752  3) There are lists of Unicode code point values such that the results of
753  ON_StringCompareOrdinalUTF8, ON_StringCompareOrdinalUTF16 and ON_StringCompareOrdinalUTF32
754  are different when applied to UTF-8, UTF-16 and UTF-32 encodings.
755  4) This function assumes the sizeof(wchar_t) is 1, 2 or 4,
756  that 1 bytes wchar_t strings are UTF-8 encoded, 2 byte wchar_t strings are UTF-16 encoded
757  and 4 bytes wchar_t strings are UTF-32 encoded.
758 */
759 ON_DECL
760 int ON_StringCompareOrdinalWideChar(
761  const wchar_t* string1,
762  int element_count1,
763  const wchar_t* string2,
764  int element_count2,
765  bool bOrdinalIgnoreCase
766  );
767 
768 /////////////////////////////////////////////////////////////////////////////
769 //
770 // ON_String is a UTF-8 char string on all platforms
771 // ON_wString is a UTF-16 encoded wchar_t string on Windows platforms
772 // ON_wString is a UTF-32 encoded wchar_t string on Windows platforms
773 //
774 
775 class ON_CLASS ON_StringBuffer
776 {
777 public:
778  ON_StringBuffer();
779 
781  char* stack_buffer,
782  size_t stack_buffer_capacity
783  );
784 
785  ~ON_StringBuffer();
786 
787  bool GrowBuffer(
788  size_t buffer_capacity
789  );
790 
791  char* m_buffer;
793 
794 private:
796  ON_StringBuffer& operator=(const ON_StringBuffer&);
797  char* m_heap_buffer;
798  size_t m_heap_buffer_capacity;
799 };
800 
801 class ON_CLASS ON_wStringBuffer
802 {
803 public:
805 
807  wchar_t* stack_buffer,
808  size_t stack_buffer_capacity
809  );
810 
811  ~ON_wStringBuffer();
812 
813  bool GrowBuffer(
814  size_t buffer_capacity
815  );
816 
817  wchar_t* m_buffer;
819 
820 private:
822  ON_wStringBuffer& operator=(const ON_wStringBuffer&);
823  wchar_t* m_heap_buffer;
824  size_t m_heap_buffer_capacity;
825 };
826 
827 ON_DECL
828 ON__UINT32 ON_UnicodeMapCodePointOrdinal(
829  ON_StringMapOrdinalType map_type,
830  ON__UINT32 unicode_code_point
831  );
832 
833 ON_DECL
834 ON__UINT32 ON_UnicodeMapCodePoint(
835  const ON_Locale& locale,
836  ON_StringMapType map_type,
837  ON__UINT32 unicode_code_point
838  );
839 
840 /*
841 Parameters:
842  sUTF8 - [in]
843  pointer to a UTF-8 encoded string.
844  element_count - [in]
845  number of char elements to parse.
846  if element_count < 0, then sUTF8 must be null terminated
847  mapping - [in]
848  mapping to apply to unicode code points
849 Returns:
850  A SHA-1 value of the sequence of unicode code points. This value is independent
851  of platform endian or UTF encoding.
852 */
853 const ON_SHA1_Hash ON_StringContentHash(
854  const char* sUTF8,
855  int element_count,
856  ON_StringMapOrdinalType mapping
857 );
858 
859 /*
860 Parameters:
861  sUTF8 - [in]
862  pointer to a UTF-8 encoded string.
863  element_count - [in]
864  number of char elements to parse.
865  if element_count < 0, then sUTF8 must be null terminated
866  mapping - [in]
867  mapping to apply to unicode code points
868 Returns:
869  A SHA-1 value of the sequence of unicode code points. This value is independent
870  of platform endian or UTF encoding.
871 */
872 const ON_SHA1_Hash ON_StringContentHash(
873  const wchar_t* sWideString,
874  int element_count,
875  ON_StringMapOrdinalType mapping
876 );
877 
878 class ON_CLASS ON_String
879 {
880 public:
881 
882 // Constructors
883  ON_String() ON_NOEXCEPT;
884  ON_String( const ON_String& );
885 
886  // ON_String::EmptyString has length 0.
887  // const char* s = ON_String::EmptyString sets s to "".
888  static const ON_String EmptyString;
889 
890  static const char Backspace; // Unicode BACKSPACE control U+0008
891  static const char Tab; // Unicode CHARACTER TABULATION control U+0009
892  static const char LineFeed; // Unicode LINE FEED control U+000A
893  static const char VerticalTab; // Unicode LINE TABULATION control U+000B
894  static const char FormFeed; // Unicode FORM FEED control U+000C
895  static const char CarriageReturn; // Unicode CHARACTER TABULATION control U+000D
896  static const char Escape; // Unicode CARRIAGE RETURN control U+001B
897  static const char Space; // Unicode SPACE U+0020
898  static const char Slash; // Unicode SOLIDUS U+002F
899  static const char Backslash; // Unicode REVERSE SOLIDUS U+005C
900  static const char Pipe; // Unicode VERTICAL LINE U+007C
901 
902 private:
903  // Use IsEmpty() or IsNotEmpty() when you want a bool
904  // to test for the empty string.
905  explicit operator bool() const { return IsNotEmpty(); }
906 public:
907 
908 #if defined(ON_HAS_RVALUEREF)
909  // Clone constructor
910  ON_String( ON_String&& ) ON_NOEXCEPT;
911 
912  // Clone Assignment operator
913  ON_String& operator=( ON_String&& ) ON_NOEXCEPT;
914 #endif
915 
916  ON_String( const char* );
917  ON_String( const char*, int /*length*/ ); // from substring
918  ON_String( char, int = 1 /* repeat count */ );
919 
920  ON_String( const unsigned char* );
921  ON_String( const unsigned char*, int /*length*/ ); // from substring
922  ON_String( unsigned char, int = 1 /* repeat count */ );
923 
924  // construct a UTF-8 string string from a UTF-16 string.
925  ON_String( const wchar_t* src ); // src = UTF-16 string
926  ON_String( const wchar_t* src, int length ); // from a UTF-16 substring
927  ON_String( const ON_wString& src ); // src = UTF-16 string
928 
929 #if defined(ON_RUNTIME_WIN)
930  // Windows support
931  bool LoadResourceString( HINSTANCE, UINT); // load from Windows string resource
932  // 2047 chars max
933 #endif
934 
935  void Create();
936  void Destroy(); // releases any memory and initializes to default empty string
937  void EmergencyDestroy();
938 
939  /*
940  Description:
941  Enables reference counting. I limited cases, this is useful
942  for large strings or strings that are frequently passed around.
943  Reference counted strings must be carefully managed in
944  when multi-threading is used.
945  Parameters:
946  If EnableReferenceCounting()
947  is not called, then the string will not be referanceThe default is to not use
948  reference counted strings.
949  */
950  void EnableReferenceCounting( bool bEnable );
951 
952  /*
953  Returns:
954  True if the string is reference counted.
955  */
956  bool IsReferenceCounted() const;
957 
958 
959  // Attributes & Operations
960 
961  /*
962  Returns:
963  number of nonzero elements in string.
964  */
965  int Length() const;
966 
967  /*
968  Returns:
969  number of nonzero elements in the string.
970  */
971  unsigned int UnsignedLength() const;
972 
973  /*
974  Returns:
975  number of nonzero elements in string before the first null terminator.
976  If string is nullptr, 0 is returned.
977  */
978  static int Length(
979  const char* string
980  );
981 
982  /*
983  Returns:
984  number of nonzero elements in string before the first null terminator.
985  If string is nullptr, 0 is returned.
986  */
987  static unsigned int UnsignedLength(
988  const char* string
989  );
990 
991  bool IsEmpty() const; // returns true if length == 0
992  bool IsNotEmpty() const; // returns true if length > 0
993  void Empty(); // sets length to zero - if possible, memory is retained
994 
995  char& operator[](int);
996  char operator[](int) const;
997  char GetAt(int) const;
998  void SetAt(int, char);
999  void SetAt(int, unsigned char);
1000 
1001  operator const char*() const;
1002 
1003  // overloaded assignment
1004  ON_String& operator=(const ON_String&);
1005  ON_String& operator=(char);
1006  ON_String& operator=(const char*);
1007  ON_String& operator=(unsigned char);
1008  ON_String& operator=(const unsigned char*);
1009  ON_String& operator=(const wchar_t* src); // src = Wide char string, result is a UTF-8 string
1010  ON_String& operator=(const ON_wString& src); // src = Wide char string, result is a UTF-8 string
1011 
1012  // operator+()
1013  ON_String operator+(const ON_String&) const;
1014  ON_String operator+(char) const;
1015  ON_String operator+(unsigned char) const;
1016  ON_String operator+(const char*) const;
1017  ON_String operator+(const unsigned char*) const;
1018 
1019  // string concatenation
1020  void Append( const char*, int ); // append specified number of characters
1021  void Append( const unsigned char*, int ); // append specified number of characters
1022  const ON_String& operator+=(const ON_String&);
1023  const ON_String& operator+=(char);
1024  const ON_String& operator+=(unsigned char);
1025  const ON_String& operator+=(const char*);
1026  const ON_String& operator+=(const unsigned char*);
1027 
1028  ON_DEPRECATED_MSG("Use CompareOrdinal(), ComparePath(), CompareAttributeName(), or a test that is linguistically apprropriate")
1029  int Compare( const char* ) const;
1030 
1031  ON_DEPRECATED_MSG("Use CompareOrdinal(), ComparePath(), CompareAttributeName(), or a test that is linguistically apprropriate")
1032  int Compare( const unsigned char* ) const;
1033 
1034  ON_DEPRECATED_MSG("Use CompareOrdinal(), ComparePath(), CompareAttributeName(), or a test that is linguistically apprropriate")
1035  int CompareNoCase( const char* ) const;
1036 
1037  ON_DEPRECATED_MSG("Use CompareOrdinal(), ComparePath(), CompareAttributeName(), or a test that is linguistically apprropriate")
1038  int CompareNoCase( const unsigned char* ) const;
1039 
1040  bool Equal(
1041  const ON_String& other_string,
1042  const class ON_Locale& locale,
1043  bool bIgnoreCase
1044  ) const;
1045 
1046  bool Equal(
1047  const char* other_string,
1048  const class ON_Locale& locale,
1049  bool bIgnoreCase
1050  ) const;
1051 
1052  static bool Equal(
1053  const char* string1,
1054  const char* string2,
1055  const class ON_Locale& locale,
1056  bool bIgnoreCase
1057  );
1058 
1059  static bool Equal(
1060  const char* string1,
1061  int element_count1,
1062  const char* string2,
1063  int element_count2,
1064  const class ON_Locale& locale,
1065  bool bOrdinalIgnoreCase
1066  );
1067 
1068  /*
1069  Description:
1070  Compare this string and other_string by normalizing (NFC)
1071  and using invariant culture ordering.
1072  Parameters:
1073  other_string - [in]
1074  bIgnoreCase - [in]
1075  Remarks:
1076  1) Ordinal compares are the fastest.
1077  2) Equal(...) is faster than Compare(...)
1078  */
1079  int Compare(
1080  const ON_String& other_string,
1081  const class ON_Locale& locale,
1082  bool bIgnoreCase
1083  ) const;
1084 
1085  int Compare(
1086  const char* other_string,
1087  const class ON_Locale& locale,
1088  bool bIgnoreCase
1089  ) const;
1090 
1091  /*
1092  Description:
1093  Compare string1 and string2 by normalizing (NFC) and using invariant culture ordering.
1094  Parameters:
1095  string1 - [in]
1096  string2 - [in]
1097  bIgnoreCase - [in]
1098  Remarks:
1099  1) Ordinal compares are the fastest.
1100  2) Equal(...) is faster than Compare(...)
1101  */
1102  static int Compare(
1103  const char* string1,
1104  const char* string2,
1105  const class ON_Locale& locale,
1106  bool bIgnoreCase
1107  );
1108 
1109  /*
1110  Description:
1111  Compare string1 and string2 by normalizing (NFC) and using invariant culture ordering.
1112  Parameters:
1113  string1 - [in]
1114  element_count1 - [in]
1115  The number of string1[] elements to compare.
1116  If element_count1 < 0, then string1 must be null terminated.
1117  string2 - [in]
1118  element_count2 - [in]
1119  The number of string2[] elements to compare.
1120  If element_count2 < 0, then string2 must be null terminated.
1121  locale - [in]
1122  Typically ON_Locale::Ordinal, ON_Locale::InvariantCulture, or
1123  ON_Locale::CurrentCulture.
1124  bIgnoreCase - [in]
1125  Remarks:
1126  1) Ordinal compares are the fastest.
1127  2) Equal(...) is faster than Compare(...)
1128  */
1129  static int Compare(
1130  const char* string1,
1131  int element_count1,
1132  const char* string2,
1133  int element_count2,
1134  const class ON_Locale& locale,
1135  bool bIgnoreCase
1136  );
1137 
1138  bool EqualOrdinal(
1139  const ON_String& other_string,
1140  bool bOrdinalIgnoreCase
1141  ) const;
1142 
1143  bool EqualOrdinal(
1144  const char* other_string,
1145  bool bOrdinalIgnoreCase
1146  ) const;
1147 
1148  static bool EqualOrdinal(
1149  const char* string1,
1150  const char* string2,
1151  bool bOrdinalIgnoreCase
1152  );
1153 
1154  static bool EqualOrdinal(
1155  const char* string1,
1156  int element_count1,
1157  const char* string2,
1158  int element_count2,
1159  bool bOrdinalIgnoreCase
1160  );
1161 
1162  /*
1163  Description:
1164  Compare this string and other_string unsigned byte by unsigned byte.
1165  Parameters:
1166  other_string - [in]
1167  bIgnoreCase - [in]
1168  Remarks:
1169  1) If the string is UTF-8 encoded and bOrdinalIgnoreCase is true, only
1170  small latin a - z and capital latin A - Z are considered equal. It is
1171  imposible to ignore case for any other values in an ordinal compare.
1172 
1173  2) If you are comparing file system paths, you should use ComparePath().
1174 
1175  3) If locale, linguistic issues, UTF-8 encoding issues or unicode normalization
1176  or collation issues need to be considered, then CompareOrdinal() is
1177  the wrong function to use.
1178  */
1179  int CompareOrdinal(
1180  const ON_String& other_string,
1181  bool bIgnoreCase
1182  ) const;
1183 
1184  int CompareOrdinal(
1185  const char* other_string,
1186  bool bIgnoreCase
1187  ) const;
1188 
1189  /*
1190  Description:
1191  Compare string1 and string2 unsigned byte by unsigned byte.
1192  Parameters:
1193  string1 - [in]
1194  string2 - [in]
1195  bIgnoreCase - [in]
1196  Remarks:
1197  1) If the string is UTF-8 encoded and bOrdinalIgnoreCase is true, only
1198  small latin a - z and capital latin A - Z are considered equal. It is
1199  imposible to ignore case for any other values in a UTF-8 ordinal compare.
1200 
1201  2) If you are comparing file system paths, you should use ComparePath().
1202 
1203  3) If locale, linguistic issues, UTF-8 encoding issues or unicode normalization
1204  or collation issues need to be considered, then CompareOrdinal() is
1205  the wrong function to use.
1206  */
1207  static int CompareOrdinal(
1208  const char* string1,
1209  const char* string2,
1210  bool bIgnoreCase
1211  );
1212 
1213  /*
1214  Description:
1215  Compare string1 and string2 unsigned byte by unsigned byte.
1216  Parameters:
1217  string1 - [in]
1218  element_count1 - [in]
1219  The number of elements in string1[] to compare.
1220  If element_count1 < 1, string1 must be null terminated and every element
1221  before the null terminator will be compared.
1222  string2 - [in]
1223  element_count2 - [in]
1224  The number of elements in string2[] to compare.
1225  If element_count2 < 1, string2 must be null terminated and every element
1226  before the null terminator will be compared.
1227  bOrdinalIgnoreCase - [in]
1228  If true, elements with values a-z are compared as if they had values A-Z.
1229  Remarks:
1230  1) If the string is UTF-8 encoded and bOrdinalIgnoreCase is true, only
1231  small latin a - z and capital latin A - Z are considered equal. It is
1232  imposible to ignore case for any other values in a UTF-8 ordinal compare.
1233 
1234  2) If you are comparing file system paths, you should use ComparePath().
1235 
1236  3) If locale, linguistic issues, UTF-8 encoding issues or unicode normalization
1237  or collation issues need to be considered, then CompareOrdinal() is
1238  the wrong function to use.
1239  */
1240  static int CompareOrdinal(
1241  const char* string1,
1242  int element_count1,
1243  const char* string2,
1244  int element_count2,
1245  bool bOrdinalIgnoreCase
1246  );
1247 
1248  /*
1249  Description:
1250  Compare this string and other_path as file system paths using
1251  appropriate tests for the current operating system.
1252  Parameters:
1253  other_path - [in]
1254  Remarks:
1255  1) Windows and UNIX directory separators (/ and \) are considered equal.
1256 
1257  2) Case is ignored when the file system is not case sensitive, like Windows.
1258 
1259  3) String normalization appropriate for the current operating system
1260  is performed.
1261  */
1262  int ComparePath(
1263  const char* other_path
1264  ) const;
1265 
1266  bool EqualPath(
1267  const char* other_path
1268  ) const;
1269 
1270  /*
1271  Description:
1272  Compare sPath1 and sPath2 as file system paths using
1273  appropriate tests for the current operating system.
1274  Parameters:
1275  path1 - [in]
1276  null terminated string
1277  path2 - [in]
1278  null terminated string
1279  Remarks:
1280  1) Windows and UNIX directory separators (/ and \) are considered equal.
1281 
1282  2) Case is ignored when the file system is not case sensitive, like Windows.
1283 
1284  3) String normalization appropriate for the current operating system
1285  is performed.
1286  */
1287  static int ComparePath(
1288  const char* path1,
1289  const char* path2
1290  );
1291 
1292  static bool EqualPath(
1293  const char* path1,
1294  const char* path2
1295  );
1296 
1297  /*
1298  Description:
1299  Compare sPath1 and sPath2 as file system paths using
1300  appropriate tests for the current operating system.
1301  Parameters:
1302  path1 - [in]
1303  maximum_element_count1 - [in]
1304  path2 - [in]
1305  maximum_element_count2 - [in]
1306  Remarks:
1307  1) Windows and UNIX directory separators (/ and \) are considered equal.
1308 
1309  2) Case is ignored when the file system is not case sensitive, like Windows.
1310 
1311  3) String normalization appropriate for the current operating system
1312  is performed.
1313  */
1314  static int ComparePath(
1315  const char* path1,
1316  int element_count1,
1317  const char* path2,
1318  int element_count2
1319  );
1320 
1321  static bool EqualPath(
1322  const char* path1,
1323  int element_count1,
1324  const char* path2,
1325  int element_count2
1326  );
1327 
1328  /*
1329  Description:
1330  Compare this string and other_name as a name attribute of an object
1331  like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on.
1332  These comparisons ignore case and use appropriate string normalization.
1333  Parameters:
1334  other_name - [in]
1335  null terminated string
1336  */
1337  int CompareAttributeName(
1338  const char* other_name
1339  ) const;
1340  bool EqualAttributeName(
1341  const char* other_name
1342  ) const;
1343 
1344  /*
1345  Description:
1346  Compare this string and other_name as a name attribute of an object
1347  like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on.
1348  These comparisons ignore case and use appropriate string normalization.
1349  Parameters:
1350  name1 - [in]
1351  null terminated string
1352  name2 - [in]
1353  null terminated string
1354  */
1355  static int CompareAttributeName(
1356  const char* name1,
1357  const char* name2
1358  );
1359  static bool EqualAttributeName(
1360  const char* name1,
1361  const char* name2
1362  );
1363 
1364  // Description:
1365  // Simple case sensitive wildcard matching. A question mark (?) in the
1366  // pattern matches a single character. An asterisk (*) in the pattern
1367  // mathes zero or more occurances of any character.
1368  //
1369  // Parameters:
1370  // pattern - [in] pattern string where ? and * are wild cards.
1371  //
1372  // Returns:
1373  // true if the string mathes the wild card pattern.
1374  bool WildCardMatch( const char* ) const;
1375  bool WildCardMatch( const unsigned char* ) const;
1376 
1377  // Description:
1378  // Simple case insensitive wildcard matching. A question mark (?) in the
1379  // pattern matches a single character. An asterisk (*) in the pattern
1380  // mathes zero or more occurances of any character.
1381  //
1382  // Parameters:
1383  // pattern - [in] pattern string where ? and * are wild cards.
1384  //
1385  // Returns:
1386  // true if the string mathes the wild card pattern.
1387  bool WildCardMatchNoCase( const char* ) const;
1388  bool WildCardMatchNoCase( const unsigned char* ) const;
1389 
1390  /*
1391  Description:
1392  Replace all substrings that match token1 with token2
1393  Parameters:
1394  token1 - [in]
1395  token2 - [in]
1396  Returns:
1397  Number of times token1 was replaced with token2.
1398  */
1399  int Replace( const char* token1, const char* token2 );
1400  int Replace( const unsigned char* token1, const unsigned char* token2 );
1401  int Replace(char utf8_single_byte_c1, char utf8_single_byte_c2);
1402  int Replace(unsigned char utf8_single_byte_c1, unsigned char utf8_single_byte_c2);
1403 
1404 
1405  // simple sub-string extraction
1406  ON_String Mid(
1407  int, // index of first char
1408  int // count
1409  ) const;
1410  ON_String Mid(
1411  int // index of first char
1412  ) const;
1413  ON_String Left(
1414  int // number of chars to keep
1415  ) const;
1416  ON_String Right(
1417  int // number of chars to keep
1418  ) const;
1419 
1420  /*
1421  Description:
1422  Map a single byte UTF-8 element to upper or lower case.
1423  Parameters:
1424  c - [in]
1425  If c is in the range A to Z or a to z, the map specified
1426  by map_type is applied. All other values of c are
1427  unchanged.
1428  Remarks:
1429  MapCharacterOrdinal is not appropriate for general string mapping.
1430  */
1431  static char MapCharacterOrdinal(
1432  ON_StringMapOrdinalType map_type,
1433  char c
1434  );
1435 
1436  ON_String MapStringOrdinal(
1437  ON_StringMapOrdinalType map_type
1438  ) const;
1439 
1440 
1441  /*
1442  Description:
1443  Map a wchar_t string.
1444  Parameters:
1445  map_type - [in]
1446  string - [in]
1447  element_count - [in]
1448  number of string[] elements to map.
1449  If element_count < 0, then ON_wString::Length(string) elements are mapped.
1450  mapped_string - [out]
1451  mapped_string_capacity - [in]
1452  number of available elements in mapped_string[].
1453  map_type - [in]
1454  Returns:
1455  Number of mapped_string[] elements that were mapped from string[].
1456 
1457  When the number of string[] input elements is >= mapped_string_capacity,
1458  mapped_string_capacity mapped_string[] elements are set and
1459  mapped_string_capacity is returned.
1460 
1461  When the return value is < mapped_string_capacity, a null terminator
1462  is appended after the last mapped element.
1463  */
1464  static int MapStringOrdinal(
1465  ON_StringMapOrdinalType map_type,
1466  const char* string,
1467  int element_count,
1468  char* mapped_string,
1469  int mapped_string_capacity
1470  );
1471 
1472  ON_String MapString(
1473  const class ON_Locale& locale,
1474  ON_StringMapType map_type
1475  ) const;
1476 
1477  static ON_String MapString(
1478  const class ON_Locale& locale,
1479  ON_StringMapType map_type,
1480  const char* string,
1481  int element_count
1482  );
1483 
1484  /*
1485  Description:
1486  Maps element_count elements of string[] to mapped_string[].
1487 
1488  Parameters:
1489  locale - [in]
1490  Locale to use when converting case. It is common to pass one of
1491  the preset locales ON_Locale::Ordinal, ON_Locale::InvariantCulture,
1492  or ON_Locale::m_CurrentCulture.
1493 
1494  map_type - [in]
1495  selects the mapping
1496 
1497  string - [in]
1498  input string to map.
1499 
1500  element_count - [in]
1501  The number of char elements to map from input string[].
1502 
1503  If element_count < 1, then string[] must be null terminated and
1504  ON_wString::Length(string)+1 elements are mapped.
1505  The +1 insures the output is null terminated.
1506 
1507  mapped_string - [out]
1508  The result of the mapping is returned in mapped_string[].
1509 
1510  mapped_string_capacity - [in]
1511  Number of char elements available in mapped_string[]
1512  or 0 to calculate the minimum number of elements needed
1513  for the mapping.
1514 
1515  Returns:
1516  If mapped_string_capacity > 0, then the number elements set in mapped_string[]
1517  is returned.
1518 
1519  If mapped_string_capacity == 0, then the number elements required to perform
1520  the mapping is returned.
1521 
1522  When there is room, mapped_string[] is null terminated.
1523 
1524  0: Failure.
1525  */
1526  static int MapString(
1527  const class ON_Locale& locale,
1528  ON_StringMapType map_type,
1529  const char* string,
1530  int element_count,
1531  char* mapped_string,
1532  int mapped_string_capacity
1533  );
1534 
1535  // upper/lower/reverse conversion
1536  /*ON_DEPRECATED */ void MakeUpper();
1537  /*ON_DEPRECATED */void MakeLower();
1538  void MakeUpperOrdinal();
1539  void MakeLowerOrdinal();
1540 
1541  const ON_SHA1_Hash ContentHash(
1542  ON_StringMapOrdinalType mapping
1543  ) const;
1544 
1545  ON_String Reverse() const;
1546 
1547  static char* Reverse(
1548  char* string,
1549  int element_count
1550  );
1551 
1552  void MakeReverse();
1553 
1554  void TrimLeft(const char* = nullptr);
1555  void TrimRight(const char* = nullptr);
1556  void TrimLeftAndRight(const char* = nullptr);
1557 
1558  // remove occurrences of chRemove
1559  int Remove(const char utf8_single_byte_c);
1560 
1561  // searching (return starting index, or -1 if not found)
1562  // look for a single character match
1563  int Find(
1564  char utf8_single_byte_c
1565  ) const;
1566  int Find(
1567  unsigned char utf8_single_byte_c
1568  ) const;
1569  int ReverseFind(
1570  char utf8_single_byte_c
1571  ) const;
1572  int ReverseFind(
1573  unsigned char utf8_single_byte_c
1574  ) const;
1575 
1576  // look for a specific sub-string
1577  int Find(
1578  const char*
1579  ) const;
1580  int Find(
1581  const unsigned char*
1582  ) const;
1583  int Find(
1584  const char*,
1585  int start_index
1586  ) const;
1587  int Find(
1588  const unsigned char*,
1589  int start_index
1590  ) const;
1591  int ReverseFind(
1592  const char*
1593  ) const;
1594  int ReverseFind(
1595  const unsigned char*
1596  ) const;
1597 
1598  // It is common to format single numbers into strings
1599  // and the FromNumber and FromDouble functions are
1600  // the fastest way to do this and provide consistent results.
1601  // They return a pointer to their buffer so the can be used
1602  // as function parameters.
1603  static const ON_String FromNumber(
1604  char n
1605  );
1606  static const ON_String FromNumber(
1607  unsigned char n
1608  );
1609  static const ON_String FromNumber(
1610  short n
1611  );
1612  static const ON_String FromNumber(
1613  unsigned short n
1614  );
1615  static const ON_String FromNumber(
1616  int n
1617  );
1618  static const ON_String FromNumber(
1619  unsigned int n
1620  );
1621  static const ON_String FromNumber(
1622  ON__INT64 n
1623  );
1624  static const ON_String FromNumber(
1625  ON__UINT64 n
1626  );
1627  static const ON_String FromNumber(
1628  double d // "%g" format
1629  );
1630  static const ON_String ApproximateFromNumber(
1631  double d // "%f" when possible, otherwise "%g"
1632  );
1633  static const ON_String PreciseFromNumber(
1634  double d // "%.17g"
1635  );
1636 
1637 
1638  /*
1639  Description:
1640  Each byte value is converted to 2 hexadecimal digits.
1641  Parameters:
1642  bytes - [in]
1643  list of byte values
1644  byte_count - [in]
1645  Number of byte values in bytes[] array.
1646  bCapitalDigits - [in]
1647  false: Use 0-9, a - b
1648  true: Use 0-9, A - F
1649  bReverse - [in]
1650  false:
1651  The digist in the string will be in the order
1652  bytes[0], bytes[1], ..., bytes[byte_count-1].
1653  true:
1654  The digist in the string will be in the order
1655  bytes[byte_count-1], ..., bytes[1], bytes[0].
1656  */
1657  static const ON_String HexadecimalFromBytes(
1658  const ON__UINT8* bytes,
1659  size_t byte_count,
1660  bool bCapitalDigits,
1661  bool bReverse
1662  );
1663 
1664  /*
1665  Parameters:
1666  format - [in]
1667  Format control.
1668  Positional paramters of the form %N$x where N >= 1 and x
1669  is the standard format specification are supported.
1670  Avoid using %S (capital S). See the Remarks for details.
1671  ... - [in]
1672  arguments for replacable items in the format string.
1673  Returns:
1674  True if successful.
1675  False if the string is too long or the format string is not valid.
1676  Remarks:
1677  When using Microsoft's compiler and other compilers that provide similar
1678  locale support, the locale is the invariant culture locale returned by
1679  ON_Locale::InvariantCulture::LocalePtr().
1680 
1681  The way Windows handles the %S (capital S) format parameter depends on locale
1682  and code page settings. It is strongly reccommended that you never use %S to
1683  include any string that may possibly contain elements with values > 127.
1684  The following examples illustrate a way to predictably use UTF-8 and wchar_t
1685  parameters in buffers of the other element type.
1686 
1687  const char* utf8_string = ...;
1688  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",utf8_string);
1689  // The code below will treat utf8_string as a UTF-8 encoded string.
1690  wchar_t wchar_buffer[...];
1691  const size_t wchar_buffer_capacity= sizeof(buffer)/sizeof(buffer[0]);
1692  ON_wString::Format(wchar_buffer, wchar_buffer_capacity, "%s", ON_wString(utf8_string));
1693 
1694  const wchar_t* wide_string = ...;
1695  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",char_string);
1696  // The code below will include wide_string as a UTF-8 encoded string.
1697  char char_buffer[...];
1698  const size_t char_buffer_capacity = sizeof(buffer)/sizeof(buffer[0]);
1699  ON_String::Format(char_buffer, char_buffer_capacity, "%s", ON_String(wide_string));
1700  */
1701  bool ON_VARGS_FUNC_CDECL Format(
1702  const char* format,
1703  ...
1704  );
1705 
1706  bool ON_VARGS_FUNC_CDECL Format(
1707  const unsigned char* format,
1708  ...
1709  );
1710 
1711  static const ON_wString ON_VARGS_FUNC_CDECL FormatToString(
1712  const char* format,
1713  ...
1714  );
1715 
1716  bool FormatVargs(
1717  const char* format,
1718  va_list args
1719  );
1720 
1721  bool FormatVargs(
1722  const unsigned char* format,
1723  va_list args
1724  );
1725 
1726  /*
1727  Description:
1728  A platform independent, secure, culture invariant way to format a char string.
1729  This function is provide to be used when it is critical that
1730  the formatting be platform independent, secure and culture invarient.
1731  Parameters:
1732  buffer - [out]
1733  not null
1734  buffer_capacity - [in]
1735  > 0
1736  Number of char elements in buffer.
1737  sFormat - [in]
1738  Avoid using %S (capital S). See the Remarks for details.
1739  ... - [in]
1740  Returns:
1741  >= 0:
1742  The number of char elements written to buffer[], not including the null terminator.
1743  A null terminator is always added (buffer[returned value] = 0).
1744  The last element of buffer[] is always set to zero (buffer[buffer_capacity-1] = 0).
1745  < 0: failure:
1746  If buffer is not null and buffer_capacity > 0, then buffer[0] = 0 and buffer[buffer_capacity-1] = 0;
1747  Remarks:
1748  The way Windows handles the %S (capital S) format parameter depends on locale
1749  and code page settings. It is strongly reccommended that you never use %S to
1750  include any string that may possibly contain elements with values > 127.
1751  The following examples illustrate a way to predictably use UTF-8 and wchar_t
1752  parameters in buffers of the other element type.
1753 
1754  const char* utf8_string = ...;
1755  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",utf8_string);
1756  wchar_t wchar_buffer[...];
1757  const size_t wchar_buffer_capacity= sizeof(buffer)/sizeof(buffer[0]);
1758  ON_wString::Format(wchar_buffer, wchar_buffer_capacity, "%s", ON_wString(utf8_string));
1759 
1760  const wchar_t* wide_string = ...;
1761  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",char_string);
1762  char char_buffer[...];
1763  const size_t char_buffer_capacity = sizeof(buffer)/sizeof(buffer[0]);
1764  ON_String::Format(char_buffer, char_buffer_capacity, "%s", ON_String(wide_string));
1765  */
1766  static int ON_VARGS_FUNC_CDECL FormatIntoBuffer(
1767  char* buffer,
1768  size_t buffer_capacity,
1769  const char* format,
1770  ...
1771  );
1772 
1773  static int ON_VARGS_FUNC_CDECL FormatIntoBuffer(
1774  ON_StringBuffer& buffer,
1775  const char* format,
1776  ...
1777  );
1778 
1779  static int FormatVargsIntoBuffer(
1780  char* buffer,
1781  size_t buffer_capacity,
1782  const char* format,
1783  va_list args
1784  );
1785 
1786  static int FormatVargsIntoBuffer(
1787  ON_StringBuffer& buffer,
1788  const char* format,
1789  va_list args
1790  );
1791 
1792  /*
1793  Returns:
1794  >= 0:
1795  Number of char elements in the formatted string, not including the null terminator.
1796  < 0:
1797  Invalid input
1798  */
1799  static int FormatVargsOutputCount(
1800  const char* format,
1801  va_list args
1802  );
1803 
1804  /*
1805  Parameters:
1806  format - [in]
1807  null terminated string to scan
1808  ... - [out]
1809  pointers to elements to assign.
1810  Returns:
1811  >= 0: number of fields successfully converted and assigned.
1812  <0: failure
1813  */
1814  int ON_VARGS_FUNC_CDECL Scan(
1815  const char* format,
1816  ...
1817  );
1818 
1819  int ON_VARGS_FUNC_CDECL Scan(
1820  const unsigned char* format,
1821  ...
1822  );
1823 
1824  static int ON_VARGS_FUNC_CDECL ScanBuffer(
1825  const char* buffer,
1826  const char* format,
1827  ...
1828  );
1829 
1830  static int ON_VARGS_FUNC_CDECL ScanBuffer(
1831  const unsigned char* buffer,
1832  const unsigned char* format,
1833  ...
1834  );
1835 
1836  static int ScanBufferVargs(
1837  const char* buffer,
1838  const char* format,
1839  va_list args
1840  );
1841 
1842  static int ScanBufferVargs(
1843  const unsigned char* buffer,
1844  const unsigned char* format,
1845  va_list args
1846  );
1847 
1848 
1849  /*
1850  Parameters:
1851  buffer - [in]
1852  decimal number
1853  Returns:
1854  not zero:
1855  pointer to the first character that was not scanned
1856  nullptr:
1857  failure
1858  */
1859  static const char* ToNumber(
1860  const char* buffer,
1861  char value_on_failure,
1862  char* value
1863  );
1864  static const char* ToNumber(
1865  const char* buffer,
1866  unsigned char value_on_failure,
1867  unsigned char* value
1868  );
1869  static const char* ToNumber(
1870  const char* buffer,
1871  short value_on_failure,
1872  short* value
1873  );
1874  static const char* ToNumber(
1875  const char* buffer,
1876  unsigned short value_on_failure,
1877  unsigned short* value
1878  );
1879  static const char* ToNumber(
1880  const char* buffer,
1881  int value_on_failure,
1882  int* value
1883  );
1884  static const char* ToNumber(
1885  const char* buffer,
1886  unsigned int value_on_failure,
1887  unsigned int* value
1888  );
1889  static const char* ToNumber(
1890  const char* buffer,
1891  ON__INT64 value_on_failure,
1892  ON__INT64* value
1893  );
1894  static const char* ToNumber(
1895  const char* buffer,
1896  ON__UINT64 value_on_failure,
1897  ON__UINT64* value
1898  );
1899  static const char* ToNumber(
1900  const char* buffer,
1901  double value_on_failure,
1902  double* value
1903  );
1904 
1905 
1906  // Low level access to string contents as character array
1907  char* ReserveArray(size_t); // make sure internal array has at least
1908  // the requested capacity.
1909  void ShrinkArray(); // shrink internal storage to minimum size
1910  char* SetLength(size_t); // set length (<=capacity)
1911  char* Array();
1912  const char* Array() const;
1913 
1914  /*
1915  Returns:
1916  Total number of bytes of memory used by this class.
1917  (For use in ON_Object::SizeOf() overrides.
1918  */
1919  unsigned int SizeOf() const;
1920 
1921  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
1922 
1923  /*
1924  OBSOLETE - use ON_FileSystemPath::SplitPath
1925  */
1926  static void SplitPath(
1927  const char* path,
1928  ON_String* drive,
1929  ON_String* dir,
1930  ON_String* fname,
1931  ON_String* ext
1932  );
1933 
1934 public:
1935  ~ON_String();
1936 
1937 protected:
1938  // Implementation
1939  char* m_s; // pointer to ref counted string array
1940  // m_s - 12 bytes points at the string's ON_aStringHeader
1941 
1942  // implementation helpers
1943  struct ON_aStringHeader* Header() const;
1944  char* CreateArray(int);
1945  void CopyArray();
1946  void CopyToArray( const ON_String& );
1947  void CopyToArray( int, const char* );
1948  void CopyToArray( int, const unsigned char* );
1949  void CopyToArray( int, const wchar_t* );
1950  void AppendToArray( const ON_String& );
1951  void AppendToArray( int, const char* );
1952  void AppendToArray( int, const unsigned char* );
1953 };
1954 
1955 /*
1956 Returns:
1957  True if lhs and rhs are identical as arrays of char elements.
1958 */
1959 ON_DECL
1960 bool operator==( const ON_String& lhs, const ON_String& rhs );
1961 
1962 /*
1963 Returns:
1964  True if lhs and rhs are not identical as arrays of char elements.
1965 */
1966 ON_DECL
1967 bool operator!=(const ON_String& lhs, const ON_String& rhs);
1968 
1969 /*
1970 Returns:
1971  True if lhs is less than rhs as an array of unsigned bytes.
1972 */
1973 ON_DECL
1974 bool operator<(const ON_String& lhs, const ON_String& rhs);
1975 
1976 /*
1977 Returns:
1978  True if lhs is greater than rhs as an array of unsigned bytes.
1979 */
1980 ON_DECL
1981 bool operator>(const ON_String& lhs, const ON_String& rhs);
1982 
1983 /*
1984 Returns:
1985  True if lhs is less than or equal to rhs as an array of unsigned bytes.
1986 */
1987 ON_DECL
1988 bool operator<=(const ON_String& lhs, const ON_String& rhs);
1989 
1990 /*
1991 Returns:
1992  True if lhs is greater than or equal to rhs as an array of unsigned bytes.
1993 */
1994 ON_DECL
1995 bool operator>=(const ON_String& lhs, const ON_String& rhs);
1996 
1997 /*
1998 Returns:
1999  True if lhs and rhs are identical as arrays of char elements.
2000 */
2001 ON_DECL
2002 bool operator==( const ON_String& lhs, const char* rhs );
2003 
2004 /*
2005 Returns:
2006  True if lhs and rhs are not identical as arrays of char elements.
2007 */
2008 ON_DECL
2009 bool operator!=(const ON_String& lhs, const char* rhs);
2010 
2011 /*
2012 Returns:
2013  True if lhs is less than rhs as an array of unsigned bytes.
2014 */
2015 ON_DECL
2016 bool operator<(const ON_String& lhs, const char* rhs);
2017 
2018 /*
2019 Returns:
2020  True if lhs is greater than rhs as an array of unsigned bytes.
2021 */
2022 ON_DECL
2023 bool operator>(const ON_String& lhs, const char* rhs);
2024 
2025 /*
2026 Returns:
2027  True if lhs is less than or equal to rhs as an array of unsigned bytes.
2028 */
2029 ON_DECL
2030 bool operator<=(const ON_String& lhs, const char* rhs);
2031 
2032 /*
2033 Returns:
2034  True if lhs is greater than or equal to rhs as an array of unsigned bytes.
2035 */
2036 ON_DECL
2037 bool operator>=(const ON_String& lhs, const char* rhs);
2038 
2039 /*
2040 Returns:
2041  True if lhs and rhs are identical as arrays of char elements.
2042 */
2043 ON_DECL
2044 bool operator==( const char* lhs, const ON_String& rhs );
2045 
2046 /*
2047 Returns:
2048  True if lhs and rhs are not identical as arrays of char elements.
2049 */
2050 ON_DECL
2051 bool operator!=(const char* lhs, const ON_String& rhs);
2052 
2053 /*
2054 Returns:
2055  True if lhs is less than rhs as an array of unsigned bytes.
2056 */
2057 ON_DECL
2058 bool operator<(const char* lhs, const ON_String& rhs);
2059 
2060 /*
2061 Returns:
2062  True if lhs is greater than rhs as an array of unsigned bytes.
2063 */
2064 ON_DECL
2065 bool operator>(const char* lhs, const ON_String& rhs);
2066 
2067 /*
2068 Returns:
2069  True if lhs is less than or equal to rhs as an array of unsigned bytes.
2070 */
2071 ON_DECL
2072 bool operator<=(const char* lhs, const ON_String& rhs);
2073 
2074 /*
2075 Returns:
2076  True if lhs is greater than or equal to rhs as an array of unsigned bytes.
2077 */
2078 ON_DECL
2079 bool operator>=(const char* lhs, const ON_String& rhs);
2080 
2081 /////////////////////////////////////////////////////////////////////////////
2082 /////////////////////////////////////////////////////////////////////////////
2083 /////////////////////////////////////////////////////////////////////////////
2084 /////////////////////////////////////////////////////////////////////////////
2085 //
2086 // ON_wString
2087 //
2088 
2089 class ON_CLASS ON_wString
2090 {
2091 public:
2092 
2093  // ON_String::EmptyString has length 0.
2094  // const char* s = ON_String::EmptyString sets s to L"".
2095  static const ON_wString EmptyString;
2096 
2097  static const wchar_t Backspace; // Unicode BACKSPACE control U+0008
2098  static const wchar_t Tab; // Unicode CHARACTER TABULATION control U+0009
2099  static const wchar_t LineFeed; // Unicode LINE FEED control U+000A
2100  static const wchar_t VerticalTab; // Unicode LINE TABULATION control U+000B
2101  static const wchar_t FormFeed; // Unicode FORM FEED control U+000C
2102  static const wchar_t CarriageReturn; // Unicode CARRIAGE RETURN control U+000D
2103  static const wchar_t Escape; // Unicode CARRIAGE RETURN control U+001B
2104  static const wchar_t Space; // Unicode SPACE U+0020
2105  static const wchar_t Slash; // Unicode SOLIDUS U+002F
2106  static const wchar_t Backslash; // Unicode REVERSE SOLIDUS U+005C
2107  static const wchar_t Pipe; // Unicode VERTICAL LINE U+007C
2108 
2109 #if defined(ON_SIZEOF_WCHAR_T) && ON_SIZEOF_WCHAR_T >= 2
2110  // Never cast these values as "char"
2111  // The UTF-8 representation of any Unicode code point with value > 127
2112  // requires multiple bytes.
2113  static const wchar_t RadiusSymbol; // Unicode LATIN CAPITAL LETTER R U+0052
2114  static const wchar_t DegreeSymbol; // Unicode DEGREE SIGN U+00B0
2115  static const wchar_t PlusMinusSymbol; // Unicode PLUS-MINUS SIGN U+00B1
2116  static const wchar_t DiameterSymbol; // Unicode LATIN CAPITAL LETTER O WITH STROKE U+00D8
2117  static const wchar_t RecyclingSymbol; // Unicode UNIVERSAL RECYCLING SYMBOL U+2672 (decimal 9842)
2118  static const wchar_t ReplacementCharacter; // Unicode REPLACEMENT CHARACTER U+FFFD
2119  static const wchar_t NextLine; // Unicode NEXT LINE (NEL) U+0085
2120  static const wchar_t LineSeparator; // LINE SEPARATOR U+2028 unambiguous line separator
2121  static const wchar_t ParagraphSeparator; // PARAGRAPH SEPARATOR U+2028 unambiguous paragraph separator
2122  static const wchar_t NoBreakSpace; // NO-BREAK SPACE (NBSP)
2123  static const wchar_t NarrowNoBreakSpace; // NARROW NO-BREAK SPACE (NNBSP)
2124  static const wchar_t ZeroWidthSpace; // ZERO WIDTH SPACE (ZWSP)
2125 #endif
2126 
2127 private:
2128  // Use IsEmpty() or IsNotEmpty() when you want a bool
2129  // to test for the empty string.
2130  explicit operator bool() const { return IsNotEmpty(); }
2131 public:
2132 
2133 // Constructors
2134  ON_wString() ON_NOEXCEPT;
2135  ON_wString( const ON_wString& );
2136 
2137 #if defined(ON_HAS_RVALUEREF)
2138  // Clone constructor
2139  ON_wString( ON_wString&& ) ON_NOEXCEPT;
2140 
2141  // Clone Assignment operator
2142  ON_wString& operator=( ON_wString&& ) ON_NOEXCEPT;
2143 #endif
2144 
2145  ON_wString( const ON_String& src ); // src = UTF-8 string
2146 
2147  ON_wString( const char* src ); // src = nul; terminated UTF-8 string
2148  ON_wString( const char* src, int /*length*/ ); // from UTF-8 substring
2149  ON_wString( char, int = 1 /* repeat count */ );
2150 
2151  ON_wString( const unsigned char* src); // src = nul; terminated UTF-8 string
2152  ON_wString( const unsigned char*src, int /*length*/ ); // from UTF-8 substring
2153  ON_wString( unsigned char, int = 1 /* repeat count */ );
2154 
2155  ON_wString( const wchar_t* );
2156  ON_wString( const wchar_t*, int /*length*/ ); // from substring
2157  ON_wString( wchar_t, int = 1 /* repeat count */ );
2158 
2159 #if defined(ON_RUNTIME_WIN)
2160  // Windows support
2161  bool LoadResourceString(HINSTANCE, UINT); // load from string resource
2162  // 2047 characters max
2163 #endif
2164 
2165  void Create();
2166  void Destroy(); // releases any memory and initializes to default empty string
2167  void EmergencyDestroy();
2168 
2169  /*
2170  Description:
2171  Enables reference counting. I limited cases, this is useful
2172  for large strings or strings that are frequently passed around.
2173  Reference counted strings must be carefully managed in
2174  when multi-threading is used.
2175  Parameters:
2176  If EnableReferenceCounting()
2177  is not called, then the string will not be referanceThe default is to not use
2178  reference counted strings.
2179  */
2180  void EnableReferenceCounting( bool bEnable );
2181 
2182  /*
2183  Returns:
2184  True if the string is reference counted.
2185  */
2186  bool IsReferenceCounted() const;
2187 
2188  // Attributes & Operations
2189 
2190  /*
2191  Returns:
2192  number of nonzero elements in string.
2193  */
2194  int Length() const;
2195 
2196  /*
2197  Returns:
2198  number of nonzero elements in the string.
2199  */
2200  unsigned int UnsignedLength() const;
2201 
2202  /*
2203  Returns:
2204  number of nonzero elements in string before the first null terminator.
2205  If string is nullptr, 0 is returned.
2206  */
2207  static int Length(
2208  const wchar_t* string
2209  );
2210 
2211  /*
2212  Returns:
2213  number of nonzero elements in string before the first null terminator.
2214  If string is nullptr, 0 is returned.
2215  */
2216  static unsigned int UnsignedLength(
2217  const wchar_t* string
2218  );
2219 
2220  bool IsEmpty() const;
2221  bool IsNotEmpty() const; // returns true if length > 0
2222  void Empty(); // sets length to zero - if possible, memory is retained
2223 
2224  wchar_t& operator[](int);
2225  wchar_t operator[](int) const;
2226  wchar_t GetAt(int) const;
2227  void SetAt(int, char);
2228  void SetAt(int, unsigned char);
2229  void SetAt(int, wchar_t);
2230 
2231  operator const wchar_t*() const;
2232 
2233  // overloaded assignment
2234  const ON_wString& operator=(const ON_wString&);
2235  const ON_wString& operator=(const ON_String& src); // src = UTF-8 string
2236  const ON_wString& operator=(char);
2237  const ON_wString& operator=(const char* src); // src = UTF-8 string
2238  const ON_wString& operator=(unsigned char);
2239  const ON_wString& operator=(const unsigned char* src); // src = UTF-8 string
2240  const ON_wString& operator=(wchar_t);
2241  const ON_wString& operator=(const wchar_t*);
2242 
2243  // string concatenation
2244  void Append( const char* sUTF8, int ); // append specified number of elements from a UTF-8 string
2245  void Append( const unsigned char* sUTF8, int ); // append specified number of elements from a UTF-8 string
2246  void Append( const wchar_t*, int ); // append specified number of elements
2247  const ON_wString& operator+=(const ON_wString&);
2248  const ON_wString& operator+=(const ON_String& sUTF8); // append UTF-8 string
2249  const ON_wString& operator+=(char);
2250  const ON_wString& operator+=(unsigned char);
2251  const ON_wString& operator+=(wchar_t);
2252  const ON_wString& operator+=(const char* sUTF8); // append UTF-8 string
2253  const ON_wString& operator+=(const unsigned char* sUTF8); // append UTF-8 string
2254  const ON_wString& operator+=(const wchar_t*);
2255 
2256  // operator+()
2257  ON_wString operator+(const ON_wString&) const;
2258  ON_wString operator+(const ON_String& sUTF8) const; // concatinate with a UTF-8 string
2259  ON_wString operator+(char) const;
2260  ON_wString operator+(unsigned char) const;
2261  ON_wString operator+(wchar_t) const;
2262  ON_wString operator+(const char* sUTF8) const; // concatinate with a UTF-8 string
2263  ON_wString operator+(const unsigned char* sUTF8) const; // concatinate with a UTF-8 string
2264  ON_wString operator+(const wchar_t*) const;
2265 
2266  // Use CompareOrdinal(), ComparePath(), CompareAttributeName(), or a test that is linguistically apprropriate
2267  //ON_DEPRECATED // deprecation in progress
2268  int Compare( const wchar_t* ) const;
2269 
2270  // Use CompareOrdinal(), ComparePath(), CompareAttributeName(), or a test that is linguistically apprropriate
2271  // ON_DEPRECATED // deprecation in progress
2272  int CompareNoCase( const wchar_t* ) const;
2273 
2274  bool Equal(
2275  const ON_wString& other_string,
2276  const class ON_Locale& locale,
2277  bool bIgnoreCase
2278  ) const;
2279 
2280  bool Equal(
2281  const wchar_t* other_string,
2282  const class ON_Locale& locale,
2283  bool bIgnoreCase
2284  ) const;
2285 
2286  static bool Equal(
2287  const wchar_t* string1,
2288  const wchar_t* string2,
2289  const class ON_Locale& locale,
2290  bool bIgnoreCase
2291  );
2292 
2293  /*
2294  Description:
2295  Determine if string 1 and string2 are equal.
2296  Parameters:
2297  string1 - [in]
2298  element_count1 - [in]
2299  The number of string1[] elements to test.
2300  If element_count1 < 0, then string1 must nullptr or be null terminated.
2301  string2 - [in]
2302  element_count2 - [in]
2303  The number of string2[] elements to test.
2304  If element_count1 < 0, then string2 must nullptr or be null terminated.
2305  locale - [in]
2306  Typically ON_Locale::Ordinal, ON_Locale::InvariantCulture, or
2307  ON_Locale::CurrentCulture.
2308  bIgnoreCase - [in]
2309  Remarks:
2310  1) Ordinal compares are the fastest.
2311  2) Equal(...) is faster than Compare(...)
2312  */
2313  static bool Equal(
2314  const wchar_t* string1,
2315  int element_count1,
2316  const wchar_t* string2,
2317  int element_count2,
2318  const class ON_Locale& locale,
2319  bool bIgnoreCase
2320  );
2321 
2322  /*
2323  Description:
2324  Compare this string and other_string by normalizing (NFC)
2325  and using invariant culture ordering.
2326  Parameters:
2327  other_string - [in]
2328  bIgnoreCase - [in]
2329  Remarks:
2330  1) Ordinal compares are the fastest.
2331  2) Equal(...) is faster than Compare(...)
2332  */
2333  int Compare(
2334  const ON_wString& other_string,
2335  const class ON_Locale& locale,
2336  bool bIgnoreCase
2337  ) const;
2338 
2339  int Compare(
2340  const wchar_t* other_string,
2341  const class ON_Locale& locale,
2342  bool bIgnoreCase
2343  ) const;
2344 
2345  /*
2346  Description:
2347  Compare string1 and string2 by normalizing (NFC) and using invariant culture ordering.
2348  Parameters:
2349  string1 - [in]
2350  string2 - [in]
2351  bIgnoreCase - [in]
2352  Remarks:
2353  1) Ordinal compares are the fastest.
2354  2) Equal(...) is faster than Compare(...)
2355  */
2356  static int Compare(
2357  const wchar_t* string1,
2358  const wchar_t* string2,
2359  const class ON_Locale& locale,
2360  bool bIgnoreCase
2361  );
2362 
2363  /*
2364  Description:
2365  Compare string1 and string2 by normalizing (NFC) and using invariant culture ordering.
2366  Parameters:
2367  string1 - [in]
2368  element_count1 - [in]
2369  The number of string1[] elements to compare.
2370  If element_count1 < 0, then string1 must be null terminated.
2371  string2 - [in]
2372  element_count2 - [in]
2373  The number of string2[] elements to compare.
2374  If element_count2 < 0, then string2 must be null terminated.
2375  locale - [in]
2376  Typically ON_Locale::Ordinal, ON_Locale::InvariantCulture, or
2377  ON_Locale::CurrentCulture.
2378  bIgnoreCase - [in]
2379  Remarks:
2380  1) Ordinal compares are the fastest.
2381  2) Equal(...) is faster than Compare(...)
2382  */
2383  static int Compare(
2384  const wchar_t* string1,
2385  int element_count1,
2386  const wchar_t* string2,
2387  int element_count2,
2388  const class ON_Locale& locale,
2389  bool bIgnoreCase
2390  );
2391 
2392  bool EqualOrdinal(
2393  const ON_wString& other_string,
2394  bool bOrdinalIgnoreCase
2395  ) const;
2396 
2397  bool EqualOrdinal(
2398  const wchar_t* other_string,
2399  bool bOrdinalIgnoreCase
2400  ) const;
2401 
2402  static bool EqualOrdinal(
2403  const wchar_t* string1,
2404  const wchar_t* string2,
2405  bool bOrdinalIgnoreCase
2406  );
2407 
2408  static bool EqualOrdinal(
2409  const wchar_t* string1,
2410  int element_count1,
2411  const wchar_t* string2,
2412  int element_count2,
2413  bool bOrdinalIgnoreCase
2414  );
2415 
2416 
2417  /*
2418  Description:
2419  Compare this string and other_string wchar_t element by wchar_t element.
2420  Parameters:
2421  other_string - [in]
2422  bOrdinalIgnoreCase - [in]
2423  Remarks:
2424  1) If the string is UTF-8 encoded and bOrdinalIgnoreCase is true, only
2425  small latin a - z and capital latin A - Z are considered equal. It is
2426  imposible to ignore case for any other values in an ordinal compare.
2427 
2428  2) If you are comparing file system paths, you should use ComparePath().
2429 
2430  3) If locale, linguistic issues, UTF-8 encoding issues or unicode normalization
2431  or collation issues need to be considered, then CompareOrdinal() is
2432  the wrong function to use.
2433  */
2434  int CompareOrdinal(
2435  const ON_wString& other_string,
2436  bool bOrdinalIgnoreCase
2437  ) const;
2438 
2439  int CompareOrdinal(
2440  const wchar_t* other_string,
2441  bool bOrdinalIgnoreCase
2442  ) const;
2443 
2444  /*
2445  Description:
2446  Compare this string1 and string2 wchar_t element by wchar_t element.
2447  Parameters:
2448  string1 - [in]
2449  string2 - [in]
2450  bOrdinalIgnoreCase - [in]
2451  If true, elements with values a-z are compared as if they had values A-Z.
2452  Remarks:
2453  1) If the string is UTF-8 encoded and bOrdinalIgnoreCase is true, only
2454  small latin a - z and capital latin A - Z are considered equal. It is
2455  imposible to ignore case for any other values in an ordinal compare.
2456 
2457  2) If you are comparing file system paths, you should use ComparePath().
2458 
2459  3) If locale, linguistic issues, UTF-8 encoding issues or unicode normalization
2460  or collation issues need to be considered, then CompareOrdinal() is
2461  the wrong function to use.
2462  */
2463  static int CompareOrdinal(
2464  const wchar_t* string1,
2465  const wchar_t* string2,
2466  bool bOrdinalIgnoreCase
2467  );
2468 
2469  /*
2470  Description:
2471  Compare this string1 and string2 wchar_t element by wchar_t element.
2472  Parameters:
2473  string1 - [in]
2474  maximum_element_count1 - [in]
2475  maximum number of elements to compare
2476  string2 - [in]
2477  maximum_element_count2 - [in]
2478  maximum number of elements to compare
2479  bOrdinalIgnoreCase - [in]
2480  If true, elements with values a-z are compared as if they had values A-Z.
2481  Remarks:
2482  1) If the string is UTF-8 encoded and bOrdinalIgnoreCase is true, only
2483  small latin a - z and capital latin A - Z are considered equal. It is
2484  imposible to ignore case for any other values in an ordinal compare.
2485 
2486  2) If you are comparing file system paths, you should use ComparePath().
2487 
2488  3) If locale, linguistic issues, UTF-8 encoding issues or unicode normalization
2489  or collation issues need to be considered, then CompareOrdinal() is
2490  the wrong function to use.
2491  */
2492  static int CompareOrdinal(
2493  const wchar_t* string1,
2494  int element_count1,
2495  const wchar_t* string2,
2496  int element_count2,
2497  bool bOrdinalIgnoreCase
2498  );
2499 
2500  /*
2501  Description:
2502  Compare this string and other_path as file system paths using
2503  appropriate tests for the current operating system.
2504  Parameters:
2505  other_path - [in]
2506  null terminated string
2507  Remarks:
2508  1) Windows and UNIX directory separators (/ and \) are considered equal.
2509 
2510  2) Case is ignored when the file system is not case sensitive, like Windows.
2511 
2512  3) String normalization appropriate for the current operating system
2513  is performed.
2514  */
2515  int ComparePath(
2516  const wchar_t* other_path
2517  ) const;
2518  bool EqualPath(
2519  const wchar_t* other_path
2520  ) const;
2521 
2522  /*
2523  Description:
2524  Compare sPath1 and sPath2 as file system paths using
2525  appropriate tests for the current operating system.
2526  Parameters:
2527  path1 - [in]
2528  null terminated string
2529  path2 - [in]
2530  null terminated string
2531  Remarks:
2532  1) Windows and UNIX directory separators (/ and \) are considered equal.
2533 
2534  2) Case is ignored when the file system is not case sensitive, like Windows.
2535 
2536  3) String normalization appropriate for the current operating system
2537  is performed.
2538  */
2539  static int ComparePath(
2540  const wchar_t* path1,
2541  const wchar_t* path2
2542  );
2543  static bool EqualPath(
2544  const wchar_t* path1,
2545  const wchar_t* path2
2546  );
2547 
2548  /*
2549  Description:
2550  Compare sPath1 and sPath2 as file system paths using
2551  appropriate tests for the current operating system.
2552  Parameters:
2553  path1 - [in]
2554  maximum_element_count1 - [in]
2555  path2 - [in]
2556  maximum_element_count2 - [in]
2557  Remarks:
2558  1) Windows and UNIX directory separators (/ and \) are considered equal.
2559 
2560  2) Case is ignored when the file system is not case sensitive, like Windows.
2561 
2562  3) String normalization appropriate for the current operating system
2563  is performed.
2564  */
2565  static int ComparePath(
2566  const wchar_t* path1,
2567  int element_count1,
2568  const wchar_t* path2,
2569  int element_count2
2570  );
2571  static bool EqualPath(
2572  const wchar_t* path1,
2573  int element_count1,
2574  const wchar_t* path2,
2575  int element_count2
2576  );
2577 
2578  /*
2579  Description:
2580  Compare this string and other_name as a name attribute of an object
2581  like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on.
2582  These comparisons ignore case and use appropriate string normalization.
2583  Parameters:
2584  other_name - [in]
2585  null terminated string
2586  */
2587  int CompareAttributeName(
2588  const wchar_t* other_name
2589  ) const;
2590  bool EqualAttributeName(
2591  const wchar_t* other_name
2592  ) const;
2593 
2594  /*
2595  Description:
2596  Compare this string and other_name as a name attribute of an object
2597  like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on.
2598  These comparisons ignore case and use appropriate string normalization.
2599  Parameters:
2600  name1 - [in]
2601  null terminated string
2602  name2 - [in]
2603  null terminated string
2604  */
2605  static int CompareAttributeName(
2606  const wchar_t* name1,
2607  const wchar_t* name2
2608  );
2609  static bool EqualAttributeName(
2610  const wchar_t* name1,
2611  const wchar_t* name2
2612  );
2613 
2614 
2615  // Description:
2616  // Simple case sensitive wildcard matching. A question mark (?) in the
2617  // pattern matches a single character. An asterisk (*) in the pattern
2618  // mathes zero or more occurances of any character.
2619  //
2620  // Parameters:
2621  // pattern - [in] pattern string where ? and * are wild cards.
2622  //
2623  // Returns:
2624  // true if the string mathes the wild card pattern.
2625  bool WildCardMatch( const wchar_t* ) const;
2626 
2627  // Description:
2628  // Simple case insensitive wildcard matching. A question mark (?) in the
2629  // pattern matches a single character. An asterisk (*) in the pattern
2630  // mathes zero or more occurances of any character.
2631  //
2632  // Parameters:
2633  // pattern - [in] pattern string where ? and * are wild cards.
2634  //
2635  // Returns:
2636  // true if the string mathes the wild card pattern.
2637  bool WildCardMatchNoCase( const wchar_t* ) const;
2638 
2639  /*
2640  Description:
2641  Replace all substrings that match token1 with token2
2642  Parameters:
2643  token1 - [in]
2644  token2 - [in]
2645  Returns:
2646  Number of times toke1 was replaced with token2
2647  */
2648  int Replace( const wchar_t* token1, const wchar_t* token2 );
2649  int Replace( wchar_t token1, wchar_t token2 );
2650 
2651  /*
2652  Description:
2653  Replaces all characters in the string whose values are
2654  not '0-9', 'A-Z', or 'a-z' with a percent sign followed
2655  by a 2 digit hex value.
2656  */
2657  void UrlEncode();
2658 
2659  /*
2660  Description:
2661  Replaces all %xx where xx a two digit hexadecimal number,
2662  with a single character. Returns false if the orginal
2663  string contained
2664  */
2665  bool UrlDecode();
2666 
2667  /*
2668  Description:
2669  Replace all white-space characters with the token.
2670  If token is zero, the string will end up with
2671  internal 0's
2672  Parameters:
2673  token - [in]
2674  whitespace - [in] if not null, this is a 0 terminated
2675  string that lists the characters considered to be
2676  white space. If null, then (1,2,...,32,127) is used.
2677  Returns:
2678  Number of whitespace characters replaced.
2679  See Also:
2680  ON_wString::RemoveWhiteSpace
2681  */
2682  int ReplaceWhiteSpace( wchar_t token, const wchar_t* whitespace = 0 );
2683 
2684  /*
2685  Description:
2686  Removes all white-space characters with the token.
2687  Parameters:
2688  whitespace - [in] if not null, this is a 0 terminated
2689  string that lists the characters considered to be
2690  white space. If null, then (1,2,...,32,127) is used.
2691  Returns:
2692  Number of whitespace characters removed.
2693  See Also:
2694  ON_wString::ReplaceWhiteSpace
2695  */
2696  int RemoveWhiteSpace( const wchar_t* whitespace = 0 );
2697 
2698  /*
2699  Parameters:
2700  prefix - [in]
2701  locale - [in]
2702  When no local is available, pass ON_Locale::Ordinal.
2703  bIgnoreCase - [in]
2704  true to ignore case.
2705  Returns:
2706  If the string begins with prefix, the returned string has prefix removed.
2707  Otherwise the returned string is identical to the string.
2708  */
2709  const ON_wString RemovePrefix(
2710  const wchar_t* prefix,
2711  const class ON_Locale& locale,
2712  bool bIgnoreCase
2713  ) const;
2714 
2715  /*
2716  Parameters:
2717  suffix - [in]
2718  locale - [in]
2719  When no local is available, pass ON_Locale::Ordinal.
2720  bIgnoreCase - [in]
2721  true to ignore case.
2722  Returns:
2723  If the string ends with suffix, the returned string has suffix removed.
2724  Otherwise the returned string is identical to the string.
2725  */
2726  const ON_wString RemoveSuffix(
2727  const wchar_t* suffix,
2728  const class ON_Locale& locale,
2729  bool bIgnoreCase
2730  ) const;
2731 
2732  // simple sub-string extraction
2733  ON_wString Mid(
2734  int, // index of first char
2735  int // count
2736  ) const;
2737  ON_wString Mid(
2738  int // index of first char
2739  ) const;
2740  ON_wString Left(
2741  int // number of chars to keep
2742  ) const;
2743  ON_wString Right(
2744  int // number of chars to keep
2745  ) const;
2746  const ON_wString SubString(
2747  int start_index
2748  ) const;
2749  const ON_wString SubString(
2750  int start_index,
2751  int count
2752  ) const;
2753 
2754  /*
2755  Description:
2756  Map a single wchar_t element to upper or lower case.
2757  Parameters:
2758  c - [in]
2759  If sizeof(wchar_t) >= 2 and c is not a value used int surrogate pairs,
2760  the map specified by map_type is applied. If c is a value used in
2761  surrogate pairs, the value is not changed.
2762  Remarks:
2763  1) MapCharacterOrdinal is not appropriate for general string mapping
2764  because it does not correctly handle surrogate pairs.
2765  2) If sizeof(wchar_t) == sizeof(char), ON_String::MapCharacterOrdinal()
2766  and ON_wString::MapCharacterOrdinal() are identical.
2767  */
2768  static wchar_t MapCharacterOrdinal(
2769  ON_StringMapOrdinalType map_type,
2770  wchar_t c
2771  );
2772 
2773  ON_wString MapStringOrdinal(
2774  ON_StringMapOrdinalType map_type
2775  ) const;
2776 
2777  /*
2778  Description:
2779  Map a wchar_t string.
2780  Parameters:
2781  map_type - [in]
2782  string - [in]
2783  element_count - [in]
2784  number of string[] elements to map.
2785  If element_count < 0, then ON_wString::Length(string) elements are mapped.
2786  mapped_string - [out]
2787  mapped_string_capacity - [in]
2788  number of available elements in mapped_string[].
2789  mapped_string_capacity must be >= mapped_element_count where
2790  mapped_element_count = (element_count >= 0) element_count ? ON_wString::Length(string).
2791  map_type - [in]
2792  Returns:
2793  Number of mapped_string[] elements that were mapped from string[].
2794 
2795  When the return value is < mapped_string_capacity, a null terminator
2796  is appended after the last mapped element.
2797  */
2798  static int MapStringOrdinal(
2799  ON_StringMapOrdinalType map_type,
2800  const wchar_t* string,
2801  int element_count,
2802  wchar_t* mapped_string,
2803  int mapped_string_capacity
2804  );
2805 
2806  ON_wString MapString(
2807  const class ON_Locale& locale,
2808  ON_StringMapType map_type
2809  ) const;
2810 
2811  static ON_wString MapString(
2812  const class ON_Locale& locale,
2813  ON_StringMapType map_type,
2814  const wchar_t* string,
2815  int element_count
2816  );
2817 
2818  /*
2819  Description:
2820  Maps element_count elements of string[] to mapped_string[].
2821  Parameters:
2822  locale - [in]
2823  Locale to use when converting case. It is common to pass one of
2824  the preset locales ON_Locale::Ordinal, ON_Locale::InvariantCulture,
2825  or ON_Locale::m_CurrentCulture.
2826 
2827  map_type - [in]
2828  selects the mapping
2829 
2830  string - [in]
2831  input string to map.
2832 
2833  element_count - [in]
2834  The number of wchar_t elements to map from input string[].
2835 
2836  If element_count < 1, then string[] must be null terminated and
2837  ON_wString::Length(string)+1 elements are mapped.
2838  The +1 insures the output is null terminated.
2839 
2840  mapped_string - [out]
2841  The result of the mapping is returned in mapped_string[].
2842 
2843  mapped_string_capacity - [in]
2844  Number of wchar_t elements available in mapped_string[]
2845  or 0 to calculate the minimum number of elements needed
2846  for the mapping.
2847 
2848  Returns:
2849  If mapped_string_capacity > 0, then the number elements set in mapped_string[]
2850  is returned.
2851 
2852  If mapped_string_capacity == 0, then the number elements required to perform
2853  the mapping is returned.
2854 
2855  When there is room, mapped_string[] is null terminated.
2856 
2857  0: Failure.
2858  */
2859  static int MapString(
2860  const class ON_Locale& locale,
2861  ON_StringMapType map_type,
2862  const wchar_t* string,
2863  int element_count,
2864  wchar_t* mapped_string,
2865  int mapped_string_capacity
2866  );
2867 
2868  /*
2869  Returns:
2870  A platform independed SHA-1 of the string content. Independent of platform endian or platform wide string UTF encoding.
2871  */
2872  const ON_SHA1_Hash ContentHash(
2873  ON_StringMapOrdinalType mapping
2874  ) const;
2875 
2876 
2877  // upper/lower/reverse conversion
2878  /*ON_DEPRECATED */ void MakeUpper();
2879  /*ON_DEPRECATED */ void MakeLower();
2880 
2881  ON_wString Reverse() const;
2882 
2883  static wchar_t* Reverse(
2884  wchar_t* string,
2885  int element_count
2886  );
2887 
2888  void MakeUpperOrdinal();
2889  void MakeLowerOrdinal();
2890  void MakeReverse();
2891 
2892  /*
2893  Description:
2894  Removes leading elements from the string.
2895  Parameters:
2896  s - [in]
2897  All leading wchar_t elements with a value that it found in s[] are removed.
2898  If s is nullptr, All leading wchar_t element with a value between 1 and space are removed.
2899  */
2900  void TrimLeft(const wchar_t* s = nullptr);
2901 
2902  /*
2903  Description:
2904  Removes trailing elements from the string.
2905  Parameters:
2906  s - [in]
2907  All trailing wchar_t elements with a value that it found in s[] are removed.
2908  If s is nullptr, All trailing wchar_t elements with a value between 1 and space are removed.
2909  */
2910  void TrimRight(const wchar_t* s = nullptr);
2911 
2912  void TrimLeftAndRight(const wchar_t* s = nullptr);
2913 
2914  /*
2915  Description:
2916  Remove all occurrences of the input character.
2917  Parameters:
2918  c - [in]
2919  utf8_single_byte_ct must have a value between 0 and 0x7F.
2920  When w is a 2 byte UTF-16 wchar_t value (like Microsoft's wchar_t),
2921  it must be in the range 0 to 0xD7FF or 0xE000 to 0xFFFF.
2922  When w is a 4 byte UTF-32 wchar_t value (like Apple's wchar_t),
2923  it must be in the range 0 to 0xD7FF or 0xE000 to 0x10FFFF.
2924  Returns:
2925  Number of characters removed.
2926  */
2927  int Remove(
2928  char utf8_single_byte_c
2929  );
2930  int Remove(
2931  unsigned char utf8_single_byte_c
2932  );
2933  int Remove(
2934  wchar_t w
2935  );
2936 
2937  /*
2938  Description:
2939  Find the first occurrence of a character or substring.
2940  Parameters:
2941  utf8_single_byte_c - [in]
2942  utf8_single_byte_c must have a value between 0 and 0x7F.
2943  w - [in]
2944  When w is a 2 byte UTF-16 wchar_t value (like Microsoft's wchar_t),
2945  it must be in the range 0 to 0xD7FF or 0xE000 to 0xFFFF.
2946  When w is a 4 byte UTF-32 wchar_t value (like Apple's wchar_t),
2947  it must be in the range 0 to 0xD7FF or 0xE000 to 0x10FFFF.
2948  sTUF8 - [in]
2949  A null terminated UTF-8 string.
2950  wcharString - [in]
2951  A null terminated wchar_t string.
2952  start_index - [in]
2953  Index where search should begin.
2954  Returns:
2955  -1: invalid input or character is not in the string.
2956  >=0: Index of the first instance of the character.
2957  */
2958  int Find(
2959  char utf8_single_byte_c
2960  ) const;
2961  int Find(
2962  unsigned char utf8_single_byte_c
2963  ) const;
2964  int Find(
2965  wchar_t w
2966  ) const;
2967  int Find(
2968  const char* sUTF8
2969  ) const;
2970  int Find(
2971  const unsigned char* sUTF8
2972  ) const;
2973  int Find(
2974  const wchar_t* wcharString
2975  ) const;
2976  int Find(
2977  char utf8_single_byte_c,
2978  size_t start_index
2979  ) const;
2980  int Find(
2981  unsigned char utf8_single_byte_c,
2982  size_t start_index
2983  ) const;
2984  int Find(
2985  wchar_t w,
2986  size_t start_index
2987  ) const;
2988  int Find(
2989  wchar_t w,
2990  int start_index
2991  ) const;
2992  int Find(
2993  const char* sUTF8,
2994  size_t start_index
2995  ) const;
2996  int Find(
2997  const unsigned char* sUTF8,
2998  size_t start_index
2999  ) const;
3000  int Find(
3001  const wchar_t* wcharString,
3002  size_t start_index
3003  ) const;
3004  int Find(
3005  const wchar_t* wcharString,
3006  int start_index
3007  ) const;
3008  int FindOneOf(
3009  const wchar_t* character_set
3010  ) const;
3011 
3012 
3013  /*
3014  Description:
3015  Find the last occurrence of a character or substring.
3016  Parameters:
3017  utf8_single_byte_c - [in]
3018  utf8_single_byte_c must have a value between 0 and 0x7F.
3019  w - [in]
3020  When w is a 2 byte UTF-16 wchar_t value (like Microsoft's wchar_t),
3021  it must be in the range 0 to 0xD7FF or 0xE000 to 0xFFFF.
3022  When w is a 4 byte UTF-32 wchar_t value (like Apple's wchar_t),
3023  it must be in the range 0 to 0xD7FF or 0xE000 to 0x10FFFF.
3024  sUTF8 - [in]
3025  wideString - [in]
3026  Returns:
3027  -1: Invalid input or character or substring was not found.
3028  >=0: Index of the final occurrence of the character or substring.
3029  */
3030  int ReverseFind(
3031  char utf8_single_byte_c
3032  ) const;
3033  int ReverseFind(
3034  unsigned char utf8_single_byte_c
3035  ) const;
3036  int ReverseFind(
3037  wchar_t w
3038  ) const;
3039  int ReverseFind(
3040  const char* sUTF8
3041  ) const;
3042 
3043  int ReverseFind(
3044  const wchar_t* wideString
3045  ) const;
3046 
3047 
3048  // It is common to format single numbers into strings
3049  // and the FromNumber and FromDouble functions are
3050  // the fastest way to do this and provide consistent results.
3051  // They return a pointer to their buffer so the can be used
3052  // as function parameters.
3053  static const ON_wString FromNumber(
3054  char n
3055  );
3056  static const ON_wString FromNumber(
3057  unsigned char n
3058  );
3059  static const ON_wString FromNumber(
3060  short n
3061  );
3062  static const ON_wString FromNumber(
3063  unsigned short n
3064  );
3065  static const ON_wString FromNumber(
3066  int n
3067  );
3068  static const ON_wString FromNumber(
3069  unsigned int n
3070  );
3071  static const ON_wString FromNumber(
3072  ON__INT64 n
3073  );
3074  static const ON_wString FromNumber(
3075  ON__UINT64 n
3076  );
3077  static const ON_wString FromNumber(
3078  double d // "%g" format
3079  );
3080  static const ON_wString ApproximateFromNumber(
3081  double d // "%f" when possible, otherwise "%g"
3082  );
3083  static const ON_wString PreciseFromNumber(
3084  double d // "%.17g"
3085  );
3086 
3087  /*
3088  Description:
3089  Convert a list of Unicode code points into a wide string.
3090  Parameters:
3091  code_points - [in]
3092  array of Unicode code points
3093  code_point_count - [in]
3094  number of code points.
3095  -1 indicates code_points[] is terminated by a 0 value.
3096  error_code_point - [in]
3097  If error_code_point is a valid Unicode code point,
3098  then error_code_point will be used in place of invalid values in code_points[].
3099  Otherwise, conversion will terminate if code_points[] contains an invalid value.
3100  The values ON_UnicodeCodePoint::ON_ReplacementCharacter and
3101  ON_UnicodeCodePoint::ON_InvalidCodePoint are commonly used for this parameter.
3102  Returns:
3103  A wide string encoding of the Unicode code points.
3104  Remarks:
3105  If more control over the conversion process is required,
3106  then use ON_ConvertUTF32ToWideChar().
3107  */
3108  static const ON_wString FromUnicodeCodePoints(
3109  const ON__UINT32* code_points,
3110  int code_point_count,
3111  ON__UINT32 error_code_point
3112  );
3113 
3114  /*
3115  Description:
3116  Each byte value is converted to 2 hexadecimal digits.
3117  Parameters:
3118  bytes - [in]
3119  list of byte values
3120  byte_count - [in]
3121  Number of byte values in bytes[] array.
3122  bCapitalDigits - [in]
3123  false: Use 0-9, a - b
3124  true: Use 0-9, A - F
3125  bReverse - [in]
3126  false:
3127  The digist in the string will be in the order
3128  bytes[0], bytes[1], ..., bytes[byte_count-1].
3129  true:
3130  The digist in the string will be in the order
3131  bytes[byte_count-1], ..., bytes[1], bytes[0].
3132  */
3133  static const ON_wString HexadecimalFromBytes(
3134  const ON__UINT8* bytes,
3135  size_t byte_count,
3136  bool bCapitalDigits,
3137  bool bReverse
3138  );
3139 
3140 
3141  /*
3142  Parameters:
3143  format - [in]
3144  Format control.
3145  Positional paramters of the form %N$x where N >= 1 and x
3146  is the standard format specification are supported.
3147  Avoid using %S (capital S). See the Remarks for details.
3148  ... - [in]
3149  arguments for replacable items in the format string.
3150  Returns:
3151  True if successful.
3152  False if the string is too long or the format string is not valid.
3153  Remarks:
3154  When using Microsoft's compiler and other compilers that provide similar
3155  locale support, the locale is the invariant culture locale returned by
3156  ON_Locale::InvariantCulture::LocalePtr().
3157 
3158  The way Windows handles the %S (capital S) format parameter depends on locale
3159  and code page settings. It is strongly reccommended that you never use %S to
3160  include any string that may possibly contain elements with values > 127.
3161  The following examples illustrate a way to predictably use UTF-8 and wchar_t
3162  parameters in buffers of the other element type.
3163 
3164  const char* utf8_string = ...;
3165  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",utf8_string);
3166  // The code below will treat utf8_string as a UTF-8 encoded string.
3167  wchar_t wchar_buffer[...];
3168  const size_t wchar_buffer_capacity= sizeof(buffer)/sizeof(buffer[0]);
3169  ON_wString::Format(wchar_buffer, wchar_buffer_capacity, "%s", ON_wString(utf8_string));
3170 
3171  const wchar_t* wide_string = ...;
3172  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",char_string);
3173  // The code below will include wide_string as a UTF-8 encoded string.
3174  char char_buffer[...];
3175  const size_t char_buffer_capacity = sizeof(buffer)/sizeof(buffer[0]);
3176  ON_String::Format(char_buffer, char_buffer_capacity, "%s", ON_String(wide_string));
3177  */
3178  bool ON_VARGS_FUNC_CDECL Format(
3179  const wchar_t* format,
3180  ...
3181  );
3182 
3183  static const ON_wString ON_VARGS_FUNC_CDECL FormatToString(
3184  const wchar_t* format,
3185  ...
3186  );
3187 
3188  bool FormatVargs(
3189  const wchar_t* format,
3190  va_list args
3191  );
3192 
3193  /*
3194  Description:
3195  A platform independent, secure, culture invariant way to format a wchar_t string
3196  with support for positional format parameters.
3197  This function is provide to be used when it is critical that
3198  the formatting be platform independent, secure and culture invarient.
3199  Parameters:
3200  buffer - [out]
3201  not null
3202  buffer_capacity - [in]
3203  > 0
3204  Number of wchar_t elements in buffer.
3205  format - [in]
3206  Avoid using %S (capital S). See the Remarks for details.
3207  ... - [in]
3208  Returns:
3209  >= 0:
3210  The number of wchar_t elements written to buffer[], not including the null terminator.
3211  A null terminator is always added (buffer[returned value] = 0).
3212  The last element of buffer[] is always set to zero (buffer[buffer_capacity-1] = 0).
3213  < 0: failure:
3214  If buffer is not null and buffer_capacity > 0, then buffer[0] = 0 and buffer[buffer_capacity-1] = 0;
3215  Remarks:
3216  The way Windows handles the %S (capital S) format parameter depends on locale
3217  and code page settings. It is strongly reccommended that you never use %S to
3218  include any string that may possibly contain elements with values > 127.
3219  The following examples illustrate a way to predictably use UTF-8 and wchar_t
3220  parameters in buffers of the other element type.
3221 
3222  const char* utf8_string = ...;
3223  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",utf8_string);
3224  wchar_t wchar_buffer[...];
3225  const size_t wchar_buffer_capacity= sizeof(buffer)/sizeof(buffer[0]);
3226  ON_wString::Format(wchar_buffer, wchar_buffer_capacity, "%s", ON_wString(utf8_string));
3227 
3228  const wchar_t* wide_string = ...;
3229  // UNRELIABLE // ON_wString::Format(buffer,buffer_capacity,"%S",char_string);
3230  char char_buffer[...];
3231  const size_t char_buffer_capacity = sizeof(buffer)/sizeof(buffer[0]);
3232  ON_String::Format(char_buffer, char_buffer_capacity, "%s", ON_String(wide_string));
3233  */
3234  static int ON_VARGS_FUNC_CDECL FormatIntoBuffer(
3235  wchar_t* buffer,
3236  size_t buffer_capacity,
3237  const wchar_t* format,
3238  ...
3239  );
3240 
3241  static int ON_VARGS_FUNC_CDECL FormatIntoBuffer(
3242  ON_wStringBuffer& buffer,
3243  const wchar_t* format,
3244  ...
3245  );
3246 
3247  static int FormatVargsIntoBuffer(
3248  ON_wStringBuffer& buffer,
3249  const wchar_t* format,
3250  va_list args
3251  );
3252 
3253  static int FormatVargsIntoBuffer(
3254  wchar_t* buffer,
3255  size_t buffer_capacity,
3256  const wchar_t* format,
3257  va_list args
3258  );
3259 
3260  /*
3261  Returns:
3262  >= 0:
3263  Number of char elements in the formatted string, not including the null terminator.
3264  < 0:
3265  Invalid input
3266  */
3267  static int FormatVargsOutputCount(
3268  const wchar_t* format,
3269  va_list args
3270  );
3271 
3272  /*
3273  Parameters:
3274  format - [in]
3275  null terminated string to scan
3276  ... - [out]
3277  pointers to elements to assign.
3278  Returns:
3279  >= 0: number of fields successfully converted and assigned.
3280  <0: failure
3281  */
3282  int ON_VARGS_FUNC_CDECL Scan(
3283  const wchar_t* format,
3284  ...
3285  ) const;
3286 
3287  static int ON_VARGS_FUNC_CDECL ScanBuffer(
3288  const wchar_t* buffer,
3289  const wchar_t* format,
3290  ...
3291  );
3292 
3293  static int ScanBufferVargs(
3294  const wchar_t* buffer,
3295  const wchar_t* format,
3296  va_list args
3297  );
3298 
3299  /*
3300  Returns:
3301  not zero:
3302  pointer to the first character that was not scanned
3303  nullptr:
3304  failure
3305  */
3306  static const wchar_t* ToNumber(
3307  const wchar_t* buffer,
3308  char value_on_failure,
3309  char* value
3310  );
3311  static const wchar_t* ToNumber(
3312  const wchar_t* buffer,
3313  unsigned char value_on_failure,
3314  unsigned char* value
3315  );
3316  static const wchar_t* ToNumber(
3317  const wchar_t* buffer,
3318  short value_on_failure,
3319  short* value
3320  );
3321  static const wchar_t* ToNumber(
3322  const wchar_t* buffer,
3323  unsigned short value_on_failure,
3324  unsigned short* value
3325  );
3326  static const wchar_t* ToNumber(
3327  const wchar_t* buffer,
3328  int value_on_failure,
3329  int* value
3330  );
3331  static const wchar_t* ToNumber(
3332  const wchar_t* buffer,
3333  unsigned int value_on_failure,
3334  unsigned int* value
3335  );
3336  static const wchar_t* ToNumber(
3337  const wchar_t* buffer,
3338  ON__INT64 value_on_failure,
3339  ON__INT64* value
3340  );
3341  static const wchar_t* ToNumber(
3342  const wchar_t* buffer,
3343  ON__UINT64 value_on_failure,
3344  ON__UINT64* value
3345  );
3346  static const wchar_t* ToNumber(
3347  const wchar_t* buffer,
3348  double value_on_failure,
3349  double* value
3350  );
3351 
3352 
3353  // Low level access to string contents as character array
3354  wchar_t* ReserveArray(size_t); // make sure internal array has at least
3355  // the requested capacity.
3356  void ShrinkArray(); // shrink internal storage to minimum size
3357  wchar_t* SetLength(size_t); // set length (<=capacity)
3358  wchar_t* Array();
3359  const wchar_t* Array() const;
3360 
3361  /*
3362  Returns:
3363  Total number of bytes of memory used by this class.
3364  (For use in ON_Object::SizeOf() overrides.
3365  */
3366  unsigned int SizeOf() const;
3367 
3368  /*
3369  Returns:
3370  CRC of the string.
3371  */
3372  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
3373 
3374  /*
3375  Returns:
3376  CRC of the lower case version of the string. Useful
3377  for case insensitive CRCs and hash codes.
3378  */
3379  ON__UINT32 DataCRCLower(ON__UINT32 current_remainder) const;
3380 
3381  /*
3382  OBSOLETE - Use ON_FileSystemPath::SplitPath
3383  */
3384  static void SplitPath(
3385  const char* path,
3386  ON_wString* drive,
3387  ON_wString* dir,
3388  ON_wString* fname,
3389  ON_wString* ext
3390  );
3391 
3392  static void SplitPath(
3393  const wchar_t* path,
3394  ON_wString* drive,
3395  ON_wString* dir,
3396  ON_wString* fname,
3397  ON_wString* ext
3398  );
3399 
3400 public:
3401  ~ON_wString();
3402 
3403 protected:
3404  // Implementation
3405  wchar_t* m_s; // pointer to ref counted string array
3406  // m_s - 12 bytes points at the string's ON_wStringHeader
3407 
3408  // implementation helpers
3409  struct ON_wStringHeader* Header() const;
3410  wchar_t* CreateArray(int);
3411  void CopyArray();
3412  void CopyToArray( const ON_wString& );
3413  void CopyToArray( int, const char* );
3414  void CopyToArray( int, const unsigned char* );
3415  void CopyToArray( int, const wchar_t* );
3416  void AppendToArray( const ON_wString& );
3417  void AppendToArray( int, const char* );
3418  void AppendToArray( int, const unsigned char* );
3419  void AppendToArray( int, const wchar_t* );
3420 };
3421 
3422 /*
3423 Returns:
3424  True if lhs and rhs are identical as arrays of wchar_t elements.
3425 */
3426 ON_DECL
3427 bool operator==( const ON_wString& lhs, const ON_wString& rhs );
3428 
3429 /*
3430 Returns:
3431  True if lhs and rhs are not identical as arrays of wchar_t elements.
3432 */
3433 ON_DECL
3434 bool operator!=(const ON_wString& lhs, const ON_wString& rhs);
3435 
3436 /*
3437 Returns:
3438  True if lhs is less than rhs as an array of wchar_t elements.
3439 */
3440 ON_DECL
3441 bool operator<(const ON_wString& lhs, const ON_wString& rhs);
3442 
3443 /*
3444 Returns:
3445  True if lhs is greater than rhs as an array of wchar_t elements.
3446 */
3447 ON_DECL
3448 bool operator>(const ON_wString& lhs, const ON_wString& rhs);
3449 
3450 /*
3451 Returns:
3452  True if lhs is less than or equal to rhs as an array of wchar_t elements.
3453 */
3454 ON_DECL
3455 bool operator<=(const ON_wString& lhs, const ON_wString& rhs);
3456 
3457 /*
3458 Returns:
3459  True if lhs is greater than or equal to rhs as an array of wchar_t elements.
3460 */
3461 ON_DECL
3462 bool operator>=(const ON_wString& lhs, const ON_wString& rhs);
3463 
3464 /*
3465 Returns:
3466  True if lhs and rhs are identical as arrays of wchar_t elements.
3467 */
3468 ON_DECL
3469 bool operator==( const ON_wString& lhs, const wchar_t* rhs );
3470 
3471 /*
3472 Returns:
3473  True if lhs and rhs are not identical as arrays of wchar_t elements.
3474 */
3475 ON_DECL
3476 bool operator!=(const ON_wString& lhs, const wchar_t* rhs);
3477 
3478 /*
3479 Returns:
3480  True if lhs is less than rhs as an array of wchar_t elements.
3481 */
3482 ON_DECL
3483 bool operator<(const ON_wString& lhs, const wchar_t* rhs);
3484 
3485 /*
3486 Returns:
3487  True if lhs is greater than rhs as an array of wchar_t elements.
3488 */
3489 ON_DECL
3490 bool operator>(const ON_wString& lhs, const wchar_t* rhs);
3491 
3492 /*
3493 Returns:
3494  True if lhs is less than or equal to rhs as an array of wchar_t elements.
3495 */
3496 ON_DECL
3497 bool operator<=(const ON_wString& lhs, const wchar_t* rhs);
3498 
3499 /*
3500 Returns:
3501  True if lhs is greater than or equal to rhs as an array of wchar_t elements.
3502 */
3503 ON_DECL
3504 bool operator>=(const ON_wString& lhs, const wchar_t* rhs);
3505 
3506 /*
3507 Returns:
3508  True if lhs and rhs are identical as arrays of wchar_t elements.
3509 */
3510 ON_DECL
3511 bool operator==( const wchar_t* lhs, const ON_wString& rhs );
3512 
3513 /*
3514 Returns:
3515  True if lhs and rhs are not identical as arrays of wchar_t elements.
3516 */
3517 ON_DECL
3518 bool operator!=(const wchar_t* lhs, const ON_wString& rhs);
3519 
3520 /*
3521 Returns:
3522  True if lhs is less than rhs as an array of wchar_t elements.
3523 */
3524 ON_DECL
3525 bool operator<(const wchar_t* lhs, const ON_wString& rhs);
3526 
3527 /*
3528 Returns:
3529  True if lhs is greater than rhs as an array of wchar_t elements.
3530 */
3531 ON_DECL
3532 bool operator>(const wchar_t* lhs, const ON_wString& rhs);
3533 
3534 /*
3535 Returns:
3536  True if lhs is less than or equal to rhs as an array of wchar_t elements.
3537 */
3538 ON_DECL
3539 bool operator<=(const wchar_t* lhs, const ON_wString& rhs);
3540 
3541 /*
3542 Returns:
3543  True if lhs is greater than or equal to rhs as an array of wchar_t elements.
3544 */
3545 ON_DECL
3546 bool operator>=(const wchar_t* lhs, const ON_wString& rhs);
3547 
3548 /*
3549 Description:
3550  An ON_NameHash is designed to help search for and compare attribute names
3551  like the ON_ModelComponent.Name() value.
3552 
3553  If a name is wchar_t encoded as wide_char_name and UTF-8 encoded as utf8_name,
3554  then ON_NameHash(wide_char_name) == ON_NameHash(utf8_name).
3555 
3556  Set:
3557  bool bEqualNameHash = ON_NameHash::Create(parent_id1,name1) == ON_NameHash::Create(parent_id2,name2);
3558  bool bEqualParentId = (parent_id1 == parent_id2)
3559  bool bEqualAttributeName = ON_String::EqualAttributeName(name1,name2);
3560 
3561  If (bEqualParentId && bEqualAttributeName) is true, then bEqualNameHash is true.
3562  If bEqualParentId is false, then bEqualNameHash is false.
3563  With probablity 1-epsilon, if bEqualAttributeName is false, then bEqualNameHash is false,
3564  where epsilon is an extremely tiny number.
3565 */
3566 class ON_CLASS ON_NameHash
3567 {
3568 public:
3569  /*
3570  Default conststruction creates ON_NameHash::UnsetNameHash.
3571  */
3572  ON_NameHash() = default;
3573  ~ON_NameHash() = default;
3574  ON_NameHash(const ON_NameHash&) = default;
3575  ON_NameHash& operator=(const ON_NameHash&) = default;
3576 
3579 
3580  /*
3581  Returns:
3582  True if the hash is for a valid non-empty name.
3583  */
3584  bool IsValidAndNotEmpty() const;
3585 
3586  /*
3587  Returns:
3588  True if the hash is for an empty name.
3589  */
3590  bool IsEmptyNameHash() const;
3591 
3592  /*
3593  Returns:
3594  True if the hash is for an invalid name.
3595  */
3596  bool IsInvalidNameHash() const;
3597 
3598  /*
3599  Returns:
3600  True if the hash is not empty and was set by calling CreateFilePathHash().
3601  */
3602  bool IsFilePathHash() const;
3603 
3604  /*
3605  Returns:
3606  True if hash is set and case is ignored
3607  */
3608  bool IgnoreCase() const;
3609 
3610  /*
3611  Returns:
3612  ON_NameHash::EmptyNameHash if name is empty.
3613  ON_NameHash::UnsetNameHash if name is not valid.
3614  */
3615  static ON_NameHash Create(
3616  const ON_wString& name
3617  );
3618  static ON_NameHash Create(
3619  const wchar_t* name
3620  );
3621  static ON_NameHash Create(
3622  size_t length,
3623  const wchar_t* name
3624  );
3625  static ON_NameHash Create(
3626  const ON_String& utf8_name
3627  );
3628  static ON_NameHash Create(
3629  const char* utf8_name
3630  );
3631  static ON_NameHash Create(
3632  size_t length,
3633  const char* utf8_name
3634  );
3635 
3636  static ON_NameHash Create(
3637  const ON_UUID& parent_id,
3638  const ON_wString& name
3639  );
3640  static ON_NameHash Create(
3641  const ON_UUID& parent_id,
3642  const wchar_t* name
3643  );
3644  static ON_NameHash Create(
3645  const ON_UUID& parent_id,
3646  size_t length,
3647  const wchar_t* name
3648  );
3649  static ON_NameHash Create(
3650  const ON_UUID& parent_id,
3651  const ON_String& name
3652  );
3653  static ON_NameHash Create(
3654  const ON_UUID& parent_id,
3655  const char* utf8_name
3656  );
3657  static ON_NameHash Create(
3658  const ON_UUID& parent_id,
3659  size_t length,
3660  const char* utf8_name
3661  );
3662 
3663  static ON_NameHash Create(
3664  const ON_wString& name,
3665  bool bIgnoreCase
3666  );
3667  static ON_NameHash Create(
3668  const wchar_t* name,
3669  bool bIgnoreCase
3670  );
3671  static ON_NameHash Create(
3672  size_t length,
3673  const wchar_t* name,
3674  bool bIgnoreCase
3675  );
3676  static ON_NameHash Create(
3677  const ON_String& name,
3678  bool bIgnoreCase
3679  );
3680  static ON_NameHash Create(
3681  const char* utf8_name,
3682  bool bIgnoreCase
3683  );
3684  static ON_NameHash Create(
3685  size_t length,
3686  const char* utf8_name,
3687  bool bIgnoreCase
3688  );
3689  static ON_NameHash Create(
3690  const ON_UUID& parent_id,
3691  const ON_wString& name,
3692  bool bIgnoreCase
3693  );
3694  static ON_NameHash Create(
3695  const ON_UUID& parent_id,
3696  const wchar_t* name,
3697  bool bIgnoreCase
3698  );
3699  static ON_NameHash Create(
3700  const ON_UUID& parent_id,
3701  size_t length,
3702  const wchar_t* name,
3703  bool bIgnoreCase
3704  );
3705  static ON_NameHash Create(
3706  const ON_UUID& parent_id,
3707  const ON_String& utf8_name,
3708  bool bIgnoreCase
3709  );
3710  static ON_NameHash Create(
3711  const ON_UUID& parent_id,
3712  const char* utf8_name,
3713  bool bIgnoreCase
3714  );
3715  static ON_NameHash Create(
3716  const ON_UUID& parent_id,
3717  size_t length,
3718  const char* utf8_name,
3719  bool bIgnoreCase
3720  );
3721 
3722  static ON_NameHash CreateIdAndEmptyName(
3723  const ON_UUID& parent_id
3724  );
3725 
3726  static ON_NameHash CreateIdAndUnsetName(
3727  const ON_UUID& parent_id
3728  );
3729 
3730  static ON_NameHash CreateFilePathHash(
3731  const class ON_FileReference& file_reference
3732  );
3733 
3734  static ON_NameHash CreateFilePathHash(
3735  const wchar_t* file_path
3736  );
3737 
3738  static ON_NameHash CreateFilePathHash(
3739  const char* file_path
3740  );
3741 
3742  static int CompareNameSHA1(
3743  const ON_NameHash& a,
3744  const ON_NameHash& b
3745  );
3746 
3747  static int CompareNameSHA1Ptr(
3748  const ON_NameHash* a,
3749  const ON_NameHash* b
3750  );
3751 
3752  static int CompareParentId(
3753  const ON_NameHash& a,
3754  const ON_NameHash& b
3755  );
3756 
3757  static int CompareParentIdPtr(
3758  const ON_NameHash* a,
3759  const ON_NameHash* b
3760  );
3761 
3762  /*
3763  Description:
3764  Compares id, then length, then SHA-1 digest.
3765  */
3766  static int Compare(
3767  const ON_NameHash& a,
3768  const ON_NameHash& b
3769  );
3770 
3771  /*
3772  Description:
3773  Compares id, then length, then SHA-1 digest.
3774  */
3775  static int ComparePtr(
3776  const ON_NameHash* a,
3777  const ON_NameHash* b
3778  );
3779 
3780  // Number of UTf-32 code point values in mapped name.
3781  // (0 for file path hashes)
3782  ON__UINT32 MappedNameCodePointCount() const;
3783 
3784  // SHA-1 hash of mapped name
3785  ON_SHA1_Hash MappedNameSha1Hash() const;
3786 
3787  // 32 bit hash of id and mapped name
3788  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
3789 
3790  // 32 bit hash of id
3791  ON__UINT32 IdCRC(ON__UINT32 current_remainder) const;
3792 
3793  // 32 bit hash of id and mapped name
3794  ON__UINT32 NameCRC(ON__UINT32 current_remainder) const;
3795 
3796  ON_UUID ParentId() const;
3797 
3798 private:
3799 
3800  enum : unsigned int
3801  {
3802  flags_length_mask = 0x0FFFFFFF,
3803  flags_case_sensitive = 0x80000000,
3804  flags_file_path = 0xFFFFFFFF
3805  };
3806  // m_flags = 0xFFFFFFFFU -> Hash is a file path hash
3807  // m_flags != 0
3808  // m_flags &0x0FFFFFFF = number of unicode (UTF-32) code points in name
3809  // m_flags &0x80000000 = 0 to ignore case, !=0 if case sensitive hash
3810  ON__UINT32 m_flags = 0;
3811 
3812  // m_sha1_hash = SHA-1 hash of ordinal minimum mapped unicode (UTF-32) code points
3813  // If the name is empty, m_length = 0 and m_sha1_hash = ON_SHA1_Hash::EmptyContentHash.
3814  // If the name is not valid, m_length = 0 and m_sha1_hash = ON_SHA1_Hash::ZeroDigest.
3815  ON_SHA1_Hash m_sha1_hash = ON_SHA1_Hash::ZeroDigest;
3816 
3817  // When names appear in a tree structure, m_parent_id identifies the
3818  // parent node.
3819  ON_UUID m_parent_id = ON_nil_uuid;
3820 
3821 public:
3822  /*
3823  Description:
3824  Internal_CreateFromDotNet() is public for technical reasons. It is used
3825  in Rhino Common p-invoke code that provides a .NET interface to the
3826  services ON_NameHash provided by the ON_NameHash class.
3827  This function should be ignored and never called from ordinary C++ code.
3828  If you choose to ignore the preceding admonition, you will have to read
3829  the source code for information about how this function works.
3830  */
3831  static ON_NameHash Internal_DotNetInterfaceSet(
3832  const ON_UUID&,
3833  const ON_SHA1_Hash&,
3834  const ON__UINT32
3835  );
3836 
3837  ON__UINT32 Internal_DotNetInterfaceGetFlags() const;
3838 };
3839 
3840 /*
3841 Compares id, then length, then SHA-1 digest
3842 */
3843 ON_DECL
3844 bool operator==(
3845  const ON_NameHash& a,
3846  const ON_NameHash& b
3847  );
3848 
3849 /*
3850 Compares id, then length, then SHA-1 digest
3851 */
3852 ON_DECL
3853 bool operator!=(
3854  const ON_NameHash& a,
3855  const ON_NameHash& b
3856  );
3857 
3858 /*
3859 Compares id, then length, then SHA-1 digest
3860 */
3861 ON_DECL
3862 bool operator<(
3863  const ON_NameHash& a,
3864  const ON_NameHash& b
3865  );
3866 
3867 /*
3868 Compares id, then length, then SHA-1 digest
3869 */
3870 ON_DECL
3871 bool operator<=(
3872  const ON_NameHash& a,
3873  const ON_NameHash& b
3874  );
3875 
3876 /*
3877 Compares id, then length, then SHA-1 digest
3878 */
3879 ON_DECL
3880 bool operator>(
3881  const ON_NameHash& a,
3882  const ON_NameHash& b
3883  );
3884 
3885 /*
3886 Compares id, then length, then SHA-1 digest
3887 */
3888 ON_DECL
3889 bool operator>=(
3890  const ON_NameHash& a,
3891  const ON_NameHash& b
3892  );
3893 
3894 class ON_CLASS ON_UnitSystem
3895 {
3896 public:
3897  // Default construction sets this to ON_UnitSystem::Meters
3898  ON_UnitSystem() = default;
3899 
3900  ~ON_UnitSystem() = default;
3901  ON_UnitSystem(const ON_UnitSystem&) = default;
3902  ON_UnitSystem& operator=(const ON_UnitSystem&) = default;
3903 
3904 public:
3905  ON_UnitSystem(
3906  ON::LengthUnitSystem length_unit_system
3907  );
3908 
3909  ON_UnitSystem& operator=(
3910  ON::LengthUnitSystem length_unit_system
3911  );
3912 
3913  /*
3914  Parameters:
3915  custom_unit_name - [in]
3916  length unit name (no spaces)
3917  meters_per_custom_unit - [in]
3918  a positive number
3919  Example:
3920  // 1 League = 5556 meters
3921  const ON_UnitSystem Leagues = ON_UnitSystem::CreateCustomUnitSystem(L"Leagues", 1.0/5556.0);
3922  */
3923  static ON_UnitSystem CreateCustomUnitSystem(
3924  const wchar_t* custom_unit_name,
3925  double meters_per_custom_unit
3926  );
3927 
3928 public:
3929  // unit system = ON::LengthUnitSystem::None. Scale to or from any valid unit = 1
3930  static const ON_UnitSystem None;
3931 
3932  static const ON_UnitSystem Angstroms;
3934  static const ON_UnitSystem Microns;
3935 
3936  // unit system = ON::LengthUnitSystem::Millimeters and meters/unit = 0.001 exactly
3938 
3941 
3942  // unit system = ON::LengthUnitSystem::Meters and meters/unit = 1
3943  static const ON_UnitSystem Meters;
3950  static const ON_UnitSystem Mils;
3951 
3952  // unit system = ON::LengthUnitSystem::Inches and meters/unit = 0.0254 exactly
3953  static const ON_UnitSystem Inches;
3954 
3955  // unit system = ON::LengthUnitSystem::Feet and meters/unit = 0.3048 exactly
3956  static const ON_UnitSystem Feet;
3957 
3958  static const ON_UnitSystem Yards;
3959  static const ON_UnitSystem Miles;
3965  static const ON_UnitSystem Parsecs;
3966 
3967  // unit system = ON::LengthUnitSystem::Unset and meters/unit = ON_DBL_QNAN
3968  static const ON_UnitSystem Unset;
3969 
3970 
3971 
3972 public:
3973  bool operator==(const ON_UnitSystem&) const;
3974  bool operator!=(const ON_UnitSystem&) const;
3975 
3976  /*
3977  Returns
3978  true if m_unit_system is a valid ON::LengthUnitSystem enum value,
3979  which may be ON::LengthUnitSystem::None. If m_unit_system is
3980  ON::LengthUnitSystem::CustomUnits, then IsValid() returns true
3981  if m_custom_unit_scale > 0.0 and false otherwise.
3982  The value of m_custom_unit_name is not tested.
3983  See Also:
3984  IsSet()
3985  */
3986  bool IsValid() const;
3987 
3988  bool Read( class ON_BinaryArchive& );
3989  bool Write( class ON_BinaryArchive& ) const;
3990  void Dump( class ON_TextLog& ) const;
3991 
3992  /*
3993  Returns
3994  true If the unit system is valid and set to something beside
3995  ON::no_unit_systm;
3996  */
3997  bool IsSet() const;
3998 
3999  /*
4000  Returns
4001  true If the unit system is ON::LengthUnitSystem::CustomUnits
4002  */
4003  bool IsCustomUnitSystem() const;
4004 
4005  void SetUnitSystem(
4006  ON::LengthUnitSystem us
4007  );
4008 
4009  /*
4010  Parameters:
4011  custom_unit_name - [in]
4012  length unit name (no spaces)
4013  meters_per_custom_unit - [in]
4014  a positive number
4015  Example:
4016  // 1 League = 5556 meters
4017  ON_UnitSystem Leagues;
4018  Leagues.SetCustomUnitSystem( L"Leagues", 1.0/5556.0);
4019  // or
4020  ON_UnitSystem Leagues = ON_UnitSystem::CreateCustomUnitSystem(L"Leagues", 1.0/5556.0);
4021  */
4022  void SetCustomUnitSystem(
4023  const wchar_t* custom_unit_name,
4024  double meters_per_custom_unit
4025  );
4026 
4027  /*
4028  Description:
4029  Changes the unit system to custom units and sets the custom unit scale.
4030  Remarks:
4031  Avoid using this function. Use SetCustomUnitSystem() or SetUnitSystem()
4032  instead.
4033  */
4034  void SetCustomUnitSystemName(
4035  const wchar_t* custom_unit_name
4036  );
4037 
4038  /*
4039  Description:
4040  Changes the unit system to custom units and sets the custom unit scale.
4041  Remarks:
4042  Avoid using this function. Use SetCustomUnitSystem() or SetUnitSystem()
4043  instead.
4044  */
4045  void SetCustomUnitSystemScale(
4046  double meters_per_custom_unit
4047  );
4048 
4049  double MetersPerUnit() const;
4050  ON::LengthUnitSystem UnitSystem() const;
4051  const ON_wString& UnitSystemName() const;
4052 
4053 
4054 private:
4055  ON::LengthUnitSystem m_unit_system = ON::LengthUnitSystem::Meters;
4056  unsigned int m_reserved = 0;
4057 
4058  // The m_custom_unit_... settings apply when m_unit_system = ON::LengthUnitSystem::CustomUnits
4059  double m_meters_per_unit = 1.0; // 1 meter = m_custom_unit_scale custom units
4060  ON_wString m_custom_unit_name; // name of custom units
4061 };
4062 #endif
static const ON_UnitSystem Mils
Definition: opennurbs_string.h:3950
static const ON_UnitSystem Nanometers
Definition: opennurbs_string.h:3933
char * m_buffer
Definition: opennurbs_string.h:791
static const ON_UnitSystem Yards
Definition: opennurbs_string.h:3958
@@ -108,6 +106,7 @@ $(function() {
static const char CarriageReturn
Unicode CHARACTER TABULATION control U+000D.
Definition: opennurbs_string.h:895
static const char Space
Unicode SPACE U+0020.
Definition: opennurbs_string.h:897
static const ON_UnitSystem Decimeters
Definition: opennurbs_string.h:3940
+
char * m_s
Implementation.
Definition: opennurbs_string.h:1939
static const wchar_t FormFeed
Unicode FORM FEED control U+000C.
Definition: opennurbs_string.h:2101
static const ON_UnitSystem Millimeters
unit system = ON::LengthUnitSystem::Millimeters and meters/unit = 0.001 exactly
Definition: opennurbs_string.h:3937
static const wchar_t CarriageReturn
Unicode CARRIAGE RETURN control U+000D.
Definition: opennurbs_string.h:2102
@@ -146,9 +145,9 @@ $(function() {
diff --git a/6/d1/d94/class_o_n___poly_edge_history-members.html b/6/d1/d94/class_o_n___poly_edge_history-members.html index d71c7eb2..3fce9a5b 100644 --- a/6/d1/d94/class_o_n___poly_edge_history-members.html +++ b/6/d1/d94/class_o_n___poly_edge_history-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@
- + +
diff --git a/6/d1/d96/class_o_n___mesh_face_side.html b/6/d1/d96/class_o_n___mesh_face_side.html index 6bea54e0..34889044 100644 --- a/6/d1/d96/class_o_n___mesh_face_side.html +++ b/6/d1/d96/class_o_n___mesh_face_side.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshFaceSide Class Reference @@ -22,6 +22,7 @@
openNURBS SDK Help +  6.0
@@ -29,21 +30,18 @@ - + +
  • If fi_list is null, then fi_list_count is ignored. vertex_id_map - [in] (can be null)
  • If vertex_id_map is null, then the ON_MeshFaceSide::m_vi[] values are the vertex index values from mesh_face_list[].
  • If vertex_id_map is not null, then vertex_id_map[] is an array with the mesh_vertex_count elements and ON_MeshFaceSide::m_vi[] values are vertex_id_map[mesh_face_list[] vertex indices]. A vertex_id_map[] is commonly used when coincident vertices need to be treated as a single topological entity. face_side_list - [out]
  • -
  • If the input value of face_side_list is not null, then face_side_list[] must be long enough to hold the returned face_side_list list.
    - The maximum posssible length is 4*mesh_face_list.FaceCount().
  • +
  • If the input value of face_side_list is not null, then face_side_list[] must be long enough to hold the returned face_side_list list. The maximum posssible length is 4*mesh_face_list.FaceCount().
  • If the input falue of face_side_list is null, memory will be allocated using onmalloc() and the caller is responsible for calling onfree() at an appropriate time. The returned is face_side_list[] is dictionary sorted by ON_MeshFaceSide.m_fi and then ON_MeshFaceSide.m_si. The vertex ids satisfy ON_MeshFaceSide.m_vi[0] < ON_MeshFaceSide.m_vi[1]. ON_MeshFaceSide.m_dir is 0 if the face vertex order is the same and 1 if the face vertex order is opposite. The static sorting functions on ON_MeshFaceSide can be used to change this ordering. Returns: Number of elements set in face_side_list[]. Remarks: Faces in mesh_face_list with vertex indices that are >= mesh_vertex_count are ignored. Degenerate faces are processed, but degenerate sides (equal vertex ids) are not added to face_side_list[].
  • @@ -455,9 +452,9 @@ Static Public Attributes
    diff --git a/6/d1/d97/class_o_n___polynomial_curve.html b/6/d1/d97/class_o_n___polynomial_curve.html index 503fa0c5..51e340e6 100644 --- a/6/d1/d97/class_o_n___polynomial_curve.html +++ b/6/d1/d97/class_o_n___polynomial_curve.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_PolynomialCurve Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d1/d9a/class_o_n___rtf_string_builder_1_1_text_run.html b/6/d1/d9a/class_o_n___rtf_string_builder_1_1_text_run.html index 86fb8ce3..e204cd1e 100644 --- a/6/d1/d9a/class_o_n___rtf_string_builder_1_1_text_run.html +++ b/6/d1/d9a/class_o_n___rtf_string_builder_1_1_text_run.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RtfStringBuilder::TextRun Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d1/d9f/class_o_n___binary_file-members.html b/6/d1/d9f/class_o_n___binary_file-members.html index 331e2e59..bcad1164 100644 --- a/6/d1/d9f/class_o_n___binary_file-members.html +++ b/6/d1/d9f/class_o_n___binary_file-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d1/da0/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o.html b/6/d1/da0/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o.html index 49b71f5d..ba9748ea 100644 --- a/6/d1/da0/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o.html +++ b/6/d1/da0/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_WindowsBITMAPINFO Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d1/da8/opennurbs__linestyle_8h_source.html b/6/d1/da8/opennurbs__linestyle_8h_source.html index 3494b1b9..a4049751 100644 --- a/6/d1/da8/opennurbs__linestyle_8h_source.html +++ b/6/d1/da8/opennurbs__linestyle_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_linestyle.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_linestyle.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d1/dac/opennurbs__compress_8h_source.html b/6/d1/dac/opennurbs__compress_8h_source.html index d5a2d89a..e64cbf2b 100644 --- a/6/d1/dac/opennurbs__compress_8h_source.html +++ b/6/d1/dac/opennurbs__compress_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_compress.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_compress.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d1/db0/class_o_n___scale_value-members.html b/6/d1/db0/class_o_n___scale_value-members.html index 615f1063..cd2e52d0 100644 --- a/6/d1/db0/class_o_n___scale_value-members.html +++ b/6/d1/db0/class_o_n___scale_value-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d1/dbb/class_o_n___mapping_ref.html b/6/d1/dbb/class_o_n___mapping_ref.html index 191c4b38..a4b49f61 100644 --- a/6/d1/dbb/class_o_n___mapping_ref.html +++ b/6/d1/dbb/class_o_n___mapping_ref.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MappingRef Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d1/dbf/opennurbs__terminator_8h_source.html b/6/d1/dbf/opennurbs__terminator_8h_source.html index 2e32e452..6cfa4710 100644 --- a/6/d1/dbf/opennurbs__terminator_8h_source.html +++ b/6/d1/dbf/opennurbs__terminator_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_terminator.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_terminator.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d1/dc1/class_o_n___extrusion-members.html b/6/d1/dc1/class_o_n___extrusion-members.html index ba18f055..3f0148a7 100644 --- a/6/d1/dc1/class_o_n___extrusion-members.html +++ b/6/d1/dc1/class_o_n___extrusion-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d1/dc5/class_o_n___simple_fixed_size_pool-members.html b/6/d1/dc5/class_o_n___simple_fixed_size_pool-members.html index 461eb35e..994722a8 100644 --- a/6/d1/dc5/class_o_n___simple_fixed_size_pool-members.html +++ b/6/d1/dc5/class_o_n___simple_fixed_size_pool-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d1/dce/class_o_n___brep_loop_array.html b/6/d1/dce/class_o_n___brep_loop_array.html index 6ca499e3..88e3fede 100644 --- a/6/d1/dce/class_o_n___brep_loop_array.html +++ b/6/d1/dce/class_o_n___brep_loop_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepLoopArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d1/dd5/class_o_n___mesh_triangle.html b/6/d1/dd5/class_o_n___mesh_triangle.html index e8accaaf..122b2be3 100644 --- a/6/d1/dd5/class_o_n___mesh_triangle.html +++ b/6/d1/dd5/class_o_n___mesh_triangle.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshTriangle Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d1/dd7/class_o_n___component_attributes.html b/6/d1/dd7/class_o_n___component_attributes.html index 9a0bb3fa..e5b354d8 100644 --- a/6/d1/dd7/class_o_n___component_attributes.html +++ b/6/d1/dd7/class_o_n___component_attributes.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ComponentAttributes Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2015 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2015 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Member Enumeration Documentation

    ◆ EdgeFlags

    @@ -377,8 +373,7 @@ Static Public Member Functions

    Inspects aggregate edge demographics to determine if every edge has exactly two faces and all the faces have a compatible orientations.

    -


    -This sample shows how to determine if an ON_SubD is a solid.

    ON_SubD subd = ...;
    if (ON_ComponentAttributes::IsSolid(subd.AggregateEdgeComponentAttributes())
    {
    ///< subd is a solid
    ...
    }
    Parameters
    +

    This sample shows how to determine if an ON_SubD is a solid.

    ON_SubD subd = ...;
    if (ON_ComponentAttributes::IsSolid(subd.AggregateEdgeComponentAttributes())
    {
    ///< subd is a solid
    ...
    }
    Parameters
    aggregate_edge_component_attributesValue made by bitwise or of ON_ComponentAttributes::EdgeFlags values for every edge in the object.
    @@ -392,9 +387,9 @@ This sample shows how to determine if an ON_SubD is a solid.

    - + +
    diff --git a/6/d1/ddb/structtag_font_key-members.html b/6/d1/ddb/structtag_font_key-members.html index 793b56bc..2e586a40 100644 --- a/6/d1/ddb/structtag_font_key-members.html +++ b/6/d1/ddb/structtag_font_key-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d1/dde/opennurbs__internal___v2__annotation_8h_source.html b/6/d1/dde/opennurbs__internal___v2__annotation_8h_source.html index 42e0774c..cb57bb80 100644 --- a/6/d1/dde/opennurbs__internal___v2__annotation_8h_source.html +++ b/6/d1/dde/opennurbs__internal___v2__annotation_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_internal_V2_annotation.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_internal_V2_annotation.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_internal_V2_annotation.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_INTERNAL_V2_ANNOTATION_H_INC)
    18 #define OPENNURBS_INTERNAL_V2_ANNOTATION_H_INC
    19 
    20 #if defined(ON_COMPILING_OPENNURBS)
    21 
    22 #include "opennurbs_internal_defines.h"
    23 
    24 // Annotation classes used in version 2 .3dm archives and Rhino version 2.
    25 // All classes in this file are obsolete. They exist so that old files can be read.
    26 
    27 // Legacy annotation arrow is in some old .3dm files.
    28 // Gets converted to an ON_Line with ON_3dmObjectAttributes arrow head
    29 // ON_3dmObjectAttributes.m_object_decoration = (ON::end_arrowhead | other bits)
    30 class ON_OBSOLETE_V2_AnnotationArrow : public ON_Geometry
    31 {
    32  // 3d annotation arrow
    33  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_AnnotationArrow);
    34 public:
    35  ON_OBSOLETE_V2_AnnotationArrow();
    36  ~ON_OBSOLETE_V2_AnnotationArrow();
    37  ON_OBSOLETE_V2_AnnotationArrow(const ON_OBSOLETE_V2_AnnotationArrow&);
    38  ON_OBSOLETE_V2_AnnotationArrow& operator=(const ON_OBSOLETE_V2_AnnotationArrow&);
    39 
    40  /////////////////////////////////////////////////////////////////
    41  //
    42  // ON_Object overrides
    43  //
    44  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    45 
    46  void Dump( ON_TextLog& ) const override; // for debugging
    47 
    48  bool Write(
    49  ON_BinaryArchive& // serialize definition to binary archive
    50  ) const override;
    51 
    52  bool Read(
    53  ON_BinaryArchive& // restore definition from binary archive
    54  ) override;
    55 
    56  ON::object_type ObjectType() const override;
    57 
    58  /////////////////////////////////////////////////////////////////
    59  //
    60  // ON_Geometry overrides
    61  //
    62 
    63  int Dimension() const override;
    64 
    65  // virtual ON_Geometry GetBBox override
    66  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    67 
    68  bool Transform(
    69  const ON_Xform&
    70  ) override;
    71 
    72  /////////////////////////////////////////////////////////////////
    73  //
    74  // Interface
    75  //
    76  ON_3dVector Vector() const;
    77  ON_3dPoint Head() const;
    78  ON_3dPoint Tail() const;
    79 
    80  ON_3dPoint m_tail;
    81  ON_3dPoint m_head;
    82 };
    83 
    84 class ON_OBSOLETE_V2_TextDot : public ON_Point
    85 {
    86  // 3d annotation dot with text
    87  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_TextDot);
    88 public:
    89  ON_OBSOLETE_V2_TextDot();
    90  ~ON_OBSOLETE_V2_TextDot();
    91  ON_OBSOLETE_V2_TextDot(const ON_OBSOLETE_V2_TextDot&);
    92  ON_OBSOLETE_V2_TextDot& operator=(const ON_OBSOLETE_V2_TextDot&);
    93 
    94  /////////////////////////////////////////////////////////////////
    95  //
    96  // ON_Object overrides
    97  //
    98 
    99  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    100  void Dump( ON_TextLog& ) const override; // for debugging
    101 
    102  bool Write(
    103  ON_BinaryArchive& // serialize definition to binary archive
    104  ) const override;
    105 
    106  bool Read(
    107  ON_BinaryArchive& // restore definition from binary archive
    108  ) override;
    109 
    110  ON_wString m_text;
    111 };
    112 
    113 
    114 ////////////////////////////////////////////////////////////////
    115 //
    116 // ON_OBSOLETE_V2_Annotation - used to serialize definitions of annotation
    117 // objects (dimensions, text blocks, etc.).
    118 //
    119 
    120 class ON_OBSOLETE_V2_Annotation : public ON_Geometry
    121 {
    122  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_Annotation);
    123 
    124 protected:
    125  ON_OBSOLETE_V2_Annotation() = default;
    126  ON_OBSOLETE_V2_Annotation(const ON_OBSOLETE_V2_Annotation&) = default;
    127  ON_OBSOLETE_V2_Annotation& operator=(const ON_OBSOLETE_V2_Annotation&) = default;
    128 
    129 public:
    130  virtual ~ON_OBSOLETE_V2_Annotation() = default;
    131 
    132 protected:
    133  void Internal_Initialize(); // initialize class's fields assuming
    134  // memory is uninitialized
    135 
    136 public:
    137  static ON_OBSOLETE_V2_Annotation* CreateFromV5Annotation(
    138  const class ON_OBSOLETE_V5_Annotation& V5_annotation,
    139  const class ON_3dmAnnotationContext* annotation_context
    140  );
    141 
    142  static ON_OBSOLETE_V2_Annotation* CreateFromV6Annotation(
    143  const class ON_Annotation& V6_annotation,
    144  const class ON_3dmAnnotationContext* annotation_context
    145  );
    146 
    147 protected:
    148  void Internal_InitializeFromV5Annotation(
    149  const ON_OBSOLETE_V5_Annotation& V5_annotation,
    150  const class ON_3dmAnnotationContext* annotation_context
    151  );
    152 
    153 public:
    154  void Destroy();
    155  void EmergencyDestroy();
    156 
    157  /////////////////////////////////////////////////////////////////
    158  //
    159  // ON_Object overrides
    160  //
    161  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    162 
    163  void Dump( ON_TextLog& ) const override; // for debugging
    164 
    165  bool Write(
    166  ON_BinaryArchive& // serialize definition to binary archive
    167  ) const override;
    168 
    169  bool Read(
    170  ON_BinaryArchive& // restore definition from binary archive
    171  ) override;
    172 
    173  ON::object_type ObjectType() const override;
    174 
    175  /////////////////////////////////////////////////////////////////
    176  //
    177  // ON_Geometry overrides
    178  //
    179 
    180  int Dimension() const override;
    181 
    182  // virtual ON_Geometry GetBBox override
    183  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    184 
    185  bool Transform(
    186  const ON_Xform&
    187  ) override;
    188 
    189  /////////////////////////////////////////////////////////////////
    190  //
    191  // ON_OBSOLETE_V2_Annotation interface
    192  //
    193 
    194  // use these to get/set the current annotation settings
    195  static const ON_3dmAnnotationSettings& AnnotationSettings();
    196  static void SetAnnotationSettings( const ON_3dmAnnotationSettings* );
    197 
    198  bool IsText() const;
    199  bool IsLeader() const;
    200  bool IsDimension() const;
    201 
    202  virtual double NumericValue() const;
    203  virtual void SetTextToDefault();
    204 
    205  void SetType( ON_INTERNAL_OBSOLETE::V5_eAnnotationType type );
    206  ON_INTERNAL_OBSOLETE::V5_eAnnotationType Type() const;
    207  void SetTextDisplayMode( ON_INTERNAL_OBSOLETE::V5_TextDisplayMode mode);
    208  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode TextDisplayMode() const;
    209 
    210  void SetPlane( const ON_Plane& plane );
    211  ON_Plane Plane() const;
    212  int PointCount() const;
    213  void SetPoints( const ON_SimpleArray<ON_2dPoint>& points );
    214  const ON_SimpleArray<ON_2dPoint>& Points() const;
    215  void SetPoint( int idx, ON_3dPoint point );
    216  ON_2dPoint Point( int idx ) const;
    217  void SetUserText( const wchar_t* string );
    218  const ON_wString& UserText() const;
    219  void SetDefaultText( const wchar_t* string );
    220  const ON_wString& DefaultText() const;
    221  void SetUserPositionedText( int bUserPositionedText );
    222  bool UserPositionedText() const;
    223 
    224  // to convert world 3d points to and from annotation 2d points
    225  bool GetECStoWCSXform( ON_Xform& xform ) const;
    226  bool GeWCStoECSXform( ON_Xform& xform ) const;
    227 
    228  ON_INTERNAL_OBSOLETE::V5_eAnnotationType m_type = ON_INTERNAL_OBSOLETE::V5_eAnnotationType::dtNothing; // enum for type of annotation
    229  // DimLinear, DimRadius, etc.
    230 
    231  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode m_textdisplaymode = ON_INTERNAL_OBSOLETE::V5_TextDisplayMode::kNormal; // how the text is displayed
    232  // Horizontal, InLine, AboveLine
    233 
    234  ON_Plane m_plane = ON_Plane::World_xy; // ECS reference plane in WCS coordinates
    235  ON_SimpleArray<ON_2dPoint> m_points; // Definition points for the dimension
    236 
    237  ON_wString m_usertext; // "<>", or user override
    238  ON_wString m_defaulttext; // The displayed text string
    239 
    240  bool m_userpositionedtext = false; // true: User has positioned text
    241  // false: use default location
    242 };
    243 
    244 class ON_OBSOLETE_V2_DimLinear : public ON_OBSOLETE_V2_Annotation
    245 {
    246  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_DimLinear);
    247 
    248 public:
    249  ON_OBSOLETE_V2_DimLinear();
    250  ON_OBSOLETE_V2_DimLinear(const ON_OBSOLETE_V2_DimLinear&);
    251  ~ON_OBSOLETE_V2_DimLinear();
    252  ON_OBSOLETE_V2_DimLinear& operator=(const ON_OBSOLETE_V2_DimLinear&);
    253 
    254  double NumericValue() const override;
    255  void SetTextToDefault() override;
    256  void EmergencyDestroy();
    257 
    258  static ON_OBSOLETE_V2_DimLinear* CreateFromV5LinearDimension(
    259  const class ON_OBSOLETE_V5_DimLinear& V5_linear_dimension,
    260  const class ON_3dmAnnotationContext* annotation_context,
    261  ON_OBSOLETE_V2_DimLinear* destination
    262  );
    263 };
    264 
    265 class ON_OBSOLETE_V2_DimRadial : public ON_OBSOLETE_V2_Annotation
    266 {
    267  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_DimRadial);
    268 
    269 public:
    270  ON_OBSOLETE_V2_DimRadial();
    271  ON_OBSOLETE_V2_DimRadial(const ON_OBSOLETE_V2_DimRadial&);
    272  ~ON_OBSOLETE_V2_DimRadial();
    273  ON_OBSOLETE_V2_DimRadial& operator=(const ON_OBSOLETE_V2_DimRadial&);
    274 
    275  double NumericValue() const override;
    276  void SetTextToDefault() override;
    277 
    278  void EmergencyDestroy();
    279 
    280  static ON_OBSOLETE_V2_DimRadial* CreateFromV5RadialDimension(
    281  const class ON_OBSOLETE_V5_DimRadial& V5_linear_dimension,
    282  const class ON_3dmAnnotationContext* annotation_context,
    283  ON_OBSOLETE_V2_DimRadial* destination
    284  );
    285 };
    286 
    287 class ON_OBSOLETE_V2_DimAngular : public ON_OBSOLETE_V2_Annotation
    288 {
    289  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_DimAngular);
    290 
    291 public:
    292  ON_OBSOLETE_V2_DimAngular();
    293  ON_OBSOLETE_V2_DimAngular(const ON_OBSOLETE_V2_DimAngular&);
    294  ~ON_OBSOLETE_V2_DimAngular();
    295  ON_OBSOLETE_V2_DimAngular& operator=(const ON_OBSOLETE_V2_DimAngular&);
    296 
    297  static ON_OBSOLETE_V2_DimAngular* CreateFromV5AngularDimension(
    298  const class ON_OBSOLETE_V5_DimAngular& V5_angular_dimension,
    299  const class ON_3dmAnnotationContext* annotation_context,
    300  ON_OBSOLETE_V2_DimAngular* destination
    301  );
    302 
    303  void EmergencyDestroy();
    304 
    305  bool Write( ON_BinaryArchive& file ) const override;
    306  bool Read( ON_BinaryArchive& file ) override;
    307 
    308  void SetAngle( double angle ) { m_angle = angle; }
    309  double Angle() const { return m_angle; }
    310  void SetRadius( double radius ) { m_radius = radius; }
    311  double Radius() const { return m_radius; }
    312 
    313  double NumericValue() const override;
    314  void SetTextToDefault() override;
    315 
    316 private:
    317  double m_angle; // angle being dimensioned
    318  double m_radius; // radius for dimension arc
    319 };
    320 
    321 class ON_OBSOLETE_V2_TextObject : public ON_OBSOLETE_V2_Annotation
    322 {
    323  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_TextObject);
    324 
    325 public:
    326  ON_OBSOLETE_V2_TextObject();
    327  ON_OBSOLETE_V2_TextObject(const ON_OBSOLETE_V2_TextObject&);
    328  ~ON_OBSOLETE_V2_TextObject();
    329  ON_OBSOLETE_V2_TextObject& operator=(const ON_OBSOLETE_V2_TextObject&);
    330 
    331  static ON_OBSOLETE_V2_TextObject* CreateFromV5TextObject(
    332  const class ON_OBSOLETE_V5_TextObject& V5_text_object,
    333  const class ON_3dmAnnotationContext* annotation_context,
    334  ON_OBSOLETE_V2_TextObject* destination
    335  );
    336 
    337  void EmergencyDestroy();
    338 
    339  bool Write( ON_BinaryArchive& file ) const override;
    340  bool Read( ON_BinaryArchive& file ) override;
    341 
    342  void SetFaceName( ON_wString string ) { m_facename = string; }
    343  ON_wString FaceName() const { return m_facename; }
    344  void SetFontWeight( int weight ) { m_fontweight = weight; }
    345  int FontWeight() const { return m_fontweight; }
    346  void SetHeight( double height ) { m_height = height; }
    347  double Height() const { return m_height; }
    348 
    349 
    350 private:
    351  ON_wString m_facename;
    352  int m_fontweight; // windows - 400 = NORMAL )
    353  double m_height; // gets multiplied by dimscale
    354 };
    355 
    356 class ON_OBSOLETE_V2_Leader : public ON_OBSOLETE_V2_Annotation
    357 {
    358  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_Leader);
    359 
    360 public:
    361  ON_OBSOLETE_V2_Leader();
    362  ON_OBSOLETE_V2_Leader(const ON_OBSOLETE_V2_Leader&);
    363  ~ON_OBSOLETE_V2_Leader();
    364  ON_OBSOLETE_V2_Leader& operator=(const ON_OBSOLETE_V2_Leader&);
    365 
    366  static ON_OBSOLETE_V2_Leader* CreateFromV5Leader(
    367  const class ON_OBSOLETE_V5_Leader& V5_leader,
    368  const class ON_3dmAnnotationContext* annotation_context,
    369  ON_OBSOLETE_V2_Leader* destination
    370  );
    371 
    372  void EmergencyDestroy();
    373 };
    374 
    375 #endif
    376 #endif
    377 
    Definition: opennurbs_annotationbase.h:23
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_INTERNAL_V2_ANNOTATION_H_INC)
    18 #define OPENNURBS_INTERNAL_V2_ANNOTATION_H_INC
    19 
    20 #if defined(ON_COMPILING_OPENNURBS)
    21 
    22 #include "opennurbs_internal_defines.h"
    23 
    24 // Annotation classes used in version 2 .3dm archives and Rhino version 2.
    25 // All classes in this file are obsolete. They exist so that old files can be read.
    26 
    27 // Legacy annotation arrow is in some old .3dm files.
    28 // Gets converted to an ON_Line with ON_3dmObjectAttributes arrow head
    29 // ON_3dmObjectAttributes.m_object_decoration = (ON::end_arrowhead | other bits)
    30 class ON_OBSOLETE_V2_AnnotationArrow : public ON_Geometry
    31 {
    32  // 3d annotation arrow
    33  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_AnnotationArrow);
    34 public:
    35  ON_OBSOLETE_V2_AnnotationArrow();
    36  ~ON_OBSOLETE_V2_AnnotationArrow();
    37  ON_OBSOLETE_V2_AnnotationArrow(const ON_OBSOLETE_V2_AnnotationArrow&);
    38  ON_OBSOLETE_V2_AnnotationArrow& operator=(const ON_OBSOLETE_V2_AnnotationArrow&);
    39 
    40  /////////////////////////////////////////////////////////////////
    41  //
    42  // ON_Object overrides
    43  //
    44  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    45 
    46  void Dump( ON_TextLog& ) const override; // for debugging
    47 
    48  bool Write(
    49  ON_BinaryArchive& // serialize definition to binary archive
    50  ) const override;
    51 
    52  bool Read(
    53  ON_BinaryArchive& // restore definition from binary archive
    54  ) override;
    55 
    56  ON::object_type ObjectType() const override;
    57 
    58  /////////////////////////////////////////////////////////////////
    59  //
    60  // ON_Geometry overrides
    61  //
    62 
    63  int Dimension() const override;
    64 
    65  // virtual ON_Geometry GetBBox override
    66  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    67 
    68  bool Transform(
    69  const ON_Xform&
    70  ) override;
    71 
    72  /////////////////////////////////////////////////////////////////
    73  //
    74  // Interface
    75  //
    76  ON_3dVector Vector() const;
    77  ON_3dPoint Head() const;
    78  ON_3dPoint Tail() const;
    79 
    80  ON_3dPoint m_tail;
    81  ON_3dPoint m_head;
    82 };
    83 
    84 class ON_OBSOLETE_V2_TextDot : public ON_Point
    85 {
    86  // 3d annotation dot with text
    87  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_TextDot);
    88 public:
    89  ON_OBSOLETE_V2_TextDot();
    90  ~ON_OBSOLETE_V2_TextDot();
    91  ON_OBSOLETE_V2_TextDot(const ON_OBSOLETE_V2_TextDot&);
    92  ON_OBSOLETE_V2_TextDot& operator=(const ON_OBSOLETE_V2_TextDot&);
    93 
    94  /////////////////////////////////////////////////////////////////
    95  //
    96  // ON_Object overrides
    97  //
    98 
    99  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    100  void Dump( ON_TextLog& ) const override; // for debugging
    101 
    102  bool Write(
    103  ON_BinaryArchive& // serialize definition to binary archive
    104  ) const override;
    105 
    106  bool Read(
    107  ON_BinaryArchive& // restore definition from binary archive
    108  ) override;
    109 
    110  ON_wString m_text;
    111 };
    112 
    113 
    114 ////////////////////////////////////////////////////////////////
    115 //
    116 // ON_OBSOLETE_V2_Annotation - used to serialize definitions of annotation
    117 // objects (dimensions, text blocks, etc.).
    118 //
    119 
    120 class ON_OBSOLETE_V2_Annotation : public ON_Geometry
    121 {
    122  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_Annotation);
    123 
    124 protected:
    125  ON_OBSOLETE_V2_Annotation() = default;
    126  ON_OBSOLETE_V2_Annotation(const ON_OBSOLETE_V2_Annotation&) = default;
    127  ON_OBSOLETE_V2_Annotation& operator=(const ON_OBSOLETE_V2_Annotation&) = default;
    128 
    129 public:
    130  virtual ~ON_OBSOLETE_V2_Annotation() = default;
    131 
    132 protected:
    133  void Internal_Initialize(); // initialize class's fields assuming
    134  // memory is uninitialized
    135 
    136 public:
    137  static ON_OBSOLETE_V2_Annotation* CreateFromV5Annotation(
    138  const class ON_OBSOLETE_V5_Annotation& V5_annotation,
    139  const class ON_3dmAnnotationContext* annotation_context
    140  );
    141 
    142  static ON_OBSOLETE_V2_Annotation* CreateFromV6Annotation(
    143  const class ON_Annotation& V6_annotation,
    144  const class ON_3dmAnnotationContext* annotation_context
    145  );
    146 
    147 protected:
    148  void Internal_InitializeFromV5Annotation(
    149  const ON_OBSOLETE_V5_Annotation& V5_annotation,
    150  const class ON_3dmAnnotationContext* annotation_context
    151  );
    152 
    153 public:
    154  void Destroy();
    155  void EmergencyDestroy();
    156 
    157  /////////////////////////////////////////////////////////////////
    158  //
    159  // ON_Object overrides
    160  //
    161  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    162 
    163  void Dump( ON_TextLog& ) const override; // for debugging
    164 
    165  bool Write(
    166  ON_BinaryArchive& // serialize definition to binary archive
    167  ) const override;
    168 
    169  bool Read(
    170  ON_BinaryArchive& // restore definition from binary archive
    171  ) override;
    172 
    173  ON::object_type ObjectType() const override;
    174 
    175  /////////////////////////////////////////////////////////////////
    176  //
    177  // ON_Geometry overrides
    178  //
    179 
    180  int Dimension() const override;
    181 
    182  // virtual ON_Geometry GetBBox override
    183  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    184 
    185  bool Transform(
    186  const ON_Xform&
    187  ) override;
    188 
    189  /////////////////////////////////////////////////////////////////
    190  //
    191  // ON_OBSOLETE_V2_Annotation interface
    192  //
    193 
    194  // use these to get/set the current annotation settings
    195  static const ON_3dmAnnotationSettings& AnnotationSettings();
    196  static void SetAnnotationSettings( const ON_3dmAnnotationSettings* );
    197 
    198  bool IsText() const;
    199  bool IsLeader() const;
    200  bool IsDimension() const;
    201 
    202  virtual double NumericValue() const;
    203  virtual void SetTextToDefault();
    204 
    205  void SetType( ON_INTERNAL_OBSOLETE::V5_eAnnotationType type );
    206  ON_INTERNAL_OBSOLETE::V5_eAnnotationType Type() const;
    207  void SetTextDisplayMode( ON_INTERNAL_OBSOLETE::V5_TextDisplayMode mode);
    208  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode TextDisplayMode() const;
    209 
    210  void SetPlane( const ON_Plane& plane );
    211  ON_Plane Plane() const;
    212  int PointCount() const;
    213  void SetPoints( const ON_SimpleArray<ON_2dPoint>& points );
    214  const ON_SimpleArray<ON_2dPoint>& Points() const;
    215  void SetPoint( int idx, ON_3dPoint point );
    216  ON_2dPoint Point( int idx ) const;
    217  void SetUserText( const wchar_t* string );
    218  const ON_wString& UserText() const;
    219  void SetDefaultText( const wchar_t* string );
    220  const ON_wString& DefaultText() const;
    221  void SetUserPositionedText( int bUserPositionedText );
    222  bool UserPositionedText() const;
    223 
    224  // to convert world 3d points to and from annotation 2d points
    225  bool GetECStoWCSXform( ON_Xform& xform ) const;
    226  bool GeWCStoECSXform( ON_Xform& xform ) const;
    227 
    228  ON_INTERNAL_OBSOLETE::V5_eAnnotationType m_type = ON_INTERNAL_OBSOLETE::V5_eAnnotationType::dtNothing; // enum for type of annotation
    229  // DimLinear, DimRadius, etc.
    230 
    231  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode m_textdisplaymode = ON_INTERNAL_OBSOLETE::V5_TextDisplayMode::kNormal; // how the text is displayed
    232  // Horizontal, InLine, AboveLine
    233 
    234  ON_Plane m_plane = ON_Plane::World_xy; // ECS reference plane in WCS coordinates
    235  ON_SimpleArray<ON_2dPoint> m_points; // Definition points for the dimension
    236 
    237  ON_wString m_usertext; // "<>", or user override
    238  ON_wString m_defaulttext; // The displayed text string
    239 
    240  bool m_userpositionedtext = false; // true: User has positioned text
    241  // false: use default location
    242 };
    243 
    244 class ON_OBSOLETE_V2_DimLinear : public ON_OBSOLETE_V2_Annotation
    245 {
    246  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_DimLinear);
    247 
    248 public:
    249  ON_OBSOLETE_V2_DimLinear();
    250  ON_OBSOLETE_V2_DimLinear(const ON_OBSOLETE_V2_DimLinear&);
    251  ~ON_OBSOLETE_V2_DimLinear();
    252  ON_OBSOLETE_V2_DimLinear& operator=(const ON_OBSOLETE_V2_DimLinear&);
    253 
    254  double NumericValue() const override;
    255  void SetTextToDefault() override;
    256  void EmergencyDestroy();
    257 
    258  static ON_OBSOLETE_V2_DimLinear* CreateFromV5LinearDimension(
    259  const class ON_OBSOLETE_V5_DimLinear& V5_linear_dimension,
    260  const class ON_3dmAnnotationContext* annotation_context,
    261  ON_OBSOLETE_V2_DimLinear* destination
    262  );
    263 };
    264 
    265 class ON_OBSOLETE_V2_DimRadial : public ON_OBSOLETE_V2_Annotation
    266 {
    267  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_DimRadial);
    268 
    269 public:
    270  ON_OBSOLETE_V2_DimRadial();
    271  ON_OBSOLETE_V2_DimRadial(const ON_OBSOLETE_V2_DimRadial&);
    272  ~ON_OBSOLETE_V2_DimRadial();
    273  ON_OBSOLETE_V2_DimRadial& operator=(const ON_OBSOLETE_V2_DimRadial&);
    274 
    275  double NumericValue() const override;
    276  void SetTextToDefault() override;
    277 
    278  void EmergencyDestroy();
    279 
    280  static ON_OBSOLETE_V2_DimRadial* CreateFromV5RadialDimension(
    281  const class ON_OBSOLETE_V5_DimRadial& V5_linear_dimension,
    282  const class ON_3dmAnnotationContext* annotation_context,
    283  ON_OBSOLETE_V2_DimRadial* destination
    284  );
    285 };
    286 
    287 class ON_OBSOLETE_V2_DimAngular : public ON_OBSOLETE_V2_Annotation
    288 {
    289  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_DimAngular);
    290 
    291 public:
    292  ON_OBSOLETE_V2_DimAngular();
    293  ON_OBSOLETE_V2_DimAngular(const ON_OBSOLETE_V2_DimAngular&);
    294  ~ON_OBSOLETE_V2_DimAngular();
    295  ON_OBSOLETE_V2_DimAngular& operator=(const ON_OBSOLETE_V2_DimAngular&);
    296 
    297  static ON_OBSOLETE_V2_DimAngular* CreateFromV5AngularDimension(
    298  const class ON_OBSOLETE_V5_DimAngular& V5_angular_dimension,
    299  const class ON_3dmAnnotationContext* annotation_context,
    300  ON_OBSOLETE_V2_DimAngular* destination
    301  );
    302 
    303  void EmergencyDestroy();
    304 
    305  bool Write( ON_BinaryArchive& file ) const override;
    306  bool Read( ON_BinaryArchive& file ) override;
    307 
    308  void SetAngle( double angle ) { m_angle = angle; }
    309  double Angle() const { return m_angle; }
    310  void SetRadius( double radius ) { m_radius = radius; }
    311  double Radius() const { return m_radius; }
    312 
    313  double NumericValue() const override;
    314  void SetTextToDefault() override;
    315 
    316 private:
    317  double m_angle; // angle being dimensioned
    318  double m_radius; // radius for dimension arc
    319 };
    320 
    321 class ON_OBSOLETE_V2_TextObject : public ON_OBSOLETE_V2_Annotation
    322 {
    323  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_TextObject);
    324 
    325 public:
    326  ON_OBSOLETE_V2_TextObject();
    327  ON_OBSOLETE_V2_TextObject(const ON_OBSOLETE_V2_TextObject&);
    328  ~ON_OBSOLETE_V2_TextObject();
    329  ON_OBSOLETE_V2_TextObject& operator=(const ON_OBSOLETE_V2_TextObject&);
    330 
    331  static ON_OBSOLETE_V2_TextObject* CreateFromV5TextObject(
    332  const class ON_OBSOLETE_V5_TextObject& V5_text_object,
    333  const class ON_3dmAnnotationContext* annotation_context,
    334  ON_OBSOLETE_V2_TextObject* destination
    335  );
    336 
    337  void EmergencyDestroy();
    338 
    339  bool Write( ON_BinaryArchive& file ) const override;
    340  bool Read( ON_BinaryArchive& file ) override;
    341 
    342  void SetFaceName( ON_wString string ) { m_facename = string; }
    343  ON_wString FaceName() const { return m_facename; }
    344  void SetFontWeight( int weight ) { m_fontweight = weight; }
    345  int FontWeight() const { return m_fontweight; }
    346  void SetHeight( double height ) { m_height = height; }
    347  double Height() const { return m_height; }
    348 
    349 
    350 private:
    351  ON_wString m_facename;
    352  int m_fontweight; // windows - 400 = NORMAL )
    353  double m_height; // gets multiplied by dimscale
    354 };
    355 
    356 class ON_OBSOLETE_V2_Leader : public ON_OBSOLETE_V2_Annotation
    357 {
    358  ON_OBJECT_DECLARE(ON_OBSOLETE_V2_Leader);
    359 
    360 public:
    361  ON_OBSOLETE_V2_Leader();
    362  ON_OBSOLETE_V2_Leader(const ON_OBSOLETE_V2_Leader&);
    363  ~ON_OBSOLETE_V2_Leader();
    364  ON_OBSOLETE_V2_Leader& operator=(const ON_OBSOLETE_V2_Leader&);
    365 
    366  static ON_OBSOLETE_V2_Leader* CreateFromV5Leader(
    367  const class ON_OBSOLETE_V5_Leader& V5_leader,
    368  const class ON_3dmAnnotationContext* annotation_context,
    369  ON_OBSOLETE_V2_Leader* destination
    370  );
    371 
    372  void EmergencyDestroy();
    373 };
    374 
    375 #endif
    376 #endif
    377 
    Definition: opennurbs_annotationbase.h:23
    virtual bool Transform(const ON_Xform &xform)
    virtual int Dimension() const
    virtual bool GetBBox(double *boxmin, double *boxmax, bool bGrowBox=false) const
    -
    ON_Point & operator=(const ON_Point &)
    -
    bool IsValid(class ON_TextLog *text_log=nullptr) const override
    Definition: opennurbs_string.h:2089
    virtual ON::object_type ObjectType() const
    -
    void Dump(ON_TextLog &) const override
    for debugging
    Definition: opennurbs_archive.h:1653
    Definition: opennurbs_geometry.h:36
    Definition: opennurbs_point.h:292
    Definition: opennurbs_3dm_settings.h:108
    static const ON_Plane World_xy
    world plane coordinate system ON_Plane(ON_3dPoint::Origin, ON_3dVector::XAxis, ON_3dVector::YAxis); ...
    Definition: opennurbs_plane.h:517
    -
    bool Write(ON_BinaryArchive &) const override
    -
    bool Read(ON_BinaryArchive &) override
    Definition: opennurbs_xform.h:28
    virtual void Dump(ON_TextLog &) const
    -
    void EmergencyDestroy()
    ON_Geometry & operator=(const ON_Geometry &)=default
    Definition: opennurbs_textlog.h:20
    < use for generic serialization of binary data
    Definition: opennurbs_archive.h:1866
    @@ -102,9 +94,9 @@ $(function() {
    diff --git a/6/d1/de2/class_o_n___file_iterator-members.html b/6/d1/de2/class_o_n___file_iterator-members.html index 2055da75..3216aca2 100644 --- a/6/d1/de2/class_o_n___file_iterator-members.html +++ b/6/d1/de2/class_o_n___file_iterator-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d1/df0/class_o_n___aggregate_component_status.html b/6/d1/df0/class_o_n___aggregate_component_status.html index 0c486579..3c0ece1d 100644 --- a/6/d1/df0/class_o_n___aggregate_component_status.html +++ b/6/d1/df0/class_o_n___aggregate_component_status.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_AggregateComponentStatus Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Sets all states specified by states_to_clear to clear.
    - Does not change current mark. Does not change compoent count. Returns true if successful. false if information is not current and ClearAggregateStatus() failed.

    +

    Description: Sets all states specified by states_to_clear to clear. Does not change current mark. Does not change compoent count. Returns true if successful. false if information is not current and ClearAggregateStatus() failed.

    @@ -289,8 +286,7 @@ Static Public Attributes
    -

    Description: Sets all states to clear.
    - Marks status as current. Does not change compoent count Returns true if successful. false if information is not current and ClearAllStates() failed.

    +

    Description: Sets all states to clear. Marks status as current. Does not change compoent count Returns true if successful. false if information is not current and ClearAllStates() failed.

    @@ -543,9 +539,9 @@ Static Public Attributes diff --git a/6/d1/df2/opennurbs__sha1_8h_source.html b/6/d1/df2/opennurbs__sha1_8h_source.html index 8200ce25..12e5ebe2 100644 --- a/6/d1/df2/opennurbs__sha1_8h_source.html +++ b/6/d1/df2/opennurbs__sha1_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_sha1.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_sha1.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d00/class_o_n___length_value-members.html b/6/d2/d00/class_o_n___length_value-members.html index 0007c8f2..054d9f8f 100644 --- a/6/d2/d00/class_o_n___length_value-members.html +++ b/6/d2/d00/class_o_n___length_value-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d00/opennurbs__math_8h_source.html b/6/d2/d00/opennurbs__math_8h_source.html index 51282130..b69b9c9e 100644 --- a/6/d2/d00/opennurbs__math_8h_source.html +++ b/6/d2/d00/opennurbs__math_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_math.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_math.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d1a/class_o_n___point_cloud-members.html b/6/d2/d1a/class_o_n___point_cloud-members.html index 6141e449..3f55849e 100644 --- a/6/d2/d1a/class_o_n___point_cloud-members.html +++ b/6/d2/d1a/class_o_n___point_cloud-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d1e/class_o_n___material_ref-members.html b/6/d2/d1e/class_o_n___material_ref-members.html index 5924a94d..cae29fa2 100644 --- a/6/d2/d1e/class_o_n___material_ref-members.html +++ b/6/d2/d1e/class_o_n___material_ref-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d22/class_o_n___read3dm_buffer_archive-members.html b/6/d2/d22/class_o_n___read3dm_buffer_archive-members.html index 3f9eb72f..f5b4f7d3 100644 --- a/6/d2/d22/class_o_n___read3dm_buffer_archive-members.html +++ b/6/d2/d22/class_o_n___read3dm_buffer_archive-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d25/class_o_n___component_attributes-members.html b/6/d2/d25/class_o_n___component_attributes-members.html index 072482bc..999eddec 100644 --- a/6/d2/d25/class_o_n___component_attributes-members.html +++ b/6/d2/d25/class_o_n___component_attributes-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d25/opennurbs__arc_8h_source.html b/6/d2/d25/opennurbs__arc_8h_source.html index e7a3e30e..02530a65 100644 --- a/6/d2/d25/opennurbs__arc_8h_source.html +++ b/6/d2/d25/opennurbs__arc_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_arc.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_arc.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d32/class_o_n__3f_point_array.html b/6/d2/d32/class_o_n__3f_point_array.html index 4637a82d..a360af52 100644 --- a/6/d2/d32/class_o_n__3f_point_array.html +++ b/6/d2/d32/class_o_n__3f_point_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3fPointArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d35/class_o_n__3d_point.html b/6/d2/d35/class_o_n__3d_point.html index ae77e6e1..5a68d614 100644 --- a/6/d2/d35/class_o_n__3d_point.html +++ b/6/d2/d35/class_o_n__3d_point.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dPoint Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    ◆ operator<()

    +

    ◆ operator<()

    @@ -1540,7 +1538,7 @@ Static Public Attributes
    -

    ◆ operator<=()

    +

    ◆ operator<=()

    @@ -1808,7 +1806,7 @@ Static Public Attributes
    -

    ◆ operator>()

    +

    ◆ operator>()

    @@ -1826,7 +1824,7 @@ Static Public Attributes
    -

    ◆ operator>=()

    +

    ◆ operator>=()

    @@ -2200,9 +2198,9 @@ Static Public Attributes
    diff --git a/6/d2/d39/opennurbs__brep_8h_source.html b/6/d2/d39/opennurbs__brep_8h_source.html index a0144160..bd5b6767 100644 --- a/6/d2/d39/opennurbs__brep_8h_source.html +++ b/6/d2/d39/opennurbs__brep_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_brep.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_brep.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d2/d3b/class_o_n___string.html b/6/d2/d3b/class_o_n___string.html index 3401b1de..54aa7fe4 100644 --- a/6/d2/d3b/class_o_n___string.html +++ b/6/d2/d3b/class_o_n___string.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_String Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Compare this string and other_name as a name attribute of an object like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on. These comparisons ignore case and use appropriate string normalization.
    -Parameters: other_name - [in] null terminated string

    +

    Description: Compare this string and other_name as a name attribute of an object like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on. These comparisons ignore case and use appropriate string normalization. Parameters: other_name - [in] null terminated string

    @@ -1237,8 +1234,7 @@ Parameters: other_name - [in] null terminated string

    -

    Description: Compare this string and other_name as a name attribute of an object like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on. These comparisons ignore case and use appropriate string normalization.
    -Parameters: name1 - [in] null terminated string name2 - [in] null terminated string

    +

    Description: Compare this string and other_name as a name attribute of an object like ON_3dmObjectAttributes.m_name, ON_Layer.m_name, and so on. These comparisons ignore case and use appropriate string normalization. Parameters: name1 - [in] null terminated string name2 - [in] null terminated string

    @@ -2466,8 +2462,7 @@ Parameters: name1 - [in] null terminated string name2 - [in] null terminated str
    -

    Parameters: format - [in] Format control.
    - Positional paramters of the form N$x where N >= 1 and x is the standard format specification are supported. Avoid using S (capital S). See the Remarks for details. ... - [in] arguments for replacable items in the format string. Returns: True if successful. False if the string is too long or the format string is not valid. Remarks: When using Microsoft's compiler and other compilers that provide similar locale support, the locale is the invariant culture locale returned by ON_Locale::InvariantCulture::LocalePtr().

    +

    Parameters: format - [in] Format control. Positional paramters of the form N$x where N >= 1 and x is the standard format specification are supported. Avoid using S (capital S). See the Remarks for details. ... - [in] arguments for replacable items in the format string. Returns: True if successful. False if the string is too long or the format string is not valid. Remarks: When using Microsoft's compiler and other compilers that provide similar locale support, the locale is the invariant culture locale returned by ON_Locale::InvariantCulture::LocalePtr().

    The way Windows handles the S (capital S) format parameter depends on locale and code page settings. It is strongly reccommended that you never use S to include any string that may possibly contain elements with values > 127. The following examples illustrate a way to predictably use UTF-8 and wchar_t parameters in buffers of the other element type.

    const char* utf8_string = ...; / UNRELIABLE ///< ON_wString::Format(buffer,buffer_capacity,"%S",utf8_string); / The code below will treat utf8_string as a UTF-8 encoded string. wchar_t wchar_buffer[...]; const size_t wchar_buffer_capacity= sizeof(buffer)/sizeof(buffer[0]); ON_wString::Format(wchar_buffer, wchar_buffer_capacity, "%s", ON_wString(utf8_string));

    const wchar_t* wide_string = ...; / UNRELIABLE ///< ON_wString::Format(buffer,buffer_capacity,"%S",char_string); / The code below will include wide_string as a UTF-8 encoded string. char char_buffer[...]; const size_t char_buffer_capacity = sizeof(buffer)/sizeof(buffer[0]); ON_String::Format(char_buffer, char_buffer_capacity, "%s", ON_String(wide_string));

    @@ -2547,8 +2542,7 @@ Parameters: name1 - [in] null terminated string name2 - [in] null terminated str
    -

    Description: A platform independent, secure, culture invariant way to format a char string. This function is provide to be used when it is critical that the formatting be platform independent, secure and culture invarient. Parameters: buffer - [out] not null buffer_capacity - [in] > 0 Number of char elements in buffer. sFormat - [in] Avoid using S (capital S). See the Remarks for details. ... - [in] Returns: >= 0: The number of char elements written to buffer[], not including the null terminator. A null terminator is always added (buffer[returned value] = 0). The last element of buffer[] is always set to zero (buffer[buffer_capacity-1] = 0). < 0: failure: If buffer is not null and buffer_capacity > 0, then buffer[0] = 0 and buffer[buffer_capacity-1] = 0; Remarks: The way Windows handles the S (capital S) format parameter depends on locale and code page settings. It is strongly reccommended that you never use S to include any string that may possibly contain elements with values > 127.
    - The following examples illustrate a way to predictably use UTF-8 and wchar_t parameters in buffers of the other element type.

     const char* utf8_string = ...;
    +

    Description: A platform independent, secure, culture invariant way to format a char string. This function is provide to be used when it is critical that the formatting be platform independent, secure and culture invarient. Parameters: buffer - [out] not null buffer_capacity - [in] > 0 Number of char elements in buffer. sFormat - [in] Avoid using S (capital S). See the Remarks for details. ... - [in] Returns: >= 0: The number of char elements written to buffer[], not including the null terminator. A null terminator is always added (buffer[returned value] = 0). The last element of buffer[] is always set to zero (buffer[buffer_capacity-1] = 0). < 0: failure: If buffer is not null and buffer_capacity > 0, then buffer[0] = 0 and buffer[buffer_capacity-1] = 0; Remarks: The way Windows handles the S (capital S) format parameter depends on locale and code page settings. It is strongly reccommended that you never use S to include any string that may possibly contain elements with values > 127. The following examples illustrate a way to predictably use UTF-8 and wchar_t parameters in buffers of the other element type.

     const char* utf8_string = ...;
     

    / UNRELIABLE ///< ON_wString::Format(buffer,buffer_capacity,"%S",utf8_string); wchar_t wchar_buffer[...]; const size_t wchar_buffer_capacity= sizeof(buffer)/sizeof(buffer[0]); ON_wString::Format(wchar_buffer, wchar_buffer_capacity, "%s", ON_wString(utf8_string));

    const wchar_t* wide_string = ...; / UNRELIABLE ///< ON_wString::Format(buffer,buffer_capacity,"%S",char_string); char char_buffer[...]; const size_t char_buffer_capacity = sizeof(buffer)/sizeof(buffer[0]); ON_String::Format(char_buffer, char_buffer_capacity, "%s", ON_String(wide_string));

    @@ -3394,8 +3388,7 @@ Parameters: name1 - [in] null terminated string name2 - [in] null terminated str
    -

    Description: Map a single byte UTF-8 element to upper or lower case. Parameters: c - [in] If c is in the range A to Z or a to z, the map specified by map_type is applied. All other values of c are unchanged.
    -Remarks: MapCharacterOrdinal is not appropriate for general string mapping.

    +

    Description: Map a single byte UTF-8 element to upper or lower case. Parameters: c - [in] If c is in the range A to Z or a to z, the map specified by map_type is applied. All other values of c are unchanged. Remarks: MapCharacterOrdinal is not appropriate for general string mapping.

    @@ -3540,8 +3533,8 @@ Remarks: MapCharacterOrdinal is not appropriate for general string mapping.

    If element_count < 1, then string[] must be null terminated and ON_wString::Length(string)+1 elements are mapped. The +1 insures the output is null terminated.

    mapped_string - [out] The result of the mapping is returned in mapped_string[].

    mapped_string_capacity - [in] Number of char elements available in mapped_string[] or 0 to calculate the minimum number of elements needed for the mapping.

    -

    Returns: If mapped_string_capacity > 0, then the number elements set in mapped_string[] is returned.
    - If mapped_string_capacity == 0, then the number elements required to perform the mapping is returned.

    +

    Returns: If mapped_string_capacity > 0, then the number elements set in mapped_string[] is returned.

    +

    If mapped_string_capacity == 0, then the number elements required to perform the mapping is returned.

    When there is room, mapped_string[] is null terminated.

    0: Failure.

    @@ -5792,9 +5785,9 @@ Remarks: MapCharacterOrdinal is not appropriate for general string mapping.

    diff --git a/6/d2/d44/class_o_n___brep_vertex_array.html b/6/d2/d44/class_o_n___brep_vertex_array.html index ef3861c3..95361e8b 100644 --- a/6/d2/d44/class_o_n___brep_vertex_array.html +++ b/6/d2/d44/class_o_n___brep_vertex_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepVertexArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d4c/class_o_n__3dm_units_and_tolerances-members.html b/6/d2/d4c/class_o_n__3dm_units_and_tolerances-members.html index 4a010f39..58c8ed49 100644 --- a/6/d2/d4c/class_o_n__3dm_units_and_tolerances-members.html +++ b/6/d2/d4c/class_o_n__3dm_units_and_tolerances-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d4d/class_o_n___rtf_string_builder_1_1_text_run-members.html b/6/d2/d4d/class_o_n___rtf_string_builder_1_1_text_run-members.html index d7693ff1..9d34db8f 100644 --- a/6/d2/d4d/class_o_n___rtf_string_builder_1_1_text_run-members.html +++ b/6/d2/d4d/class_o_n___rtf_string_builder_1_1_text_run-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d53/class_o_n___linetype_segment.html b/6/d2/d53/class_o_n___linetype_segment.html index 35b05424..b5614731 100644 --- a/6/d2/d53/class_o_n___linetype_segment.html +++ b/6/d2/d53/class_o_n___linetype_segment.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_LinetypeSegment Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d58/class_o_n__3dm_annotation_settings-members.html b/6/d2/d58/class_o_n__3dm_annotation_settings-members.html index 0f3c24ce..33577517 100644 --- a/6/d2/d58/class_o_n__3dm_annotation_settings-members.html +++ b/6/d2/d58/class_o_n__3dm_annotation_settings-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d58/class_o_n___bounding_box-members.html b/6/d2/d58/class_o_n___bounding_box-members.html index a57608fd..0563d19f 100644 --- a/6/d2/d58/class_o_n___bounding_box-members.html +++ b/6/d2/d58/class_o_n___bounding_box-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d63/opennurbs__internal___v5__dimstyle_8h_source.html b/6/d2/d63/opennurbs__internal___v5__dimstyle_8h_source.html index 333ab829..e76bfabe 100644 --- a/6/d2/d63/opennurbs__internal___v5__dimstyle_8h_source.html +++ b/6/d2/d63/opennurbs__internal___v5__dimstyle_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_internal_V5_dimstyle.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_internal_V5_dimstyle.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d69/opennurbs__private__wrap__defs_8h_source.html b/6/d2/d69/opennurbs__private__wrap__defs_8h_source.html index 62599c03..05cb0af9 100644 --- a/6/d2/d69/opennurbs__private__wrap__defs_8h_source.html +++ b/6/d2/d69/opennurbs__private__wrap__defs_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_private_wrap_defs.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_private_wrap_defs.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2014 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 #if !defined(OPENNURBS_PRIVATE_WRAP_DEFS_INC_)
    17 #define OPENNURBS_PRIVATE_WRAP_DEFS_INC_
    18 
    19 #if 0
    20 // OBSOLETE
    21 template <class T>
    22 ON_PrivateWrap<T>::ON_PrivateWrap()
    23  : r(*(new(((void*)_buffer))T()))
    24 {
    25  // Use placement new to constuct a T class in the memory located in the _buffer[] member;
    26 }
    27 
    28 template <class T >
    29 ON_PrivateWrap< T >::~ON_PrivateWrap()
    30 {
    31  T * p = &r;
    32  if (nullptr != p)
    33  p->~T();
    34  _buffer[0] = _buffer[1] = _buffer[2] = _buffer[3] = _buffer[4] = 0;
    35 }
    36 
    37 template <class T >
    38 ON_PrivateWrap< T >::ON_PrivateWrap(const ON_PrivateWrap< T >& src)
    39  : r(*(new(((void*)_buffer))T(src.r)))
    40 {
    41  // Use in placement new to copy constuct a T class in the memory located in the _buffer[] member;
    42 }
    43 
    44 template <class T >
    45 ON_PrivateWrap< T >& ON_PrivateWrap< T >::operator=(const ON_PrivateWrap< T >& src)
    46 {
    47  if (this != &src)
    48  r = src.r;
    49  return *this;
    50 }
    51 
    52 template <class T >
    53 ON_PrivateWrap< T >::ON_PrivateWrap(const ON_PrivateWrap< T >&& src)
    54  : r(*(new(((void*)_buffer))T(std::move(src.r))))
    55 {
    56  // Use in placement new to rvalue copy constuct a T class in the memory located in the _buffer[] member;
    57 }
    58 
    59 template <class T >
    60 ON_PrivateWrap< T >& ON_PrivateWrap< T >::operator=(const ON_PrivateWrap< T >&& src)
    61 {
    62  if (this != &src)
    63  r = std::move(src.r);
    64  return *this;
    65 }
    66 
    67 template <class T >
    68 ON_PrivateWrap< T >::operator const T * () const
    69 {
    70  return &r;
    71 }
    72 
    73 template <class T >
    74 ON_PrivateWrap< T >::operator T * ()
    75 {
    76  return &r;
    77 }
    78 
    79 template <class T >
    80 ON_PrivateWrap< T >::operator const T & () const
    81 {
    82  return r;
    83 }
    84 
    85 template <class T >
    86 ON_PrivateWrap< T >::operator T& ()
    87 {
    88  return r;
    89 }
    90 #endif
    91 
    92 #endif
    93 
    diff --git a/6/d2/d6a/class_o_n__3dm_view_position.html b/6/d2/d6a/class_o_n__3dm_view_position.html index bb263f74..cc0a4aa9 100644 --- a/6/d2/d6a/class_o_n__3dm_view_position.html +++ b/6/d2/d6a/class_o_n__3dm_view_position.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmViewPosition Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d6a/class_o_n___referenced_component_settings-members.html b/6/d2/d6a/class_o_n___referenced_component_settings-members.html index 4499b79c..99957152 100644 --- a/6/d2/d6a/class_o_n___referenced_component_settings-members.html +++ b/6/d2/d6a/class_o_n___referenced_component_settings-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d6c/class_o_n___earth_anchor_point.html b/6/d2/d6c/class_o_n___earth_anchor_point.html index 0d1bc071..0a9097db 100644 --- a/6/d2/d6c/class_o_n___earth_anchor_point.html +++ b/6/d2/d6c/class_o_n___earth_anchor_point.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_EarthAnchorPoint Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Get a transformation from model coordinates to earth coordinates. This transformation assumes the model is small enough that the curvature of the earth can be ignored.
    -Parameters: model_unit_system - [in] model_to_earth - [out] Transformation from model coordinates to earth locations (degrees latitude,degrees longitude,elevation in meters) Remarks: If M is a point in model coordinates and E = model_to_earth*M, then E.x = latitude in decimal degrees E.y = longitude in decimal degrees E.z = elevation in meters above mean sea level

    +

    Description: Get a transformation from model coordinates to earth coordinates. This transformation assumes the model is small enough that the curvature of the earth can be ignored. Parameters: model_unit_system - [in] model_to_earth - [out] Transformation from model coordinates to earth locations (degrees latitude,degrees longitude,elevation in meters) Remarks: If M is a point in model coordinates and E = model_to_earth*M, then E.x = latitude in decimal degrees E.y = longitude in decimal degrees E.z = elevation in meters above mean sea level

    Because the earth is not flat, there is a small amount of error when using a linear transformation to calculate oblate spherical coordinates. This error is small. If the distance from P to M is d meters, then the approximation error is

    latitude error <= longitude error <= elevation error <= 6379000*((1 + (d/6356000)^2)-1) meters

    In particular, if every point in the model is within 1000 meters of the m_model_basepoint, then the maximum approximation errors are

    @@ -1302,9 +1299,9 @@ Parameters: model_unit_system - [in] model_to_earth - [out] Transformation from
    diff --git a/6/d2/d71/class_o_n___base64_encode_stream-members.html b/6/d2/d71/class_o_n___base64_encode_stream-members.html index 62edbc12..e057d27e 100644 --- a/6/d2/d71/class_o_n___base64_encode_stream-members.html +++ b/6/d2/d71/class_o_n___base64_encode_stream-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d73/class_o_n___rdk_material_instance_id_obsolete_user_data.html b/6/d2/d73/class_o_n___rdk_material_instance_id_obsolete_user_data.html index 4854a207..533f792d 100644 --- a/6/d2/d73/class_o_n___rdk_material_instance_id_obsolete_user_data.html +++ b/6/d2/d73/class_o_n___rdk_material_instance_id_obsolete_user_data.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RdkMaterialInstanceIdObsoleteUserData Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d76/class_o_n___rdk_material_instance_id_obsolete_user_data-members.html b/6/d2/d76/class_o_n___rdk_material_instance_id_obsolete_user_data-members.html index 6f238653..98aa8fba 100644 --- a/6/d2/d76/class_o_n___rdk_material_instance_id_obsolete_user_data-members.html +++ b/6/d2/d76/class_o_n___rdk_material_instance_id_obsolete_user_data-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d78/struct_o_n___r_tree_sphere-members.html b/6/d2/d78/struct_o_n___r_tree_sphere-members.html index fc2de380..af108764 100644 --- a/6/d2/d78/struct_o_n___r_tree_sphere-members.html +++ b/6/d2/d78/struct_o_n___r_tree_sphere-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d7a/class_o_n___linetype-members.html b/6/d2/d7a/class_o_n___linetype-members.html index e7f4bbf7..ffcb5a42 100644 --- a/6/d2/d7a/class_o_n___linetype-members.html +++ b/6/d2/d7a/class_o_n___linetype-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d7c/class_o_n__3dm_notes-members.html b/6/d2/d7c/class_o_n__3dm_notes-members.html index e8f22ab6..3da88bd0 100644 --- a/6/d2/d7c/class_o_n__3dm_notes-members.html +++ b/6/d2/d7c/class_o_n__3dm_notes-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d7d/class_o_n___m_d5-members.html b/6/d2/d7d/class_o_n___m_d5-members.html index cd7cc826..122ff563 100644 --- a/6/d2/d7d/class_o_n___m_d5-members.html +++ b/6/d2/d7d/class_o_n___m_d5-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d7f/class_o_n___hash32_table.html b/6/d2/d7f/class_o_n___hash32_table.html index 8eb34451..39a2ea03 100644 --- a/6/d2/d7f/class_o_n___hash32_table.html +++ b/6/d2/d7f/class_o_n___hash32_table.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Hash32Table Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d86/class_o_n___user_string_list-members.html b/6/d2/d86/class_o_n___user_string_list-members.html index 5d08b9f7..971336d4 100644 --- a/6/d2/d86/class_o_n___user_string_list-members.html +++ b/6/d2/d86/class_o_n___user_string_list-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d98/opennurbs__plane_8h_source.html b/6/d2/d98/opennurbs__plane_8h_source.html index f25ddb07..676a180b 100644 --- a/6/d2/d98/opennurbs__plane_8h_source.html +++ b/6/d2/d98/opennurbs__plane_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_plane.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_plane.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d99/opennurbs__textlog_8h_source.html b/6/d2/d99/opennurbs__textlog_8h_source.html index 1d8c3dfe..9d3c2528 100644 --- a/6/d2/d99/opennurbs__textlog_8h_source.html +++ b/6/d2/d99/opennurbs__textlog_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_textlog.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_textlog.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/d9a/class_o_n___text.html b/6/d2/d9a/class_o_n___text.html index b0347016..89c5c941 100644 --- a/6/d2/d9a/class_o_n___text.html +++ b/6/d2/d9a/class_o_n___text.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Text Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -1472,9 +1470,9 @@ Additional Inherited Members diff --git a/6/d2/d9b/class_o_n__4d_point_array.html b/6/d2/d9b/class_o_n__4d_point_array.html index b934ff3c..80c5622a 100644 --- a/6/d2/d9b/class_o_n__4d_point_array.html +++ b/6/d2/d9b/class_o_n__4d_point_array.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: ON_4dPointArray Class Reference @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archiveserialize definition to binary archive
    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/d2/d9b/class_o_n___obj_ref___i_ref_i_d-members.html b/6/d2/d9b/class_o_n___obj_ref___i_ref_i_d-members.html index 4db9093f..985116cf 100644 --- a/6/d2/d9b/class_o_n___obj_ref___i_ref_i_d-members.html +++ b/6/d2/d9b/class_o_n___obj_ref___i_ref_i_d-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/da2/class_o_n___face_name_key.html b/6/d2/da2/class_o_n___face_name_key.html index cbca79da..1404770a 100644 --- a/6/d2/da2/class_o_n___face_name_key.html +++ b/6/d2/da2/class_o_n___face_name_key.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_FaceNameKey Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/da3/class_o_n___text_log.html b/6/d2/da3/class_o_n___text_log.html index 963bbcf0..9188d448 100644 --- a/6/d2/da3/class_o_n___text_log.html +++ b/6/d2/da3/class_o_n___text_log.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextLog Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_TextLog() [1/3]

    @@ -457,7 +453,7 @@ Friends
    -

    ◆ operator<<() [1/12]

    +

    ◆ operator<<() [1/12]

    @@ -475,7 +471,7 @@ Friends
    -

    ◆ operator<<() [2/12]

    +

    ◆ operator<<() [2/12]

    @@ -493,7 +489,7 @@ Friends
    -

    ◆ operator<<() [3/12]

    +

    ◆ operator<<() [3/12]

    @@ -511,7 +507,7 @@ Friends
    -

    ◆ operator<<() [4/12]

    +

    ◆ operator<<() [4/12]

    @@ -529,7 +525,7 @@ Friends
    -

    ◆ operator<<() [5/12]

    +

    ◆ operator<<() [5/12]

    @@ -547,7 +543,7 @@ Friends
    -

    ◆ operator<<() [6/12]

    +

    ◆ operator<<() [6/12]

    @@ -565,7 +561,7 @@ Friends
    -

    ◆ operator<<() [7/12]

    +

    ◆ operator<<() [7/12]

    @@ -583,7 +579,7 @@ Friends
    -

    ◆ operator<<() [8/12]

    +

    ◆ operator<<() [8/12]

    @@ -601,7 +597,7 @@ Friends
    -

    ◆ operator<<() [9/12]

    +

    ◆ operator<<() [9/12]

    @@ -619,7 +615,7 @@ Friends
    -

    ◆ operator<<() [10/12]

    +

    ◆ operator<<() [10/12]

    @@ -637,7 +633,7 @@ Friends
    -

    ◆ operator<<() [11/12]

    +

    ◆ operator<<() [11/12]

    @@ -655,7 +651,7 @@ Friends
    -

    ◆ operator<<() [12/12]

    +

    ◆ operator<<() [12/12]

    @@ -1519,9 +1515,9 @@ Friends
    diff --git a/6/d2/da4/class_o_n___text_run_builder-members.html b/6/d2/da4/class_o_n___text_run_builder-members.html index bb0b4164..bd2735bb 100644 --- a/6/d2/da4/class_o_n___text_run_builder-members.html +++ b/6/d2/da4/class_o_n___text_run_builder-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d2/da9/class_o_n__4d_rect.html b/6/d2/da9/class_o_n__4d_rect.html index 6543188b..9cc4060e 100644 --- a/6/d2/da9/class_o_n__4d_rect.html +++ b/6/d2/da9/class_o_n__4d_rect.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_4dRect Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/dac/class_o_n___rtf_first_char_1_1_text_run-members.html b/6/d2/dac/class_o_n___rtf_first_char_1_1_text_run-members.html index 69b642d3..489e34bb 100644 --- a/6/d2/dac/class_o_n___rtf_first_char_1_1_text_run-members.html +++ b/6/d2/dac/class_o_n___rtf_first_char_1_1_text_run-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/db4/class_o_n___fixed_size_pool_iterator-members.html b/6/d2/db4/class_o_n___fixed_size_pool_iterator-members.html index 3bc53730..63f836da 100644 --- a/6/d2/db4/class_o_n___fixed_size_pool_iterator-members.html +++ b/6/d2/db4/class_o_n___fixed_size_pool_iterator-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/dc2/opennurbs__knot_8h_source.html b/6/d2/dc2/opennurbs__knot_8h_source.html index 80e0922b..72616bb2 100644 --- a/6/d2/dc2/opennurbs__knot_8h_source.html +++ b/6/d2/dc2/opennurbs__knot_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_knot.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_knot.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/dc5/class_o_n___polyline_curve-members.html b/6/d2/dc5/class_o_n___polyline_curve-members.html index 5d3b7ab7..f525461a 100644 --- a/6/d2/dc5/class_o_n___polyline_curve-members.html +++ b/6/d2/dc5/class_o_n___polyline_curve-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/dc6/class_o_n___model_component_content_mark.html b/6/d2/dc6/class_o_n___model_component_content_mark.html index 1c1c6d02..dc3026b7 100644 --- a/6/d2/dc6/class_o_n___model_component_content_mark.html +++ b/6/d2/dc6/class_o_n___model_component_content_mark.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ModelComponentContentMark Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/dca/class_o_n___detail_view.html b/6/d2/dca/class_o_n___detail_view.html index 5b28ce3b..ad4c428e 100644 --- a/6/d2/dca/class_o_n___detail_view.html +++ b/6/d2/dca/class_o_n___detail_view.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_DetailView Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_DetailView()

    @@ -496,8 +492,8 @@ Additional Inherited Members
    -

    C++ defaults for copy constructor and operator= work fine.
    - virtual ON_Object overrides

    +

    C++ defaults for copy constructor and operator= work fine.

    +

    virtual ON_Object overrides

    Reimplemented from ON_Object.

    @@ -646,8 +642,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -702,9 +698,9 @@ Additional Inherited Members
    diff --git a/6/d2/dd5/class_o_n___mesh_curvature_stats-members.html b/6/d2/dd5/class_o_n___mesh_curvature_stats-members.html index f24357e6..55f45008 100644 --- a/6/d2/dd5/class_o_n___mesh_curvature_stats-members.html +++ b/6/d2/dd5/class_o_n___mesh_curvature_stats-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/dde/class_o_n__3d_ray-members.html b/6/d2/dde/class_o_n__3d_ray-members.html index 661bac4a..410a0506 100644 --- a/6/d2/dde/class_o_n__3d_ray-members.html +++ b/6/d2/dde/class_o_n__3d_ray-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/de1/opennurbs__defines_8h_source.html b/6/d2/de1/opennurbs__defines_8h_source.html index 402c9d81..919dfe89 100644 --- a/6/d2/de1/opennurbs__defines_8h_source.html +++ b/6/d2/de1/opennurbs__defines_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_defines.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_defines.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_defines.h
    -
    1 /*
    2 // Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved.
    3 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    4 // McNeel & Associates.
    5 //
    6 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    7 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    8 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    9 //
    10 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    11 //
    12 ////////////////////////////////////////////////////////////////
    13 */
    14 
    15 ////////////////////////////////////////////////////////////////
    16 //
    17 // Includes all openNURBS toolkit defines and enums.
    18 //
    19 ////////////////////////////////////////////////////////////////
    20 
    21 #if !defined(OPENNURBS_DEFINES_INC_)
    22 #define OPENNURBS_DEFINES_INC_
    23 
    24 #if !defined(OPENNURBS_SYSTEM_INC_)
    25 #error Include opennurbs_system.h before opennurbs_defines.h
    26 #endif
    27 
    28 #if defined (cplusplus) || defined(_cplusplus) || defined(__cplusplus) || defined(ON_CPLUSPLUS)
    29 // C++ extern "C" declaration for C linkage
    30 
    31 #if !defined(ON_CPLUSPLUS)
    32 #define ON_CPLUSPLUS
    33 #endif
    34 #define ON_EXTERNC extern "C"
    35 #define ON_BEGIN_EXTERNC extern "C" {
    36 #define ON_END_EXTERNC }
    37 
    38 #define ON_UINT_FROM_ENUM(e) (static_cast<unsigned int>(e))
    39 #define ON_INT_FROM_ENUM(e) ((int)static_cast<unsigned int>(e))
    40 
    41 #else
    42 
    43 /* C file - no extern declaration required or permitted */
    44 
    45 #define ON_EXTERNC
    46 #define ON_BEGIN_EXTERNC
    47 #define ON_END_EXTERNC
    48 
    49 #endif
    50 
    51 
    52 /*
    53 // Declarations in header (.H) files look like
    54 //
    55 // ON_DECL type function():
    56 // extern ON_EXTERN_DECL type global_variable;
    57 // class ON_CLASS classname {};
    58 // ON_TEMPLATE template class ON_CLASS template<T>;
    59 //
    60 */
    61 
    62 #define ON_ENUM_FROM_UNSIGNED_CASE(e) case (unsigned int)e: return(e); break
    63 #define ON_ENUM_TO_STRING_CASE(e) case e: return( ON_String(#e) ); break
    64 #define ON_ENUM_TO_WIDE_STRING_CASE(e) case e: return( ON_wString(#e) ); break
    65 
    66 /* export/import */
    67 #if defined(OPENNURBS_EXPORTS)
    68 /* compiling opennurbs as some type of dynamic linking library */
    69 
    70 #if defined(ON_COMPILER_MSC)
    71 /* compiling OpenNurbs as a Windows DLL - export classes, functions, templates, and globals */
    72 #define ON_CLASS __declspec(dllexport)
    73 #define ON_DECL __declspec(dllexport)
    74 #define ON_EXTERN_DECL __declspec(dllexport)
    75 #define ON_DLL_TEMPLATE
    76 
    77 #elif defined(ON_COMPILER_CLANG)
    78 /* compiling opennurbs as an Apple shared library */
    79 #define ON_CLASS __attribute__ ((visibility ("default")))
    80 #define ON_DECL __attribute__ ((visibility ("default")))
    81 #define ON_EXTERN_DECL __attribute__ ((visibility ("default")))
    82 
    83 #else
    84 #error fill in your compiler dynamic linking decorations
    85 #endif
    86 
    87 #elif defined(OPENNURBS_IMPORTS)
    88 /* dynamically linking with opennurbs in some way */
    89 
    90 #if defined(ON_COMPILER_MSC)
    91 /* using OpenNurbs as a Windows DLL - import classes, functions, templates, and globals */
    92 #define ON_CLASS __declspec(dllimport)
    93 #define ON_DECL __declspec(dllimport)
    94 #define ON_EXTERN_DECL __declspec(dllimport)
    95 #define ON_DLL_TEMPLATE extern
    96 
    97 #elif defined(ON_COMPILER_CLANG)
    98 /* using opennurbs as an Apple shared library */
    99 #define ON_CLASS __attribute__ ((visibility ("default")))
    100 #define ON_DECL __attribute__ ((visibility ("default")))
    101 #define ON_EXTERN_DECL __attribute__ ((visibility ("default")))
    102 
    103 #else
    104 #error fill in your compiler dynamic linking decorations
    105 #endif
    106 
    107 #else
    108 
    109 /* compiling or using OpenNurbs as a static library */
    110 #define ON_CLASS
    111 #define ON_DECL
    112 #define ON_EXTERN_DECL
    113 
    114 #if defined(ON_DLL_TEMPLATE)
    115 #undef ON_DLL_TEMPLATE
    116 #endif
    117 
    118 #endif
    119 
    120 
    121 // ON_DEPRECATED is used to mark deprecated functions.
    122 #if defined(ON_COMPILER_MSC)
    123 #define ON_DEPRECATED __declspec(deprecated)
    124 #define ON_DEPRECATED_MSG(s) [[deprecated(s)]]
    125 #elif defined(ON_COMPILER_CLANG)
    126 #define ON_DEPRECATED __attribute__((deprecated))
    127 #define ON_DEPRECATED_MSG(s) [[deprecated(s)]]
    128 #else
    129 #define ON_DEPRECATED
    130 #define ON_DEPRECATED_MSG(s)
    131 #endif
    132 
    133 #if defined(PI)
    134 #define ON_PI PI
    135 #else
    136 #define ON_PI 3.141592653589793238462643
    137 #endif
    138 
    139 #define ON_DEGREES_TO_RADIANS (ON_PI/180.0)
    140 #define ON_RADIANS_TO_DEGREES (180.0/ON_PI)
    141 
    142 /*
    143 Parameters:
    144  angle_in_radians - [in]
    145  Angle measure in radians
    146 Returns:
    147  Angle measure in degrees
    148 */
    149 ON_DECL
    150 double ON_DegreesFromRadians(
    151  double angle_in_radians
    152 );
    153 
    154 /*
    155 Parameters:
    156  angle_in_degrees - [in]
    157  Angle measure in degrees
    158 Returns:
    159  Angle measure in radians
    160 */
    161 ON_DECL
    162 double ON_RadiansFromDegrees(
    163  double angle_in_degrees
    164 );
    165 
    166 #define ON_SQRT2 1.414213562373095048801689
    167 #define ON_SQRT3 1.732050807568877293527446
    168 #define ON_SQRT3_OVER_2 0.8660254037844386467637230
    169 #define ON_1_OVER_SQRT2 0.7071067811865475244008445
    170 #define ON_SIN_PI_OVER_12 0.2588190451025207623488990
    171 #define ON_COS_PI_OVER_12 0.9659258262890682867497433
    172 
    173 #define ON_LOG2 0.6931471805599453094172321
    174 #define ON_LOG10 2.302585092994045684017991
    175 
    176 #define ON_ArrayCount(a) (sizeof(a)/sizeof((a)[0]))
    177 
    178 #if defined(DBL_MAX)
    179 #define ON_DBL_MAX DBL_MAX
    180 #else
    181 #define ON_DBL_MAX 1.7976931348623158e+308
    182 #endif
    183 
    184 #if defined(DBL_MIN)
    185 #define ON_DBL_MIN DBL_MIN
    186 #else
    187 #define ON_DBL_MIN 2.22507385850720200e-308
    188 #endif
    189 
    190 // ON_EPSILON = 2^-52
    191 #if defined(DBL_EPSILON)
    192 #define ON_EPSILON DBL_EPSILON
    193 #else
    194 #define ON_EPSILON 2.2204460492503131e-16
    195 #endif
    196 #define ON_SQRT_EPSILON 1.490116119385000000e-8
    197 
    198 #if defined(FLT_EPSILON)
    199 #define ON_FLOAT_EPSILON FLT_EPSILON
    200 #else
    201 #define ON_FLOAT_EPSILON 1.192092896e-07
    202 #endif
    203 #define ON_SQRT_FLOAT_EPSILON 3.452669830725202719e-4
    204 
    205 /*
    206 // In cases where lazy evaluation of a double value is
    207 // performed, b-rep tolerances being a notable example,
    208 // this value is used to indicate the value has not been
    209 // computed. This value must be < -1.0e308. and > -ON_DBL_MAX
    210 //
    211 // The reasons ON_UNSET_VALUE is a valid finite number are:
    212 //
    213 // 1) It needs to round trip through fprintf/sscanf.
    214 // 2) It needs to persist unchanged through assigment
    215 / and not generate exceptions when assigned.
    216 // 3) ON_UNSET_VALUE == ON_UNSET_VALUE needs to be true.
    217 // 4) ON_UNSET_VALUE != ON_UNSET_VALUE needs to be false.
    218 //
    219 // Ideally, it would also have these SNaN attributes
    220 // * When used in a calculation, a floating point exception
    221 // occures.
    222 // * No possibility of a valid calculation would generate
    223 // ON_UNSET_VALUE.
    224 // * float f = (float)ON_UNSET_VALUE would create an invalid
    225 // float and generate an exception.
    226 */
    227 #define ON_UNSET_POSITIVE_VALUE 1.23432101234321e+308
    228 #define ON_UNSET_VALUE -ON_UNSET_POSITIVE_VALUE
    229 
    230 /*
    231 // ON_UNSET_FLOAT is used to indicate a texture coordinate
    232 // value cannot be calculated or is not well defined.
    233 // In hindsight, this value should have been ON_FLT_QNAN
    234 // because many calculation convert float texture coordinates
    235 // to doubles and the "unset"ness attribute is lost.
    236 */
    237 #define ON_UNSET_POSITIVE_FLOAT 1.234321e+38f
    238 #define ON_UNSET_FLOAT -ON_UNSET_POSITIVE_FLOAT
    239 
    240 // When unsinged int values are used in a context where
    241 // 0 is a valid index and there needs to be a value that
    242 // indicates the index is not set, use ON_UNSET_UINT_INDEX.
    243 #define ON_UNSET_UINT_INDEX 0xFFFFFFFFU
    244 
    245 // When signed int values are used in a context where
    246 // 0 and small negative values are valid indices and there needs
    247 // to be a value that indicates the index is not set,
    248 // use ON_UNSET_INT_INDEX. This value is INT_MIN+1
    249 #define ON_UNSET_INT_INDEX ((const int)-2147483647)
    250 
    251 ON_BEGIN_EXTERNC
    252 
    253 // IEEE 754 special values
    254 
    255 extern ON_EXTERN_DECL const double ON_DBL_QNAN;
    256 extern ON_EXTERN_DECL const double ON_DBL_PINF;
    257 extern ON_EXTERN_DECL const double ON_DBL_NINF;
    258 
    259 extern ON_EXTERN_DECL const float ON_FLT_QNAN;
    260 extern ON_EXTERN_DECL const float ON_FLT_PINF;
    261 extern ON_EXTERN_DECL const float ON_FLT_NINF;
    262 
    263 
    264 /*
    265 Description:
    266 Paramters:
    267  x - [out] returned value of x is an SNan
    268  (signalling not a number).
    269 Remarks:
    270  Any time an SNaN passes through an Intel FPU, the result
    271  is a QNaN (quiet nan) and the invalid operation excpetion
    272  flag is set. If this exception is not masked, then the
    273  exception handler is invoked.
    274 
    275  double x, y;
    276  ON_DBL_SNAN(&x);
    277  y = x; // y = QNAN and invalid op exception occurs
    278  z = sin(x) // z = QNAN and invalid op exception occurs
    279 
    280  So, if you want to reliably initialize doubles to SNaNs,
    281  you must use memcpy() or some other method that does not
    282  use the Intel FPU.
    283 */
    284 ON_DECL
    285 void ON_DBL_SNAN( double* x );
    286 
    287 ON_DECL
    288 void ON_FLT_SNAN( float* x );
    289 
    290 /*
    291 Returns:
    292  ON_UNSET_FLOAT, if x = ON_UNSET_VALUE.
    293  ON_UNSET_POSITIVE_FLOAT, if x = ON_UNSET_POSITIVE_VALUE.
    294  (float)x, otherwise.
    295 */
    296 ON_DECL
    297 float ON_FloatFromDouble(
    298  double x
    299 );
    300 
    301 /*
    302 Returns:
    303  ON_UNSET_VALUE, if x = ON_UNSET_FLOAT.
    304  ON_UNSET_POSITIVE_VALUE, if x = ON_UNSET_POSITIVE_FLOAT.
    305  (double)x, otherwise.
    306 */
    307 ON_DECL
    308 double ON_DoubleFromFloat(
    309  float x
    310 );
    311 
    312 
    313 ON_END_EXTERNC
    314 
    315 #if defined(ON_CPLUSPLUS)
    316 ON_DECL
    317 bool ON_IsNullPtr(const void* ptr);
    318 
    319 ON_DECL
    320 bool ON_IsNullPtr(const ON__UINT_PTR ptr);
    321 
    322 ON_DECL
    323 bool ON_IsNullPtr(const ON__INT_PTR ptr);
    324 #endif
    325 
    326 /*
    327 // In cases where lazy evaluation of a color value is
    328 // performed, this value is used to indicate the value
    329 // has not been computed.
    330 */
    331 #define ON_UNSET_COLOR 0xFFFFFFFF
    332 
    333 /*
    334 // In cases when an absolute "zero" tolerance
    335 // is required to compare model space coordinates,
    336 // ON_ZERO_TOLERANCE is used. The value of
    337 // ON_ZERO_TOLERANCE should be no smaller than
    338 // ON_EPSILON and should be several orders of
    339 // magnitude smaller than ON_SQRT_EPSILON
    340 //
    341 */
    342 //#define ON_ZERO_TOLERANCE 1.0e-12
    343 // ON_ZERO_TOLERANCE = 2^-32
    344 #define ON_ZERO_TOLERANCE 2.3283064365386962890625e-10
    345 
    346 /*
    347 // In cases when an relative "zero" tolerance is
    348 // required for comparing model space coordinates,
    349 // (fabs(a)+fabs(b))*ON_RELATIVE_TOLERANCE is used.
    350 // ON_RELATIVE_TOLERANCE should be larger than
    351 // ON_EPSILON and smaller than no larger than
    352 // ON_ZERO_TOLERANCE*2^-10.
    353 //
    354 */
    355 // ON_RELATIVE_TOLERANCE = 2^-42
    356 #define ON_RELATIVE_TOLERANCE 2.27373675443232059478759765625e-13
    357 
    358 /*
    359 // Bugs in geometry calculations involving world coordinates
    360 // values > ON_MAXIMUM_WORLD_COORDINATE_VALUE
    361 // will be a low priority.
    362 */
    363 // ON_MAXIMUM_VALUE = 2^27
    364 #define ON_MAXIMUM_WORLD_COORDINATE_VALUE 1.34217728e8
    365 
    366 /*
    367 // Any 3d coordinate value >= ON_NONSENSE_WORLD_COORDINATE_VALUE
    368 // will be adjusted as needed. Any calculation creating 3d coordinates
    369 // with values >= ON_NONSENSE_WORLD_COORDINATE_VALUE should be
    370 // inspected for bugs.
    371 */
    372 // ON_NONSENSE_WORLD_COORDINATE_VALUE = 1.0e100
    373 #define ON_NONSENSE_WORLD_COORDINATE_VALUE 1.0e100
    374 
    375 /*
    376 // The default test for deciding if a curvature value should be
    377 // treated as zero is
    378 // length(curvature) <= ON_ZERO_CURVATURE_TOLERANCE.
    379 // ON_ZERO_CURVATURE_TOLERANCE must be set so that
    380 // ON_ZERO_CURVATURE_TOLERANCE >= sqrt(3)*ON_ZERO_TOLERANCE
    381 // so that K.IsTiny() = true implies |K| <= ON_ZERO_CURVATURE_TOLERANCE
    382 */
    383 #define ON_ZERO_CURVATURE_TOLERANCE 1.0e-8
    384 #define ON_RELATIVE_CURVATURE_TOLERANCE 0.05
    385 
    386 /* default value for angle tolerances = 1 degree */
    387 #define ON_DEFAULT_ANGLE_TOLERANCE (ON_PI/180.0)
    388 #define ON_DEFAULT_ANGLE_TOLERANCE_COSINE 0.99984769515639123915701155881391
    389 #define ON_MINIMUM_ANGLE_TOLERANCE (ON_DEFAULT_ANGLE_TOLERANCE/10.0)
    390 
    391 
    392 /*
    393 */
    394 ON_DECL
    395 ON__UINT64 ON_SecondsSinceJanOne1970UTC();
    396 
    397 union ON_U
    398 {
    399  char b[8]; // 8 bytes
    400  ON__INT64 h; // 64 bit integer
    401  ON__INT32 i; // 32 bit integer
    402  int j[2]; // two 32 bit integers
    403  void* p;
    404  double d;
    405 };
    406 
    407 #if defined(ON_CPLUSPLUS)
    408 
    409 // pair of integer indices. This
    410 // is intentionally a struct/typedef
    411 // rather than a class so that it
    412 // can be used in other structs.
    413 class ON_CLASS ON_2dex
    414 {
    415 public:
    416  ON_2dex() = default;
    417  ~ON_2dex() = default;
    418  ON_2dex(const ON_2dex&) = default;
    419  ON_2dex& operator=(const ON_2dex&) = default;
    420 
    421 public:
    422  // do not initialize i, j for performance reasons
    423  int i;
    424  int j;
    425 
    426  ON_2dex(int i, int j);
    427 
    428  static const ON_2dex Unset; // (ON_UNSET_INT_INDEX, ON_UNSET_INT_INDEX);
    429  static const ON_2dex Zero; // (0, 0)
    430 };
    431 
    432 class ON_CLASS ON_2udex
    433 {
    434 public:
    435  ON_2udex() = default;
    436  ~ON_2udex() = default;
    437  ON_2udex(const ON_2udex&) = default;
    438  ON_2udex& operator=(const ON_2udex&) = default;
    439 
    440 public:
    441  // do not initialize i, j for performance reasons
    442  unsigned int i;
    443  unsigned int j;
    444 
    445  ON_2udex(unsigned int i, unsigned int j);
    446 
    447  static const ON_2udex Unset; // (ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX);
    448  static const ON_2udex Zero; // (0, 0)
    449 };
    450 
    451 class ON_CLASS ON_3dex
    452 {
    453 public:
    454  ON_3dex() = default;
    455  ~ON_3dex() = default;
    456  ON_3dex(const ON_3dex&) = default;
    457  ON_3dex& operator=(const ON_3dex&) = default;
    458 
    459 public:
    460  // do not initialize i, j, k for performance reasons
    461  int i;
    462  int j;
    463  int k;
    464 
    465  ON_3dex(int i, int j, int k);
    466 
    467  static const ON_3dex Unset; // (ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX);
    468  static const ON_3dex Zero; // (0, 0, 0)
    469 };
    470 
    471 class ON_CLASS ON_3udex
    472 {
    473 public:
    474  ON_3udex() = default;
    475  ~ON_3udex() = default;
    476  ON_3udex(const ON_3udex&) = default;
    477  ON_3udex& operator=(const ON_3udex&) = default;
    478 
    479 public:
    480  // do not initialize i, j, k for performance reasons
    481  unsigned int i;
    482  unsigned int j;
    483  unsigned int k;
    484 
    485  ON_3udex(unsigned int i, unsigned int j, unsigned int k);
    486 
    487  static const ON_3udex Unset; // (ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX);
    488  static const ON_3udex Zero; // (0, 0, 0)
    489 };
    490 
    491 // quadruplet of integer indices.
    492 class ON_CLASS ON_4dex
    493 {
    494 public:
    495  ON_4dex() = default;
    496  ~ON_4dex() = default;
    497  ON_4dex(const ON_4dex&) = default;
    498  ON_4dex& operator=(const ON_4dex&) = default;
    499 
    500 public:
    501  // do not initialize i, j, k, l for performance reasons
    502  int i;
    503  int j;
    504  int k;
    505  int l;
    506 
    507  ON_4dex(int i, int j, int k, int l);
    508 
    509  static const ON_4dex Unset; // (ON_UNSET_INT_INDEX, ON_UNSET_INT_INDEX, ON_UNSET_INT_INDEX, ON_UNSET_INT_INDEX);
    510  static const ON_4dex Zero; // (0, 0, 0, 0)
    511 };
    512 
    513 class ON_CLASS ON_4udex
    514 {
    515 public:
    516  ON_4udex() = default;
    517  ~ON_4udex() = default;
    518  ON_4udex(const ON_4udex&) = default;
    519  ON_4udex& operator=(const ON_4udex&) = default;
    520 
    521 public:
    522  // do not initialize i, j, k, l for performance reasons
    523  unsigned int i;
    524  unsigned int j;
    525  unsigned int k;
    526  unsigned int l;
    527 
    528  ON_4udex(unsigned int i, unsigned int j, unsigned int k, unsigned int l);
    529 
    530  static const ON_4udex Unset; // (ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX);
    531  static const ON_4udex Zero; // (0, 0, 0, 0)
    532 };
    533 
    534 
    535 enum class ON_StringMapType : int
    536 {
    537  Identity = 0,
    538  UpperCase = 1,
    539  LowerCase = 2
    540 };
    541 
    542 enum class ON_StringMapOrdinalType : int
    543 {
    544  Identity = 0,
    545  UpperOrdinal = 1,
    546  LowerOrdinal = 2,
    547  MinimumOrdinal = 3
    548 };
    549 
    550 ON_DECL
    551 ON_StringMapOrdinalType ON_StringMapOrdinalTypeFromStringMapType(
    552  ON_StringMapType map_type
    553  );
    554 
    555 // OpenNurbs enums
    556 class ON_CLASS ON
    557 {
    558 public:
    559  /*
    560  Description:
    561  Call before using openNURBS to ensure all class definitions
    562  are linked.
    563  */
    564  static void Begin();
    565 
    566 
    567  /*
    568  Description:
    569  Call when finished with openNURBS.
    570  Remarks:
    571  Currently does nothing.
    572  */
    573  static void End();
    574 
    575  /*
    576  Returns:
    577  0: not initialized
    578  1: in the body of ON:Begin()
    579  2: ON::Begin() has finished.
    580  */
    581  static unsigned int LibraryStatus();
    582 
    583  /*
    584  Set the library status
    585  */
    586  static void SetLibraryStatus(unsigned int status);
    587 
    588  /*
    589  Returns:
    590  The value of OPENNURBS_VERSION_NUMBER, which is defined in opennurbs_version.h.
    591  Remarks:
    592  The high bit of this number is set. Do not cast the result as an int.
    593  */
    594  static
    595  unsigned int Version();
    596 
    597  /*
    598  Returns:
    599  The value of OPENNURBS_VERSION_MAJOR, which is defined in opennurbs_version.h
    600  (0 to 63).
    601  */
    602  static
    603  unsigned int VersionMajor();
    604 
    605  /*
    606  Returns:
    607  The value of OPENNURBS_VERSION_MINOR, which is defined in opennurbs_version.h
    608  (0 to 127).
    609  */
    610  static
    611  unsigned int VersionMinor();
    612 
    613  /*
    614  Returns:
    615  The value of OPENNURBS_VERSION_YEAR, which is defined in opennurbs_version.h
    616  > 2014.
    617  */
    618  static
    619  unsigned int VersionYear();
    620 
    621  /*
    622  Returns:
    623  The value of OPENNURBS_VERSION_MONTH, which is defined in opennurbs_version.h
    624  1 to 12.
    625  */
    626  static
    627  unsigned int VersionMonth();
    628 
    629  /*
    630  Returns:
    631  The value of OPENNURBS_VERSION_DAY_OF_MONTH, which is defined in opennurbs_version.h
    632  (1 to 31).
    633  */
    634  static
    635  unsigned int VersionDayOfMonth();
    636 
    637  /*
    638  Returns:
    639  The value of OPENNURBS_VERSION_HOUR, which is defined in opennurbs_version.h
    640  (0 to 23).
    641  */
    642  static
    643  unsigned int VersionHour();
    644 
    645  /*
    646  Returns:
    647  The value of OPENNURBS_VERSION_MINUTE, which is defined in opennurbs_version.h
    648  (0 to 59).
    649  */
    650  static
    651  unsigned int VersionMinute();
    652 
    653  /*
    654  Returns:
    655  The value of OPENNURBS_VERSION_BRANCH, which is defined in opennurbs_version.h
    656  0: developer build
    657  1: trunk build
    658  2: release candidate build
    659  3: release build
    660  */
    661  static
    662  unsigned int VersionBranch();
    663 
    664  /*
    665  Description:
    666  Get the opennurbs version number as a quartet of values.
    667  Parameters:
    668  version_quartet - [out]
    669  version_quartet[0] = ON::VersionMajor()
    670  version_quartet[1] = ON::VersionMinor()
    671  version_quartet[2] = (year - 2000)*1000 + day_of_year
    672  version_quartet[3] = (hour*1000 + minute*10 + OPENNURBS_VERSION_BRANCH)
    673  Returns:
    674  The value of OPENNURBS_VERSION_NUMBER, which is defined in opennurbs_version.h.
    675  Remarks:
    676  The high bit of the returned value is set. Do not cast the result as an int.
    677  */
    678  static
    679  unsigned int VersionGetQuartet(
    680  unsigned int version_quartet[4]
    681  );
    682 
    683 
    684  /*
    685  Returns:
    686  The value of OPENNURBS_VERSION_QUARTET_STRING, which is defined in opennurbs_version.h.
    687  Remarks:
    688  The high bit of this number is set. Do not cast the result as an int.
    689  */
    690  static
    691  const char* VersionQuartetAsString();
    692 
    693  /*
    694  Returns:
    695  The value of OPENNURBS_VERSION_QUARTET_WSTRING, which is defined in opennurbs_version.h.
    696  Remarks:
    697  The high bit of this number is set. Do not cast the result as an int.
    698  */
    699  static
    700  const wchar_t* VersionQuartetAsWideString();
    701 
    702  /*
    703  Returns:
    704  Empty string or the git hash of the revison of the source code used to build this application.
    705  The git hash is a hexadecimal number represented in UTF-8 string.
    706  Remarks:
    707  Developer builds return "".
    708  Build system builds return the git revsion hash.
    709  */
    710  static const char* SourceGitRevisionHash();
    711 
    712  /*
    713  Returns:
    714  Empty string or the name of the git branch containing the source code used to build this application.
    715  Remarks:
    716  Developer builds return "".
    717  Build system builds return the git branch name or "".
    718  */
    719  static const char* SourceGitBranchName();
    720 
    721  /*
    722  Returns:
    723  A string that identifies the McNeel version control system source code to build this application.
    724  Remarks:
    725  Developer builds return "".
    726  Build system builds return the git <branch name> @ <git revision hash> or "".
    727  */
    728  static const char* SourceIdentification();
    729 
    730  //// File open/close for DLL use ///////////////////////////////////////////////
    731 
    732  static
    733  FILE* OpenFile( // like fopen() - needed when OpenNURBS is used as a DLL
    734  const char* filename,
    735  const char* filemode
    736  );
    737 
    738  static
    739  FILE* OpenFile( // like fopen() - needed when OpenNURBS is used as a DLL
    740  const wchar_t* filename,
    741  const wchar_t* filemode
    742  );
    743 
    744  static
    745  int CloseFile( // like fclose() - needed when OpenNURBS is used as a DLL
    746  FILE* // pointer returned by OpenFile()
    747  );
    748 
    749  static
    750  int CloseAllFiles(); // like _fcloseall() - needed when OpenNURBS is used as a DLL
    751 
    752  /*
    753  Description:
    754  Uses the flavor of fstat that is appropriate for the platform.
    755  Parameters:
    756  filename - [in]
    757  fp - [in]
    758  filesize - [out] (can be nullptr if you do not want filesize)
    759  create_time - [out] (can be nullptr if you do not want last create time)
    760  lastmodify_time - [out] (can be nullptr if you do not want last modification time)
    761  Returns:
    762  True if file exists, can be opened for read, and fstat worked.
    763  */
    764  static
    765  bool GetFileStats( const wchar_t* filename,
    766  size_t* filesize,
    767  time_t* create_time,
    768  time_t* lastmodify_time
    769  );
    770 
    771  static
    772  bool GetFileStats( FILE* fp,
    773  size_t* filesize,
    774  time_t* create_time,
    775  time_t* lastmodify_time
    776  );
    777 
    778  /*
    779  Returns true if pathname is a directory.
    780  */
    781  static bool IsDirectory( const wchar_t* pathname );
    782  static bool IsDirectory( const char* utf8pathname );
    783 
    784  /*
    785  Returns
    786  If the file is an opennurbs file, the version of the file
    787  is returned (2,3,4,50,...).
    788  If the file is not an opennurbs file, 0 is returned.
    789  */
    790  static int IsOpenNURBSFile( const wchar_t* pathname );
    791  static int IsOpenNURBSFile( const char* utf8pathname );
    792  static int IsOpenNURBSFile( FILE* fp );
    793 
    794 #pragma region RH_C_SHARED_ENUM [ON::RuntimeEnvironment] [Rhino.RuntimeEnvironment] [byte]
    795  /////////////////////////////////////////////////////////////////
    796  /// <summary>
    797  /// ON::RuntimeEnvironment identifies a runtime environment (operating system).
    798  /// This value is saved in binary archives so appropriate adjustments
    799  /// to resources provided by runtime environments, like fonts, can be made
    800  /// when an archive created in one runtime environment is used in another.
    801  /// </summary>
    802  enum class RuntimeEnvironment : unsigned char
    803  {
    804  ///<summary>
    805  /// ON::RuntimeEnvironment::Unset indicates no runtime is set.
    806  ///</summary>
    807  Unset = 0,
    808 
    809  ///<summary>
    810  /// ON::RuntimeEnvironment::None indicates no runtime.
    811  /// This is a different condition from ON::Runtime::Unset.
    812  ///</summary>
    813  None = 1,
    814 
    815  ///<summary>
    816  /// ON::RuntimeEnvironment::Windows indicates some version of Microsoft Windows.
    817  ///</summary>
    818  Windows = 2,
    819 
    820  ///<summary>
    821  /// ON::RuntimeEnvironment::Apple indicates some version of Apple OS X or iOS.
    822  ///</summary>
    823  Apple = 3,
    824 
    825  ///<summary>
    826  /// ON::RuntimeEnvironment::Android indicates some version of Google Android.
    827  ///</summary>
    828  Android = 4
    829  };
    830 #pragma endregion
    831 
    832  static ON::RuntimeEnvironment RuntimeEnvironmentFromUnsigned(
    833  unsigned int runtime_environment_as_unsigned
    834  );
    835 
    836  /*
    837  Returns:
    838  Current runtime environment.
    839  */
    840  static ON::RuntimeEnvironment CurrentRuntimeEnvironment();
    841 
    842 
    843 #pragma region RH_C_SHARED_ENUM [ON::ReadFileResult] [Rhino.ReadFileResult] [byte]
    844  /// <summary>
    845  /// ON::ReadFileResult reports what happened when a file read was attempted.
    846  /// </summary>
    847  enum class ReadFileResult : unsigned char
    848  {
    849  ///<summary>
    850  /// No result is available.
    851  ///</summary>
    852  Unset = 0,
    853 
    854  ///<summary>
    855  /// Read completed with no errors.
    856  ///</summary>
    857  Completed = 1,
    858 
    859  ///<summary>
    860  /// Read completed with non fatal errors.
    861  ///</summary>
    862  CompletedWithErrors = 2,
    863 
    864  ///<summary>
    865  /// Read failed.
    866  ///</summary>
    867  Failed = 3
    868  };
    869 #pragma endregion
    870 
    871  static ON::ReadFileResult ReadFileResultFromUnsigned(
    872  unsigned int read_file_result_as_unsigned
    873  );
    874 
    875  /*
    876  Returns:
    877  True if the value of read_file_result is one indicating partial to complete success.
    878  False if read_file_result is ON::ReadFileResult::Unset or ON::ReadFileResult::Failed.
    879  */
    880  static bool ReadFileCompleted(
    881  ON::ReadFileResult read_file_result
    882  );
    883 
    884  /*
    885  Returns:
    886  True if the value of read_file_result is one indicating total failure.
    887  False if read_file_result is ON::ReadFileResult::Unset or a value indicating partial to complete success.
    888  */
    889  static bool ReadFileFailed(
    890  ON::ReadFileResult read_file_result
    891  );
    892 
    893 
    894  // Defines the current working space.
    895  enum active_space : unsigned char
    896  {
    897  no_space = 0,
    898  model_space = 1, // 3d modeling or "world" space
    899  page_space = 2 // page/layout/paper/printing space
    900  };
    901 
    902  static active_space ActiveSpace(int); // convert integer to active_space enum
    903 
    904 #pragma region RH_C_SHARED_ENUM [ON::LengthUnitSystem] [Rhino.UnitSystem] [byte]
    905  // unit_system ///////////////////////////////////////////////////////////////
    906  /// <summary>
    907  /// ON::LengthUnitSystem identifies a length unit system
    908  /// United States customary length units references:
    909  /// http://www.nist.gov/pml/wmd/metric/upload/frn-59-5442-1959.pdf
    910  /// http://en.wikipedia.org/wiki/United_States_customary_units
    911  /// http://en.wikipedia.org/wiki/International_yard_and_pound
    912  /// </summary>
    913  enum class LengthUnitSystem : unsigned char
    914  {
    915  ///<summary>
    916  /// ON::LengthUnitSystem::None indicates no length unit system. The scale factor
    917  /// when converting between a specified unit system and None is always 1.0.
    918  /// ON::LengthUnitSystem::None is used as a unit system for models and
    919  /// instance defitions that should be imported or referenced with no
    920  /// scaling applied.
    921  ///</summary>
    922  None = 0,
    923 
    924  ///<summary>
    925  /// 1 angstroms = 1.0e-10 meters
    926  ///</summary>
    927  Angstroms = 12,
    928 
    929  // SI (metric) units
    930 
    931  ///<summary>
    932  /// 1 nanometer = 1.0e-9 meters
    933  ///</summary>
    934  Nanometers = 13,
    935 
    936  ///<summary>
    937  /// 1 micron = 1.0e-6 meters
    938  ///</summary>
    939  Microns = 1,
    940 
    941  ///<summary>
    942  /// 1 millimeter = 1.0e-3 meters
    943  ///</summary>
    944  Millimeters = 2,
    945 
    946  ///<summary>
    947  /// 1 centimeter = 1.0e-2 meters
    948  ///</summary>
    949  Centimeters = 3,
    950 
    951  ///<summary>
    952  /// 1 decimeter = 1.0e-1 meters
    953  ///</summary>
    954  Decimeters = 14,
    955 
    956  ///<summary>
    957  /// SI meter length unit
    958  ///</summary>
    959  Meters = 4,
    960 
    961  ///<summary>
    962  /// 1 dekameter = 1.0e+1 meters
    963  ///</summary>
    964  Dekameters = 15, // 1.0e+1 meters
    965 
    966  ///<summary>
    967  /// 1 hectometer = 1.0e+2 meters
    968  ///</summary>
    969  Hectometers = 16,
    970 
    971  ///<summary>
    972  /// 1 kilometer = 1.0e+3 meters
    973  ///</summary>
    974  Kilometers = 5,
    975 
    976  ///<summary>
    977  /// 1 megameter = 1.0e+6 meters
    978  ///</summary>
    979  Megameters = 17,
    980 
    981  ///<summary>
    982  /// 1 gigameter = 1.0e+9 meters
    983  ///</summary>
    984  Gigameters = 18,
    985 
    986  ///<summary>
    987  /// 1 microinches = 2.54e-8 meters = 1.0e-6 inches
    988  ///</summary>
    989  Microinches = 6,
    990 
    991  ///<summary>
    992  /// 1 mil = 2.54e-5 meters = 0.001 inches
    993  ///</summary>
    994  Mils = 7,
    995 
    996  ///<summary>
    997  /// 1 inch = 0.0254 meters = 1/12 foot
    998  ///</summary>
    999  Inches = 8,
    1000 
    1001  ///<summary>
    1002  /// 1 foot = 0.3048 meters (12 inches)
    1003  ///</summary>
    1004  Feet = 9,
    1005 
    1006  ///<summary>
    1007  /// 1 foot = 0.3048 meters = 12 inches
    1008  ///</summary>
    1009  Yards = 19,
    1010 
    1011  ///<summary>
    1012  /// 1 US statute mile = 1609.344 meters = 5280 feet
    1013  ///</summary>
    1014  Miles = 10,
    1015 
    1016  ///<summary>
    1017  /// 1 printer point = 1/72 inch
    1018  ///</summary>
    1019  PrinterPoints = 20,
    1020 
    1021  ///<summary>
    1022  /// 1 printer pica = 1/6 inch
    1023  ///</summary>
    1024  PrinterPicas = 21,
    1025 
    1026  // terrestrial distances
    1027 
    1028  ///<summary>
    1029  /// 1 nautical mile = 1852 meters
    1030  /// Approximately 1 minute of arc on a terrestrial great circle.
    1031  /// Reference: http://en.wikipedia.org/wiki/Nautical_mile
    1032  ///</summary>
    1033  NauticalMiles = 22,
    1034 
    1035  // astronomical distances
    1036 
    1037  ///<summary>
    1038  /// 1 astronomical unit = 1.4959787e+11 meters
    1039  /// An astronomical unit (au) is the mean distance from the
    1040  /// center of the earth to the center of the sun.
    1041  /// References:
    1042  /// http://en.wikipedia.org/wiki/Astronomical_unit (1.4959787e+11 meters)
    1043  /// http://units.nist.gov/Pubs/SP811/appenB9.htm (1.495979e+11 meters)
    1044  ///</summary>
    1045  AstronomicalUnits = 23,
    1046 
    1047  ///<summary>
    1048  /// 1 light year = 9.4607304725808e+15 meters
    1049  /// A light year is the distance light travels in one Julian year.
    1050  /// The speed of light is exactly 299792458 meters/second.
    1051  /// A Julian year is exactly 365.25 * 86400 seconds and is
    1052  /// approximately the time it takes for one earth orbit.
    1053  /// References:
    1054  /// http://en.wikipedia.org/wiki/Light_year (9.4607304725808e+15 meters)
    1055  /// http://units.nist.gov/Pubs/SP811/appenB9.htm (9.46073e+15 meters)
    1056  ///</summary>
    1057  LightYears = 24,
    1058 
    1059  ///<summary>
    1060  /// 1 parsec = 3.08567758e+16 meters
    1061  /// References:
    1062  /// http://en.wikipedia.org/wiki/Parsec (3.08567758e+16 meters)
    1063  /// http://units.nist.gov/Pubs/SP811/appenB9.htm (3.085678e+16)
    1064  ///</summary>
    1065  Parsecs = 25,
    1066 
    1067  ///<summary>
    1068  /// The name of a custom unit and the conversion to meters
    1069  /// are saved in the ON_UnitSystem class.
    1070  ///</summary>
    1071  CustomUnits = 11,
    1072 
    1073  ///<summary>
    1074  /// The ON::LengthUnitSystem::Unset is used to indicate no unit system is set.
    1075  /// This is a differnt condition from ON::LengthUnitSystem::None.
    1076  ///</summary>
    1077  Unset = 255
    1078  };
    1079 #pragma endregion
    1080 
    1081  static ON::LengthUnitSystem LengthUnitSystemFromUnsigned(
    1082  unsigned int length_unit_system_as_unsigned
    1083  );
    1084 
    1085  /*
    1086  Parameters:
    1087  model_serial_number - [in]
    1088  One good way to get this value is from ON_ModelComponent::ModelSerialNumber().
    1089  ON_DimStyle, ON_Layer, ... are all derived from ON_ModelComponent.
    1090  Returns:
    1091  The length unit system used by the model
    1092  */
    1093  static ON::LengthUnitSystem ModelLengthUnitSystem(
    1094  ON__UINT_PTR model_serial_number
    1095  );
    1096 
    1097 
    1098  static void RegisterModelLengthUnitSystemCallback(
    1099  ON::LengthUnitSystem (*func_ModelLengthUnitSystemCallback)(ON__UINT_PTR)
    1100  );
    1101 
    1102 public:
    1103 
    1104  /*
    1105  Returns
    1106  True if the length unit is one of
    1107  LengthUnitSystem::Angstroms
    1108  LengthUnitSystem::Nanometers
    1109  LengthUnitSystem::Microns
    1110  LengthUnitSystem::Millimeters
    1111  LengthUnitSystem::Centimeters
    1112  LengthUnitSystem::Decimeters
    1113  LengthUnitSystem::Meters
    1114  LengthUnitSystem::Dekameters
    1115  LengthUnitSystem::Hectometers
    1116  LengthUnitSystem::Kilometers
    1117  LengthUnitSystem::Megameters
    1118  LengthUnitSystem::Gigameters
    1119  LengthUnitSystem::NauticalMiles
    1120  LengthUnitSystem::AstronomicalUnits
    1121  LengthUnitSystem::LightYears
    1122  LengthUnitSystem::Parsecs
    1123  */
    1124  static bool IsMetricLengthUnit(
    1125  ON::LengthUnitSystem length_unit_system
    1126  );
    1127 
    1128  /*
    1129  Returns
    1130  True if the length unit is one of
    1131  LengthUnitSystem::Microinches
    1132  LengthUnitSystem::Mils
    1133  LengthUnitSystem::Inches
    1134  LengthUnitSystem::Feet
    1135  LengthUnitSystem::Yards
    1136  LengthUnitSystem::Miles
    1137  LengthUnitSystem::PrinterPoints
    1138  LengthUnitSystem::PrinterPicas
    1139  */
    1140  static bool IsUnitedStatesCustomaryLengthUnit(
    1141  ON::LengthUnitSystem length_unit_system
    1142  );
    1143 
    1144  /*
    1145  Returns
    1146  True if the length unit is one of
    1147  LengthUnitSystem::Millimeters
    1148  LengthUnitSystem::Centimeters
    1149  LengthUnitSystem::Decimeters
    1150  LengthUnitSystem::Meters
    1151  LengthUnitSystem::Dekameters
    1152  LengthUnitSystem::Hectometers
    1153  LengthUnitSystem::Kilometers
    1154  LengthUnitSystem::Inches
    1155  LengthUnitSystem::Feet
    1156  LengthUnitSystem::Yards
    1157  LengthUnitSystem::Miles
    1158  LengthUnitSystem::NauticalMiles
    1159  */
    1160  static bool IsTerrestrialLengthUnit(
    1161  ON::LengthUnitSystem length_unit_system
    1162  );
    1163 
    1164  /*
    1165  Returns
    1166  True if the length unit is one of
    1167  LengthUnitSystem::AstronomicalUnits
    1168  LengthUnitSystem::LightYears
    1169  LengthUnitSystem::Parsecs
    1170  */
    1171  static bool IsExtraTerrestrialLengthUnit(
    1172  ON::LengthUnitSystem length_unit_system
    1173  );
    1174 
    1175  /*
    1176  Returns
    1177  True if the length unit is one of
    1178  LengthUnitSystem::Angstroms
    1179  LengthUnitSystem::Nanometers
    1180  LengthUnitSystem::Microns
    1181  LengthUnitSystem::Microinches
    1182  LengthUnitSystem::Mils
    1183  */
    1184  static bool IsMicroscopicLengthUnit(
    1185  ON::LengthUnitSystem length_unit_system
    1186  );
    1187 
    1188  /*
    1189  Returns
    1190  True if the length unit is one of
    1191  LengthUnitSystem::PrinterPoints
    1192  LengthUnitSystem::PrinterPicas
    1193  */
    1194  static bool IsUnitedStatesPrinterLengthUnit(
    1195  ON::LengthUnitSystem length_unit_system
    1196  );
    1197 
    1198  /*
    1199  Description:
    1200  Scale factor for changing unit "standard" systems.
    1201  Parameters:
    1202  us_from - [in]
    1203  us_to - [in]
    1204  For example:
    1205 
    1206  100.0 = ON::UnitScale( ON::LengthUnitSystem::Meters, ON::LengthUnitSystem::Centimeters )
    1207  2.54 = ON::UnitScale( ON::LengthUnitSystem::Inches, ON::LengthUnitSystem::Centimeters )
    1208  12.0 = ON::UnitScale( ON::LengthUnitSystem::Feet, ON::LengthUnitSystem::Inches )
    1209 
    1210  Remarks:
    1211  If you are using custom unit systems, use the version
    1212  that takes ON_UnitSystem or ON_3dmUnitsAndTolerances
    1213  parameters.
    1214  */
    1215  static double UnitScale(
    1216  ON::LengthUnitSystem us_from,
    1217  ON::LengthUnitSystem us_to
    1218  );
    1219  static double UnitScale(
    1220  const class ON_UnitSystem& us_from,
    1221  const class ON_UnitSystem& us_to
    1222  );
    1223  static double UnitScale(
    1224  ON::LengthUnitSystem us_from,
    1225  const class ON_UnitSystem& us_to
    1226  );
    1227  static double UnitScale(
    1228  const class ON_UnitSystem& us_from,
    1229  ON::LengthUnitSystem us_to
    1230  );
    1231  static double UnitScale(
    1232  const class ON_3dmUnitsAndTolerances& us_from,
    1233  const class ON_3dmUnitsAndTolerances& us_to
    1234  );
    1235 
    1236 
    1237 #pragma region RH_C_SHARED_ENUM [ON::AngleUnitSystem] [Rhino.AngleUnitSystem] [byte]
    1238  /// <summary>
    1239  /// ON::AngleUnitSystem identifies an angle unit system
    1240  /// </summary>
    1241  enum class AngleUnitSystem : unsigned char
    1242  {
    1243  ///<summary>
    1244  /// ON::AngleUnitSystem::None indicates no angle unit system
    1245  /// is specified and model angle unit system should be used.
    1246  ///</summary>
    1247  None = 0,
    1248 
    1249  ///<summary>
    1250  /// 1 turn = 2pi radians.
    1251  ///</summary>
    1252  Turns = 1,
    1253 
    1254  ///<summary>
    1255  /// 1 turn = 2pi radians.
    1256  ///</summary>
    1257  Radians = 2, // 2pi radians = 1 turn
    1258 
    1259  ///<summary>
    1260  /// 360 arc degrees = 1 turn = 2pi radians
    1261  ///</summary>
    1262  Degrees = 3,
    1263 
    1264  ///<summary>
    1265  /// 60 arc minutes = 1 arc degree
    1266  ///</summary>
    1267  Minutes = 4,
    1268 
    1269  ///<summary>
    1270  /// 60 arc seconds = 1 arc minute
    1271  ///</summary>
    1272  Seconds = 5,
    1273 
    1274  ///<summary>
    1275  /// 400 gradians = 2pi radians.
    1276  ///</summary>
    1277  Gradians = 6,
    1278 
    1279  ///<summary>
    1280  /// The ON::AngleUnitSystem::Unset is used to indicates no angle unit system
    1281  /// has been specified in user interface code.
    1282  ///</summary>
    1283  Unset = 255
    1284  };
    1285 #pragma endregion
    1286 
    1287  static ON::AngleUnitSystem AngleUnitSystemFromUnsigned(
    1288  unsigned int angle_unit_system_as_unsigned
    1289  );
    1290 
    1291  static double AngleUnitScale(
    1292  ON::AngleUnitSystem us_from,
    1293  ON::AngleUnitSystem us_to
    1294  );
    1295 
    1296 
    1297  /// <summary>
    1298  /// ON::EarthCoordinateSystem identifies the standard used to define Earth latitude, longitude, and elevation coordinates.
    1299  /// </summary>
    1300  enum class EarthCoordinateSystem : unsigned char
    1301  {
    1302  ///<summary>
    1303  /// ON::EarthCoordinateSystem::Unset
    1304  ///</summary>
    1305  Unset = 0,
    1306 
    1307  ///<summary>
    1308  /// ON::EarthCoordinateSystem::GroundLevel Not well defined, but latitude and longitude will be good enough for architecture sun studies.
    1309  ///</summary>
    1310  GroundLevel = 1, /// Ground level - coordinates vary with time and location
    1311 
    1312  ///<summary>
    1313  /// ON::EarthCoordinateSystem::MeanSeaLevel Not well defined, but latitude and longitude will be good enough for architecture sun studies.
    1314  ///</summary>
    1315  MeanSeaLevel = 2,
    1316 
    1317  ///<summary>
    1318  /// ON::EarthCoordinateSystem::CenterOfEarth Not well defined. The Earth's center of mass and center of volume are at different locations.
    1319  ///</summary>
    1320  CenterOfEarth = 3,
    1321 
    1322  ///<summary>
    1323  /// ON::EarthCoordinateSystem::WGS1984 World Geodetic System 1984 standard. (Current GPS standard.)
    1324  ///</summary>
    1325  WGS1984 = 5,
    1326 
    1327  ///<summary>
    1328  /// ON::EarthCoordinateSystem::EGM2008 Earth Gravitational Model 2008 standard.
    1329  ///</summary>
    1330  EGM2008 = 6
    1331  };
    1332 
    1333  static ON::EarthCoordinateSystem EarthCoordinateSystemFromUnsigned(
    1334  unsigned int earth_coordinte_system_as_unsigned
    1335  );
    1336 
    1337  /// <summary>
    1338  /// ON::ComponentNameConflictResolution identifies a method to use
    1339  /// when components are being added to model, the component name must
    1340  /// be unique, and the name of the new is already in use in the context.
    1341  /// The function ON_ModelComponent::UniqueNameRequired(ON_ModelComponent::Type)
    1342  /// can be used to determine if a component requires a unique name.
    1343  /// </summary>
    1344  enum class ComponentNameConflictResolution : unsigned char
    1345  {
    1346  ///<summary>
    1347  /// A method to resolve name conflicts has not been specified.
    1348  ///</summary>
    1349  Unset = 0,
    1350 
    1351  ///<summary>
    1352  /// Interactivly ask the user to choose one of the following methods
    1353  /// to resolve component name conflicts.
    1354  ///</summary>
    1355  QueryMethod = 1,
    1356 
    1357  ///<summary>
    1358  /// Use the existing component, discard the new component.
    1359  /// All references to the discarded component are changed to reference the
    1360  /// the surviving component.
    1361  ///</summary>
    1362  UseExistingComponent = 2,
    1363 
    1364  ///<summary>
    1365  /// Replace the existing component with the new component.
    1366  /// All references to the discarded component are changed reference the
    1367  /// the surviving component.
    1368  ///</summary>
    1369  ReplaceExistingComponent = 3,
    1370 
    1371  ///<summary>
    1372  /// Keep both components.
    1373  /// Resolve the name conflict by automatically assigning a name new component.
    1374  /// This is typically done by appending an integer to the original name.
    1375  ///</summary>
    1376  KeepBothComponentsAutomaticRename = 4,
    1377 
    1378  ///<summary>
    1379  /// Keep both components.
    1380  /// Resolve the name conflict by interactivly asking for an unused name
    1381  /// to assign to the new component.
    1382  ///</summary>
    1383  KeepBothComponentsQueryRename = 5,
    1384 
    1385  ///<summary>
    1386  /// No name conflict was detected and no special action is required.
    1387  /// This can occur when the names in question are unique or unique names are not required.
    1388  ///</summary>
    1389  NoConflict = 0xFF
    1390  };
    1391 
    1392  static ON::ComponentNameConflictResolution ComponentNameConflictResolutionFromUnsigned(
    1393  unsigned int component_name_conflict_resolution_as_unsigned
    1394  );
    1395 
    1396  //// distance_display_mode ///////////////////////////////////
    1397 
    1398 
    1399  // Obsolete - use ON_DimStyle::DimensionLengthDisplay
    1400  enum class OBSOLETE_DistanceDisplayMode : unsigned char
    1401  {
    1402  // Obsolete - Obsolete - use ON_DimStyle::DimensionLengthDisplay::ModelUnits
    1403  Decimal = 0,
    1404 
    1405  // Obsolete - Obsolete - use ON_DimStyle::DimensionLengthDisplay::InchesFractional
    1406  Fractional = 1,
    1407 
    1408  // Obsolete - Obsolete - use ON_DimStyle::DimensionLengthDisplay::FeetAndInches
    1409  FeetInches = 2
    1410  };
    1411 
    1412  static ON::OBSOLETE_DistanceDisplayMode DistanceDisplayModeFromUnsigned(
    1413  unsigned int distance_display_mode_as_unsigned
    1414  );
    1415 
    1416 
    1417  //// point_style ///////////////////////////////////////////////////////////////
    1418  enum point_style
    1419  {
    1420  unknown_point_style = 0,
    1421  not_rational = 1,
    1422  homogeneous_rational = 2,
    1423  euclidean_rational = 3,
    1424  intrinsic_point_style = 4, // point format used in definition
    1425  point_style_count = 5
    1426  };
    1427 
    1428  static point_style PointStyle(int); // convert integer to point_style enum
    1429 
    1430  //// knot_style ///////////////////////////////////////////////////////////////
    1431  enum knot_style // if a knot vector meets the conditions of two styles,
    1432  { // then the style with the lowest value is used
    1433  unknown_knot_style = 0, // unknown knot style
    1434  uniform_knots = 1, // uniform knots (ends not clamped)
    1435  quasi_uniform_knots = 2, // uniform knots (clamped ends, degree >= 2)
    1436  piecewise_bezier_knots = 3, // all internal knots have full multiplicity
    1437  clamped_end_knots = 4, // clamped end knots (with at least 1 interior non-uniform knot)
    1438  non_uniform_knots = 5, // known to be none of the above
    1439  knot_style_count = 6
    1440  };
    1441 
    1442  static knot_style KnotStyle(int); // convert integer to knot_style enum
    1443 
    1444  //// continuity ////////////////////////////////////////////////////////////////
    1445  enum class continuity : unsigned int
    1446  {
    1447  unknown_continuity = 0,
    1448 
    1449  // These test for parametric continuity. In particular,
    1450  // all types of ON_Curves are considered infinitely
    1451  // continuous at the start/end of the evaluation domain.
    1452  C0_continuous = 1, // continuous function
    1453  C1_continuous = 2, // continuous first derivative
    1454  C2_continuous = 3, // continuous first and second derivative
    1455  G1_continuous = 4, // continuous unit tangent
    1456  G2_continuous = 5, // continuous unit tangent and curvature
    1457 
    1458  // 20 March 2003 Dale Lear added these.
    1459  //
    1460  // Continuity tests using the following enum values
    1461  // are identical to tests using the preceding enum values
    1462  // on the INTERIOR of a curve's domain. At the END of
    1463  // a curve a "locus" test is performed in place of a
    1464  // parametric test. In particular, at the END of a domain,
    1465  // all open curves are locus discontinuous. At the END of
    1466  // a domain, all closed curves are at least C0_locus_continuous.
    1467  // By convention all ON_Curves are considered
    1468  // locus continuous at the START of the evaluation domain.
    1469  // This convention is not strictly correct, but is was
    1470  // adopted to make iterative kink finding tools easier to
    1471  // use and so that locus discontinuities are reported once
    1472  // at the end parameter of a curve rather than twice.
    1473  C0_locus_continuous = 6, // locus continuous function
    1474  C1_locus_continuous = 7, // locus continuous first derivative
    1475  C2_locus_continuous = 8, // locus continuous first and second derivative
    1476  G1_locus_continuous = 9, // locus continuous unit tangent
    1477  G2_locus_continuous = 10, // locus continuous unit tangent and curvature
    1478 
    1479  Cinfinity_continuous = 11, // analytic discontinuity
    1480  Gsmooth_continuous = 12 // aesthetic discontinuity
    1481  };
    1482 
    1483  /*
    1484  Description:
    1485  Convert int to ON::continuity enum value
    1486  */
    1487  static continuity Continuity(int);
    1488 
    1489  /*
    1490  Description:
    1491  Convert int to ON::continuity enum value and
    1492  convert the locus flavored values to the parametric
    1493  flavored values.
    1494  */
    1495  static continuity ParametricContinuity(int);
    1496 
    1497  /*
    1498  Description:
    1499  Convert int to ON::continuity enum value and
    1500  convert the higher order flavored values to
    1501  the corresponding C1 or G1 values needed to
    1502  test piecewise linear curves.
    1503  */
    1504  static continuity PolylineContinuity(int);
    1505 
    1506  //// curve_style ///////////////////////////////////////////////////////////////
    1507  enum curve_style
    1508  {
    1509  unknown_curve_style = 0,
    1510  line = 1,
    1511  circle = 2,
    1512  ellipse = 3, // with distinct foci (not a circle)
    1513  parabola = 4,
    1514  hyperbola = 5,
    1515  planar_polyline = 6, // not a line segment
    1516  polyline = 7, // non-planar polyline
    1517  planar_freeform_curve = 8, // planar but none of the above
    1518  freeform_curve = 9, // known to be none of the above
    1519  curve_style_count = 10
    1520  };
    1521 
    1522  static curve_style CurveStyle(int); // convert integer to curve_style enum
    1523 
    1524  //// surface_style ///////////////////////////////////////////////////////////////
    1525  enum surface_style
    1526  {
    1527  unknown_surface_style = 0,
    1528  plane = 1,
    1529  circular_cylinder = 2, // portion of right circular cylinder
    1530  elliptical_cylinder = 3, // portion of right elliptical cylinder
    1531  circular_cone = 4, // portion of right circular cone
    1532  elliptical_cone = 5, // portion of right elliptical cone
    1533  sphere = 6, // portion of sphere
    1534  torus = 7, // portion of torus
    1535  surface_of_revolution = 8, // portion of surface of revolution that is none of the above
    1536  ruled_surface = 9, // portion of a ruled surface this is none of the above
    1537  freeform_surface = 10, // known to be none of the above
    1538  surface_style_count = 11
    1539  };
    1540 
    1541  static surface_style SurfaceStyle(int); // convert integer to surface_style enum
    1542 
    1543  //// sort_algorithm ///////////////////////////////////////////////////////////////
    1544  enum class sort_algorithm : unsigned int
    1545  {
    1546  heap_sort = 0,
    1547  quick_sort = 1
    1548  };
    1549 
    1550  static sort_algorithm SortAlgorithm(int); // convert integer to sort_method enum
    1551 
    1552  //// endian-ness ///////////////////////////////////////////////////////////////
    1553  enum class endian : unsigned int
    1554  {
    1555  little_endian = 0, // least significant byte first or reverse byte order - Intel x86, ...
    1556  big_endian = 1 // most significant byte first - Motorola, Sparc, MIPS, ...
    1557  };
    1558 
    1559  static endian Endian(int); // convert integer to endian enum
    1560  static endian Endian(); // returns endian-ness of current CPU
    1561 
    1562  //// archive modes //////////////////////////////////////////////////////////////
    1563  enum class archive_mode : unsigned int
    1564  {
    1565  unset_archive_mode = 0,
    1566  read = 1, // all read modes have bit 0x0001 set
    1567  write = 2, // all write modes have bit 0x0002 set
    1568  readwrite = 3,
    1569  read3dm = 5,
    1570  write3dm = 6
    1571  };
    1572  static archive_mode ArchiveMode(int); // convert integer to endian enum
    1573 
    1574 
    1575  //// view projections ///////////////////////////////////////////////////////////
    1576 
    1577  // The x/y/z_2pt_perspective_view projections are ordinary perspective
    1578  // projection. Using these values insures the ON_Viewport member
    1579  // fuctions properly constrain the camera up and camera direction vectors
    1580  // to preserve the specified perspective vantage.
    1581  enum view_projection : unsigned int
    1582  {
    1583  unknown_view = 0,
    1584  parallel_view = 1,
    1585  perspective_view = 2
    1586  };
    1587 
    1588  /*
    1589  Description:
    1590  Converts integer into ON::view_projection enum value.
    1591  Parameters:
    1592  i - [in]
    1593  Returns:
    1594  ON::view_projection enum with same value as i.
    1595  If i is not an ON::view_projection enum value,
    1596  then ON::unknow_view is returned.
    1597  */
    1598  static view_projection ViewProjection(int i);
    1599 
    1600  /*
    1601  Parameters:
    1602  projection - [in]
    1603  Returns:
    1604  True if projection is ON::perspective_view.
    1605  */
    1606  static bool IsPerspectiveProjection( ON::view_projection projection );
    1607 
    1608 
    1609  /*
    1610  Parameters:
    1611  projection - [in]
    1612  Returns:
    1613  True if projection is ON::parallel_view.
    1614  */
    1615  static bool IsParallelProjection( ON::view_projection projection );
    1616 
    1617  //// view coordinates ///////////////////////////////////////////////////////////
    1618 
    1619  enum coordinate_system
    1620  {
    1621  world_cs = 0,
    1622  camera_cs = 1,
    1623  clip_cs = 2,
    1624  screen_cs = 3
    1625  };
    1626 
    1627  static coordinate_system CoordinateSystem(int); // convert integer to coordinate_system enum
    1628 
    1629  //// exception types ///////////////////////////////////////////////////////////
    1630  enum exception_type
    1631  {
    1632  unknown_exception = 0,
    1633  out_of_memory,
    1634  corrupt_object, // invalid object encountered - continuing would crash or
    1635  // result in corrupt object being saved in archive.
    1636  unable_to_write_archive, // write operation failed - out of file space/read only mode/...?
    1637  unable_to_read_archive, // read operation failed - truncated archive/locked file/... ?
    1638  unable_to_seek_archive, // seek operation failed - locked file/size out of bounds/... ?
    1639  unexpected_end_of_archive, // truncated archive
    1640  unexpected_value_in_archive // corrupt archive?
    1641  };
    1642  static exception_type ExceptionType(int); // convert integer to exception_type enum
    1643 
    1644  //// layer mode ///////////////////////////////////////////////////////////
    1645  // OBSOLETE
    1646  enum layer_mode
    1647  {
    1648  normal_layer = 0, // visible, objects on layer can be selected and changed
    1649  hidden_layer = 1, // not visible, objects on layer cannot be selected or changed
    1650  locked_layer = 2, // visible, objects on layer cannot be selected or changed
    1651  layer_mode_count = 3
    1652  };
    1653  static layer_mode LayerMode(int); // convert integer to layer_mode enum
    1654 
    1655  //// object mode ///////////////////////////////////////////////////////////
    1656  enum object_mode
    1657  {
    1658  normal_object = 0, // object mode comes from layer
    1659  hidden_object = 1, // not visible, object cannot be selected or changed
    1660  locked_object = 2, // visible, object cannot be selected or changed
    1661  idef_object = 3, // object is part of an ON_InstanceDefinition. The
    1662  // ON_InstanceDefinition m_object_uuid[] array will
    1663  // contain this object attribute's uuid.
    1664  object_mode_count = 4
    1665  };
    1666  static object_mode ObjectMode(int); // convert integer to object_mode enum
    1667 
    1668  //// object display color /////////////////////////////////////////////////////////
    1669  enum object_color_source
    1670  {
    1671  color_from_layer = 0, // use color assigned to layer
    1672  color_from_object = 1, // use color assigned to object
    1673  color_from_material = 2, // use diffuse render material color
    1674  color_from_parent = 3 // for objects with parents (like objects in instance references, use parent linetype)
    1675  // if no parent, treat as color_from_layer
    1676  };
    1677  static object_color_source ObjectColorSource(int); // convert integer to object_color_source enum
    1678 
    1679  //// object plot color /////////////////////////////////////////////////////////
    1680  enum plot_color_source
    1681  {
    1682  plot_color_from_layer = 0, // use plot color assigned to layer
    1683  plot_color_from_object = 1, // use plot color assigned to object
    1684  plot_color_from_display = 2, // use display color
    1685  plot_color_from_parent = 3 // for objects with parents (like objects in instance references, use parent plot color)
    1686  // if no parent, treat as plot_color_from_layer
    1687  };
    1688  static plot_color_source PlotColorSource(int); // convert integer to plot_color_source enum
    1689 
    1690  //// object plot weight /////////////////////////////////////////////////////////
    1691  enum plot_weight_source
    1692  {
    1693  plot_weight_from_layer = 0, // use plot color assigned to layer
    1694  plot_weight_from_object = 1, // use plot color assigned to object
    1695  plot_weight_from_parent = 3 // for objects with parents (like objects in instance references, use parent plot color)
    1696  // if no parent, treat as plot_color_from_layer
    1697  };
    1698  static plot_weight_source PlotWeightSource(int); // convert integer to plot_color_source enum
    1699 
    1700  //// object linetype /////////////////////////////////////////////////////////
    1701  enum object_linetype_source
    1702  {
    1703  linetype_from_layer = 0, // use line style assigned to layer
    1704  linetype_from_object = 1, // use line style assigned to object
    1705  linetype_from_parent = 3 // for objects with parents (like objects in instance references, use parent linetype)
    1706  // if not parent, treat as linetype_from_layer.
    1707  };
    1708  static object_linetype_source ObjectLinetypeSource(int); // convert integer to object_linetype_source enum
    1709 
    1710  //// object material /////////////////////////////////////////////////////////
    1711  enum object_material_source
    1712  {
    1713  material_from_layer = 0, // use material assigned to layer
    1714  material_from_object = 1, // use material assigned to object
    1715  material_from_parent = 3 // for objects with parents, like
    1716  // definition geometry in instance
    1717  // references and faces in polysurfaces,
    1718  // this value indicates the material
    1719  // definition should come from the parent.
    1720  // If the object does not have an
    1721  // obvious "parent", then treat
    1722  // it the same as material_from_layer.
    1723  };
    1724  static object_material_source ObjectMaterialSource(int); // convert integer to object_color_source enum
    1725 
    1726  //// light style /////////////////////////////////////////////////////////////
    1727  enum light_style
    1728  {
    1729  unknown_light_style = 0,
    1730  //view_directional_light = 1, // light location and direction in clip coordinates
    1731  //view_point_light = 2,
    1732  //view_spot_light = 3,
    1733  camera_directional_light = 4, // light location and direction in camera coordinates
    1734  camera_point_light = 5, // +x points to right, +y points up, +z points towards camera
    1735  camera_spot_light = 6,
    1736  world_directional_light = 7, // light location and direction in world coordinates
    1737  world_point_light = 8,
    1738  world_spot_light = 9,
    1739  ambient_light = 10, // pure ambient light
    1740  world_linear_light = 11,
    1741  world_rectangular_light = 12,
    1742  light_style_count = 13
    1743  };
    1744  static light_style LightStyle(int); // convert integer to light_style enum
    1745 
    1746  //// curvature style /////////////////////////////////////////////////////////
    1747  enum curvature_style
    1748  {
    1749  unknown_curvature_style = 0,
    1750  gaussian_curvature = 1,
    1751  mean_curvature = 2, // unsigned mean curvature
    1752  min_curvature = 3, // minimum unsigned radius of curvature
    1753  max_curvature = 4, // maximum unsigned radius of curvature
    1754  curvature_style_count = 5
    1755  };
    1756  static curvature_style CurvatureStyle(int); // convert integer to curvature_style enum
    1757 
    1758  /////////////////////////////////////////////////////////////////
    1759  //
    1760  // Legacy V3 display mode enum values.
    1761  // Beginning with V4, opennurbs and Rhino us an ON_UUID to identify
    1762  // display modes. The standard display mode ids are static
    1763  // values in ON_StandardDisplayModeId.
    1764  enum v3_display_mode
    1765  {
    1766  v3_default_display = 0, // default display
    1767  v3_wireframe_display = 1, // wireframe display
    1768  v3_shaded_display = 2, // shaded display
    1769  v3_renderpreview_display = 3 // render preview display
    1770  };
    1771  static ON::v3_display_mode V3DisplayMode(int); // convert integer to legacy v3_display_mode enum
    1772 
    1773  enum view_type
    1774  {
    1775  model_view_type = 0, // standard model space 3d view
    1776  page_view_type = 1, // a.k.a "paper space", "plot view", etc.
    1777  // A page view must be orthographic,
    1778  // the camera frame x,y,z direction must be
    1779  // world x,y,z (which means the camera direction
    1780  // is always (0,0,-1)).
    1781  nested_view_type = 2, // This view is a "model" view that is nested
    1782  // in another view. The nesting and parent
    1783  // information is saved in ON_3dmView.
    1784  };
    1785  static view_type ViewType(int); // convert integer to display_mode enum
    1786 
    1787 
    1788  //// texture mapping mode ///////////////////////////////////////////////////
    1789  //
    1790  // OBSOLETE
    1791  enum texture_mode
    1792  {
    1793  no_texture = 0, // texture disabled
    1794  modulate_texture = 1, // modulate with material diffuse color
    1795  decal_texture = 2 // decal
    1796  };
    1797  // OBSOLETE
    1798  static texture_mode TextureMode(int); // convert integer to texture_mode enum
    1799  // OBSOLETE
    1800  //
    1801  /////////////////////////////////////////////////////////////////////////////
    1802 
    1803  //// object_type ///////////////////////////////////////////////////
    1804  enum object_type
    1805  {
    1806  // Use with ON_Object::ObjectType() in situations where
    1807  // using a switch() is better than a long string of if else if ...
    1808  // if ( ON_Curve::Cast() ) ... else if ( ON_Surface::Cast() ) ...
    1809  // ...
    1810  unknown_object_type = 0,
    1811 
    1812  point_object = 1, // some type of ON_Point
    1813  pointset_object = 2, // some type of ON_PointCloud, ON_PointGrid, ...
    1814  curve_object = 4, // some type of ON_Curve like ON_LineCurve, ON_NurbsCurve, etc.
    1815  surface_object = 8, // some type of ON_Surface like ON_PlaneSurface, ON_NurbsSurface, etc.
    1816  brep_object = 0x10, // some type of ON_Brep
    1817  mesh_object = 0x20, // some type of ON_Mesh
    1818  layer_object = 0x40, // some type of ON_Layer
    1819  material_object = 0x80, // some type of ON_Material
    1820  light_object = 0x100, // some type of ON_Light
    1821  annotation_object = 0x200, // some type of ON_Annotation
    1822  userdata_object = 0x400, // some type of ON_UserData
    1823  instance_definition = 0x800, // some type of ON_InstanceDefinition
    1824  instance_reference = 0x1000, // some type of ON_InstanceRef
    1825  text_dot = 0x2000, // some type of ON_TextDot
    1826  grip_object = 0x4000, // selection filter value - not a real object type
    1827  detail_object = 0x8000, // some type of ON_DetailView
    1828  hatch_object = 0x10000, // some type of ON_Hatch
    1829  morph_control_object = 0x20000, // some type of ON_MorphControl
    1830  subd_object = 0x40000, // some type of ON_SubD, ON_SubDRef, ON_SubDComponentRef, ON_SubD....
    1831  loop_object = 0x80000, // some type of ON_BrepLoop
    1832  brepvertex_filter = 0x100000, // selection filter value - not a real object type
    1833  polysrf_filter = 0x200000, // selection filter value - not a real object type
    1834  edge_filter = 0x400000, // selection filter value - not a real object type
    1835  polyedge_filter = 0x800000, // selection filter value - not a real object type
    1836  meshvertex_filter = 0x01000000, // selection filter value - not a real object type
    1837  meshedge_filter = 0x02000000, // selection filter value - not a real object type
    1838  meshface_filter = 0x04000000, // selection filter for mesh triangle, quad or ngon - not a real object type
    1839  meshcomponent_reference = 0x07000000, // an ON_MeshComponentRef to vertex, edge, face, ngon
    1840  cage_object = 0x08000000, // some type of ON_NurbsCage
    1841  phantom_object = 0x10000000,
    1842  clipplane_object = 0x20000000,
    1843  extrusion_object = 0x40000000, // some type of ON_Extrusion
    1844 
    1845  any_object = 0xFFFFFFFF
    1846 
    1847  // Please discuss any changes with Dale Lear
    1848  };
    1849 
    1850  static object_type ObjectType(int); // convert integer to object_type enum
    1851 
    1852  //// bitmap_type ///////////////////////////////////////////////////
    1853  enum bitmap_type
    1854  {
    1855  unknown_bitmap_type = 0,
    1856  windows_bitmap = 1, // BITMAPINFO style
    1857  opengl_bitmap = 2, // unpacked OpenGL RGB or RGBA
    1858  png_bitmap = 3
    1859  };
    1860  static bitmap_type BitmapType(int); // convert integer to bitmap_type enum
    1861 
    1862  enum object_decoration
    1863  {
    1864  no_object_decoration = 0,
    1865  start_arrowhead = 0x08, // arrow head at start
    1866  end_arrowhead = 0x10, // arrow head at end
    1867  both_arrowhead = 0x18 // arrow heads at start and end
    1868  };
    1869  static object_decoration ObjectDecoration(int); // convert integer to line_pattern enum
    1870 
    1871  enum mesh_type
    1872  {
    1873  default_mesh = 0,
    1874  render_mesh = 1,
    1875  analysis_mesh = 2,
    1876  preview_mesh = 3,
    1877  any_mesh = 4
    1878  };
    1879  static mesh_type MeshType(int); // convert integer to mesh_type enum
    1880 
    1881 
    1882  // Types of object snapping.
    1883  // In situations where more than one type of snap applies,
    1884  // snaps with higher value take precedence.
    1885  // enum values must be a power of 2.
    1886  // ON_ObjRef saves these values in files. Do not change
    1887  // the values. The reason for the gaps between the enum
    1888  // values is to leave room for future snaps with prededence
    1889  // falling between existing snaps
    1890  enum osnap_mode
    1891  {
    1892  os_none = 0,
    1893  os_near = 2,
    1894  os_focus = 8,
    1895  os_center = 0x20,
    1896  os_vertex = 0x40,
    1897  os_knot = 0x80,
    1898  os_quadrant = 0x200,
    1899  os_midpoint = 0x800,
    1900  os_intersection = 0x2000,
    1901  os_end = 0x20000,
    1902  os_perpendicular = 0x80000,
    1903  os_tangent = 0x200000,
    1904  os_point = 0x08000000,
    1905  os_all_snaps = 0xFFFFFFFF
    1906  };
    1907  static osnap_mode OSnapMode(int); // convert integer to osnap_mode enum
    1908 
    1909 
    1910  //// Types of Curves ///////////////////////////////////////////////////////////
    1911  enum eCurveType
    1912  {
    1913  ctCurve, // nothing
    1914  ctArc,
    1915  ctCircle,
    1916  ctLine,
    1917  ctNurbs,
    1918  ctOnsurface,
    1919  ctProxy,
    1920  ctPolycurve,
    1921  ctPolyline,
    1922  };
    1923 
    1924 
    1925  //// surface_loft_end_condition //////////////////////////////////////////////
    1926  //
    1927  // End condition paramter values for ON_Curve::CreateCubicLoft() and
    1928  // ON_Surface::CreateCubicLoft().
    1929  enum cubic_loft_end_condition
    1930  {
    1931  cubic_loft_ec_quadratic = 0,
    1932  cubic_loft_ec_linear = 1,
    1933  cubic_loft_ec_cubic = 2,
    1934  cubic_loft_ec_natural = 3,
    1935  cubic_loft_ec_unit_tangent = 4,
    1936  cubic_loft_ec_1st_derivative = 5,
    1937  cubic_loft_ec_2nd_derivative = 6,
    1938  cubic_loft_ec_free_cv = 7
    1939  };
    1940 
    1941  /*
    1942  Description:
    1943  Convert an integer to cubic_loft_end_condition enum.
    1944  Parameters:
    1945  i - [in]
    1946  Returns:
    1947  corresponding cubic_loft_end_condition enum value.
    1948  Remarks:
    1949  If i does not correspond to a cubic_loft_end_condition
    1950  enum value, then cubic_loft_ec_quadratic is returned.
    1951  */
    1952  static
    1953  cubic_loft_end_condition CubicLoftEndCondition(int i);
    1954 
    1955 
    1956 public:
    1957 
    1958 #pragma region RH_C_SHARED_ENUM [ON::AnnotationType] [Rhino.Geometry.AnnotationType] [byte]
    1959 
    1960  /// <summary>
    1961  /// ON::AnnotationType identifies the type of an annotation object derived from ON_Annotation.
    1962  /// </summary>
    1963  enum class AnnotationType : unsigned char
    1964  {
    1965  ///<summary>
    1966  /// Not a valid annotation type.
    1967  ///</summary>
    1968  Unset = 0,
    1969 
    1970  ///<summary>
    1971  /// Linear distance between two points with dimension line parallel to the dimensioned points.
    1972  ///</summary>
    1973  Aligned = 1,
    1974 
    1975  ///<summary>
    1976  /// Angle bewteen two lines.
    1977  ///</summary>
    1978  Angular = 2,
    1979 
    1980  ///<summary>
    1981  /// Arc or circle diameter dimension.
    1982  ///</summary>
    1983  Diameter = 3,
    1984 
    1985  ///<summary>
    1986  /// Arc or circle radius dimension.
    1987  ///</summary>
    1988  Radius = 4,
    1989 
    1990  ///<summary>
    1991  /// Linear distance between two points with dimension line horizontal, vertical or rotated by a specified amount.
    1992  ///</summary>
    1993  Rotated = 5,
    1994 
    1995  ///<summary>
    1996  /// Ordinate dimension. Typically used to document an offset distance between the center of a circle and a reference point.
    1997  ///</summary>
    1998  Ordinate = 6,
    1999 
    2000  ///<summary>
    2001  /// Arc length of a curve.
    2002  ///</summary>
    2003  ArcLen = 7,
    2004 
    2005  ///<summary>
    2006  /// Center mark dimension. Typically used to document the center of an arc or circle.
    2007  ///</summary>
    2008  CenterMark = 8,
    2009 
    2010  ///<summary>
    2011  /// Text. Stand alone text with a wide variety of uses.
    2012  ///</summary>
    2013  Text = 9,
    2014 
    2015  ///<summary>
    2016  /// Leader. Text and a curve with an arrow head.
    2017  ///</summary>
    2018  Leader = 10,
    2019 
    2020  ///<summary>
    2021  /// Angular3pt. Angle defined by 3 points.
    2022  ///</summary>
    2023  Angular3pt = 11
    2024  };
    2025 
    2026 #pragma endregion
    2027 
    2028  static ON::AnnotationType AnnotationTypeFromUnsigned(
    2029  unsigned int annotation_type_as_unsigned
    2030  );
    2031 
    2032 
    2033 
    2034 #pragma region RH_C_SHARED_ENUM [ON::TextVerticalAlignment] [Rhino.DocObjects.TextVerticalAlignment] [byte]
    2035  /// <summary>
    2036  /// Vertical location of text attach point relative to text
    2037  /// </summary>
    2038  enum class TextVerticalAlignment : unsigned char
    2039  {
    2040  ///<summary>
    2041  /// Attach to top of an "I" on the first line. (Independent of glyphs being displayed.)
    2042  ///</summary>
    2043  Top = 0,
    2044  ///<summary>
    2045  /// Attach to middle of an "I" on the first line. (Independent of glyphs being displayed.)
    2046  ///</summary>
    2047  MiddleOfTop = 1,
    2048  ///<summary>
    2049  /// Attach to baseline of first line. (Independent of glyphs being displayed.)
    2050  ///</summary>
    2051  BottomOfTop = 2,
    2052  ///<summary>
    2053  /// Attach to middle of text vertical advance. (Independent of glyphs being displayed.)
    2054  ///</summary>
    2055  Middle = 3,
    2056  ///<summary>
    2057  /// Attach to middle of an "I" on the last line. (Independent of glyphs being displayed.)
    2058  ///</summary>
    2059  MiddleOfBottom = 4,
    2060  ///<summary>
    2061  /// Attach to the basline of the last line. (Independent of glyphs being displayed.)
    2062  ///</summary>
    2063  Bottom = 5,
    2064  ///<summary>
    2065  /// Attach to the bottom of the boudning box of the visible glyphs.
    2066  ///</summary>
    2067  BottomOfBoundingBox = 6, // TODO - changed to BottomOfBoundingBox
    2068  };
    2069 #pragma endregion
    2070 
    2071  static ON::TextVerticalAlignment TextVerticalAlignmentFromUnsigned(
    2072  unsigned int vertical_alignment_as_unsigned
    2073  );
    2074 
    2075  static ON::TextVerticalAlignment TextVerticalAlignmentFromV5Justification(
    2076  unsigned int v5_justification_bits
    2077  );
    2078 
    2079 #pragma region RH_C_SHARED_ENUM [ON::TextHorizontalAlignment] [Rhino.DocObjects.TextHorizontalAlignment] [byte]
    2080  /// <summary>
    2081  /// Horizontal location of text attach point relative to text
    2082  /// </summary>
    2083  enum class TextHorizontalAlignment : unsigned char
    2084  {
    2085  /// <summary>
    2086  /// Attach at left of text lines (Independent of glyphs being displayed.)
    2087  /// </summary>
    2088  Left = 0,
    2089  /// <summary>
    2090  /// Attach point at center of text horizontal advance (not glyph bounding box)
    2091  /// </summary>
    2092  Center = 1,
    2093  /// <summary>
    2094  /// Attach point at right text horizontal advance (not glyph bounding box)
    2095  /// </summary>
    2096  Right = 2,
    2097  };
    2098 #pragma endregion
    2099 
    2100  static ON::TextHorizontalAlignment TextHorizontalAlignmentFromUnsigned(
    2101  unsigned int horizontal_alignment_as_unsigned
    2102  );
    2103 
    2104  static ON::TextHorizontalAlignment TextHorizontalAlignmentFromV5Justification(
    2105  unsigned int v5_justification_bits
    2106  );
    2107 
    2108 #pragma region RH_C_SHARED_ENUM [ON::TextOrientation] [Rhino.DocObjects.TextOrientation] [byte]
    2109  /// <summary>
    2110  /// Method for getting rotation for drawing text
    2111  /// </summary>
    2112  enum class TextOrientation : unsigned char
    2113  {
    2114  /// <summary>
    2115  /// Text has fixed rotation on a world coordinate plane
    2116  /// </summary>
    2117  InPlane = 0,
    2118  /// <summary>
    2119  /// Text is drawn on a plane perpendicular to view direction horizontal to the screen
    2120  /// </summary>
    2121  InView = 1,
    2122  };
    2123 
    2124 #pragma endregion
    2125 
    2126  static ON::TextOrientation TextOrientationFromUnsigned(
    2127  unsigned int orientation_as_unsigned
    2128  );
    2129 
    2130 
    2131 
    2132 private:
    2133  // ON::Begin() sets m_opennurbs_library_status
    2134  // 0 = not initialized
    2135  // 1 = in the body of ON::Begin()
    2136  // 2 = ON:Begin() finished.
    2137  static unsigned int m_opennurbs_library_status;
    2138 
    2139 private:
    2140  // prohibit instantiaion
    2141  //ON(); // no implementation
    2142  //ON( const ON& ); // no implementation
    2143  //~ON(); // no implementation
    2144 };
    2145 
    2146 /*
    2147 Description:
    2148  Component indices are used to provide a persistent way
    2149  to identify portions of complex objects.
    2150 
    2151 */
    2152 class ON_CLASS ON_COMPONENT_INDEX
    2153 {
    2154 public:
    2155 
    2156  // Do not change these values; they are stored in 3dm archives
    2157  // and provide a persistent way to indentify components of
    2158  // complex objects.
    2159  enum TYPE
    2160  {
    2161  invalid_type = 0,
    2162 
    2163  brep_vertex = 1,
    2164  brep_edge = 2,
    2165  brep_face = 3,
    2166  brep_trim = 4,
    2167  brep_loop = 5,
    2168 
    2169  mesh_vertex = 11,
    2170  meshtop_vertex = 12,
    2171  meshtop_edge = 13,
    2172  mesh_face = 14,
    2173  mesh_ngon = 15,
    2174 
    2175  idef_part = 21,
    2176 
    2177  polycurve_segment = 31,
    2178 
    2179  pointcloud_point = 41,
    2180 
    2181  group_member = 51,
    2182 
    2183 
    2184  extrusion_bottom_profile = 61, // 3d bottom profile curves
    2185  // index identifies profile component
    2186  extrusion_top_profile = 62, // 3d top profile curves
    2187  // index identifies profile component
    2188  extrusion_wall_edge = 63, // 3d wall edge curve
    2189  // index/2: identifies profile component
    2190  // index%2: 0 = start, 1 = end
    2191  extrusion_wall_surface = 64, // side wall surfaces
    2192  // index: identifies profile component
    2193  extrusion_cap_surface = 65, // bottom and top cap surfaces
    2194  // index: 0 = bottom, 1 = top
    2195  extrusion_path = 66, // extrusion path (axis line)
    2196  // index -1 = entire path, 0 = start point, 1 = endpoint
    2197 
    2198  //////////////////////////////////////////////////////
    2199  //
    2200  // ON_SubD component index
    2201  //
    2202  // Use ON_SubD.ComponentPtrFromComponentIndex() to convert an ON_COMPONENT_INDEX
    2203  // into a component pointer.
    2204  // See also
    2205  // ON_SubD.VertexFromId()
    2206  // ON_SubD.EdgeFromId()
    2207  // ON_SubD.FaceFromId()
    2208  //
    2209  subd_vertex = 71, // m_index = ON_SubDVertex.m_id, use ON_SubD.ComponentPtrFromComponentIndex()
    2210  subd_edge = 72, // m_index = ON_SubDEdge.m_id
    2211  subd_face = 73, // m_index = ON_SubDFace.m_id
    2212 
    2213  dim_linear_point = 100,
    2214  dim_radial_point = 101,
    2215  dim_angular_point = 102,
    2216  dim_ordinate_point = 103,
    2217  dim_text_point = 104,
    2218  dim_centermark_point = 105,
    2219  dim_leader_point = 106,
    2220 
    2221  no_type = 0xFFFFFFFF
    2222  };
    2223 
    2224  /*
    2225  Description:
    2226  Safe conversion of integer value to TYPE enum.
    2227  Parameters:
    2228  i - [in] integer with value equal to one of the TYPE enums.
    2229  Returns:
    2230  The TYPE enum with the same numeric value
    2231  or ON_COMPONENT_INDEX::invalid_type if no corresponding enum
    2232  exists.
    2233  */
    2234  static
    2235  ON_COMPONENT_INDEX::TYPE Type(int i);
    2236 
    2237  /*
    2238  Description:
    2239  Dictionary compare on m_type, m_index as ints.
    2240  Returns:
    2241  < 0: a < b
    2242  = 0: a = b
    2243  > 0: a > b
    2244  */
    2245  static
    2246  int Compare( const ON_COMPONENT_INDEX* a, const ON_COMPONENT_INDEX* b);
    2247 
    2248  /*
    2249  Description:
    2250  UnsetComponentIndex.m_type = invalid_type
    2251  UnsetComponentIndex.m_index = -1 as int
    2252  = ON_UNSET_UINT_INDEX as unsigned int
    2253  */
    2254  static const ON_COMPONENT_INDEX UnsetComponentIndex;
    2255 
    2256  /*
    2257  Description:
    2258  Default constructor has value ON_COMPONENT_INDEX UnsetComponentIndex.
    2259  */
    2260  ON_COMPONENT_INDEX();
    2261 
    2262  /*
    2263  Description:
    2264  Sets m_type = type and m_index = index.
    2265  */
    2266  ON_COMPONENT_INDEX(ON_COMPONENT_INDEX::TYPE type,int index);
    2267 
    2268  bool operator==(const ON_COMPONENT_INDEX& other) const;
    2269  bool operator!=(const ON_COMPONENT_INDEX& other) const;
    2270  bool operator<(const ON_COMPONENT_INDEX& other) const;
    2271  bool operator<=(const ON_COMPONENT_INDEX& other) const;
    2272  bool operator>(const ON_COMPONENT_INDEX& other) const;
    2273  bool operator>=(const ON_COMPONENT_INDEX& other) const;
    2274 
    2275  void Set(ON_COMPONENT_INDEX::TYPE type,int index);
    2276  void Set(ON_COMPONENT_INDEX::TYPE type,unsigned int index);
    2277 
    2278  /*
    2279  Description:
    2280  Sets m_type = invalid_type and m_index = -1.
    2281  */
    2282  void UnSet();
    2283 
    2284  /*
    2285  Returns:
    2286  True if m_type is set to a TYPE enum value between
    2287  brep_vertex and polycurve_segment.
    2288  */
    2289  bool IsSet() const;
    2290 
    2291  bool IsNotSet() const;
    2292 
    2293  /*
    2294  Returns:
    2295  True if m_type is set to one of the mesh or meshtop
    2296  TYPE enum values and m_index >= 0.
    2297  */
    2298  bool IsMeshComponentIndex() const;
    2299 
    2300  /*
    2301  Returns:
    2302  True if m_type is set to one of the subd
    2303  TYPE enum values and m_index >= 0.
    2304  */
    2305  bool IsSubDComponentIndex() const;
    2306 
    2307  /*
    2308  Returns:
    2309  True if m_type is set to one of the
    2310  brep TYPE enum values and m_index >= 0.
    2311  */
    2312  bool IsBrepComponentIndex() const;
    2313 
    2314  /*
    2315  Returns:
    2316  True if m_type = idef_part and m_index >= 0.
    2317  */
    2318  bool IsIDefComponentIndex() const;
    2319 
    2320  /*
    2321  Returns:
    2322  True if m_type = polycurve_segment and m_index >= 0.
    2323  */
    2324  bool IsPolyCurveComponentIndex() const;
    2325 
    2326  /*
    2327  Returns:
    2328  True if m_type = group_member and m_index >= 0.
    2329  */
    2330  bool IsGroupMemberComponentIndex() const;
    2331 
    2332  /*
    2333  Returns:
    2334  True if m_type = extrusion_bottom_profile or extrusion_top_profile
    2335  and m_index >= 0.
    2336  */
    2337  bool IsExtrusionProfileComponentIndex() const;
    2338 
    2339  /*
    2340  Returns:
    2341  True if m_type = extrusion_path and -1 <= m_index <= 1.
    2342  */
    2343  bool IsExtrusionPathComponentIndex() const;
    2344 
    2345  /*
    2346  Returns:
    2347  True if m_type = extrusion_wall_edge and m_index >= 0.
    2348  */
    2349  bool IsExtrusionWallEdgeComponentIndex() const;
    2350 
    2351  /*
    2352  Returns:
    2353  True if m_type = extrusion_wall_surface and m_index >= 0.
    2354  */
    2355  bool IsExtrusionWallSurfaceComponentIndex() const;
    2356 
    2357  /*
    2358  Returns:
    2359  True if m_type = extrusion_wall_surface or extrusion_wall_edge
    2360  and m_index >= 0.
    2361  */
    2362  bool IsExtrusionWallComponentIndex() const;
    2363 
    2364  /*
    2365  Returns:
    2366  True if m_type = extrusion_bottom_profile, extrusion_top_profile,
    2367  extrusion_wall_edge, extrusion_wall_surface, extrusion_cap_surface
    2368  or extrusion_path and m_index is reasonable.
    2369  */
    2370  bool IsExtrusionComponentIndex() const;
    2371 
    2372  /*
    2373  Returns:
    2374  True if m_type = pointcloud_point and m_index >= 0.
    2375  */
    2376  bool IsPointCloudComponentIndex() const;
    2377 
    2378  /*
    2379  Returns:
    2380  True if m_type = dim_... and m_index >= 0.
    2381  */
    2382  bool IsAnnotationComponentIndex() const;
    2383 
    2384  void Dump(
    2385  class ON_TextLog& text_log
    2386  )const;
    2387 
    2388  void AppendToString(
    2389  class ON_String& s
    2390  )const;
    2391 
    2392  void AppendToString(
    2393  class ON_wString& s
    2394  )const;
    2395 
    2396 
    2397  TYPE m_type;
    2398 
    2399  /*
    2400  The interpretation of m_index depends on the m_type value.
    2401 
    2402  m_type m_index interpretation (0 based indices)
    2403 
    2404  no_type used when context makes it clear what array is being index
    2405  brep_vertex ON_Brep.m_V[] array index
    2406  brep_edge ON_Brep.m_E[] array index
    2407  brep_face ON_Brep.m_F[] array index
    2408  brep_trim ON_Brep.m_T[] array index
    2409  brep_loop ON_Brep.m_L[] array index
    2410  mesh_vertex ON_Mesh.m_V[] array index
    2411  meshtop_vertex ON_MeshTopology.m_topv[] array index
    2412  meshtop_edge ON_MeshTopology.m_tope[] array index
    2413  mesh_face ON_Mesh.m_F[] array index
    2414  mesh_ngon ON_Mesh.Ngon() array index
    2415  idef_part ON_InstanceDefinition.m_object_uuid[] array index
    2416  polycurve_segment ON_PolyCurve::m_segment[] array index
    2417 
    2418  extrusion_bottom_profile Use ON_Extrusion::Profile3d() to get 3d profile curve
    2419  extrusion_top_profile Use ON_Extrusion::Profile3d() to get 3d profile curve
    2420  extrusion_wall_edge Use ON_Extrusion::WallEdge() to get 3d line curve
    2421  extrusion_wall_surface Use ON_Extrusion::WallSurface() to get 3d wall surface
    2422  extrusion_cap_surface 0 = bottom cap, 1 = top cap
    2423  extrusion_path -1 = entire path, 0 = start of path, 1 = end of path
    2424 
    2425  dim_linear_point linear dimension point index
    2426  dim_radial_point radial dimension point index
    2427  dim_angular_point angular dimension point index
    2428  dim_ordinate_point ordinate dimension point index
    2429  dim_text_point annotation text object point
    2430  */
    2431 
    2432  unsigned int UnsignedIndex() const
    2433  {
    2434  return (unsigned int)m_index;
    2435  }
    2436 
    2437  int m_index;
    2438 };
    2439 
    2440 #endif
    2441 
    2442 ON_BEGIN_EXTERNC
    2443 
    2444 // on_wcsicmp() is a wrapper for case insensitive wide string compare
    2445 // and calls one of _wcsicmp() or wcscasecmp() depending on OS.
    2446 ON_DECL
    2447 int on_wcsicmp( const wchar_t*, const wchar_t* );
    2448 
    2449 // on_wcsupr() calls _wcsupr() or wcsupr() depending on OS
    2450 ON_DECL
    2451 wchar_t* on_wcsupr(wchar_t*);
    2452 
    2453 // on_wcslwr() calls _wcslwr() or wcslwr() depending on OS
    2454 ON_DECL
    2455 wchar_t* on_wcslwr(wchar_t*);
    2456 
    2457 // on_wcsrev() calls _wcsrev() or wcsrev() depending on OS
    2458 ON_DECL
    2459 wchar_t* on_wcsrev(wchar_t*);
    2460 
    2461 // on_stricmp() is a wrapper for case insensitive string compare
    2462 // and calls one of _stricmp(), stricmp(), or strcasecmp()
    2463 // depending on OS.
    2464 ON_DECL
    2465 int on_stricmp(const char*, const char*);
    2466 
    2467 // on_stricmp() is a wrapper for case insensitive string compare
    2468 // and calls one of _strnicmp() or strncasecmp()
    2469 // depending on OS.
    2470 ON_DECL
    2471 int on_strnicmp(const char * s1, const char * s2, int n);
    2472 
    2473 // on_strupr() calls _strupr() or strupr() depending on OS
    2474 ON_DECL
    2475 char* on_strupr(char*);
    2476 
    2477 // on_strlwr() calls _strlwr() or strlwr() depending on OS
    2478 ON_DECL
    2479 char* on_strlwr(char*);
    2480 
    2481 // on_strrev() calls _strrev() or strrev() depending on OS
    2482 ON_DECL
    2483 char* on_strrev(char*);
    2484 
    2485 /*
    2486 Description:
    2487  Calls ON_ConvertWideCharToUTF8()
    2488 */
    2489 ON_DECL
    2490 int on_WideCharToMultiByte(
    2491  const wchar_t*, // lpWideCharStr,
    2492  int, // cchWideChar,
    2493  char*, // lpMultiByteStr,
    2494  int // cchMultiByte,
    2495  );
    2496 
    2497 /*
    2498 Description:
    2499  Calls ON_ConvertUTF8ToWideChar()
    2500 */
    2501 ON_DECL
    2502 int on_MultiByteToWideChar(
    2503  const char*, // lpMultiByteStr,
    2504  int, // cchMultiByte,
    2505  wchar_t*, // lpWideCharStr,
    2506  int // cchWideChar
    2507  );
    2508 
    2509 /*
    2510 Description:
    2511  Find the locations in a path the specify the drive, directory,
    2512  file name and file extension.
    2513 Parameters:
    2514  path - [in]
    2515  UTF-8 encoded string that is a legitimate path to a file.
    2516  volume - [out] (pass null if you don't need the volume)
    2517  If volume is not null and the path parameter begins with
    2518  a Windows volum specification, the value of *volume will
    2519  equal the input value of path. Otherwise *volume will be nullptr.
    2520  A Windows volume specification can be either a single A-Z or a-z
    2521  letter followed by a colon ( C: ) or a Windows UNC host name
    2522  (\\MY_SERVER).
    2523  dir - [out] (pass null if you don't need the directory)
    2524  If dir is not null and the path parameter contains a
    2525  directory specification, then the returned value of *dir
    2526  will point to the character in path where the directory
    2527  specification begins.
    2528  fname - [out] (pass null if you don't need the file name)
    2529  If fname is not null and the path parameter contains a
    2530  file name specification, then the returned value of *fname
    2531  will point to the character in path where the file name
    2532  specification begins.
    2533  ext - [out] (pass null if you don't need the extension)
    2534  If ext is not null and the path parameter contains a
    2535  file extension specification, then the returned value of
    2536  *ext will point to the '.' character in path where the file
    2537  extension specification begins.
    2538 Remarks:
    2539  This function will treat a front slash ( / ) and a back slash
    2540  ( \ ) as directory separators. Because this function parses
    2541  file names store in .3dm files and the .3dm file may have been
    2542  written on a Windows computer and then read on a another
    2543  computer, it looks for a volume specification even when the
    2544  operating system is not Windows.
    2545  This function will not return an directory that does not
    2546  end with a trailing slash.
    2547  This function will not return an empty filename and a non-empty
    2548  extension.
    2549  This function parses the path string according to these rules.
    2550  It does not check the actual file system to see if the answer
    2551  is correct.
    2552 See Also:
    2553  ON_String::SplitPath
    2554 */
    2555 ON_DECL void on_splitpath(
    2556  const char* path,
    2557  const char** volume,
    2558  const char** dir,
    2559  const char** fname,
    2560  const char** ext
    2561  );
    2562 
    2563 /*
    2564 Description:
    2565  Find the locations in a path the specify the drive, directory,
    2566  file name and file extension.
    2567 Parameters:
    2568  path - [in]
    2569  A legitimate file system path to a file.
    2570  volume - [out] (pass null if you don't need the volume)
    2571  If volume is not null and the path parameter begins with
    2572  a Windows volum specification, the value of *volume will
    2573  equal the input value of path. Otherwise *volume will be nullptr.
    2574  A Windows volume specification can be either a single A-Z or a-z
    2575  letter followed by a colon ( C: ) or a Windows UNC host name
    2576  (\\MY_SERVER).
    2577  dir - [out] (pass null if you don't need the directory)
    2578  If dir is not null and the path parameter contains a
    2579  directory specification, then the returned value of *dir
    2580  will point to the character in path where the directory
    2581  specification begins.
    2582  fname - [out] (pass null if you don't need the file name)
    2583  If fname is not null and the path parameter contains a
    2584  file name specification, then the returned value of *fname
    2585  will point to the character in path where the file name
    2586  specification begins.
    2587  ext - [out] (pass null if you don't need the extension)
    2588  If ext is not null and the path parameter contains a
    2589  file extension specification, then the returned value of
    2590  *ext will point to the '.' character in path where the file
    2591  extension specification begins.
    2592 Remarks:
    2593  This function will treat a front slash ( / ) and a back slash
    2594  ( \ ) as directory separators. Because this function parses
    2595  file names store in .3dm files and the .3dm file may have been
    2596  written on a Windows computer and then read on a another
    2597  computer, it looks for a volume specification even when the
    2598  operating system is not Windows.
    2599  This function will not return an directory that does not
    2600  end with a trailing slash.
    2601  This function will not return an empty filename and a non-empty
    2602  extension.
    2603  This function parses the path string according to these rules.
    2604  It does not check the actual file system to see if the answer
    2605  is correct.
    2606 See Also:
    2607  ON_wString::SplitPath
    2608 */
    2609 ON_DECL void on_wsplitpath(
    2610  const wchar_t* path,
    2611  const wchar_t** volume,
    2612  const wchar_t** dir,
    2613  const wchar_t** fname,
    2614  const wchar_t** ext
    2615  );
    2616 
    2617 ON_END_EXTERNC
    2618 
    2619 
    2620 #endif
    double d
    Definition: opennurbs_defines.h:404
    +
    1 /*
    2 // Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved.
    3 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    4 // McNeel & Associates.
    5 //
    6 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    7 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    8 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    9 //
    10 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    11 //
    12 ////////////////////////////////////////////////////////////////
    13 */
    14 
    15 ////////////////////////////////////////////////////////////////
    16 //
    17 // Includes all openNURBS toolkit defines and enums.
    18 //
    19 ////////////////////////////////////////////////////////////////
    20 
    21 #if !defined(OPENNURBS_DEFINES_INC_)
    22 #define OPENNURBS_DEFINES_INC_
    23 
    24 #if !defined(OPENNURBS_SYSTEM_INC_)
    25 #error Include opennurbs_system.h before opennurbs_defines.h
    26 #endif
    27 
    28 #if defined (cplusplus) || defined(_cplusplus) || defined(__cplusplus) || defined(ON_CPLUSPLUS)
    29 // C++ extern "C" declaration for C linkage
    30 
    31 #if !defined(ON_CPLUSPLUS)
    32 #define ON_CPLUSPLUS
    33 #endif
    34 #define ON_EXTERNC extern "C"
    35 #define ON_BEGIN_EXTERNC extern "C" {
    36 #define ON_END_EXTERNC }
    37 
    38 #define ON_UINT_FROM_ENUM(e) (static_cast<unsigned int>(e))
    39 #define ON_INT_FROM_ENUM(e) ((int)static_cast<unsigned int>(e))
    40 
    41 #else
    42 
    43 /* C file - no extern declaration required or permitted */
    44 
    45 #define ON_EXTERNC
    46 #define ON_BEGIN_EXTERNC
    47 #define ON_END_EXTERNC
    48 
    49 #endif
    50 
    51 
    52 /*
    53 // Declarations in header (.H) files look like
    54 //
    55 // ON_DECL type function():
    56 // extern ON_EXTERN_DECL type global_variable;
    57 // class ON_CLASS classname {};
    58 // ON_TEMPLATE template class ON_CLASS template<T>;
    59 //
    60 */
    61 
    62 #define ON_ENUM_FROM_UNSIGNED_CASE(e) case (unsigned int)e: return(e); break
    63 #define ON_ENUM_TO_STRING_CASE(e) case e: return( ON_String(#e) ); break
    64 #define ON_ENUM_TO_WIDE_STRING_CASE(e) case e: return( ON_wString(#e) ); break
    65 
    66 /* export/import */
    67 #if defined(OPENNURBS_EXPORTS)
    68 /* compiling opennurbs as some type of dynamic linking library */
    69 
    70 #if defined(ON_COMPILER_MSC)
    71 /* compiling OpenNurbs as a Windows DLL - export classes, functions, templates, and globals */
    72 #define ON_CLASS __declspec(dllexport)
    73 #define ON_DECL __declspec(dllexport)
    74 #define ON_EXTERN_DECL __declspec(dllexport)
    75 #define ON_DLL_TEMPLATE
    76 
    77 #elif defined(ON_COMPILER_CLANG)
    78 /* compiling opennurbs as an Apple shared library */
    79 #define ON_CLASS __attribute__ ((visibility ("default")))
    80 #define ON_DECL __attribute__ ((visibility ("default")))
    81 #define ON_EXTERN_DECL __attribute__ ((visibility ("default")))
    82 
    83 #else
    84 #error fill in your compiler dynamic linking decorations
    85 #endif
    86 
    87 #elif defined(OPENNURBS_IMPORTS)
    88 /* dynamically linking with opennurbs in some way */
    89 
    90 #if defined(ON_COMPILER_MSC)
    91 /* using OpenNurbs as a Windows DLL - import classes, functions, templates, and globals */
    92 #define ON_CLASS __declspec(dllimport)
    93 #define ON_DECL __declspec(dllimport)
    94 #define ON_EXTERN_DECL __declspec(dllimport)
    95 #define ON_DLL_TEMPLATE extern
    96 
    97 #elif defined(ON_COMPILER_CLANG)
    98 /* using opennurbs as an Apple shared library */
    99 #define ON_CLASS __attribute__ ((visibility ("default")))
    100 #define ON_DECL __attribute__ ((visibility ("default")))
    101 #define ON_EXTERN_DECL __attribute__ ((visibility ("default")))
    102 
    103 #else
    104 #error fill in your compiler dynamic linking decorations
    105 #endif
    106 
    107 #else
    108 
    109 /* compiling or using OpenNurbs as a static library */
    110 #define ON_CLASS
    111 #define ON_DECL
    112 #define ON_EXTERN_DECL
    113 
    114 #if defined(ON_DLL_TEMPLATE)
    115 #undef ON_DLL_TEMPLATE
    116 #endif
    117 
    118 #endif
    119 
    120 
    121 // ON_DEPRECATED is used to mark deprecated functions.
    122 #if defined(ON_COMPILER_MSC)
    123 #define ON_DEPRECATED __declspec(deprecated)
    124 #define ON_DEPRECATED_MSG(s) [[deprecated(s)]]
    125 #elif defined(ON_COMPILER_CLANG)
    126 #define ON_DEPRECATED __attribute__((deprecated))
    127 #define ON_DEPRECATED_MSG(s) [[deprecated(s)]]
    128 #else
    129 #define ON_DEPRECATED
    130 #define ON_DEPRECATED_MSG(s)
    131 #endif
    132 
    133 #if defined(PI)
    134 #define ON_PI PI
    135 #else
    136 #define ON_PI 3.141592653589793238462643
    137 #endif
    138 
    139 #define ON_DEGREES_TO_RADIANS (ON_PI/180.0)
    140 #define ON_RADIANS_TO_DEGREES (180.0/ON_PI)
    141 
    142 /*
    143 Parameters:
    144  angle_in_radians - [in]
    145  Angle measure in radians
    146 Returns:
    147  Angle measure in degrees
    148 */
    149 ON_DECL
    150 double ON_DegreesFromRadians(
    151  double angle_in_radians
    152 );
    153 
    154 /*
    155 Parameters:
    156  angle_in_degrees - [in]
    157  Angle measure in degrees
    158 Returns:
    159  Angle measure in radians
    160 */
    161 ON_DECL
    162 double ON_RadiansFromDegrees(
    163  double angle_in_degrees
    164 );
    165 
    166 #define ON_SQRT2 1.414213562373095048801689
    167 #define ON_SQRT3 1.732050807568877293527446
    168 #define ON_SQRT3_OVER_2 0.8660254037844386467637230
    169 #define ON_1_OVER_SQRT2 0.7071067811865475244008445
    170 #define ON_SIN_PI_OVER_12 0.2588190451025207623488990
    171 #define ON_COS_PI_OVER_12 0.9659258262890682867497433
    172 
    173 #define ON_LOG2 0.6931471805599453094172321
    174 #define ON_LOG10 2.302585092994045684017991
    175 
    176 #define ON_ArrayCount(a) (sizeof(a)/sizeof((a)[0]))
    177 
    178 #if defined(DBL_MAX)
    179 #define ON_DBL_MAX DBL_MAX
    180 #else
    181 #define ON_DBL_MAX 1.7976931348623158e+308
    182 #endif
    183 
    184 #if defined(DBL_MIN)
    185 #define ON_DBL_MIN DBL_MIN
    186 #else
    187 #define ON_DBL_MIN 2.22507385850720200e-308
    188 #endif
    189 
    190 // ON_EPSILON = 2^-52
    191 #if defined(DBL_EPSILON)
    192 #define ON_EPSILON DBL_EPSILON
    193 #else
    194 #define ON_EPSILON 2.2204460492503131e-16
    195 #endif
    196 #define ON_SQRT_EPSILON 1.490116119385000000e-8
    197 
    198 #if defined(FLT_EPSILON)
    199 #define ON_FLOAT_EPSILON FLT_EPSILON
    200 #else
    201 #define ON_FLOAT_EPSILON 1.192092896e-07
    202 #endif
    203 #define ON_SQRT_FLOAT_EPSILON 3.452669830725202719e-4
    204 
    205 /*
    206 // In cases where lazy evaluation of a double value is
    207 // performed, b-rep tolerances being a notable example,
    208 // this value is used to indicate the value has not been
    209 // computed. This value must be < -1.0e308. and > -ON_DBL_MAX
    210 //
    211 // The reasons ON_UNSET_VALUE is a valid finite number are:
    212 //
    213 // 1) It needs to round trip through fprintf/sscanf.
    214 // 2) It needs to persist unchanged through assigment
    215 / and not generate exceptions when assigned.
    216 // 3) ON_UNSET_VALUE == ON_UNSET_VALUE needs to be true.
    217 // 4) ON_UNSET_VALUE != ON_UNSET_VALUE needs to be false.
    218 //
    219 // Ideally, it would also have these SNaN attributes
    220 // * When used in a calculation, a floating point exception
    221 // occures.
    222 // * No possibility of a valid calculation would generate
    223 // ON_UNSET_VALUE.
    224 // * float f = (float)ON_UNSET_VALUE would create an invalid
    225 // float and generate an exception.
    226 */
    227 #define ON_UNSET_POSITIVE_VALUE 1.23432101234321e+308
    228 #define ON_UNSET_VALUE -ON_UNSET_POSITIVE_VALUE
    229 
    230 /*
    231 // ON_UNSET_FLOAT is used to indicate a texture coordinate
    232 // value cannot be calculated or is not well defined.
    233 // In hindsight, this value should have been ON_FLT_QNAN
    234 // because many calculation convert float texture coordinates
    235 // to doubles and the "unset"ness attribute is lost.
    236 */
    237 #define ON_UNSET_POSITIVE_FLOAT 1.234321e+38f
    238 #define ON_UNSET_FLOAT -ON_UNSET_POSITIVE_FLOAT
    239 
    240 // When unsinged int values are used in a context where
    241 // 0 is a valid index and there needs to be a value that
    242 // indicates the index is not set, use ON_UNSET_UINT_INDEX.
    243 #define ON_UNSET_UINT_INDEX 0xFFFFFFFFU
    244 
    245 // When signed int values are used in a context where
    246 // 0 and small negative values are valid indices and there needs
    247 // to be a value that indicates the index is not set,
    248 // use ON_UNSET_INT_INDEX. This value is INT_MIN+1
    249 #define ON_UNSET_INT_INDEX ((const int)-2147483647)
    250 
    251 ON_BEGIN_EXTERNC
    252 
    253 // IEEE 754 special values
    254 
    255 extern ON_EXTERN_DECL const double ON_DBL_QNAN;
    256 extern ON_EXTERN_DECL const double ON_DBL_PINF;
    257 extern ON_EXTERN_DECL const double ON_DBL_NINF;
    258 
    259 extern ON_EXTERN_DECL const float ON_FLT_QNAN;
    260 extern ON_EXTERN_DECL const float ON_FLT_PINF;
    261 extern ON_EXTERN_DECL const float ON_FLT_NINF;
    262 
    263 
    264 /*
    265 Description:
    266 Paramters:
    267  x - [out] returned value of x is an SNan
    268  (signalling not a number).
    269 Remarks:
    270  Any time an SNaN passes through an Intel FPU, the result
    271  is a QNaN (quiet nan) and the invalid operation excpetion
    272  flag is set. If this exception is not masked, then the
    273  exception handler is invoked.
    274 
    275  double x, y;
    276  ON_DBL_SNAN(&x);
    277  y = x; // y = QNAN and invalid op exception occurs
    278  z = sin(x) // z = QNAN and invalid op exception occurs
    279 
    280  So, if you want to reliably initialize doubles to SNaNs,
    281  you must use memcpy() or some other method that does not
    282  use the Intel FPU.
    283 */
    284 ON_DECL
    285 void ON_DBL_SNAN( double* x );
    286 
    287 ON_DECL
    288 void ON_FLT_SNAN( float* x );
    289 
    290 /*
    291 Returns:
    292  ON_UNSET_FLOAT, if x = ON_UNSET_VALUE.
    293  ON_UNSET_POSITIVE_FLOAT, if x = ON_UNSET_POSITIVE_VALUE.
    294  (float)x, otherwise.
    295 */
    296 ON_DECL
    297 float ON_FloatFromDouble(
    298  double x
    299 );
    300 
    301 /*
    302 Returns:
    303  ON_UNSET_VALUE, if x = ON_UNSET_FLOAT.
    304  ON_UNSET_POSITIVE_VALUE, if x = ON_UNSET_POSITIVE_FLOAT.
    305  (double)x, otherwise.
    306 */
    307 ON_DECL
    308 double ON_DoubleFromFloat(
    309  float x
    310 );
    311 
    312 
    313 ON_END_EXTERNC
    314 
    315 #if defined(ON_CPLUSPLUS)
    316 ON_DECL
    317 bool ON_IsNullPtr(const void* ptr);
    318 
    319 ON_DECL
    320 bool ON_IsNullPtr(const ON__UINT_PTR ptr);
    321 
    322 ON_DECL
    323 bool ON_IsNullPtr(const ON__INT_PTR ptr);
    324 #endif
    325 
    326 /*
    327 // In cases where lazy evaluation of a color value is
    328 // performed, this value is used to indicate the value
    329 // has not been computed.
    330 */
    331 #define ON_UNSET_COLOR 0xFFFFFFFF
    332 
    333 /*
    334 // In cases when an absolute "zero" tolerance
    335 // is required to compare model space coordinates,
    336 // ON_ZERO_TOLERANCE is used. The value of
    337 // ON_ZERO_TOLERANCE should be no smaller than
    338 // ON_EPSILON and should be several orders of
    339 // magnitude smaller than ON_SQRT_EPSILON
    340 //
    341 */
    342 //#define ON_ZERO_TOLERANCE 1.0e-12
    343 // ON_ZERO_TOLERANCE = 2^-32
    344 #define ON_ZERO_TOLERANCE 2.3283064365386962890625e-10
    345 
    346 /*
    347 // In cases when an relative "zero" tolerance is
    348 // required for comparing model space coordinates,
    349 // (fabs(a)+fabs(b))*ON_RELATIVE_TOLERANCE is used.
    350 // ON_RELATIVE_TOLERANCE should be larger than
    351 // ON_EPSILON and smaller than no larger than
    352 // ON_ZERO_TOLERANCE*2^-10.
    353 //
    354 */
    355 // ON_RELATIVE_TOLERANCE = 2^-42
    356 #define ON_RELATIVE_TOLERANCE 2.27373675443232059478759765625e-13
    357 
    358 /*
    359 // Bugs in geometry calculations involving world coordinates
    360 // values > ON_MAXIMUM_WORLD_COORDINATE_VALUE
    361 // will be a low priority.
    362 */
    363 // ON_MAXIMUM_VALUE = 2^27
    364 #define ON_MAXIMUM_WORLD_COORDINATE_VALUE 1.34217728e8
    365 
    366 /*
    367 // Any 3d coordinate value >= ON_NONSENSE_WORLD_COORDINATE_VALUE
    368 // will be adjusted as needed. Any calculation creating 3d coordinates
    369 // with values >= ON_NONSENSE_WORLD_COORDINATE_VALUE should be
    370 // inspected for bugs.
    371 */
    372 // ON_NONSENSE_WORLD_COORDINATE_VALUE = 1.0e100
    373 #define ON_NONSENSE_WORLD_COORDINATE_VALUE 1.0e100
    374 
    375 /*
    376 // The default test for deciding if a curvature value should be
    377 // treated as zero is
    378 // length(curvature) <= ON_ZERO_CURVATURE_TOLERANCE.
    379 // ON_ZERO_CURVATURE_TOLERANCE must be set so that
    380 // ON_ZERO_CURVATURE_TOLERANCE >= sqrt(3)*ON_ZERO_TOLERANCE
    381 // so that K.IsTiny() = true implies |K| <= ON_ZERO_CURVATURE_TOLERANCE
    382 */
    383 #define ON_ZERO_CURVATURE_TOLERANCE 1.0e-8
    384 #define ON_RELATIVE_CURVATURE_TOLERANCE 0.05
    385 
    386 /* default value for angle tolerances = 1 degree */
    387 #define ON_DEFAULT_ANGLE_TOLERANCE (ON_PI/180.0)
    388 #define ON_DEFAULT_ANGLE_TOLERANCE_COSINE 0.99984769515639123915701155881391
    389 #define ON_MINIMUM_ANGLE_TOLERANCE (ON_DEFAULT_ANGLE_TOLERANCE/10.0)
    390 
    391 
    392 /*
    393 */
    394 ON_DECL
    395 ON__UINT64 ON_SecondsSinceJanOne1970UTC();
    396 
    397 union ON_U
    398 {
    399  char b[8]; // 8 bytes
    400  ON__INT64 h; // 64 bit integer
    401  ON__INT32 i; // 32 bit integer
    402  int j[2]; // two 32 bit integers
    403  void* p;
    404  double d;
    405 };
    406 
    407 #if defined(ON_CPLUSPLUS)
    408 
    409 // pair of integer indices. This
    410 // is intentionally a struct/typedef
    411 // rather than a class so that it
    412 // can be used in other structs.
    413 class ON_CLASS ON_2dex
    414 {
    415 public:
    416  ON_2dex() = default;
    417  ~ON_2dex() = default;
    418  ON_2dex(const ON_2dex&) = default;
    419  ON_2dex& operator=(const ON_2dex&) = default;
    420 
    421 public:
    422  // do not initialize i, j for performance reasons
    423  int i;
    424  int j;
    425 
    426  ON_2dex(int i, int j);
    427 
    428  static const ON_2dex Unset; // (ON_UNSET_INT_INDEX, ON_UNSET_INT_INDEX);
    429  static const ON_2dex Zero; // (0, 0)
    430 };
    431 
    432 class ON_CLASS ON_2udex
    433 {
    434 public:
    435  ON_2udex() = default;
    436  ~ON_2udex() = default;
    437  ON_2udex(const ON_2udex&) = default;
    438  ON_2udex& operator=(const ON_2udex&) = default;
    439 
    440 public:
    441  // do not initialize i, j for performance reasons
    442  unsigned int i;
    443  unsigned int j;
    444 
    445  ON_2udex(unsigned int i, unsigned int j);
    446 
    447  static const ON_2udex Unset; // (ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX);
    448  static const ON_2udex Zero; // (0, 0)
    449 };
    450 
    451 class ON_CLASS ON_3dex
    452 {
    453 public:
    454  ON_3dex() = default;
    455  ~ON_3dex() = default;
    456  ON_3dex(const ON_3dex&) = default;
    457  ON_3dex& operator=(const ON_3dex&) = default;
    458 
    459 public:
    460  // do not initialize i, j, k for performance reasons
    461  int i;
    462  int j;
    463  int k;
    464 
    465  ON_3dex(int i, int j, int k);
    466 
    467  static const ON_3dex Unset; // (ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX);
    468  static const ON_3dex Zero; // (0, 0, 0)
    469 };
    470 
    471 class ON_CLASS ON_3udex
    472 {
    473 public:
    474  ON_3udex() = default;
    475  ~ON_3udex() = default;
    476  ON_3udex(const ON_3udex&) = default;
    477  ON_3udex& operator=(const ON_3udex&) = default;
    478 
    479 public:
    480  // do not initialize i, j, k for performance reasons
    481  unsigned int i;
    482  unsigned int j;
    483  unsigned int k;
    484 
    485  ON_3udex(unsigned int i, unsigned int j, unsigned int k);
    486 
    487  static const ON_3udex Unset; // (ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX);
    488  static const ON_3udex Zero; // (0, 0, 0)
    489 };
    490 
    491 // quadruplet of integer indices.
    492 class ON_CLASS ON_4dex
    493 {
    494 public:
    495  ON_4dex() = default;
    496  ~ON_4dex() = default;
    497  ON_4dex(const ON_4dex&) = default;
    498  ON_4dex& operator=(const ON_4dex&) = default;
    499 
    500 public:
    501  // do not initialize i, j, k, l for performance reasons
    502  int i;
    503  int j;
    504  int k;
    505  int l;
    506 
    507  ON_4dex(int i, int j, int k, int l);
    508 
    509  static const ON_4dex Unset; // (ON_UNSET_INT_INDEX, ON_UNSET_INT_INDEX, ON_UNSET_INT_INDEX, ON_UNSET_INT_INDEX);
    510  static const ON_4dex Zero; // (0, 0, 0, 0)
    511 };
    512 
    513 class ON_CLASS ON_4udex
    514 {
    515 public:
    516  ON_4udex() = default;
    517  ~ON_4udex() = default;
    518  ON_4udex(const ON_4udex&) = default;
    519  ON_4udex& operator=(const ON_4udex&) = default;
    520 
    521 public:
    522  // do not initialize i, j, k, l for performance reasons
    523  unsigned int i;
    524  unsigned int j;
    525  unsigned int k;
    526  unsigned int l;
    527 
    528  ON_4udex(unsigned int i, unsigned int j, unsigned int k, unsigned int l);
    529 
    530  static const ON_4udex Unset; // (ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX, ON_UNSET_UINT_INDEX);
    531  static const ON_4udex Zero; // (0, 0, 0, 0)
    532 };
    533 
    534 
    535 enum class ON_StringMapType : int
    536 {
    537  Identity = 0,
    538  UpperCase = 1,
    539  LowerCase = 2
    540 };
    541 
    542 enum class ON_StringMapOrdinalType : int
    543 {
    544  Identity = 0,
    545  UpperOrdinal = 1,
    546  LowerOrdinal = 2,
    547  MinimumOrdinal = 3
    548 };
    549 
    550 ON_DECL
    551 ON_StringMapOrdinalType ON_StringMapOrdinalTypeFromStringMapType(
    552  ON_StringMapType map_type
    553  );
    554 
    555 // OpenNurbs enums
    556 class ON_CLASS ON
    557 {
    558 public:
    559  /*
    560  Description:
    561  Call before using openNURBS to ensure all class definitions
    562  are linked.
    563  */
    564  static void Begin();
    565 
    566 
    567  /*
    568  Description:
    569  Call when finished with openNURBS.
    570  Remarks:
    571  Currently does nothing.
    572  */
    573  static void End();
    574 
    575  /*
    576  Returns:
    577  0: not initialized
    578  1: in the body of ON:Begin()
    579  2: ON::Begin() has finished.
    580  */
    581  static unsigned int LibraryStatus();
    582 
    583  /*
    584  Set the library status
    585  */
    586  static void SetLibraryStatus(unsigned int status);
    587 
    588  /*
    589  Returns:
    590  The value of OPENNURBS_VERSION_NUMBER, which is defined in opennurbs_version.h.
    591  Remarks:
    592  The high bit of this number is set. Do not cast the result as an int.
    593  */
    594  static
    595  unsigned int Version();
    596 
    597  /*
    598  Returns:
    599  The value of OPENNURBS_VERSION_MAJOR, which is defined in opennurbs_version.h
    600  (0 to 63).
    601  */
    602  static
    603  unsigned int VersionMajor();
    604 
    605  /*
    606  Returns:
    607  The value of OPENNURBS_VERSION_MINOR, which is defined in opennurbs_version.h
    608  (0 to 127).
    609  */
    610  static
    611  unsigned int VersionMinor();
    612 
    613  /*
    614  Returns:
    615  The value of OPENNURBS_VERSION_YEAR, which is defined in opennurbs_version.h
    616  > 2014.
    617  */
    618  static
    619  unsigned int VersionYear();
    620 
    621  /*
    622  Returns:
    623  The value of OPENNURBS_VERSION_MONTH, which is defined in opennurbs_version.h
    624  1 to 12.
    625  */
    626  static
    627  unsigned int VersionMonth();
    628 
    629  /*
    630  Returns:
    631  The value of OPENNURBS_VERSION_DAY_OF_MONTH, which is defined in opennurbs_version.h
    632  (1 to 31).
    633  */
    634  static
    635  unsigned int VersionDayOfMonth();
    636 
    637  /*
    638  Returns:
    639  The value of OPENNURBS_VERSION_HOUR, which is defined in opennurbs_version.h
    640  (0 to 23).
    641  */
    642  static
    643  unsigned int VersionHour();
    644 
    645  /*
    646  Returns:
    647  The value of OPENNURBS_VERSION_MINUTE, which is defined in opennurbs_version.h
    648  (0 to 59).
    649  */
    650  static
    651  unsigned int VersionMinute();
    652 
    653  /*
    654  Returns:
    655  The value of OPENNURBS_VERSION_BRANCH, which is defined in opennurbs_version.h
    656  0: developer build
    657  1: trunk build
    658  2: release candidate build
    659  3: release build
    660  */
    661  static
    662  unsigned int VersionBranch();
    663 
    664  /*
    665  Description:
    666  Get the opennurbs version number as a quartet of values.
    667  Parameters:
    668  version_quartet - [out]
    669  version_quartet[0] = ON::VersionMajor()
    670  version_quartet[1] = ON::VersionMinor()
    671  version_quartet[2] = (year - 2000)*1000 + day_of_year
    672  version_quartet[3] = (hour*1000 + minute*10 + OPENNURBS_VERSION_BRANCH)
    673  Returns:
    674  The value of OPENNURBS_VERSION_NUMBER, which is defined in opennurbs_version.h.
    675  Remarks:
    676  The high bit of the returned value is set. Do not cast the result as an int.
    677  */
    678  static
    679  unsigned int VersionGetQuartet(
    680  unsigned int version_quartet[4]
    681  );
    682 
    683 
    684  /*
    685  Returns:
    686  The value of OPENNURBS_VERSION_QUARTET_STRING, which is defined in opennurbs_version.h.
    687  Remarks:
    688  The high bit of this number is set. Do not cast the result as an int.
    689  */
    690  static
    691  const char* VersionQuartetAsString();
    692 
    693  /*
    694  Returns:
    695  The value of OPENNURBS_VERSION_QUARTET_WSTRING, which is defined in opennurbs_version.h.
    696  Remarks:
    697  The high bit of this number is set. Do not cast the result as an int.
    698  */
    699  static
    700  const wchar_t* VersionQuartetAsWideString();
    701 
    702  /*
    703  Returns:
    704  Empty string or the git hash of the revison of the source code used to build this application.
    705  The git hash is a hexadecimal number represented in UTF-8 string.
    706  Remarks:
    707  Developer builds return "".
    708  Build system builds return the git revsion hash.
    709  */
    710  static const char* SourceGitRevisionHash();
    711 
    712  /*
    713  Returns:
    714  Empty string or the name of the git branch containing the source code used to build this application.
    715  Remarks:
    716  Developer builds return "".
    717  Build system builds return the git branch name or "".
    718  */
    719  static const char* SourceGitBranchName();
    720 
    721  /*
    722  Returns:
    723  A string that identifies the McNeel version control system source code to build this application.
    724  Remarks:
    725  Developer builds return "".
    726  Build system builds return the git <branch name> @ <git revision hash> or "".
    727  */
    728  static const char* SourceIdentification();
    729 
    730  //// File open/close for DLL use ///////////////////////////////////////////////
    731 
    732  static
    733  FILE* OpenFile( // like fopen() - needed when OpenNURBS is used as a DLL
    734  const char* filename,
    735  const char* filemode
    736  );
    737 
    738  static
    739  FILE* OpenFile( // like fopen() - needed when OpenNURBS is used as a DLL
    740  const wchar_t* filename,
    741  const wchar_t* filemode
    742  );
    743 
    744  static
    745  int CloseFile( // like fclose() - needed when OpenNURBS is used as a DLL
    746  FILE* // pointer returned by OpenFile()
    747  );
    748 
    749  static
    750  int CloseAllFiles(); // like _fcloseall() - needed when OpenNURBS is used as a DLL
    751 
    752  /*
    753  Description:
    754  Uses the flavor of fstat that is appropriate for the platform.
    755  Parameters:
    756  filename - [in]
    757  fp - [in]
    758  filesize - [out] (can be nullptr if you do not want filesize)
    759  create_time - [out] (can be nullptr if you do not want last create time)
    760  lastmodify_time - [out] (can be nullptr if you do not want last modification time)
    761  Returns:
    762  True if file exists, can be opened for read, and fstat worked.
    763  */
    764  static
    765  bool GetFileStats( const wchar_t* filename,
    766  size_t* filesize,
    767  time_t* create_time,
    768  time_t* lastmodify_time
    769  );
    770 
    771  static
    772  bool GetFileStats( FILE* fp,
    773  size_t* filesize,
    774  time_t* create_time,
    775  time_t* lastmodify_time
    776  );
    777 
    778  /*
    779  Returns true if pathname is a directory.
    780  */
    781  static bool IsDirectory( const wchar_t* pathname );
    782  static bool IsDirectory( const char* utf8pathname );
    783 
    784  /*
    785  Returns
    786  If the file is an opennurbs file, the version of the file
    787  is returned (2,3,4,50,...).
    788  If the file is not an opennurbs file, 0 is returned.
    789  */
    790  static int IsOpenNURBSFile( const wchar_t* pathname );
    791  static int IsOpenNURBSFile( const char* utf8pathname );
    792  static int IsOpenNURBSFile( FILE* fp );
    793 
    794 #pragma region RH_C_SHARED_ENUM [ON::RuntimeEnvironment] [Rhino.RuntimeEnvironment] [byte]
    795  /////////////////////////////////////////////////////////////////
    796  /// <summary>
    797  /// ON::RuntimeEnvironment identifies a runtime environment (operating system).
    798  /// This value is saved in binary archives so appropriate adjustments
    799  /// to resources provided by runtime environments, like fonts, can be made
    800  /// when an archive created in one runtime environment is used in another.
    801  /// </summary>
    802  enum class RuntimeEnvironment : unsigned char
    803  {
    804  ///<summary>
    805  /// ON::RuntimeEnvironment::Unset indicates no runtime is set.
    806  ///</summary>
    807  Unset = 0,
    808 
    809  ///<summary>
    810  /// ON::RuntimeEnvironment::None indicates no runtime.
    811  /// This is a different condition from ON::Runtime::Unset.
    812  ///</summary>
    813  None = 1,
    814 
    815  ///<summary>
    816  /// ON::RuntimeEnvironment::Windows indicates some version of Microsoft Windows.
    817  ///</summary>
    818  Windows = 2,
    819 
    820  ///<summary>
    821  /// ON::RuntimeEnvironment::Apple indicates some version of Apple OS X or iOS.
    822  ///</summary>
    823  Apple = 3,
    824 
    825  ///<summary>
    826  /// ON::RuntimeEnvironment::Android indicates some version of Google Android.
    827  ///</summary>
    828  Android = 4
    829  };
    830 #pragma endregion
    831 
    832  static ON::RuntimeEnvironment RuntimeEnvironmentFromUnsigned(
    833  unsigned int runtime_environment_as_unsigned
    834  );
    835 
    836  /*
    837  Returns:
    838  Current runtime environment.
    839  */
    840  static ON::RuntimeEnvironment CurrentRuntimeEnvironment();
    841 
    842 
    843 #pragma region RH_C_SHARED_ENUM [ON::ReadFileResult] [Rhino.ReadFileResult] [byte]
    844  /// <summary>
    845  /// ON::ReadFileResult reports what happened when a file read was attempted.
    846  /// </summary>
    847  enum class ReadFileResult : unsigned char
    848  {
    849  ///<summary>
    850  /// No result is available.
    851  ///</summary>
    852  Unset = 0,
    853 
    854  ///<summary>
    855  /// Read completed with no errors.
    856  ///</summary>
    857  Completed = 1,
    858 
    859  ///<summary>
    860  /// Read completed with non fatal errors.
    861  ///</summary>
    862  CompletedWithErrors = 2,
    863 
    864  ///<summary>
    865  /// Read failed.
    866  ///</summary>
    867  Failed = 3
    868  };
    869 #pragma endregion
    870 
    871  static ON::ReadFileResult ReadFileResultFromUnsigned(
    872  unsigned int read_file_result_as_unsigned
    873  );
    874 
    875  /*
    876  Returns:
    877  True if the value of read_file_result is one indicating partial to complete success.
    878  False if read_file_result is ON::ReadFileResult::Unset or ON::ReadFileResult::Failed.
    879  */
    880  static bool ReadFileCompleted(
    881  ON::ReadFileResult read_file_result
    882  );
    883 
    884  /*
    885  Returns:
    886  True if the value of read_file_result is one indicating total failure.
    887  False if read_file_result is ON::ReadFileResult::Unset or a value indicating partial to complete success.
    888  */
    889  static bool ReadFileFailed(
    890  ON::ReadFileResult read_file_result
    891  );
    892 
    893 
    894  // Defines the current working space.
    895  enum active_space : unsigned char
    896  {
    897  no_space = 0,
    898  model_space = 1, // 3d modeling or "world" space
    899  page_space = 2 // page/layout/paper/printing space
    900  };
    901 
    902  static active_space ActiveSpace(int); // convert integer to active_space enum
    903 
    904 #pragma region RH_C_SHARED_ENUM [ON::LengthUnitSystem] [Rhino.UnitSystem] [byte]
    905  // unit_system ///////////////////////////////////////////////////////////////
    906  /// <summary>
    907  /// ON::LengthUnitSystem identifies a length unit system
    908  /// United States customary length units references:
    909  /// http://www.nist.gov/pml/wmd/metric/upload/frn-59-5442-1959.pdf
    910  /// http://en.wikipedia.org/wiki/United_States_customary_units
    911  /// http://en.wikipedia.org/wiki/International_yard_and_pound
    912  /// </summary>
    913  enum class LengthUnitSystem : unsigned char
    914  {
    915  ///<summary>
    916  /// ON::LengthUnitSystem::None indicates no length unit system. The scale factor
    917  /// when converting between a specified unit system and None is always 1.0.
    918  /// ON::LengthUnitSystem::None is used as a unit system for models and
    919  /// instance defitions that should be imported or referenced with no
    920  /// scaling applied.
    921  ///</summary>
    922  None = 0,
    923 
    924  ///<summary>
    925  /// 1 angstroms = 1.0e-10 meters
    926  ///</summary>
    927  Angstroms = 12,
    928 
    929  // SI (metric) units
    930 
    931  ///<summary>
    932  /// 1 nanometer = 1.0e-9 meters
    933  ///</summary>
    934  Nanometers = 13,
    935 
    936  ///<summary>
    937  /// 1 micron = 1.0e-6 meters
    938  ///</summary>
    939  Microns = 1,
    940 
    941  ///<summary>
    942  /// 1 millimeter = 1.0e-3 meters
    943  ///</summary>
    944  Millimeters = 2,
    945 
    946  ///<summary>
    947  /// 1 centimeter = 1.0e-2 meters
    948  ///</summary>
    949  Centimeters = 3,
    950 
    951  ///<summary>
    952  /// 1 decimeter = 1.0e-1 meters
    953  ///</summary>
    954  Decimeters = 14,
    955 
    956  ///<summary>
    957  /// SI meter length unit
    958  ///</summary>
    959  Meters = 4,
    960 
    961  ///<summary>
    962  /// 1 dekameter = 1.0e+1 meters
    963  ///</summary>
    964  Dekameters = 15, // 1.0e+1 meters
    965 
    966  ///<summary>
    967  /// 1 hectometer = 1.0e+2 meters
    968  ///</summary>
    969  Hectometers = 16,
    970 
    971  ///<summary>
    972  /// 1 kilometer = 1.0e+3 meters
    973  ///</summary>
    974  Kilometers = 5,
    975 
    976  ///<summary>
    977  /// 1 megameter = 1.0e+6 meters
    978  ///</summary>
    979  Megameters = 17,
    980 
    981  ///<summary>
    982  /// 1 gigameter = 1.0e+9 meters
    983  ///</summary>
    984  Gigameters = 18,
    985 
    986  ///<summary>
    987  /// 1 microinches = 2.54e-8 meters = 1.0e-6 inches
    988  ///</summary>
    989  Microinches = 6,
    990 
    991  ///<summary>
    992  /// 1 mil = 2.54e-5 meters = 0.001 inches
    993  ///</summary>
    994  Mils = 7,
    995 
    996  ///<summary>
    997  /// 1 inch = 0.0254 meters = 1/12 foot
    998  ///</summary>
    999  Inches = 8,
    1000 
    1001  ///<summary>
    1002  /// 1 foot = 0.3048 meters (12 inches)
    1003  ///</summary>
    1004  Feet = 9,
    1005 
    1006  ///<summary>
    1007  /// 1 foot = 0.3048 meters = 12 inches
    1008  ///</summary>
    1009  Yards = 19,
    1010 
    1011  ///<summary>
    1012  /// 1 US statute mile = 1609.344 meters = 5280 feet
    1013  ///</summary>
    1014  Miles = 10,
    1015 
    1016  ///<summary>
    1017  /// 1 printer point = 1/72 inch
    1018  ///</summary>
    1019  PrinterPoints = 20,
    1020 
    1021  ///<summary>
    1022  /// 1 printer pica = 1/6 inch
    1023  ///</summary>
    1024  PrinterPicas = 21,
    1025 
    1026  // terrestrial distances
    1027 
    1028  ///<summary>
    1029  /// 1 nautical mile = 1852 meters
    1030  /// Approximately 1 minute of arc on a terrestrial great circle.
    1031  /// Reference: http://en.wikipedia.org/wiki/Nautical_mile
    1032  ///</summary>
    1033  NauticalMiles = 22,
    1034 
    1035  // astronomical distances
    1036 
    1037  ///<summary>
    1038  /// 1 astronomical unit = 1.4959787e+11 meters
    1039  /// An astronomical unit (au) is the mean distance from the
    1040  /// center of the earth to the center of the sun.
    1041  /// References:
    1042  /// http://en.wikipedia.org/wiki/Astronomical_unit (1.4959787e+11 meters)
    1043  /// http://units.nist.gov/Pubs/SP811/appenB9.htm (1.495979e+11 meters)
    1044  ///</summary>
    1045  AstronomicalUnits = 23,
    1046 
    1047  ///<summary>
    1048  /// 1 light year = 9.4607304725808e+15 meters
    1049  /// A light year is the distance light travels in one Julian year.
    1050  /// The speed of light is exactly 299792458 meters/second.
    1051  /// A Julian year is exactly 365.25 * 86400 seconds and is
    1052  /// approximately the time it takes for one earth orbit.
    1053  /// References:
    1054  /// http://en.wikipedia.org/wiki/Light_year (9.4607304725808e+15 meters)
    1055  /// http://units.nist.gov/Pubs/SP811/appenB9.htm (9.46073e+15 meters)
    1056  ///</summary>
    1057  LightYears = 24,
    1058 
    1059  ///<summary>
    1060  /// 1 parsec = 3.08567758e+16 meters
    1061  /// References:
    1062  /// http://en.wikipedia.org/wiki/Parsec (3.08567758e+16 meters)
    1063  /// http://units.nist.gov/Pubs/SP811/appenB9.htm (3.085678e+16)
    1064  ///</summary>
    1065  Parsecs = 25,
    1066 
    1067  ///<summary>
    1068  /// The name of a custom unit and the conversion to meters
    1069  /// are saved in the ON_UnitSystem class.
    1070  ///</summary>
    1071  CustomUnits = 11,
    1072 
    1073  ///<summary>
    1074  /// The ON::LengthUnitSystem::Unset is used to indicate no unit system is set.
    1075  /// This is a differnt condition from ON::LengthUnitSystem::None.
    1076  ///</summary>
    1077  Unset = 255
    1078  };
    1079 #pragma endregion
    1080 
    1081  static ON::LengthUnitSystem LengthUnitSystemFromUnsigned(
    1082  unsigned int length_unit_system_as_unsigned
    1083  );
    1084 
    1085  /*
    1086  Parameters:
    1087  model_serial_number - [in]
    1088  One good way to get this value is from ON_ModelComponent::ModelSerialNumber().
    1089  ON_DimStyle, ON_Layer, ... are all derived from ON_ModelComponent.
    1090  Returns:
    1091  The length unit system used by the model
    1092  */
    1093  static ON::LengthUnitSystem ModelLengthUnitSystem(
    1094  ON__UINT_PTR model_serial_number
    1095  );
    1096 
    1097 
    1098  static void RegisterModelLengthUnitSystemCallback(
    1099  ON::LengthUnitSystem (*func_ModelLengthUnitSystemCallback)(ON__UINT_PTR)
    1100  );
    1101 
    1102 public:
    1103 
    1104  /*
    1105  Returns
    1106  True if the length unit is one of
    1107  LengthUnitSystem::Angstroms
    1108  LengthUnitSystem::Nanometers
    1109  LengthUnitSystem::Microns
    1110  LengthUnitSystem::Millimeters
    1111  LengthUnitSystem::Centimeters
    1112  LengthUnitSystem::Decimeters
    1113  LengthUnitSystem::Meters
    1114  LengthUnitSystem::Dekameters
    1115  LengthUnitSystem::Hectometers
    1116  LengthUnitSystem::Kilometers
    1117  LengthUnitSystem::Megameters
    1118  LengthUnitSystem::Gigameters
    1119  LengthUnitSystem::NauticalMiles
    1120  LengthUnitSystem::AstronomicalUnits
    1121  LengthUnitSystem::LightYears
    1122  LengthUnitSystem::Parsecs
    1123  */
    1124  static bool IsMetricLengthUnit(
    1125  ON::LengthUnitSystem length_unit_system
    1126  );
    1127 
    1128  /*
    1129  Returns
    1130  True if the length unit is one of
    1131  LengthUnitSystem::Microinches
    1132  LengthUnitSystem::Mils
    1133  LengthUnitSystem::Inches
    1134  LengthUnitSystem::Feet
    1135  LengthUnitSystem::Yards
    1136  LengthUnitSystem::Miles
    1137  LengthUnitSystem::PrinterPoints
    1138  LengthUnitSystem::PrinterPicas
    1139  */
    1140  static bool IsUnitedStatesCustomaryLengthUnit(
    1141  ON::LengthUnitSystem length_unit_system
    1142  );
    1143 
    1144  /*
    1145  Returns
    1146  True if the length unit is one of
    1147  LengthUnitSystem::Millimeters
    1148  LengthUnitSystem::Centimeters
    1149  LengthUnitSystem::Decimeters
    1150  LengthUnitSystem::Meters
    1151  LengthUnitSystem::Dekameters
    1152  LengthUnitSystem::Hectometers
    1153  LengthUnitSystem::Kilometers
    1154  LengthUnitSystem::Inches
    1155  LengthUnitSystem::Feet
    1156  LengthUnitSystem::Yards
    1157  LengthUnitSystem::Miles
    1158  LengthUnitSystem::NauticalMiles
    1159  */
    1160  static bool IsTerrestrialLengthUnit(
    1161  ON::LengthUnitSystem length_unit_system
    1162  );
    1163 
    1164  /*
    1165  Returns
    1166  True if the length unit is one of
    1167  LengthUnitSystem::AstronomicalUnits
    1168  LengthUnitSystem::LightYears
    1169  LengthUnitSystem::Parsecs
    1170  */
    1171  static bool IsExtraTerrestrialLengthUnit(
    1172  ON::LengthUnitSystem length_unit_system
    1173  );
    1174 
    1175  /*
    1176  Returns
    1177  True if the length unit is one of
    1178  LengthUnitSystem::Angstroms
    1179  LengthUnitSystem::Nanometers
    1180  LengthUnitSystem::Microns
    1181  LengthUnitSystem::Microinches
    1182  LengthUnitSystem::Mils
    1183  */
    1184  static bool IsMicroscopicLengthUnit(
    1185  ON::LengthUnitSystem length_unit_system
    1186  );
    1187 
    1188  /*
    1189  Returns
    1190  True if the length unit is one of
    1191  LengthUnitSystem::PrinterPoints
    1192  LengthUnitSystem::PrinterPicas
    1193  */
    1194  static bool IsUnitedStatesPrinterLengthUnit(
    1195  ON::LengthUnitSystem length_unit_system
    1196  );
    1197 
    1198  /*
    1199  Description:
    1200  Scale factor for changing unit "standard" systems.
    1201  Parameters:
    1202  us_from - [in]
    1203  us_to - [in]
    1204  For example:
    1205 
    1206  100.0 = ON::UnitScale( ON::LengthUnitSystem::Meters, ON::LengthUnitSystem::Centimeters )
    1207  2.54 = ON::UnitScale( ON::LengthUnitSystem::Inches, ON::LengthUnitSystem::Centimeters )
    1208  12.0 = ON::UnitScale( ON::LengthUnitSystem::Feet, ON::LengthUnitSystem::Inches )
    1209 
    1210  Remarks:
    1211  If you are using custom unit systems, use the version
    1212  that takes ON_UnitSystem or ON_3dmUnitsAndTolerances
    1213  parameters.
    1214  */
    1215  static double UnitScale(
    1216  ON::LengthUnitSystem us_from,
    1217  ON::LengthUnitSystem us_to
    1218  );
    1219  static double UnitScale(
    1220  const class ON_UnitSystem& us_from,
    1221  const class ON_UnitSystem& us_to
    1222  );
    1223  static double UnitScale(
    1224  ON::LengthUnitSystem us_from,
    1225  const class ON_UnitSystem& us_to
    1226  );
    1227  static double UnitScale(
    1228  const class ON_UnitSystem& us_from,
    1229  ON::LengthUnitSystem us_to
    1230  );
    1231  static double UnitScale(
    1232  const class ON_3dmUnitsAndTolerances& us_from,
    1233  const class ON_3dmUnitsAndTolerances& us_to
    1234  );
    1235 
    1236 
    1237 #pragma region RH_C_SHARED_ENUM [ON::AngleUnitSystem] [Rhino.AngleUnitSystem] [byte]
    1238  /// <summary>
    1239  /// ON::AngleUnitSystem identifies an angle unit system
    1240  /// </summary>
    1241  enum class AngleUnitSystem : unsigned char
    1242  {
    1243  ///<summary>
    1244  /// ON::AngleUnitSystem::None indicates no angle unit system
    1245  /// is specified and model angle unit system should be used.
    1246  ///</summary>
    1247  None = 0,
    1248 
    1249  ///<summary>
    1250  /// 1 turn = 2pi radians.
    1251  ///</summary>
    1252  Turns = 1,
    1253 
    1254  ///<summary>
    1255  /// 1 turn = 2pi radians.
    1256  ///</summary>
    1257  Radians = 2, // 2pi radians = 1 turn
    1258 
    1259  ///<summary>
    1260  /// 360 arc degrees = 1 turn = 2pi radians
    1261  ///</summary>
    1262  Degrees = 3,
    1263 
    1264  ///<summary>
    1265  /// 60 arc minutes = 1 arc degree
    1266  ///</summary>
    1267  Minutes = 4,
    1268 
    1269  ///<summary>
    1270  /// 60 arc seconds = 1 arc minute
    1271  ///</summary>
    1272  Seconds = 5,
    1273 
    1274  ///<summary>
    1275  /// 400 gradians = 2pi radians.
    1276  ///</summary>
    1277  Gradians = 6,
    1278 
    1279  ///<summary>
    1280  /// The ON::AngleUnitSystem::Unset is used to indicates no angle unit system
    1281  /// has been specified in user interface code.
    1282  ///</summary>
    1283  Unset = 255
    1284  };
    1285 #pragma endregion
    1286 
    1287  static ON::AngleUnitSystem AngleUnitSystemFromUnsigned(
    1288  unsigned int angle_unit_system_as_unsigned
    1289  );
    1290 
    1291  static double AngleUnitScale(
    1292  ON::AngleUnitSystem us_from,
    1293  ON::AngleUnitSystem us_to
    1294  );
    1295 
    1296 
    1297  /// <summary>
    1298  /// ON::EarthCoordinateSystem identifies the standard used to define Earth latitude, longitude, and elevation coordinates.
    1299  /// </summary>
    1300  enum class EarthCoordinateSystem : unsigned char
    1301  {
    1302  ///<summary>
    1303  /// ON::EarthCoordinateSystem::Unset
    1304  ///</summary>
    1305  Unset = 0,
    1306 
    1307  ///<summary>
    1308  /// ON::EarthCoordinateSystem::GroundLevel Not well defined, but latitude and longitude will be good enough for architecture sun studies.
    1309  ///</summary>
    1310  GroundLevel = 1, /// Ground level - coordinates vary with time and location
    1311 
    1312  ///<summary>
    1313  /// ON::EarthCoordinateSystem::MeanSeaLevel Not well defined, but latitude and longitude will be good enough for architecture sun studies.
    1314  ///</summary>
    1315  MeanSeaLevel = 2,
    1316 
    1317  ///<summary>
    1318  /// ON::EarthCoordinateSystem::CenterOfEarth Not well defined. The Earth's center of mass and center of volume are at different locations.
    1319  ///</summary>
    1320  CenterOfEarth = 3,
    1321 
    1322  ///<summary>
    1323  /// ON::EarthCoordinateSystem::WGS1984 World Geodetic System 1984 standard. (Current GPS standard.)
    1324  ///</summary>
    1325  WGS1984 = 5,
    1326 
    1327  ///<summary>
    1328  /// ON::EarthCoordinateSystem::EGM2008 Earth Gravitational Model 2008 standard.
    1329  ///</summary>
    1330  EGM2008 = 6
    1331  };
    1332 
    1333  static ON::EarthCoordinateSystem EarthCoordinateSystemFromUnsigned(
    1334  unsigned int earth_coordinte_system_as_unsigned
    1335  );
    1336 
    1337  /// <summary>
    1338  /// ON::ComponentNameConflictResolution identifies a method to use
    1339  /// when components are being added to model, the component name must
    1340  /// be unique, and the name of the new is already in use in the context.
    1341  /// The function ON_ModelComponent::UniqueNameRequired(ON_ModelComponent::Type)
    1342  /// can be used to determine if a component requires a unique name.
    1343  /// </summary>
    1344  enum class ComponentNameConflictResolution : unsigned char
    1345  {
    1346  ///<summary>
    1347  /// A method to resolve name conflicts has not been specified.
    1348  ///</summary>
    1349  Unset = 0,
    1350 
    1351  ///<summary>
    1352  /// Interactivly ask the user to choose one of the following methods
    1353  /// to resolve component name conflicts.
    1354  ///</summary>
    1355  QueryMethod = 1,
    1356 
    1357  ///<summary>
    1358  /// Use the existing component, discard the new component.
    1359  /// All references to the discarded component are changed to reference the
    1360  /// the surviving component.
    1361  ///</summary>
    1362  UseExistingComponent = 2,
    1363 
    1364  ///<summary>
    1365  /// Replace the existing component with the new component.
    1366  /// All references to the discarded component are changed reference the
    1367  /// the surviving component.
    1368  ///</summary>
    1369  ReplaceExistingComponent = 3,
    1370 
    1371  ///<summary>
    1372  /// Keep both components.
    1373  /// Resolve the name conflict by automatically assigning a name new component.
    1374  /// This is typically done by appending an integer to the original name.
    1375  ///</summary>
    1376  KeepBothComponentsAutomaticRename = 4,
    1377 
    1378  ///<summary>
    1379  /// Keep both components.
    1380  /// Resolve the name conflict by interactivly asking for an unused name
    1381  /// to assign to the new component.
    1382  ///</summary>
    1383  KeepBothComponentsQueryRename = 5,
    1384 
    1385  ///<summary>
    1386  /// No name conflict was detected and no special action is required.
    1387  /// This can occur when the names in question are unique or unique names are not required.
    1388  ///</summary>
    1389  NoConflict = 0xFF
    1390  };
    1391 
    1392  static ON::ComponentNameConflictResolution ComponentNameConflictResolutionFromUnsigned(
    1393  unsigned int component_name_conflict_resolution_as_unsigned
    1394  );
    1395 
    1396  //// distance_display_mode ///////////////////////////////////
    1397 
    1398 
    1399  // Obsolete - use ON_DimStyle::DimensionLengthDisplay
    1400  enum class OBSOLETE_DistanceDisplayMode : unsigned char
    1401  {
    1402  // Obsolete - Obsolete - use ON_DimStyle::DimensionLengthDisplay::ModelUnits
    1403  Decimal = 0,
    1404 
    1405  // Obsolete - Obsolete - use ON_DimStyle::DimensionLengthDisplay::InchesFractional
    1406  Fractional = 1,
    1407 
    1408  // Obsolete - Obsolete - use ON_DimStyle::DimensionLengthDisplay::FeetAndInches
    1409  FeetInches = 2
    1410  };
    1411 
    1412  static ON::OBSOLETE_DistanceDisplayMode DistanceDisplayModeFromUnsigned(
    1413  unsigned int distance_display_mode_as_unsigned
    1414  );
    1415 
    1416 
    1417  //// point_style ///////////////////////////////////////////////////////////////
    1418  enum point_style
    1419  {
    1420  unknown_point_style = 0,
    1421  not_rational = 1,
    1422  homogeneous_rational = 2,
    1423  euclidean_rational = 3,
    1424  intrinsic_point_style = 4, // point format used in definition
    1425  point_style_count = 5
    1426  };
    1427 
    1428  static point_style PointStyle(int); // convert integer to point_style enum
    1429 
    1430  //// knot_style ///////////////////////////////////////////////////////////////
    1431  enum knot_style // if a knot vector meets the conditions of two styles,
    1432  { // then the style with the lowest value is used
    1433  unknown_knot_style = 0, // unknown knot style
    1434  uniform_knots = 1, // uniform knots (ends not clamped)
    1435  quasi_uniform_knots = 2, // uniform knots (clamped ends, degree >= 2)
    1436  piecewise_bezier_knots = 3, // all internal knots have full multiplicity
    1437  clamped_end_knots = 4, // clamped end knots (with at least 1 interior non-uniform knot)
    1438  non_uniform_knots = 5, // known to be none of the above
    1439  knot_style_count = 6
    1440  };
    1441 
    1442  static knot_style KnotStyle(int); // convert integer to knot_style enum
    1443 
    1444  //// continuity ////////////////////////////////////////////////////////////////
    1445  enum class continuity : unsigned int
    1446  {
    1447  unknown_continuity = 0,
    1448 
    1449  // These test for parametric continuity. In particular,
    1450  // all types of ON_Curves are considered infinitely
    1451  // continuous at the start/end of the evaluation domain.
    1452  C0_continuous = 1, // continuous function
    1453  C1_continuous = 2, // continuous first derivative
    1454  C2_continuous = 3, // continuous first and second derivative
    1455  G1_continuous = 4, // continuous unit tangent
    1456  G2_continuous = 5, // continuous unit tangent and curvature
    1457 
    1458  // 20 March 2003 Dale Lear added these.
    1459  //
    1460  // Continuity tests using the following enum values
    1461  // are identical to tests using the preceding enum values
    1462  // on the INTERIOR of a curve's domain. At the END of
    1463  // a curve a "locus" test is performed in place of a
    1464  // parametric test. In particular, at the END of a domain,
    1465  // all open curves are locus discontinuous. At the END of
    1466  // a domain, all closed curves are at least C0_locus_continuous.
    1467  // By convention all ON_Curves are considered
    1468  // locus continuous at the START of the evaluation domain.
    1469  // This convention is not strictly correct, but is was
    1470  // adopted to make iterative kink finding tools easier to
    1471  // use and so that locus discontinuities are reported once
    1472  // at the end parameter of a curve rather than twice.
    1473  C0_locus_continuous = 6, // locus continuous function
    1474  C1_locus_continuous = 7, // locus continuous first derivative
    1475  C2_locus_continuous = 8, // locus continuous first and second derivative
    1476  G1_locus_continuous = 9, // locus continuous unit tangent
    1477  G2_locus_continuous = 10, // locus continuous unit tangent and curvature
    1478 
    1479  Cinfinity_continuous = 11, // analytic discontinuity
    1480  Gsmooth_continuous = 12 // aesthetic discontinuity
    1481  };
    1482 
    1483  /*
    1484  Description:
    1485  Convert int to ON::continuity enum value
    1486  */
    1487  static continuity Continuity(int);
    1488 
    1489  /*
    1490  Description:
    1491  Convert int to ON::continuity enum value and
    1492  convert the locus flavored values to the parametric
    1493  flavored values.
    1494  */
    1495  static continuity ParametricContinuity(int);
    1496 
    1497  /*
    1498  Description:
    1499  Convert int to ON::continuity enum value and
    1500  convert the higher order flavored values to
    1501  the corresponding C1 or G1 values needed to
    1502  test piecewise linear curves.
    1503  */
    1504  static continuity PolylineContinuity(int);
    1505 
    1506  //// curve_style ///////////////////////////////////////////////////////////////
    1507  enum curve_style
    1508  {
    1509  unknown_curve_style = 0,
    1510  line = 1,
    1511  circle = 2,
    1512  ellipse = 3, // with distinct foci (not a circle)
    1513  parabola = 4,
    1514  hyperbola = 5,
    1515  planar_polyline = 6, // not a line segment
    1516  polyline = 7, // non-planar polyline
    1517  planar_freeform_curve = 8, // planar but none of the above
    1518  freeform_curve = 9, // known to be none of the above
    1519  curve_style_count = 10
    1520  };
    1521 
    1522  static curve_style CurveStyle(int); // convert integer to curve_style enum
    1523 
    1524  //// surface_style ///////////////////////////////////////////////////////////////
    1525  enum surface_style
    1526  {
    1527  unknown_surface_style = 0,
    1528  plane = 1,
    1529  circular_cylinder = 2, // portion of right circular cylinder
    1530  elliptical_cylinder = 3, // portion of right elliptical cylinder
    1531  circular_cone = 4, // portion of right circular cone
    1532  elliptical_cone = 5, // portion of right elliptical cone
    1533  sphere = 6, // portion of sphere
    1534  torus = 7, // portion of torus
    1535  surface_of_revolution = 8, // portion of surface of revolution that is none of the above
    1536  ruled_surface = 9, // portion of a ruled surface this is none of the above
    1537  freeform_surface = 10, // known to be none of the above
    1538  surface_style_count = 11
    1539  };
    1540 
    1541  static surface_style SurfaceStyle(int); // convert integer to surface_style enum
    1542 
    1543  //// sort_algorithm ///////////////////////////////////////////////////////////////
    1544  enum class sort_algorithm : unsigned int
    1545  {
    1546  heap_sort = 0,
    1547  quick_sort = 1
    1548  };
    1549 
    1550  static sort_algorithm SortAlgorithm(int); // convert integer to sort_method enum
    1551 
    1552  //// endian-ness ///////////////////////////////////////////////////////////////
    1553  enum class endian : unsigned int
    1554  {
    1555  little_endian = 0, // least significant byte first or reverse byte order - Intel x86, ...
    1556  big_endian = 1 // most significant byte first - Motorola, Sparc, MIPS, ...
    1557  };
    1558 
    1559  static endian Endian(int); // convert integer to endian enum
    1560  static endian Endian(); // returns endian-ness of current CPU
    1561 
    1562  //// archive modes //////////////////////////////////////////////////////////////
    1563  enum class archive_mode : unsigned int
    1564  {
    1565  unset_archive_mode = 0,
    1566  read = 1, // all read modes have bit 0x0001 set
    1567  write = 2, // all write modes have bit 0x0002 set
    1568  readwrite = 3,
    1569  read3dm = 5,
    1570  write3dm = 6
    1571  };
    1572  static archive_mode ArchiveMode(int); // convert integer to endian enum
    1573 
    1574 
    1575  //// view projections ///////////////////////////////////////////////////////////
    1576 
    1577  // The x/y/z_2pt_perspective_view projections are ordinary perspective
    1578  // projection. Using these values insures the ON_Viewport member
    1579  // fuctions properly constrain the camera up and camera direction vectors
    1580  // to preserve the specified perspective vantage.
    1581  enum view_projection : unsigned int
    1582  {
    1583  unknown_view = 0,
    1584  parallel_view = 1,
    1585  perspective_view = 2
    1586  };
    1587 
    1588  /*
    1589  Description:
    1590  Converts integer into ON::view_projection enum value.
    1591  Parameters:
    1592  i - [in]
    1593  Returns:
    1594  ON::view_projection enum with same value as i.
    1595  If i is not an ON::view_projection enum value,
    1596  then ON::unknow_view is returned.
    1597  */
    1598  static view_projection ViewProjection(int i);
    1599 
    1600  /*
    1601  Parameters:
    1602  projection - [in]
    1603  Returns:
    1604  True if projection is ON::perspective_view.
    1605  */
    1606  static bool IsPerspectiveProjection( ON::view_projection projection );
    1607 
    1608 
    1609  /*
    1610  Parameters:
    1611  projection - [in]
    1612  Returns:
    1613  True if projection is ON::parallel_view.
    1614  */
    1615  static bool IsParallelProjection( ON::view_projection projection );
    1616 
    1617  //// view coordinates ///////////////////////////////////////////////////////////
    1618 
    1619  enum coordinate_system
    1620  {
    1621  world_cs = 0,
    1622  camera_cs = 1,
    1623  clip_cs = 2,
    1624  screen_cs = 3
    1625  };
    1626 
    1627  static coordinate_system CoordinateSystem(int); // convert integer to coordinate_system enum
    1628 
    1629  //// exception types ///////////////////////////////////////////////////////////
    1630  enum exception_type
    1631  {
    1632  unknown_exception = 0,
    1633  out_of_memory,
    1634  corrupt_object, // invalid object encountered - continuing would crash or
    1635  // result in corrupt object being saved in archive.
    1636  unable_to_write_archive, // write operation failed - out of file space/read only mode/...?
    1637  unable_to_read_archive, // read operation failed - truncated archive/locked file/... ?
    1638  unable_to_seek_archive, // seek operation failed - locked file/size out of bounds/... ?
    1639  unexpected_end_of_archive, // truncated archive
    1640  unexpected_value_in_archive // corrupt archive?
    1641  };
    1642  static exception_type ExceptionType(int); // convert integer to exception_type enum
    1643 
    1644  //// layer mode ///////////////////////////////////////////////////////////
    1645  // OBSOLETE
    1646  enum layer_mode
    1647  {
    1648  normal_layer = 0, // visible, objects on layer can be selected and changed
    1649  hidden_layer = 1, // not visible, objects on layer cannot be selected or changed
    1650  locked_layer = 2, // visible, objects on layer cannot be selected or changed
    1651  layer_mode_count = 3
    1652  };
    1653  static layer_mode LayerMode(int); // convert integer to layer_mode enum
    1654 
    1655  //// object mode ///////////////////////////////////////////////////////////
    1656  enum object_mode
    1657  {
    1658  normal_object = 0, // object mode comes from layer
    1659  hidden_object = 1, // not visible, object cannot be selected or changed
    1660  locked_object = 2, // visible, object cannot be selected or changed
    1661  idef_object = 3, // object is part of an ON_InstanceDefinition. The
    1662  // ON_InstanceDefinition m_object_uuid[] array will
    1663  // contain this object attribute's uuid.
    1664  object_mode_count = 4
    1665  };
    1666  static object_mode ObjectMode(int); // convert integer to object_mode enum
    1667 
    1668  //// object display color /////////////////////////////////////////////////////////
    1669  enum object_color_source
    1670  {
    1671  color_from_layer = 0, // use color assigned to layer
    1672  color_from_object = 1, // use color assigned to object
    1673  color_from_material = 2, // use diffuse render material color
    1674  color_from_parent = 3 // for objects with parents (like objects in instance references, use parent linetype)
    1675  // if no parent, treat as color_from_layer
    1676  };
    1677  static object_color_source ObjectColorSource(int); // convert integer to object_color_source enum
    1678 
    1679  //// object plot color /////////////////////////////////////////////////////////
    1680  enum plot_color_source
    1681  {
    1682  plot_color_from_layer = 0, // use plot color assigned to layer
    1683  plot_color_from_object = 1, // use plot color assigned to object
    1684  plot_color_from_display = 2, // use display color
    1685  plot_color_from_parent = 3 // for objects with parents (like objects in instance references, use parent plot color)
    1686  // if no parent, treat as plot_color_from_layer
    1687  };
    1688  static plot_color_source PlotColorSource(int); // convert integer to plot_color_source enum
    1689 
    1690  //// object plot weight /////////////////////////////////////////////////////////
    1691  enum plot_weight_source
    1692  {
    1693  plot_weight_from_layer = 0, // use plot color assigned to layer
    1694  plot_weight_from_object = 1, // use plot color assigned to object
    1695  plot_weight_from_parent = 3 // for objects with parents (like objects in instance references, use parent plot color)
    1696  // if no parent, treat as plot_color_from_layer
    1697  };
    1698  static plot_weight_source PlotWeightSource(int); // convert integer to plot_color_source enum
    1699 
    1700  //// object linetype /////////////////////////////////////////////////////////
    1701  enum object_linetype_source
    1702  {
    1703  linetype_from_layer = 0, // use line style assigned to layer
    1704  linetype_from_object = 1, // use line style assigned to object
    1705  linetype_from_parent = 3 // for objects with parents (like objects in instance references, use parent linetype)
    1706  // if not parent, treat as linetype_from_layer.
    1707  };
    1708  static object_linetype_source ObjectLinetypeSource(int); // convert integer to object_linetype_source enum
    1709 
    1710  //// object material /////////////////////////////////////////////////////////
    1711  enum object_material_source
    1712  {
    1713  material_from_layer = 0, // use material assigned to layer
    1714  material_from_object = 1, // use material assigned to object
    1715  material_from_parent = 3 // for objects with parents, like
    1716  // definition geometry in instance
    1717  // references and faces in polysurfaces,
    1718  // this value indicates the material
    1719  // definition should come from the parent.
    1720  // If the object does not have an
    1721  // obvious "parent", then treat
    1722  // it the same as material_from_layer.
    1723  };
    1724  static object_material_source ObjectMaterialSource(int); // convert integer to object_color_source enum
    1725 
    1726  //// light style /////////////////////////////////////////////////////////////
    1727  enum light_style
    1728  {
    1729  unknown_light_style = 0,
    1730  //view_directional_light = 1, // light location and direction in clip coordinates
    1731  //view_point_light = 2,
    1732  //view_spot_light = 3,
    1733  camera_directional_light = 4, // light location and direction in camera coordinates
    1734  camera_point_light = 5, // +x points to right, +y points up, +z points towards camera
    1735  camera_spot_light = 6,
    1736  world_directional_light = 7, // light location and direction in world coordinates
    1737  world_point_light = 8,
    1738  world_spot_light = 9,
    1739  ambient_light = 10, // pure ambient light
    1740  world_linear_light = 11,
    1741  world_rectangular_light = 12,
    1742  light_style_count = 13
    1743  };
    1744  static light_style LightStyle(int); // convert integer to light_style enum
    1745 
    1746  //// curvature style /////////////////////////////////////////////////////////
    1747  enum curvature_style
    1748  {
    1749  unknown_curvature_style = 0,
    1750  gaussian_curvature = 1,
    1751  mean_curvature = 2, // unsigned mean curvature
    1752  min_curvature = 3, // minimum unsigned radius of curvature
    1753  max_curvature = 4, // maximum unsigned radius of curvature
    1754  curvature_style_count = 5
    1755  };
    1756  static curvature_style CurvatureStyle(int); // convert integer to curvature_style enum
    1757 
    1758  /////////////////////////////////////////////////////////////////
    1759  //
    1760  // Legacy V3 display mode enum values.
    1761  // Beginning with V4, opennurbs and Rhino us an ON_UUID to identify
    1762  // display modes. The standard display mode ids are static
    1763  // values in ON_StandardDisplayModeId.
    1764  enum v3_display_mode
    1765  {
    1766  v3_default_display = 0, // default display
    1767  v3_wireframe_display = 1, // wireframe display
    1768  v3_shaded_display = 2, // shaded display
    1769  v3_renderpreview_display = 3 // render preview display
    1770  };
    1771  static ON::v3_display_mode V3DisplayMode(int); // convert integer to legacy v3_display_mode enum
    1772 
    1773  enum view_type
    1774  {
    1775  model_view_type = 0, // standard model space 3d view
    1776  page_view_type = 1, // a.k.a "paper space", "plot view", etc.
    1777  // A page view must be orthographic,
    1778  // the camera frame x,y,z direction must be
    1779  // world x,y,z (which means the camera direction
    1780  // is always (0,0,-1)).
    1781  nested_view_type = 2, // This view is a "model" view that is nested
    1782  // in another view. The nesting and parent
    1783  // information is saved in ON_3dmView.
    1784  };
    1785  static view_type ViewType(int); // convert integer to display_mode enum
    1786 
    1787 
    1788  //// texture mapping mode ///////////////////////////////////////////////////
    1789  //
    1790  // OBSOLETE
    1791  enum texture_mode
    1792  {
    1793  no_texture = 0, // texture disabled
    1794  modulate_texture = 1, // modulate with material diffuse color
    1795  decal_texture = 2 // decal
    1796  };
    1797  // OBSOLETE
    1798  static texture_mode TextureMode(int); // convert integer to texture_mode enum
    1799  // OBSOLETE
    1800  //
    1801  /////////////////////////////////////////////////////////////////////////////
    1802 
    1803  //// object_type ///////////////////////////////////////////////////
    1804  enum object_type
    1805  {
    1806  // Use with ON_Object::ObjectType() in situations where
    1807  // using a switch() is better than a long string of if else if ...
    1808  // if ( ON_Curve::Cast() ) ... else if ( ON_Surface::Cast() ) ...
    1809  // ...
    1810  unknown_object_type = 0,
    1811 
    1812  point_object = 1, // some type of ON_Point
    1813  pointset_object = 2, // some type of ON_PointCloud, ON_PointGrid, ...
    1814  curve_object = 4, // some type of ON_Curve like ON_LineCurve, ON_NurbsCurve, etc.
    1815  surface_object = 8, // some type of ON_Surface like ON_PlaneSurface, ON_NurbsSurface, etc.
    1816  brep_object = 0x10, // some type of ON_Brep
    1817  mesh_object = 0x20, // some type of ON_Mesh
    1818  layer_object = 0x40, // some type of ON_Layer
    1819  material_object = 0x80, // some type of ON_Material
    1820  light_object = 0x100, // some type of ON_Light
    1821  annotation_object = 0x200, // some type of ON_Annotation
    1822  userdata_object = 0x400, // some type of ON_UserData
    1823  instance_definition = 0x800, // some type of ON_InstanceDefinition
    1824  instance_reference = 0x1000, // some type of ON_InstanceRef
    1825  text_dot = 0x2000, // some type of ON_TextDot
    1826  grip_object = 0x4000, // selection filter value - not a real object type
    1827  detail_object = 0x8000, // some type of ON_DetailView
    1828  hatch_object = 0x10000, // some type of ON_Hatch
    1829  morph_control_object = 0x20000, // some type of ON_MorphControl
    1830  subd_object = 0x40000, // some type of ON_SubD, ON_SubDRef, ON_SubDComponentRef, ON_SubD....
    1831  loop_object = 0x80000, // some type of ON_BrepLoop
    1832  brepvertex_filter = 0x100000, // selection filter value - not a real object type
    1833  polysrf_filter = 0x200000, // selection filter value - not a real object type
    1834  edge_filter = 0x400000, // selection filter value - not a real object type
    1835  polyedge_filter = 0x800000, // selection filter value - not a real object type
    1836  meshvertex_filter = 0x01000000, // selection filter value - not a real object type
    1837  meshedge_filter = 0x02000000, // selection filter value - not a real object type
    1838  meshface_filter = 0x04000000, // selection filter for mesh triangle, quad or ngon - not a real object type
    1839  meshcomponent_reference = 0x07000000, // an ON_MeshComponentRef to vertex, edge, face, ngon
    1840  cage_object = 0x08000000, // some type of ON_NurbsCage
    1841  phantom_object = 0x10000000,
    1842  clipplane_object = 0x20000000,
    1843  extrusion_object = 0x40000000, // some type of ON_Extrusion
    1844 
    1845  any_object = 0xFFFFFFFF
    1846 
    1847  // Please discuss any changes with Dale Lear
    1848  };
    1849 
    1850  static object_type ObjectType(int); // convert integer to object_type enum
    1851 
    1852  //// bitmap_type ///////////////////////////////////////////////////
    1853  enum bitmap_type
    1854  {
    1855  unknown_bitmap_type = 0,
    1856  windows_bitmap = 1, // BITMAPINFO style
    1857  opengl_bitmap = 2, // unpacked OpenGL RGB or RGBA
    1858  png_bitmap = 3
    1859  };
    1860  static bitmap_type BitmapType(int); // convert integer to bitmap_type enum
    1861 
    1862  enum object_decoration
    1863  {
    1864  no_object_decoration = 0,
    1865  start_arrowhead = 0x08, // arrow head at start
    1866  end_arrowhead = 0x10, // arrow head at end
    1867  both_arrowhead = 0x18 // arrow heads at start and end
    1868  };
    1869  static object_decoration ObjectDecoration(int); // convert integer to line_pattern enum
    1870 
    1871  enum mesh_type
    1872  {
    1873  default_mesh = 0,
    1874  render_mesh = 1,
    1875  analysis_mesh = 2,
    1876  preview_mesh = 3,
    1877  any_mesh = 4
    1878  };
    1879  static mesh_type MeshType(int); // convert integer to mesh_type enum
    1880 
    1881 
    1882  // Types of object snapping.
    1883  // In situations where more than one type of snap applies,
    1884  // snaps with higher value take precedence.
    1885  // enum values must be a power of 2.
    1886  // ON_ObjRef saves these values in files. Do not change
    1887  // the values. The reason for the gaps between the enum
    1888  // values is to leave room for future snaps with prededence
    1889  // falling between existing snaps
    1890  enum osnap_mode
    1891  {
    1892  os_none = 0,
    1893  os_near = 2,
    1894  os_focus = 8,
    1895  os_center = 0x20,
    1896  os_vertex = 0x40,
    1897  os_knot = 0x80,
    1898  os_quadrant = 0x200,
    1899  os_midpoint = 0x800,
    1900  os_intersection = 0x2000,
    1901  os_end = 0x20000,
    1902  os_perpendicular = 0x80000,
    1903  os_tangent = 0x200000,
    1904  os_point = 0x08000000,
    1905  os_all_snaps = 0xFFFFFFFF
    1906  };
    1907  static osnap_mode OSnapMode(int); // convert integer to osnap_mode enum
    1908 
    1909 
    1910  //// Types of Curves ///////////////////////////////////////////////////////////
    1911  enum eCurveType
    1912  {
    1913  ctCurve, // nothing
    1914  ctArc,
    1915  ctCircle,
    1916  ctLine,
    1917  ctNurbs,
    1918  ctOnsurface,
    1919  ctProxy,
    1920  ctPolycurve,
    1921  ctPolyline,
    1922  };
    1923 
    1924 
    1925  //// surface_loft_end_condition //////////////////////////////////////////////
    1926  //
    1927  // End condition paramter values for ON_Curve::CreateCubicLoft() and
    1928  // ON_Surface::CreateCubicLoft().
    1929  enum cubic_loft_end_condition
    1930  {
    1931  cubic_loft_ec_quadratic = 0,
    1932  cubic_loft_ec_linear = 1,
    1933  cubic_loft_ec_cubic = 2,
    1934  cubic_loft_ec_natural = 3,
    1935  cubic_loft_ec_unit_tangent = 4,
    1936  cubic_loft_ec_1st_derivative = 5,
    1937  cubic_loft_ec_2nd_derivative = 6,
    1938  cubic_loft_ec_free_cv = 7
    1939  };
    1940 
    1941  /*
    1942  Description:
    1943  Convert an integer to cubic_loft_end_condition enum.
    1944  Parameters:
    1945  i - [in]
    1946  Returns:
    1947  corresponding cubic_loft_end_condition enum value.
    1948  Remarks:
    1949  If i does not correspond to a cubic_loft_end_condition
    1950  enum value, then cubic_loft_ec_quadratic is returned.
    1951  */
    1952  static
    1953  cubic_loft_end_condition CubicLoftEndCondition(int i);
    1954 
    1955 
    1956 public:
    1957 
    1958 #pragma region RH_C_SHARED_ENUM [ON::AnnotationType] [Rhino.Geometry.AnnotationType] [byte]
    1959 
    1960  /// <summary>
    1961  /// ON::AnnotationType identifies the type of an annotation object derived from ON_Annotation.
    1962  /// </summary>
    1963  enum class AnnotationType : unsigned char
    1964  {
    1965  ///<summary>
    1966  /// Not a valid annotation type.
    1967  ///</summary>
    1968  Unset = 0,
    1969 
    1970  ///<summary>
    1971  /// Linear distance between two points with dimension line parallel to the dimensioned points.
    1972  ///</summary>
    1973  Aligned = 1,
    1974 
    1975  ///<summary>
    1976  /// Angle bewteen two lines.
    1977  ///</summary>
    1978  Angular = 2,
    1979 
    1980  ///<summary>
    1981  /// Arc or circle diameter dimension.
    1982  ///</summary>
    1983  Diameter = 3,
    1984 
    1985  ///<summary>
    1986  /// Arc or circle radius dimension.
    1987  ///</summary>
    1988  Radius = 4,
    1989 
    1990  ///<summary>
    1991  /// Linear distance between two points with dimension line horizontal, vertical or rotated by a specified amount.
    1992  ///</summary>
    1993  Rotated = 5,
    1994 
    1995  ///<summary>
    1996  /// Ordinate dimension. Typically used to document an offset distance between the center of a circle and a reference point.
    1997  ///</summary>
    1998  Ordinate = 6,
    1999 
    2000  ///<summary>
    2001  /// Arc length of a curve.
    2002  ///</summary>
    2003  ArcLen = 7,
    2004 
    2005  ///<summary>
    2006  /// Center mark dimension. Typically used to document the center of an arc or circle.
    2007  ///</summary>
    2008  CenterMark = 8,
    2009 
    2010  ///<summary>
    2011  /// Text. Stand alone text with a wide variety of uses.
    2012  ///</summary>
    2013  Text = 9,
    2014 
    2015  ///<summary>
    2016  /// Leader. Text and a curve with an arrow head.
    2017  ///</summary>
    2018  Leader = 10,
    2019 
    2020  ///<summary>
    2021  /// Angular3pt. Angle defined by 3 points.
    2022  ///</summary>
    2023  Angular3pt = 11
    2024  };
    2025 
    2026 #pragma endregion
    2027 
    2028  static ON::AnnotationType AnnotationTypeFromUnsigned(
    2029  unsigned int annotation_type_as_unsigned
    2030  );
    2031 
    2032 
    2033 
    2034 #pragma region RH_C_SHARED_ENUM [ON::TextVerticalAlignment] [Rhino.DocObjects.TextVerticalAlignment] [byte]
    2035  /// <summary>
    2036  /// Vertical location of text attach point relative to text
    2037  /// </summary>
    2038  enum class TextVerticalAlignment : unsigned char
    2039  {
    2040  ///<summary>
    2041  /// Attach to top of an "I" on the first line. (Independent of glyphs being displayed.)
    2042  ///</summary>
    2043  Top = 0,
    2044  ///<summary>
    2045  /// Attach to middle of an "I" on the first line. (Independent of glyphs being displayed.)
    2046  ///</summary>
    2047  MiddleOfTop = 1,
    2048  ///<summary>
    2049  /// Attach to baseline of first line. (Independent of glyphs being displayed.)
    2050  ///</summary>
    2051  BottomOfTop = 2,
    2052  ///<summary>
    2053  /// Attach to middle of text vertical advance. (Independent of glyphs being displayed.)
    2054  ///</summary>
    2055  Middle = 3,
    2056  ///<summary>
    2057  /// Attach to middle of an "I" on the last line. (Independent of glyphs being displayed.)
    2058  ///</summary>
    2059  MiddleOfBottom = 4,
    2060  ///<summary>
    2061  /// Attach to the basline of the last line. (Independent of glyphs being displayed.)
    2062  ///</summary>
    2063  Bottom = 5,
    2064  ///<summary>
    2065  /// Attach to the bottom of the boudning box of the visible glyphs.
    2066  ///</summary>
    2067  BottomOfBoundingBox = 6, // TODO - changed to BottomOfBoundingBox
    2068  };
    2069 #pragma endregion
    2070 
    2071  static ON::TextVerticalAlignment TextVerticalAlignmentFromUnsigned(
    2072  unsigned int vertical_alignment_as_unsigned
    2073  );
    2074 
    2075  static ON::TextVerticalAlignment TextVerticalAlignmentFromV5Justification(
    2076  unsigned int v5_justification_bits
    2077  );
    2078 
    2079 #pragma region RH_C_SHARED_ENUM [ON::TextHorizontalAlignment] [Rhino.DocObjects.TextHorizontalAlignment] [byte]
    2080  /// <summary>
    2081  /// Horizontal location of text attach point relative to text
    2082  /// </summary>
    2083  enum class TextHorizontalAlignment : unsigned char
    2084  {
    2085  /// <summary>
    2086  /// Attach at left of text lines (Independent of glyphs being displayed.)
    2087  /// </summary>
    2088  Left = 0,
    2089  /// <summary>
    2090  /// Attach point at center of text horizontal advance (not glyph bounding box)
    2091  /// </summary>
    2092  Center = 1,
    2093  /// <summary>
    2094  /// Attach point at right text horizontal advance (not glyph bounding box)
    2095  /// </summary>
    2096  Right = 2,
    2097  };
    2098 #pragma endregion
    2099 
    2100  static ON::TextHorizontalAlignment TextHorizontalAlignmentFromUnsigned(
    2101  unsigned int horizontal_alignment_as_unsigned
    2102  );
    2103 
    2104  static ON::TextHorizontalAlignment TextHorizontalAlignmentFromV5Justification(
    2105  unsigned int v5_justification_bits
    2106  );
    2107 
    2108 #pragma region RH_C_SHARED_ENUM [ON::TextOrientation] [Rhino.DocObjects.TextOrientation] [byte]
    2109  /// <summary>
    2110  /// Method for getting rotation for drawing text
    2111  /// </summary>
    2112  enum class TextOrientation : unsigned char
    2113  {
    2114  /// <summary>
    2115  /// Text has fixed rotation on a world coordinate plane
    2116  /// </summary>
    2117  InPlane = 0,
    2118  /// <summary>
    2119  /// Text is drawn on a plane perpendicular to view direction horizontal to the screen
    2120  /// </summary>
    2121  InView = 1,
    2122  };
    2123 
    2124 #pragma endregion
    2125 
    2126  static ON::TextOrientation TextOrientationFromUnsigned(
    2127  unsigned int orientation_as_unsigned
    2128  );
    2129 
    2130 
    2131 
    2132 private:
    2133  // ON::Begin() sets m_opennurbs_library_status
    2134  // 0 = not initialized
    2135  // 1 = in the body of ON::Begin()
    2136  // 2 = ON:Begin() finished.
    2137  static unsigned int m_opennurbs_library_status;
    2138 
    2139 private:
    2140  // prohibit instantiaion
    2141  //ON(); // no implementation
    2142  //ON( const ON& ); // no implementation
    2143  //~ON(); // no implementation
    2144 };
    2145 
    2146 /*
    2147 Description:
    2148  Component indices are used to provide a persistent way
    2149  to identify portions of complex objects.
    2150 
    2151 */
    2152 class ON_CLASS ON_COMPONENT_INDEX
    2153 {
    2154 public:
    2155 
    2156  // Do not change these values; they are stored in 3dm archives
    2157  // and provide a persistent way to indentify components of
    2158  // complex objects.
    2159  enum TYPE
    2160  {
    2161  invalid_type = 0,
    2162 
    2163  brep_vertex = 1,
    2164  brep_edge = 2,
    2165  brep_face = 3,
    2166  brep_trim = 4,
    2167  brep_loop = 5,
    2168 
    2169  mesh_vertex = 11,
    2170  meshtop_vertex = 12,
    2171  meshtop_edge = 13,
    2172  mesh_face = 14,
    2173  mesh_ngon = 15,
    2174 
    2175  idef_part = 21,
    2176 
    2177  polycurve_segment = 31,
    2178 
    2179  pointcloud_point = 41,
    2180 
    2181  group_member = 51,
    2182 
    2183 
    2184  extrusion_bottom_profile = 61, // 3d bottom profile curves
    2185  // index identifies profile component
    2186  extrusion_top_profile = 62, // 3d top profile curves
    2187  // index identifies profile component
    2188  extrusion_wall_edge = 63, // 3d wall edge curve
    2189  // index/2: identifies profile component
    2190  // index%2: 0 = start, 1 = end
    2191  extrusion_wall_surface = 64, // side wall surfaces
    2192  // index: identifies profile component
    2193  extrusion_cap_surface = 65, // bottom and top cap surfaces
    2194  // index: 0 = bottom, 1 = top
    2195  extrusion_path = 66, // extrusion path (axis line)
    2196  // index -1 = entire path, 0 = start point, 1 = endpoint
    2197 
    2198  //////////////////////////////////////////////////////
    2199  //
    2200  // ON_SubD component index
    2201  //
    2202  // Use ON_SubD.ComponentPtrFromComponentIndex() to convert an ON_COMPONENT_INDEX
    2203  // into a component pointer.
    2204  // See also
    2205  // ON_SubD.VertexFromId()
    2206  // ON_SubD.EdgeFromId()
    2207  // ON_SubD.FaceFromId()
    2208  //
    2209  subd_vertex = 71, // m_index = ON_SubDVertex.m_id, use ON_SubD.ComponentPtrFromComponentIndex()
    2210  subd_edge = 72, // m_index = ON_SubDEdge.m_id
    2211  subd_face = 73, // m_index = ON_SubDFace.m_id
    2212 
    2213  dim_linear_point = 100,
    2214  dim_radial_point = 101,
    2215  dim_angular_point = 102,
    2216  dim_ordinate_point = 103,
    2217  dim_text_point = 104,
    2218  dim_centermark_point = 105,
    2219  dim_leader_point = 106,
    2220 
    2221  no_type = 0xFFFFFFFF
    2222  };
    2223 
    2224  /*
    2225  Description:
    2226  Safe conversion of integer value to TYPE enum.
    2227  Parameters:
    2228  i - [in] integer with value equal to one of the TYPE enums.
    2229  Returns:
    2230  The TYPE enum with the same numeric value
    2231  or ON_COMPONENT_INDEX::invalid_type if no corresponding enum
    2232  exists.
    2233  */
    2234  static
    2235  ON_COMPONENT_INDEX::TYPE Type(int i);
    2236 
    2237  /*
    2238  Description:
    2239  Dictionary compare on m_type, m_index as ints.
    2240  Returns:
    2241  < 0: a < b
    2242  = 0: a = b
    2243  > 0: a > b
    2244  */
    2245  static
    2246  int Compare( const ON_COMPONENT_INDEX* a, const ON_COMPONENT_INDEX* b);
    2247 
    2248  /*
    2249  Description:
    2250  UnsetComponentIndex.m_type = invalid_type
    2251  UnsetComponentIndex.m_index = -1 as int
    2252  = ON_UNSET_UINT_INDEX as unsigned int
    2253  */
    2254  static const ON_COMPONENT_INDEX UnsetComponentIndex;
    2255 
    2256  /*
    2257  Description:
    2258  Default constructor has value ON_COMPONENT_INDEX UnsetComponentIndex.
    2259  */
    2260  ON_COMPONENT_INDEX();
    2261 
    2262  /*
    2263  Description:
    2264  Sets m_type = type and m_index = index.
    2265  */
    2266  ON_COMPONENT_INDEX(ON_COMPONENT_INDEX::TYPE type,int index);
    2267 
    2268  bool operator==(const ON_COMPONENT_INDEX& other) const;
    2269  bool operator!=(const ON_COMPONENT_INDEX& other) const;
    2270  bool operator<(const ON_COMPONENT_INDEX& other) const;
    2271  bool operator<=(const ON_COMPONENT_INDEX& other) const;
    2272  bool operator>(const ON_COMPONENT_INDEX& other) const;
    2273  bool operator>=(const ON_COMPONENT_INDEX& other) const;
    2274 
    2275  void Set(ON_COMPONENT_INDEX::TYPE type,int index);
    2276  void Set(ON_COMPONENT_INDEX::TYPE type,unsigned int index);
    2277 
    2278  /*
    2279  Description:
    2280  Sets m_type = invalid_type and m_index = -1.
    2281  */
    2282  void UnSet();
    2283 
    2284  /*
    2285  Returns:
    2286  True if m_type is set to a TYPE enum value between
    2287  brep_vertex and polycurve_segment.
    2288  */
    2289  bool IsSet() const;
    2290 
    2291  bool IsNotSet() const;
    2292 
    2293  /*
    2294  Returns:
    2295  True if m_type is set to one of the mesh or meshtop
    2296  TYPE enum values and m_index >= 0.
    2297  */
    2298  bool IsMeshComponentIndex() const;
    2299 
    2300  /*
    2301  Returns:
    2302  True if m_type is set to one of the subd
    2303  TYPE enum values and m_index >= 0.
    2304  */
    2305  bool IsSubDComponentIndex() const;
    2306 
    2307  /*
    2308  Returns:
    2309  True if m_type is set to one of the
    2310  brep TYPE enum values and m_index >= 0.
    2311  */
    2312  bool IsBrepComponentIndex() const;
    2313 
    2314  /*
    2315  Returns:
    2316  True if m_type = idef_part and m_index >= 0.
    2317  */
    2318  bool IsIDefComponentIndex() const;
    2319 
    2320  /*
    2321  Returns:
    2322  True if m_type = polycurve_segment and m_index >= 0.
    2323  */
    2324  bool IsPolyCurveComponentIndex() const;
    2325 
    2326  /*
    2327  Returns:
    2328  True if m_type = group_member and m_index >= 0.
    2329  */
    2330  bool IsGroupMemberComponentIndex() const;
    2331 
    2332  /*
    2333  Returns:
    2334  True if m_type = extrusion_bottom_profile or extrusion_top_profile
    2335  and m_index >= 0.
    2336  */
    2337  bool IsExtrusionProfileComponentIndex() const;
    2338 
    2339  /*
    2340  Returns:
    2341  True if m_type = extrusion_path and -1 <= m_index <= 1.
    2342  */
    2343  bool IsExtrusionPathComponentIndex() const;
    2344 
    2345  /*
    2346  Returns:
    2347  True if m_type = extrusion_wall_edge and m_index >= 0.
    2348  */
    2349  bool IsExtrusionWallEdgeComponentIndex() const;
    2350 
    2351  /*
    2352  Returns:
    2353  True if m_type = extrusion_wall_surface and m_index >= 0.
    2354  */
    2355  bool IsExtrusionWallSurfaceComponentIndex() const;
    2356 
    2357  /*
    2358  Returns:
    2359  True if m_type = extrusion_wall_surface or extrusion_wall_edge
    2360  and m_index >= 0.
    2361  */
    2362  bool IsExtrusionWallComponentIndex() const;
    2363 
    2364  /*
    2365  Returns:
    2366  True if m_type = extrusion_bottom_profile, extrusion_top_profile,
    2367  extrusion_wall_edge, extrusion_wall_surface, extrusion_cap_surface
    2368  or extrusion_path and m_index is reasonable.
    2369  */
    2370  bool IsExtrusionComponentIndex() const;
    2371 
    2372  /*
    2373  Returns:
    2374  True if m_type = pointcloud_point and m_index >= 0.
    2375  */
    2376  bool IsPointCloudComponentIndex() const;
    2377 
    2378  /*
    2379  Returns:
    2380  True if m_type = dim_... and m_index >= 0.
    2381  */
    2382  bool IsAnnotationComponentIndex() const;
    2383 
    2384  void Dump(
    2385  class ON_TextLog& text_log
    2386  )const;
    2387 
    2388  void AppendToString(
    2389  class ON_String& s
    2390  )const;
    2391 
    2392  void AppendToString(
    2393  class ON_wString& s
    2394  )const;
    2395 
    2396 
    2397  TYPE m_type;
    2398 
    2399  /*
    2400  The interpretation of m_index depends on the m_type value.
    2401 
    2402  m_type m_index interpretation (0 based indices)
    2403 
    2404  no_type used when context makes it clear what array is being index
    2405  brep_vertex ON_Brep.m_V[] array index
    2406  brep_edge ON_Brep.m_E[] array index
    2407  brep_face ON_Brep.m_F[] array index
    2408  brep_trim ON_Brep.m_T[] array index
    2409  brep_loop ON_Brep.m_L[] array index
    2410  mesh_vertex ON_Mesh.m_V[] array index
    2411  meshtop_vertex ON_MeshTopology.m_topv[] array index
    2412  meshtop_edge ON_MeshTopology.m_tope[] array index
    2413  mesh_face ON_Mesh.m_F[] array index
    2414  mesh_ngon ON_Mesh.Ngon() array index
    2415  idef_part ON_InstanceDefinition.m_object_uuid[] array index
    2416  polycurve_segment ON_PolyCurve::m_segment[] array index
    2417 
    2418  extrusion_bottom_profile Use ON_Extrusion::Profile3d() to get 3d profile curve
    2419  extrusion_top_profile Use ON_Extrusion::Profile3d() to get 3d profile curve
    2420  extrusion_wall_edge Use ON_Extrusion::WallEdge() to get 3d line curve
    2421  extrusion_wall_surface Use ON_Extrusion::WallSurface() to get 3d wall surface
    2422  extrusion_cap_surface 0 = bottom cap, 1 = top cap
    2423  extrusion_path -1 = entire path, 0 = start of path, 1 = end of path
    2424 
    2425  dim_linear_point linear dimension point index
    2426  dim_radial_point radial dimension point index
    2427  dim_angular_point angular dimension point index
    2428  dim_ordinate_point ordinate dimension point index
    2429  dim_text_point annotation text object point
    2430  */
    2431 
    2432  unsigned int UnsignedIndex() const
    2433  {
    2434  return (unsigned int)m_index;
    2435  }
    2436 
    2437  int m_index;
    2438 };
    2439 
    2440 #endif
    2441 
    2442 ON_BEGIN_EXTERNC
    2443 
    2444 // on_wcsicmp() is a wrapper for case insensitive wide string compare
    2445 // and calls one of _wcsicmp() or wcscasecmp() depending on OS.
    2446 ON_DECL
    2447 int on_wcsicmp( const wchar_t*, const wchar_t* );
    2448 
    2449 // on_wcsupr() calls _wcsupr() or wcsupr() depending on OS
    2450 ON_DECL
    2451 wchar_t* on_wcsupr(wchar_t*);
    2452 
    2453 // on_wcslwr() calls _wcslwr() or wcslwr() depending on OS
    2454 ON_DECL
    2455 wchar_t* on_wcslwr(wchar_t*);
    2456 
    2457 // on_wcsrev() calls _wcsrev() or wcsrev() depending on OS
    2458 ON_DECL
    2459 wchar_t* on_wcsrev(wchar_t*);
    2460 
    2461 // on_stricmp() is a wrapper for case insensitive string compare
    2462 // and calls one of _stricmp(), stricmp(), or strcasecmp()
    2463 // depending on OS.
    2464 ON_DECL
    2465 int on_stricmp(const char*, const char*);
    2466 
    2467 // on_stricmp() is a wrapper for case insensitive string compare
    2468 // and calls one of _strnicmp() or strncasecmp()
    2469 // depending on OS.
    2470 ON_DECL
    2471 int on_strnicmp(const char * s1, const char * s2, int n);
    2472 
    2473 // on_strupr() calls _strupr() or strupr() depending on OS
    2474 ON_DECL
    2475 char* on_strupr(char*);
    2476 
    2477 // on_strlwr() calls _strlwr() or strlwr() depending on OS
    2478 ON_DECL
    2479 char* on_strlwr(char*);
    2480 
    2481 // on_strrev() calls _strrev() or strrev() depending on OS
    2482 ON_DECL
    2483 char* on_strrev(char*);
    2484 
    2485 /*
    2486 Description:
    2487  Calls ON_ConvertWideCharToUTF8()
    2488 */
    2489 ON_DECL
    2490 int on_WideCharToMultiByte(
    2491  const wchar_t*, // lpWideCharStr,
    2492  int, // cchWideChar,
    2493  char*, // lpMultiByteStr,
    2494  int // cchMultiByte,
    2495  );
    2496 
    2497 /*
    2498 Description:
    2499  Calls ON_ConvertUTF8ToWideChar()
    2500 */
    2501 ON_DECL
    2502 int on_MultiByteToWideChar(
    2503  const char*, // lpMultiByteStr,
    2504  int, // cchMultiByte,
    2505  wchar_t*, // lpWideCharStr,
    2506  int // cchWideChar
    2507  );
    2508 
    2509 /*
    2510 Description:
    2511  Find the locations in a path the specify the drive, directory,
    2512  file name and file extension.
    2513 Parameters:
    2514  path - [in]
    2515  UTF-8 encoded string that is a legitimate path to a file.
    2516  volume - [out] (pass null if you don't need the volume)
    2517  If volume is not null and the path parameter begins with
    2518  a Windows volum specification, the value of *volume will
    2519  equal the input value of path. Otherwise *volume will be nullptr.
    2520  A Windows volume specification can be either a single A-Z or a-z
    2521  letter followed by a colon ( C: ) or a Windows UNC host name
    2522  (\\MY_SERVER).
    2523  dir - [out] (pass null if you don't need the directory)
    2524  If dir is not null and the path parameter contains a
    2525  directory specification, then the returned value of *dir
    2526  will point to the character in path where the directory
    2527  specification begins.
    2528  fname - [out] (pass null if you don't need the file name)
    2529  If fname is not null and the path parameter contains a
    2530  file name specification, then the returned value of *fname
    2531  will point to the character in path where the file name
    2532  specification begins.
    2533  ext - [out] (pass null if you don't need the extension)
    2534  If ext is not null and the path parameter contains a
    2535  file extension specification, then the returned value of
    2536  *ext will point to the '.' character in path where the file
    2537  extension specification begins.
    2538 Remarks:
    2539  This function will treat a front slash ( / ) and a back slash
    2540  ( \ ) as directory separators. Because this function parses
    2541  file names store in .3dm files and the .3dm file may have been
    2542  written on a Windows computer and then read on a another
    2543  computer, it looks for a volume specification even when the
    2544  operating system is not Windows.
    2545  This function will not return an directory that does not
    2546  end with a trailing slash.
    2547  This function will not return an empty filename and a non-empty
    2548  extension.
    2549  This function parses the path string according to these rules.
    2550  It does not check the actual file system to see if the answer
    2551  is correct.
    2552 See Also:
    2553  ON_String::SplitPath
    2554 */
    2555 ON_DECL void on_splitpath(
    2556  const char* path,
    2557  const char** volume,
    2558  const char** dir,
    2559  const char** fname,
    2560  const char** ext
    2561  );
    2562 
    2563 /*
    2564 Description:
    2565  Find the locations in a path the specify the drive, directory,
    2566  file name and file extension.
    2567 Parameters:
    2568  path - [in]
    2569  A legitimate file system path to a file.
    2570  volume - [out] (pass null if you don't need the volume)
    2571  If volume is not null and the path parameter begins with
    2572  a Windows volum specification, the value of *volume will
    2573  equal the input value of path. Otherwise *volume will be nullptr.
    2574  A Windows volume specification can be either a single A-Z or a-z
    2575  letter followed by a colon ( C: ) or a Windows UNC host name
    2576  (\\MY_SERVER).
    2577  dir - [out] (pass null if you don't need the directory)
    2578  If dir is not null and the path parameter contains a
    2579  directory specification, then the returned value of *dir
    2580  will point to the character in path where the directory
    2581  specification begins.
    2582  fname - [out] (pass null if you don't need the file name)
    2583  If fname is not null and the path parameter contains a
    2584  file name specification, then the returned value of *fname
    2585  will point to the character in path where the file name
    2586  specification begins.
    2587  ext - [out] (pass null if you don't need the extension)
    2588  If ext is not null and the path parameter contains a
    2589  file extension specification, then the returned value of
    2590  *ext will point to the '.' character in path where the file
    2591  extension specification begins.
    2592 Remarks:
    2593  This function will treat a front slash ( / ) and a back slash
    2594  ( \ ) as directory separators. Because this function parses
    2595  file names store in .3dm files and the .3dm file may have been
    2596  written on a Windows computer and then read on a another
    2597  computer, it looks for a volume specification even when the
    2598  operating system is not Windows.
    2599  This function will not return an directory that does not
    2600  end with a trailing slash.
    2601  This function will not return an empty filename and a non-empty
    2602  extension.
    2603  This function parses the path string according to these rules.
    2604  It does not check the actual file system to see if the answer
    2605  is correct.
    2606 See Also:
    2607  ON_wString::SplitPath
    2608 */
    2609 ON_DECL void on_wsplitpath(
    2610  const wchar_t* path,
    2611  const wchar_t** volume,
    2612  const wchar_t** dir,
    2613  const wchar_t** fname,
    2614  const wchar_t** ext
    2615  );
    2616 
    2617 ON_END_EXTERNC
    2618 
    2619 
    2620 #endif
    double d
    Definition: opennurbs_defines.h:404
    Definition: opennurbs_string.h:2089
    Definition: opennurbs_string.h:878
    void * p
    Definition: opennurbs_defines.h:403
    @@ -84,9 +82,9 @@ $(function() {
    diff --git a/6/d2/de8/class_o_n___hash32_table_item-members.html b/6/d2/de8/class_o_n___hash32_table_item-members.html index 3f7357c5..86e6ee9b 100644 --- a/6/d2/de8/class_o_n___hash32_table_item-members.html +++ b/6/d2/de8/class_o_n___hash32_table_item-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d2/de8/opennurbs__3dm__attributes_8h_source.html b/6/d2/de8/opennurbs__3dm__attributes_8h_source.html index 1f0b8df1..c3f64690 100644 --- a/6/d2/de8/opennurbs__3dm__attributes_8h_source.html +++ b/6/d2/de8/opennurbs__3dm__attributes_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_3dm_attributes.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_3dm_attributes.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/dec/opennurbs__3dm__settings_8h_source.html b/6/d2/dec/opennurbs__3dm__settings_8h_source.html index 9f5f446e..2927dea8 100644 --- a/6/d2/dec/opennurbs__3dm__settings_8h_source.html +++ b/6/d2/dec/opennurbs__3dm__settings_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_3dm_settings.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_3dm_settings.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_3dm_settings.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_3DM_SETTINGS_INC_)
    18 #define OPENNURBS_3DM_SETTINGS_INC_
    19 
    20 
    21 ///////////////////////////////////////////////////////////////////////
    22 //
    23 // units and tolerances
    24 //
    25 
    27 {
    28 public:
    29  // The default constructor set units to millimeters and tolerance = 0.001mm
    30  ON_3dmUnitsAndTolerances() = default;
    31  ~ON_3dmUnitsAndTolerances() = default;
    32 
    34  ON_3dmUnitsAndTolerances& operator=(const ON_3dmUnitsAndTolerances&) = default;
    35 
    36  bool Read( ON_BinaryArchive& );
    37  bool Write( ON_BinaryArchive& ) const;
    38 
    39  void Dump( ON_TextLog& ) const;
    40 
    41  /*
    42  Returns:
    43  True if tolerances (m_absolute_tolerance, m_angle_tolerance, m_relative_tolerance)
    44  are set to valid values.
    45  */
    46  bool TolerancesAreValid() const;
    47 
    48  /*
    49  Description:
    50  If m_absolute_tolerance is not set to a valid value, it is set
    51  to ON_3dmUnitsAndTolerances::DefaultValue.m_absolute_tolerance.
    52  If m_angle_tolerance is not set to a valid value, it is set
    53  to ON_3dmUnitsAndTolerances::DefaultValue.m_angle_tolerance.
    54  If m_relative_tolerance is not set to a valid value, it is set
    55  to ON_3dmUnitsAndTolerances::DefaultValue.m_relative_tolerance.
    56  Returns:
    57  0: all tolerances were valid
    58  0 != (rc & 1):
    59  m_absolute_tolerance was invalid and set to the default value
    60  0 != (rc & 2):
    61  m_angle_tolerance was invalid and set to the default value
    62  0 != (rc & 4):
    63  m_relative_tolerance was invalid and set to the default value
    64  */
    65  unsigned int SetInvalidTolerancesToDefaultValues();
    66 
    67  //////////
    68  // Returns scale factor that needs to be applied to change from
    69  // the argument's unit system to m_unit_system.
    70  // When m_unit_system is not ON::LengthUnitSystem::CustomUnits,
    71  // Scale(us) = ON::UnitScale(us,m_unit_system). When Scale(us)
    72  // When m_unit_system is ON::LengthUnitSystem::CustomUnits,
    73  // Scale(us) = ON::UnitScale(us,ON::LengthUnitSystem::Meters)*m_custom_unit_scale.
    74  double Scale( ON::LengthUnitSystem ) const;
    75 
    77 
    78  double m_absolute_tolerance = 0.001; // in units > 0.0
    79  double m_angle_tolerance = ON_PI/180.0; // in radians > 0.0 and <= ON_PI
    80  double m_relative_tolerance = 0.01; // fraction > 0.0 and < 1.0
    81 
    82  ON::OBSOLETE_DistanceDisplayMode m_distance_display_mode = ON::OBSOLETE_DistanceDisplayMode::Decimal; // decimal or fractional
    83  int m_distance_display_precision = 3; // decimal mode: number of decimal places
    84  // fractional modes:
    85  // denominator = (1/2)^m_distance_display_precision
    86 
    87 public:
    88  /*
    89  DefaultValue
    90  m_unit_system ON::LengthUnitSystem::Millimeters
    91  m_absolute_tolerance 0.001
    92  m_angle_tolerance pi/180 = 1 degree
    93  m_relative_tolerance 0.01 = 1%
    94  m_distance_display_mode ON::OBSOLETE_DistanceDisplayMode::Decimal
    95  m_distance_display_precision 3
    96  */
    98 };
    99 
    100 ///////////////////////////////////////////////////////////////////////
    101 //
    102 // Model settings
    103 // render mesh defaults
    104 // viewports
    105 // construction planes
    106 //
    107 
    109 {
    110 public:
    111  ON_3dmAnnotationSettings() = default;
    112  ~ON_3dmAnnotationSettings() = default;
    114  ON_3dmAnnotationSettings& operator=(const ON_3dmAnnotationSettings&) = default;
    115 
    117 
    118  bool Read( ON_BinaryArchive& );
    119  bool Write( ON_BinaryArchive& ) const;
    120 
    121  void Dump( ON_TextLog& text_log ) const;
    122 
    123  // these are the running defaults for making dimensions
    124  // they are also the things written to the 3dm file as dimension settings
    125  double m_dimscale = 1.0; // model size / plotted size
    126  double m_textheight = 1.0;
    127  double m_dimexe = 1.0;
    128  double m_dimexo = 1.0;
    129  double m_arrowlength = 1.0;
    130  double m_arrowwidth = 1.0;
    131  double m_centermark = 1.0;
    132 
    133  /*
    134  Returns:
    135  Value of m_world_view_text_scale;
    136  */
    137  double WorldViewTextScale() const;
    138 
    139  /*
    140  Parameters:
    141  world_view_text_scale - [in]
    142  Sets value of m_world_view_text_scale.
    143  */
    144  void SetWorldViewTextScale(double world_view_text_scale );
    145 
    146  /*
    147  Returns:
    148  Value of m_world_view_hatch_scale;
    149  */
    150  double WorldViewHatchScale() const;
    151 
    152  /*
    153  Parameters:
    154  world_view_hatch_scale - [in]
    155  Sets value of m_world_view_hatch_scale.
    156  */
    157  void SetWorldViewHatchScale(double world_view_hatch_scale );
    158 
    159 
    160  /*
    161  Returns:
    162  Value of m_b_V5_EnableAnnotationScaling;
    163  */
    164  bool Is_V5_AnnotationScalingEnabled() const;
    165 
    166  /*
    167  Parameters:
    168  bEnable - [in]
    169  Sets value of m_b_V5_EnableAnnotationScaling.
    170  */
    171  void Enable_V5_AnnotationScaling(bool bEnable);
    172 
    173  /*
    174  Parameters:
    175  bEnable - [in]
    176  Sets value of m_bEnableModelSpaceAnnotationScaling.
    177  */
    178  void EnableModelSpaceAnnotationScaling(bool bEnable);
    179 
    180  /*
    181  Returns:
    182  Value of m_bEnableModelSpaceAnnotationScaling;
    183  */
    184  bool IsModelSpaceAnnotationScalingEnabled() const;
    185 
    186  /*
    187  Parameters:
    188  bEnable - [in]
    189  Sets value of m_bEnableLayoutSpaceAnnotationScaling.
    190  */
    191  void EnableLayoutSpaceAnnotationScaling(bool bEnable);
    192 
    193  /*
    194  Returns:
    195  Value of m_bEnableLayoutSpaceAnnotationScaling;
    196  */
    197  bool IsLayoutSpaceAnnotationScalingEnabled() const;
    198 
    199  /*
    200  Returns:
    201  Value of m_bEnableHatchScaling;
    202  */
    203  bool IsHatchScalingEnabled() const;
    204 
    205  /*
    206  Parameters:
    207  bEnable - [in]
    208  Sets value of m_bEnableHatchScaling.
    209  */
    210  void EnableHatchScaling( bool bEnable );
    211 
    212  // Present but not used in V4 or V5 - removed 5 August 2010 to make room
    213  // for m_world_view_text_scale and m_bEnableAnnotationScaling
    214  //// added 12/28/05 LW
    215  //double m_dimdle;
    216  //double m_dimgap;
    217 private:
    218  // If m_bEnableAnnotationScaling is true,
    219  // and ON_OBSOLETE_V5_Annotation::m_annotative_scale is true,
    220  // and ON_OBSOLETE_V5_Annotation::m_type == ON::dtTextBlock,
    221  // and the text object is being displayed in a world
    222  // view (not a detail view and not a page view),
    223  // then the text will be scaled by m_world_view_text_scale.
    224  // The default is 1.0. Values <= 0.0 are not valid.
    225  float m_world_view_text_scale = 1.0f;
    226  float m_world_view_hatch_scale = 1.0f;
    227 
    228 private:
    229  // If m_bEnableAnnotationScaling is false:
    230  // * m_world_view_text_scale is ignored.
    231  // * text is not scaled.
    232  // * ON_DimStyle::DimScale() determines the scale
    233  // applied to all other annotation objects in all
    234  // types of views.
    235  // * The value of ON_DetailView::m_page_per_model_ratio
    236  // is applied to all objects (annotation and geometry)
    237  // in the detail view.
    238  //
    239  // If m_bEnableAnnotationScaling is true:
    240  // * m_world_view_text_scale is used as described above.
    241  // * ON_DimStyle::DimScale() determines the scale
    242  // applied to all non text annotation objects in
    243  // world views.
    244  // * ON_DimStyle::DimScale() is ignored in page and
    245  // detail views.
    246  // * ON_DetailView::m_page_per_model_ratio is ingored
    247  // for annotation objects in detail views, other
    248  // geometry is scaled.
    249  //
    250  // Default is true.
    251  unsigned char m_b_V5_EnableAnnotationScaling = 1;
    252 
    253  // [Lowell 3-28-2013] New fields for V6
    254  unsigned char m_bEnableModelSpaceAnnotationScaling = 1;
    255  unsigned char m_bEnableLayoutSpaceAnnotationScaling = 1;
    256 
    257  unsigned char m_bEnableHatchScaling = 1;
    258 
    259 private:
    260  ON__UINT32 m_reserved1 = 0;
    261  ON__UINT8 m_reserved2 = 0;
    262  ON__UINT8 m_reserved3 = 0;
    263  ON__UINT8 m_reserved4 = 0;
    264 
    265 public:
    266  ON::LengthUnitSystem m_dimunits = ON::LengthUnitSystem::None; // units used to measure the dimension
    267  int m_arrowtype = 0; // 0: filled narrow triangular arrow (= ((ON_Arrowhead::arrow_type enum value as int ) - 2))
    268  int m_angularunits = 0; // 0: degrees, 1: radians
    269  int m_lengthformat = 0; // 2 = ON_DimStyle::LengthDisplay::FeetAndInches, treat everything else as ON_DimStyle::LengthDisplay::ModelUnits
    270  int m_angleformat = 0; // 0: decimal degrees, ... ( ON_DimStyle::angle_format enum as int )
    271 
    272  //ON_INTERNAL_OBSOLETE::V5_TextDisplayMode m_settings_textalign; // In V2 files - 0: above line, 1: in line, 2: horizontal
    273  // // After V2 files - 0: normal (converts to above_line), 1: horizontal, 2: above_line, 3: in_line
    274 
    275  int m_resolution = 0; // depends on m_lengthformat
    276  // for decimal, digits past the decimal point
    277 
    278  ON_wString m_facename; // [LF_FACESIZE] // windows font name
    279 };
    280 
    281 //////////////////////////////////////////////////////////////////////////////////////////
    282 //
    283 // ON_3dmConstructionPlaneGridDefaults
    284 //
    285 // Default settings used for construction plane grids
    287 {
    288 public:
    293 
    295 
    296  bool Write( ON_BinaryArchive& ) const;
    297  bool Read( ON_BinaryArchive& );
    298 
    299  void Dump( ON_TextLog& text_log ) const;
    300 
    301  double m_grid_spacing = 1.0; // distance between grid lines
    302  double m_snap_spacing = 1.0; // when "grid snap" is enabled, the
    303  // distance between snap points. Typically
    304  // this is the same distance as grid spacing.
    305  int m_grid_line_count = 70; // number of grid lines in each direction
    306  int m_grid_thick_frequency = 5; // thick line frequency
    307  // 0: none,
    308  // 1: all lines are thick,
    309  // 2: every other is thick, ...
    310 
    311  bool m_bShowGrid = true;
    312  bool m_bShowGridAxes = true;
    313  bool m_bShowWorldAxes = true;
    314 };
    315 
    316 //////////////////////////////////////////////////////////////////////////////////////////
    317 //
    318 // ON_3dmConstructionPlane
    319 //
    321 {
    322 public:
    325 
    326  ON_3dmConstructionPlane(const ON_Plane& plane);
    327 
    328  // default copy constructor and operator= work fine
    329  //ON_3dmConstructionPlane(const ON_3dmConstructionPlane&);
    330  //ON_3dmConstructionPlane& operator=(const ON_3dmConstructionPlane&);
    331 
    332  void Default();
    333 
    334  bool Write( ON_BinaryArchive& ) const;
    335  bool Read( ON_BinaryArchive& );
    336 
    337  void Dump( ON_TextLog& text_log ) const;
    338 
    340 
    341  // construction grid appearance
    342  double m_grid_spacing; // distance between grid lines
    343  double m_snap_spacing; // when "grid snap" is enabled, the
    344  // distance between snap points. Typically
    345  // this is the same distance as grid spacing.
    346  int m_grid_line_count; // number of grid lines in each direction
    347  int m_grid_thick_frequency; // thick line frequency
    348  // 0: none,
    349  // 1: all lines are thick,
    350  // 2: every other is thick, ...
    351  bool m_bDepthBuffer; // false=grid is always drawn behind 3d geometry
    352  // true=grid is drawn at its depth as a 3d plane
    353  // and grid lines obscure things behind the grid.
    354 
    356 };
    357 
    358 #if defined(ON_DLL_TEMPLATE)
    359 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_3dmConstructionPlane>;
    360 #endif
    361 
    362 //////////////////////////////////////////////////////////////////////////////////////////
    363 //
    364 // ON_3dmViewPosition
    365 //
    366 class ON_CLASS ON_3dmViewPosition
    367 {
    368 public:
    369  // view window relative position and state in parent frame
    373  ON_3dmViewPosition& operator=(const ON_3dmViewPosition&);
    374 
    375  void Default();
    376 
    377  bool Write( ON_BinaryArchive& ) const;
    378  bool Read( ON_BinaryArchive& );
    379 
    380  // relative position of view window in main frame
    381  // if m_floating_viewport>0, this is relative position of the view window
    382  // on the virtual screen (union of potentially multiple monitors)
    383  double m_wnd_left; // 0.0 to 1.0
    384  double m_wnd_right;
    385  double m_wnd_top;
    386  double m_wnd_bottom;
    387 
    388  bool m_bMaximized; // true if view window is maximized
    389 
    390  // m_floating_viewport is used to track floating viewport information.
    391  // 0 = the view is docked in the main application window.
    392  // >0 = the view is floating. When floating, this corresponds to the
    393  // number of monitors on on the user's computer when the file was saved
    394  unsigned char m_floating_viewport;
    395 private:
    396  // reserved for future use
    397  unsigned char m_reserved_1;
    398  unsigned char m_reserved_2;
    399  unsigned char m_reserved_3;
    400 };
    401 
    402 //////////////////////////////////////////////////////////////////////////////////////////
    403 //
    404 // ON_3dmViewTraceImage
    405 //
    406 class ON_CLASS ON_3dmViewTraceImage
    407 {
    408 public:
    411  bool operator==( const ON_3dmViewTraceImage& ) const;
    412  bool operator!=( const ON_3dmViewTraceImage& ) const;
    413 
    414  void Default();
    415 
    416  bool Write( ON_BinaryArchive& ) const;
    417  bool Read( ON_BinaryArchive& );
    418 
    419  // view window relative position and state in parent frame
    421  double m_width;
    422  double m_height;
    423 
    425 
    426  bool m_bGrayScale; // true if image should be black and white
    427  bool m_bHidden; // true if image is currently hidden from view
    428  bool m_bFiltered; // true if image should be filtered (bilinear) before displayed.
    429 };
    430 
    431 
    432 //////////////////////////////////////////////////////////////////////////////////////////
    433 //
    434 // ON_3dmViewTraceImage
    435 //
    436 class ON_CLASS ON_3dmWallpaperImage
    437 {
    438 public:
    441  bool operator==( const ON_3dmWallpaperImage& ) const;
    442  bool operator!=( const ON_3dmWallpaperImage& ) const;
    443 
    444  void Default();
    445 
    446  bool Write( ON_BinaryArchive& ) const;
    447  bool Read( ON_BinaryArchive& );
    448 
    450 
    451  bool m_bGrayScale; // true if image should be black and white
    452  bool m_bHidden; // true if image is currently hidden from view
    453 };
    454 
    455 //////////////////////////////////////////////////////////////////////////////////////////
    456 //
    457 // ON_3dmView
    458 //
    459 
    460 class ON_CLASS ON_3dmPageSettings
    461 {
    462 public:
    465 
    466  bool IsValid( ON_TextLog* text_log = 0 ) const;
    467 
    468  void Default();
    469 
    471 
    472  // Overall size of the page in millimeters
    473  double m_width_mm;
    474  double m_height_mm;
    475 
    476  // Page margins in millimeters
    481 
    483 
    484  bool Write(ON_BinaryArchive& archive) const;
    485  bool Read(ON_BinaryArchive& archive);
    486 };
    487 
    489 {
    490 public:
    491  static const ON_UUID Wireframe; // {1311ADCB-D89E-4051-A3F0-F64441FB8EC6}
    492  static const ON_UUID Shaded; // {8BC8DEBE-C83B-4c47-B13C-9DB074510CAC}
    493  static const ON_UUID Rendered; // {CAE60BAE-2D51-4299-ABF7-A339FCA86F3B}
    494  static const ON_UUID Ghosted; // {FF608B97-81D3-4186-831C-41F7DC140881}
    495  static const ON_UUID XrayShade; // {B5C19D5D-0AEC-4ff7-A10E-E052E660263A}
    496  static const ON_UUID RenderedShadows; // {A5545314-9D87-428d-95AE-91052EEAD0FA}
    497  static const ON_UUID Technical; // {63612C72-778F-4afd-B81B-17426FDFE8A6}
    498  static const ON_UUID Artistic; // {B46AB226-05A0-4568-B454-4B1AB721C675}
    499  static const ON_UUID Pen; // {F4616FA5-A831-4620-A97E-9B807D5EC376}
    500  static const ON_UUID AmbientOcclusion; // {C32B72C3-41BD-4ADC-82A8-B7AEF4456A37}
    501  static const ON_UUID Raytraced; // {69E0C7A5-1C6A-46C8-B98B-8779686CD181}
    502 
    503  /*
    504  Parameters:
    505  id - [in]
    506  Returns:
    507  True if id is one of the standard display modes listed above.
    508  */
    509  static bool IsStandardDisplayModeId(
    510  ON_UUID id
    511  );
    512 
    513  /*
    514  Parameters:
    515  id - [in]
    516  Returns:
    517  The legacy V3 display mode enum that is the closest match to
    518  the display mode id.
    519  */
    520  static ON::v3_display_mode ToV3DisplayMode(
    521  ON_UUID id
    522  );
    523 
    524  /*
    525  Parameters:
    526  dm - [in]
    527  v3 display mode enum value
    528  Returns:
    529  display mode id that corresponds to the enum value.
    530  */
    531  static ON_UUID FromV3DisplayMode(
    532  ON::v3_display_mode dm
    533  );
    534 
    535 
    536 private:
    537  // prohibit instantiation
    538  ON_StandardDisplayModeId(); // no implementation
    539  ~ON_StandardDisplayModeId(); // no implementation
    540 };
    541 
    542 enum class ON_FocalBlurModes : unsigned int
    543 {
    544  None, // No focal blur.
    545  Automatic, // Autofocus on selected objects.
    546  Manual, // Fully manual focus.
    547 };
    548 
    549 class ON_CLASS ON_3dmView
    550 {
    551 public:
    552  ON_3dmView();
    553  ~ON_3dmView();
    554 
    555  // The C++ default copy constructor and operator= work fine.
    556  // Do not provide customized versions.
    557  // NO // ON_3dmView(const ON_3dmView&);
    558  // NO // ON_3dmView& operator=(const ON_3dmView&);
    559 
    560  void Default();
    561 
    562  bool Write( ON_BinaryArchive& ) const;
    563  bool Read( ON_BinaryArchive& );
    564 
    565  void Dump( ON_TextLog& text_log ) const;
    566 
    567  bool IsValid( ON_TextLog* text_log = 0 ) const;
    568 
    569  // view projection information
    571 
    572  // clipping planes
    573  // Prior to Dec 14, 2010 m_clipping_planes was not saved with the view.
    574  // After Dec 14, 2010 m_clipping_planes is saved.
    576 
    577  // If true, the the camera location, camera direction,
    578  // and lens angle should not be changed.
    579  // It is ok to adjust clipping planes.
    581 
    582  ///////////////////////////////////////////////////////////////////////
    583  //
    584  // target point
    585  //
    586 
    587  /*
    588  Returns:
    589  Target point. This point is saved on m_vp.m_target_point.
    590  The default constructor sets the target point to
    591  ON_3dPoint::UnsetPoint. You must explicitly set the target
    592  point if you want to use it.
    593  Remarks:
    594  The target point is stored on m_vp.m_target_point. The
    595  value ON_3dmView.m_target is obsolete. This function always
    596  returns the value of m_vp.m_target_point.
    597 
    598  */
    599  ON_3dPoint TargetPoint() const;
    600 
    601  /*
    602  Description:
    603  Sets the viewport target point.
    604  Parameters:
    605  target_point - [in]
    606  When in doubt, the point m_vp.FrustumCenterPoint(ON_UNSET_VALUE)
    607  is a good choice.
    608  Remarks:
    609  This point is saved on m_vp.m_target_point.
    610  */
    611  bool SetTargetPoint(ON_3dPoint target_point);
    612 
    613  //
    614  ///////////////////////////////////////////////////////////////////////
    615 
    616  ON_wString m_name; // name on window
    617 
    618  // The value of m_display_mode_id can be one of the "standard" ids
    619  // from ON_StandardDisplayModeId, nil, or a custom display mode
    620  // settings on a particular computer. If you encounter a nil id
    621  // or any other id that is not one of the "standard" display mode
    622  // ids, then your application should use a default display mode,
    623  // typically either wireframe or shaded, that is appropriate for
    624  // general model viewing. The function ON::RhinoV3DisplayMode(id)
    625  // will convert a display mode id into a legacy Rhino V3 display
    626  // mode enum value.
    628 
    629  // position of view in parent window
    630  // (relative display device coordinates)
    632 
    633  ON::view_type m_view_type; // model, page, or nested
    634 
    635  // If m_view_type == ON::page_view_type, then the m_page_settings
    636  // records the page size. Otherwise, m_page_settings should
    637  // be ignored.
    639 
    640  ///////////////////////////////////////////////////////////////////////
    641  //
    642  // Named view information
    643  //
    644  // If this view was created from a named view, then m_named_view_id
    645  // identifies the named view.
    646  //
    647  // The named views are ON_3dmView classes saved in ON_3dmSettings.m_named_views[].
    648  // A named view's id is the value returned by ON_3dmView.m_vp.ViewportId()
    649  // A named view's name is the value returned by ON_3dmView.m_name
    650  //
    651  // If this view is a named view, then m_named_view_id should be equal to
    652  // m_vp.m_viewport_id.
    653  //
    654  // If this view is not a named view and not created from a named view,
    655  // then m_named_view_id is equal to ON_nil_uuid.
    657 
    658  ///////////////////////////////////////////////////////////////////////
    659  //
    660  // Construction plane
    661  //
    666 
    667  // world axes icon
    669 
    670  // tracing image
    672 
    673  // wallpaper image
    675 
    676 public:
    677 
    678  double FocalBlurDistance(void) const;
    679  void SetFocalBlurDistance(double d);
    680 
    681  double FocalBlurAperture(void) const;
    682  void SetFocalBlurAperture(double d);
    683 
    684  double FocalBlurJitter(void) const;
    685  void SetFocalBlurJitter(double d);
    686 
    687  unsigned int FocalBlurSampleCount(void) const;
    688  void SetFocalBlurSampleCount(unsigned int count);
    689 
    690  ON_FocalBlurModes FocalBlurMode(void) const;
    691  void SetFocalBlurMode(ON_FocalBlurModes m);
    692 
    693  ON_2iSize RenderingSize() const;
    694  void SetRenderingSize(const ON_2iSize& size);
    695 
    696  //Focal blur settings - per view for renderers.
    697 private:
    698  double m_dFocalBlurDistance = 100.0;
    699  double m_dFocalBlurAperture = 64.0;
    700  double m_dFocalBlurJitter = 0.1;
    701  unsigned int m_uFocalBlurSampleCount = 10;
    702  ON_FocalBlurModes m_FocalBlurMode = ON_FocalBlurModes::None;
    703  ON_2iSize m_sizeRendering = ON_2iSize(640, 480);
    704 
    705 private:
    706  ON__INT_PTR reserved = 0;
    707 };
    708 
    709 #if defined(ON_DLL_TEMPLATE)
    710 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_3dmView>;
    711 #endif
    712 
    713 //////////////////////////////////////////////////////////////////////////////////////////
    714 //
    715 // ON_3dmRenderSettings
    716 //
    717 
    718 class ON_CLASS ON_3dmRenderSettings : public ON_Object
    719 {
    720  ON_OBJECT_DECLARE(ON_3dmRenderSettings);
    721 
    722 public:
    723  ON_3dmRenderSettings() = default;
    724  ~ON_3dmRenderSettings() = default;
    725  ON_3dmRenderSettings(const ON_3dmRenderSettings&) = default;
    726  ON_3dmRenderSettings& operator=(const ON_3dmRenderSettings&) = default;
    727 
    729 
    730  bool Write( ON_BinaryArchive& ) const override;
    731  bool Read( ON_BinaryArchive& ) override;
    732  void Dump( ON_TextLog& text_log ) const override;
    733 
    734 private:
    735  static bool UseV5ReadWrite(const ON_BinaryArchive&);
    736  bool WriteV5( ON_BinaryArchive& ) const;
    737  bool ReadV5( ON_BinaryArchive& );
    738 
    739 public:
    740  //New for V6, rendering source (render directly from a NamedView or Snapshot)
    741  //https://mcneel.myjetbrains.com/youtrack/issue/RH-39593
    742  enum class RenderingSources : unsigned int
    743  {
    744  ActiveViewport, // Get the rendering view from the currently active viewport (as in all previous versions of Rhino)
    745  SpecificViewport, // Get the rendering view from the named viewport (see NamedViewport below)
    746  NamedView, // Get the rendering view from a specific named view (see NamedView below)
    747  SnapShot, // Before rendering, restore the Snapshot specified in Snapshot below, then render.
    748  };
    749 
    750  RenderingSources RenderingSource(void) const;
    751  void SetRenderingSource(RenderingSources);
    752 
    753  ON_wString SpecificViewport(void) const;
    754  void SetSpecificViewport(const ON_wString&);
    755 
    756  ON_wString NamedView(void) const;
    757  void SetNamedView(const ON_wString&);
    758 
    759  ON_wString Snapshot(void) const;
    760  void SetSnapshot(const ON_wString&);
    761 
    762 private:
    763  RenderingSources m_rendering_source = RenderingSources::ActiveViewport;
    764  ON_wString m_specific_viewport;
    765  ON_wString m_named_view;
    766  ON_wString m_snapshot;
    767 
    768 public:
    769  bool ScaleBackgroundToFit() const;
    770  void SetScaleBackgroundToFit( bool bScaleBackgroundToFit );
    771 
    772 private:
    773  unsigned short m_reserved1 = 0;
    774 
    775 public:
    776  //////////////////////////////////////////////////////////////
    777  //
    778  // Force viewport aspect ratio:
    779  // If m_bCustomImageSize is true and m_bForceViewportAspectRatio is true
    780  // then the image height should be calculated by multiplying the m_image_width
    781  // by the viewport aspect ratio. Note that this might be affected by m_rendering_source
    782  // In this case, m_image_height should not be used.
    783  //
    784  bool m_bForceViewportAspectRatio = false;
    785  //////////////////////////////////////////////////////////////
    786  //
    787  // Custom image size:
    788  // If m_bCustomImageSize is true, then the image pixel size
    789  // is m_image_width X m_image_height pixels.
    790  // If m_bCustomImageSize is false, then the image pixel size
    791  // is the size of the viewport being rendered.
    792  //
    793  bool m_bCustomImageSize = false;
    794  int m_image_width = 800; // image width in pixels
    795  int m_image_height = 600; // image height in pixels
    796 
    797 private:
    798  unsigned int m_reserved3 = 0;
    799 public:
    800 
    801  ////////
    802  // Number of dots/inch (dots=pixels) to use when printing and
    803  // saving bitmaps. The default is 72.0 dots/inch.
    804  double m_image_dpi = 72.0;
    805 
    806  //////////
    807  // unit system to use when converting image pixel size and dpi
    808  // information into a print size. Default = inches
    809  ON::LengthUnitSystem m_image_us = ON::LengthUnitSystem::Inches;
    810 
    811  ON_Color m_ambient_light = ON_Color::Black;
    812 
    813  int m_background_style = 0; // 0 = solid color, 1 = "wallpaper" image, 2 = Gradient, 3 = Environment
    814 
    815  // m_background_color was changed from ON_Color::Gray160 to ON_Color::White for "white studio" look.
    816  // m_background_color = Top color of gradient...
    817  ON_Color m_background_color = ON_Color::White;
    818  ON_Color m_background_bottom_color = ON_Color::Gray160;
    819 
    820 
    822  // If m_background_bitmap_filename is not empty, the file cannot be found,
    823  // and m_embedded_file_id identifes an embedded image file in the model,
    824  // then that file will be used as the background bitmap.
    825  ON_UUID m_embedded_image_file_id = ON_nil_uuid;
    826 
    827  bool m_bUseHiddenLights = false;
    828 
    829  bool m_bDepthCue = false;
    830  bool m_bFlatShade = false;
    831 
    832  bool m_bRenderBackfaces = true;
    833  bool m_bRenderPoints = false;
    834  bool m_bRenderCurves = false;
    835  bool m_bRenderIsoparams = false;
    836  bool m_bRenderMeshEdges = false;
    837  bool m_bRenderAnnotation = false;
    838  bool m_bScaleBackgroundToFit = false;
    839  bool m_bTransparentBackground = false;
    840 
    841 private:
    842  unsigned char m_reserved4 = 0;
    843  unsigned int m_reserved5 = 0;
    844 public:
    845 
    846  int m_antialias_style = 1; // 0 = none, 1 = normal, 2 = medium, 3 = best
    847 
    848  int m_shadowmap_style = 1; // 0 = none, 1 = normal, 2 = best
    849  int m_shadowmap_width= 1000;
    850  int m_shadowmap_height = 1000;
    851  double m_shadowmap_offset = 0.75;
    852 
    853 
    854  // Flags that are used to determine which render settings a render
    855  // plugin uses, and which ones the display pipeline should use.
    856  // Note: Render plugins set these, and they don't need to persist
    857  // in the document...Also, when set, they turn OFF their
    858  // corresponding setting in the Display Attributes Manager's
    859  // UI pages for "Rendered" mode.
    860  bool m_bUsesAmbientAttr = true;
    861  bool m_bUsesBackgroundAttr = true;
    862  bool m_bUsesBackfaceAttr = false;
    863  bool m_bUsesPointsAttr = false;
    864  bool m_bUsesCurvesAttr = true;
    865  bool m_bUsesIsoparmsAttr = true;
    866  bool m_bUsesMeshEdgesAttr = false;
    867  bool m_bUsesAnnotationAttr = true;
    868  bool m_bUsesHiddenLightsAttr = true;
    869 
    870 private:
    871  unsigned char m_reserved6 = 0;
    872  unsigned short m_reserved7 = 0;
    873  unsigned short m_reserved8 = 0;
    874 
    875 private:
    876  ON__INT_PTR m_reserved9 = 0;
    877 };
    878 
    879 
    880 //////////////////////////////////////////////////////////////////////////////////////////
    881 //
    882 // ON_EarthAnchorPoint
    883 //
    884 
    885 class ON_CLASS ON_EarthAnchorPoint
    886 {
    887 public:
    888  ON_EarthAnchorPoint() = default;
    889  ~ON_EarthAnchorPoint() = default;
    890  ON_EarthAnchorPoint(const ON_EarthAnchorPoint&) = default;
    891  ON_EarthAnchorPoint& operator=(const ON_EarthAnchorPoint&) = default;
    892 
    893  // Latitude, longitude, and elevation are ON_UNSET_VALUE.
    895 
    896  // Latitude, longitude, and elevation are the Seattle Space Needle.
    898 
    899  static
    900  int Compare(
    901  const ON_EarthAnchorPoint*,
    902  const ON_EarthAnchorPoint*
    903  );
    904 
    905  static
    906  int CompareEarthLocation(
    907  const ON_EarthAnchorPoint*,
    908  const ON_EarthAnchorPoint*
    909  );
    910 
    911  static
    912  int CompareModelDirection(
    913  const ON_EarthAnchorPoint*,
    914  const ON_EarthAnchorPoint*
    915  );
    916 
    917  static
    918  int CompareIdentification(
    919  const ON_EarthAnchorPoint*,
    920  const ON_EarthAnchorPoint*
    921  );
    922 
    923  bool Read( ON_BinaryArchive& );
    924  bool Write( ON_BinaryArchive& ) const;
    925 
    926  /*
    927  Returns:
    928  True if the latitude, longitude, and elevation are set.
    929  */
    930  bool EarthLocationIsSet() const;
    931 
    932  /*
    933  Returns:
    934  True if model basepoint, north and east are set.
    935  */
    936  bool ModelLocationIsSet() const;
    937 
    938  /*
    939  Parameters:
    940  elevation_unit_system - [in]
    941  elevation - [in]
    942  */
    943  void SetEarthLocation(
    944  ON::EarthCoordinateSystem earth_coordinate_system,
    945  const class ON_UnitSystem& elevation_unit_system,
    946  double latitude_degrees,
    947  double longitude_degrees,
    948  double elevation
    949  );
    950 
    951  void SetEarthLocation(
    952  ON::EarthCoordinateSystem earth_coordinate_system,
    953  ON::LengthUnitSystem elevation_unit_system,
    954  double latitude_degrees,
    955  double longitude_degrees,
    956  double elevation
    957  );
    958 
    959  void SetLatitudeAndLongitude(
    960  double latitude_degrees,
    961  double longitude_degrees
    962  );
    963 
    964  /*
    965  Returns:
    966  A 3d point with coordinates (latitude in degrees, longitude in degrees, elevation in meters).
    967  Remarks:
    968  Some coordinates may be ON_UNSET_VALUE.
    969  */
    970  ON_3dPoint EarthLocation() const;
    971 
    972  /*
    973  Parameters:
    974  unset_location - [in]
    975  Location to return if EarlocationIsSet() is false.
    976  Returns:
    977  A 3d point with coordinates (latitude, longitude, elevation).
    978  */
    979  ON_3dPoint EarthLocation(
    980  ON_3dPoint unset_location
    981  ) const;
    982 
    983  /*
    984  Returns:
    985  Earth location latitude in degrees. Can be ON_UNSET_VALUE
    986  */
    987  double Latitude() const;
    988 
    989  /*
    990  Parameters:
    991  unset_latitude - [in]
    992  Value to return if the Earth location latitude is not set.
    993  Returns:
    994  Earth location latitude in degrees.
    995  */
    996  double Latitude(
    997  double unset_latitude
    998  ) const;
    999 
    1000  void SetLatitude(
    1001  double latitude_degrees
    1002  );
    1003 
    1004  /*
    1005  Returns:
    1006  Earth location longitude in degrees. Can be ON_UNSET_VALUE
    1007  */
    1008  double Longitude() const;
    1009 
    1010  /*
    1011  Parameters:
    1012  unset_longitude - [in]
    1013  Value to return if the Earth location latitude is not set.
    1014  Returns:
    1015  Earth location longitude in degrees.
    1016  */
    1017  double Longitude(
    1018  double unset_longitude
    1019  ) const;
    1020 
    1021  void SetLongitude(
    1022  double longitude_degrees
    1023  );
    1024 
    1025  /*
    1026  System used to define latiude, longitude and elevation.
    1027  */
    1028  ON::EarthCoordinateSystem EarthCoordinateSystem() const;
    1029 
    1030  /*
    1031  System used to define Earth latiude, longitude, and elevation coordinates.
    1032  */
    1033  void SetEarthCoordinateSystem(
    1034  ON::EarthCoordinateSystem earth_coordinate_system
    1035  );
    1036 
    1037  double ElevationInMeters() const;
    1038 
    1039 
    1040  /*
    1041  Parameters:
    1042  elevation_unit_system - [in]
    1043  length unit system for returned value.
    1044  Returns:
    1045  Earth location elevation in in elevation_unit_system.
    1046  The value is with
    1047  Can be ON_UNSET_VALUE
    1048  */
    1049  double Elevation(
    1050  const class ON_UnitSystem& elevation_unit_system
    1051  ) const;
    1052 
    1053  /*
    1054  Parameters:
    1055  elevation_unit_system - [in]
    1056  length unit system for returned value.
    1057  Returns:
    1058  Earth location elevation in degrees. Can be ON_UNSET_VALUE
    1059  */
    1060  double Elevation(
    1061  ON::LengthUnitSystem elevation_unit_system
    1062  ) const;
    1063 
    1064  /*
    1065  Parameters:
    1066  elevation_unit_system - [in]
    1067  length unit system for returned value.
    1068  unset_elevation - [in]
    1069  Value to return if the Earth location elevation is not set.
    1070  */
    1071  double Elevation(
    1072  const class ON_UnitSystem& elevation_unit_system,
    1073  double unset_elevation
    1074  ) const;
    1075 
    1076  /*
    1077  Parameters:
    1078  elevation_unit_system - [in]
    1079  length unit system for returned value.
    1080  unset_elevation - [in]
    1081  Value to return if the Earth location elevation is not set.
    1082  */
    1083  double Elevation(
    1084  ON::LengthUnitSystem elevation_unit_system,
    1085  double unset_elevation
    1086  ) const;
    1087 
    1088  /*
    1089  Parameters:
    1090  elevation_unit_system - [in]
    1091  elevation - [in]
    1092  */
    1093  void SetElevation(
    1094  const ON_UnitSystem& elevation_unit_system,
    1095  double elevation
    1096  );
    1097 
    1098  void SetElevation(
    1099  ON::LengthUnitSystem elevation_unit_system,
    1100  double elevation
    1101  );
    1102 
    1103  const ON_3dPoint& ModelPoint() const;
    1104  const ON_3dVector& ModelNorth() const;
    1105  const ON_3dVector& ModelEast() const;
    1106 
    1107  void SetModelPoint(
    1108  ON_3dPoint model_point
    1109  );
    1110 
    1111  void SetModelNorth(
    1112  ON_3dVector model_north
    1113  );
    1114 
    1115  void SetModelEast(
    1116  ON_3dVector model_east
    1117  );
    1118 
    1119  void SetModelLocation(
    1120  ON_3dPoint model_point,
    1121  ON_3dVector model_north,
    1122  ON_3dVector model_east
    1123  );
    1124 
    1125 private:
    1126  // Point on the Earth
    1127  // Latitude (degrees): +90 = north pole, 0 = equator, -90 = south pole
    1128  // Longitude (degrees): 0 = prime meridian (Greenwich meridian)
    1129  // Elevation (meters):
    1130  double m_earth_latitude = ON_UNSET_VALUE; // in decimal degrees
    1131  double m_earth_longitude = ON_UNSET_VALUE; // in decimal degrees
    1132  double m_earth_elevation_meters = 0.0;
    1133 
    1134  ON::EarthCoordinateSystem m_earth_coordinate_system = ON::EarthCoordinateSystem::Unset;
    1135 
    1136 private:
    1137  unsigned char m_reserved1 = 0;
    1138  unsigned char m_reserved2 = 0;
    1139  unsigned char m_reserved3 = 0;
    1140  ON__UINT32 m_reserved4 = 0;
    1141 
    1142 private:
    1143  // Corresponding model point in model coordinates.
    1144  ON_3dPoint m_model_point = ON_3dPoint::Origin; // in model coordinates
    1145 
    1146  // Earth directions in model coordinates
    1147  ON_3dVector m_model_north = ON_3dVector::YAxis; // in model coordinates
    1148  ON_3dVector m_model_east = ON_3dVector::XAxis; // in model coordinates
    1149 
    1150 public:
    1151  // Identification information about this location
    1152  ON_UUID m_id = ON_nil_uuid; // unique id for this anchor point
    1156  ON_wString m_url_tag; // UI link text for m_url
    1157 
    1158  /*
    1159  Parameters:
    1160  model_compass - [out]
    1161  A plane in model coordinates whose xaxis points East,
    1162  yaxis points North and zaxis points up. The origin
    1163  is set to m_model_basepoint.
    1164  */
    1165  bool GetModelCompass(
    1166  ON_Plane& model_compass
    1167  ) const;
    1168 
    1169  /*
    1170  Description:
    1171  Get a transformation from model coordinates to earth coordinates.
    1172  This transformation assumes the model is small enough that
    1173  the curvature of the earth can be ignored.
    1174  Parameters:
    1175  model_unit_system - [in]
    1176  model_to_earth - [out]
    1177  Transformation from model coordinates to earth locations
    1178  (degrees latitude,degrees longitude,elevation in meters)
    1179  Remarks:
    1180  If M is a point in model coordinates and E = model_to_earth*M,
    1181  then
    1182  E.x = latitude in decimal degrees
    1183  E.y = longitude in decimal degrees
    1184  E.z = elevation in meters above mean sea level
    1185 
    1186  Because the earth is not flat, there is a small amount of error
    1187  when using a linear transformation to calculate oblate spherical
    1188  coordinates. This error is small. If the distance from P to M
    1189  is d meters, then the approximation error is
    1190 
    1191  latitude error <=
    1192  longitude error <=
    1193  elevation error <= 6379000*((1 + (d/6356000)^2)-1) meters
    1194 
    1195  In particular, if every point in the model is within 1000 meters of
    1196  the m_model_basepoint, then the maximum approximation errors are
    1197 
    1198  latitude error <=
    1199  longitude error <=
    1200  elevation error <= 8 centimeters
    1201  */
    1202  bool GetModelToEarthXform(
    1203  const ON_UnitSystem& model_unit_system,
    1204  ON_Xform& model_to_earth
    1205  ) const;
    1206 };
    1207 
    1208 
    1209 
    1210 class ON_CLASS ON_3dmIOSettings
    1211 {
    1212 public:
    1213  ON_3dmIOSettings() = default;
    1214  ~ON_3dmIOSettings() = default;
    1215  ON_3dmIOSettings(const ON_3dmIOSettings&) = default;
    1216  ON_3dmIOSettings& operator=(const ON_3dmIOSettings&) = default;
    1217 
    1219 
    1220  bool Read(ON_BinaryArchive&);
    1221  bool Write(ON_BinaryArchive&) const;
    1222 
    1223  // bitmaps associated with rendering materials
    1224  bool m_bSaveTextureBitmapsInFile = false;
    1225 
    1226  // As of 7 February 2012, the m_idef_link_update setting
    1227  // controls if, when and how linked and linked_and_embedded
    1228  // instance defintions are updated when the source archive
    1229  // that was used to create the idef has changed.
    1230  int m_idef_link_update = 1;
    1231  // 1 = prompt - ask the user if the idef should be updated.
    1232  // 2 = always update - no prompting
    1233  // 3 = never update - no prompting
    1234  // Any value not equal to 1,2 or 3 shall be treated as 1.
    1235 };
    1236 
    1237 //////////////////////////////////////////////////////////////////////////////////////////
    1238 //
    1239 // ON_3dmSettings
    1240 //
    1241 
    1242 class ON_CLASS ON_3dmSettings
    1243 {
    1244 public:
    1245  ON_3dmSettings() = default;
    1246  ~ON_3dmSettings() = default;
    1247 
    1248  ON_3dmSettings(const ON_3dmSettings&) = default;
    1249  ON_3dmSettings& operator=(const ON_3dmSettings&) = default;
    1250 
    1251  static const ON_3dmSettings Default;
    1252 
    1253  bool Read(ON_BinaryArchive&);
    1254  bool Write(ON_BinaryArchive&) const;
    1255 
    1256  void Dump( ON_TextLog& ) const;
    1257 
    1258  // model URL (can be empty)
    1260 
    1261  // Model basepoint is used when the file is read as
    1262  // an instance definition and is the point that is
    1263  // mapped to the origin in the instance definition.
    1264  ON_3dPoint m_model_basepoint = ON_3dPoint::Origin;
    1265 
    1266  // If set, this is the model's location on the earth.
    1267  // This information is used when the model is used
    1268  // with GIS information.
    1270 
    1271  // Model space tolerances and unit system
    1273 
    1274  // Page space (printing/paper) tolerances and unit system
    1276 
    1277  // settings used for automatically created rendering meshes
    1279 
    1280  // saved custom settings
    1282 
    1283  /*
    1284  Returns:
    1285  ON_MeshParameters::render_mesh_fast
    1286  m_RenderMeshSettings and ON_MeshParameters::FastRenderMesh have
    1287  the same mesh geometry parameter settings.
    1288  ON_MeshParameters::render_mesh_quality
    1289  m_RenderMeshSettings and ON_MeshParameters::QualityRenderMesh have
    1290  the same mesh geometry parameter settings.
    1291  ON_MeshParameters::render_mesh_custom
    1292  m_RenderMeshSettings and m_CustomRenderMeshSettings have
    1293  the same mesh geometry parameter settings.
    1294  no_match_found_result
    1295  otherwise
    1296  */
    1297  ON_MeshParameters::MESH_STYLE RenderMeshStyle(
    1298  ON_MeshParameters::MESH_STYLE no_match_found_result
    1299  ) const;
    1300 
    1301  // settings used for automatically created analysis meshes
    1303 
    1304  // settings used when annotation objects are created
    1306 
    1309  ON_ClassArray<ON_3dmView> m_views; // current viewports
    1310  ON_UUID m_active_view_id = ON_nil_uuid; // id of "active" viewport
    1311 
    1312  // These fields determine what layer, material, color, line style, and
    1313  // wire density are used for new objects.
    1314 
    1315 public:
    1316  void SetCurrentLayerId(
    1317  ON_UUID layer_id
    1318  );
    1319  void SetV5CurrentLayerIndex(
    1320  int V5_current_layer_index
    1321  );
    1322  int CurrentLayerIndex() const;
    1323  ON_UUID CurrentLayerId() const;
    1324 private:
    1325  // The index is for reading V5 and earlier files.
    1326  int m_V5_current_layer_index = ON_UNSET_INT_INDEX;
    1327  ON_UUID m_current_layer_id = ON_nil_uuid;
    1328 
    1329 public:
    1330  void SetCurrentMaterialId(
    1331  ON_UUID material_id
    1332  );
    1333  int CurrentMaterialIndex() const;
    1334  ON_UUID CurrentMaterialId() const;
    1335 private:
    1336  // The index is for reading V5 and earlier files.
    1337  int m_V5_current_render_material_index = ON_UNSET_INT_INDEX;
    1338  ON_UUID m_current_render_material_id = ON_nil_uuid;
    1339 
    1340 public:
    1341  ON::object_material_source m_current_material_source = ON::material_from_layer;
    1342 
    1343  ON_Color m_current_color = ON_Color::Black;
    1344  ON::object_color_source m_current_color_source = ON::color_from_layer;
    1345 
    1346  ON_Color m_current_plot_color = ON_Color::UnsetColor;
    1347  ON::plot_color_source m_current_plot_color_source = ON::plot_color_from_layer;
    1348 
    1349 public:
    1350  void SetCurrentLinePatternId(
    1351  ON_UUID line_pattern_id
    1352  );
    1353  int CurrentLinePatternIndex() const;
    1354  ON_UUID CurrentLinePatternId() const;
    1355 private:
    1356  // The index is for reading V5 and earlier files.
    1357  int m_V5_current_line_pattern_index = ON_UNSET_INT_INDEX;
    1358  ON_UUID m_current_line_pattern_id = ON_nil_uuid;
    1359 
    1360 public:
    1361  ON::object_linetype_source m_current_linetype_source = ON::linetype_from_layer;
    1362 
    1363 public:
    1364  void SetCurrentTextStyleId(
    1365  ON_UUID text_style_id
    1366  );
    1367  int CurrentTextStyleIndex() const;
    1368  ON_UUID CurrentTextStyleId() const;
    1369 private:
    1370  // The index is for reading V5 and earlier files.
    1371  int m_V5_current_text_style_index = ON_UNSET_INT_INDEX;
    1372  ON_UUID m_current_text_style_id = ON_nil_uuid;
    1373 
    1374 public:
    1375  void SetCurrentDimensionStyleId(
    1376  ON_UUID dimension_style_id
    1377  );
    1378  int CurrentDimensionStyleIndex() const;
    1379  ON_UUID CurrentDimensionStyleId() const;
    1380 private:
    1381  // The index is for reading V5 and earlier files.
    1382  int m_V5_current_dimension_style_index = ON_UNSET_INT_INDEX;
    1383  ON_UUID m_current_dimension_style_id = ON_nil_uuid;
    1384 
    1385 public:
    1386  void SetCurrentHatchPatternId(
    1387  ON_UUID hatch_pattern_id
    1388  );
    1389  ON_UUID CurrentHatchPatternId() const;
    1390 private:
    1391  ON_UUID m_current_hatch_pattern_id = ON_nil_uuid;
    1392 
    1393 public:
    1394  // Surface wireframe density
    1395  //
    1396  // @untitled table
    1397  // 0 boundary + "knot" wires
    1398  // 1 boundary + "knot" wires + 1 interior wire if no interior "knots"
    1399  // N>=2 boundry + "knot" wires + (N-1) interior wires
    1400  int m_current_wire_density = 1;
    1401 
    1403 
    1404  // default settings for construction plane grids
    1406 
    1407  // World scale factor to apply to non-solid linetypes
    1408  // for model display. For plotting, the linetype settings
    1409  // are used without scaling.
    1410  double m_linetype_display_scale = 1.0;
    1411 
    1412  // Plugins that were loaded when the file was saved.
    1414 
    1416 private:
    1417  bool Read_v1(ON_BinaryArchive&);
    1418  bool Read_v2(ON_BinaryArchive&);
    1419  bool Write_v1(ON_BinaryArchive&) const;
    1420  bool Write_v2(ON_BinaryArchive&) const;
    1421 };
    1422 
    1423 #endif
    double m_width
    Definition: opennurbs_3dm_settings.h:421
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_3DM_SETTINGS_INC_)
    18 #define OPENNURBS_3DM_SETTINGS_INC_
    19 
    20 
    21 ///////////////////////////////////////////////////////////////////////
    22 //
    23 // units and tolerances
    24 //
    25 
    27 {
    28 public:
    29  // The default constructor set units to millimeters and tolerance = 0.001mm
    30  ON_3dmUnitsAndTolerances() = default;
    31  ~ON_3dmUnitsAndTolerances() = default;
    32 
    34  ON_3dmUnitsAndTolerances& operator=(const ON_3dmUnitsAndTolerances&) = default;
    35 
    36  bool Read( ON_BinaryArchive& );
    37  bool Write( ON_BinaryArchive& ) const;
    38 
    39  void Dump( ON_TextLog& ) const;
    40 
    41  /*
    42  Returns:
    43  True if tolerances (m_absolute_tolerance, m_angle_tolerance, m_relative_tolerance)
    44  are set to valid values.
    45  */
    46  bool TolerancesAreValid() const;
    47 
    48  /*
    49  Description:
    50  If m_absolute_tolerance is not set to a valid value, it is set
    51  to ON_3dmUnitsAndTolerances::DefaultValue.m_absolute_tolerance.
    52  If m_angle_tolerance is not set to a valid value, it is set
    53  to ON_3dmUnitsAndTolerances::DefaultValue.m_angle_tolerance.
    54  If m_relative_tolerance is not set to a valid value, it is set
    55  to ON_3dmUnitsAndTolerances::DefaultValue.m_relative_tolerance.
    56  Returns:
    57  0: all tolerances were valid
    58  0 != (rc & 1):
    59  m_absolute_tolerance was invalid and set to the default value
    60  0 != (rc & 2):
    61  m_angle_tolerance was invalid and set to the default value
    62  0 != (rc & 4):
    63  m_relative_tolerance was invalid and set to the default value
    64  */
    65  unsigned int SetInvalidTolerancesToDefaultValues();
    66 
    67  //////////
    68  // Returns scale factor that needs to be applied to change from
    69  // the argument's unit system to m_unit_system.
    70  // When m_unit_system is not ON::LengthUnitSystem::CustomUnits,
    71  // Scale(us) = ON::UnitScale(us,m_unit_system). When Scale(us)
    72  // When m_unit_system is ON::LengthUnitSystem::CustomUnits,
    73  // Scale(us) = ON::UnitScale(us,ON::LengthUnitSystem::Meters)*m_custom_unit_scale.
    74  double Scale( ON::LengthUnitSystem ) const;
    75 
    77 
    78  double m_absolute_tolerance = 0.001; // in units > 0.0
    79  double m_angle_tolerance = ON_PI/180.0; // in radians > 0.0 and <= ON_PI
    80  double m_relative_tolerance = 0.01; // fraction > 0.0 and < 1.0
    81 
    82  ON::OBSOLETE_DistanceDisplayMode m_distance_display_mode = ON::OBSOLETE_DistanceDisplayMode::Decimal; // decimal or fractional
    83  int m_distance_display_precision = 3; // decimal mode: number of decimal places
    84  // fractional modes:
    85  // denominator = (1/2)^m_distance_display_precision
    86 
    87 public:
    88  /*
    89  DefaultValue
    90  m_unit_system ON::LengthUnitSystem::Millimeters
    91  m_absolute_tolerance 0.001
    92  m_angle_tolerance pi/180 = 1 degree
    93  m_relative_tolerance 0.01 = 1%
    94  m_distance_display_mode ON::OBSOLETE_DistanceDisplayMode::Decimal
    95  m_distance_display_precision 3
    96  */
    98 };
    99 
    100 ///////////////////////////////////////////////////////////////////////
    101 //
    102 // Model settings
    103 // render mesh defaults
    104 // viewports
    105 // construction planes
    106 //
    107 
    109 {
    110 public:
    111  ON_3dmAnnotationSettings() = default;
    112  ~ON_3dmAnnotationSettings() = default;
    114  ON_3dmAnnotationSettings& operator=(const ON_3dmAnnotationSettings&) = default;
    115 
    117 
    118  bool Read( ON_BinaryArchive& );
    119  bool Write( ON_BinaryArchive& ) const;
    120 
    121  void Dump( ON_TextLog& text_log ) const;
    122 
    123  // these are the running defaults for making dimensions
    124  // they are also the things written to the 3dm file as dimension settings
    125  double m_dimscale = 1.0; // model size / plotted size
    126  double m_textheight = 1.0;
    127  double m_dimexe = 1.0;
    128  double m_dimexo = 1.0;
    129  double m_arrowlength = 1.0;
    130  double m_arrowwidth = 1.0;
    131  double m_centermark = 1.0;
    132 
    133  /*
    134  Returns:
    135  Value of m_world_view_text_scale;
    136  */
    137  double WorldViewTextScale() const;
    138 
    139  /*
    140  Parameters:
    141  world_view_text_scale - [in]
    142  Sets value of m_world_view_text_scale.
    143  */
    144  void SetWorldViewTextScale(double world_view_text_scale );
    145 
    146  /*
    147  Returns:
    148  Value of m_world_view_hatch_scale;
    149  */
    150  double WorldViewHatchScale() const;
    151 
    152  /*
    153  Parameters:
    154  world_view_hatch_scale - [in]
    155  Sets value of m_world_view_hatch_scale.
    156  */
    157  void SetWorldViewHatchScale(double world_view_hatch_scale );
    158 
    159 
    160  /*
    161  Returns:
    162  Value of m_b_V5_EnableAnnotationScaling;
    163  */
    164  bool Is_V5_AnnotationScalingEnabled() const;
    165 
    166  /*
    167  Parameters:
    168  bEnable - [in]
    169  Sets value of m_b_V5_EnableAnnotationScaling.
    170  */
    171  void Enable_V5_AnnotationScaling(bool bEnable);
    172 
    173  /*
    174  Parameters:
    175  bEnable - [in]
    176  Sets value of m_bEnableModelSpaceAnnotationScaling.
    177  */
    178  void EnableModelSpaceAnnotationScaling(bool bEnable);
    179 
    180  /*
    181  Returns:
    182  Value of m_bEnableModelSpaceAnnotationScaling;
    183  */
    184  bool IsModelSpaceAnnotationScalingEnabled() const;
    185 
    186  /*
    187  Parameters:
    188  bEnable - [in]
    189  Sets value of m_bEnableLayoutSpaceAnnotationScaling.
    190  */
    191  void EnableLayoutSpaceAnnotationScaling(bool bEnable);
    192 
    193  /*
    194  Returns:
    195  Value of m_bEnableLayoutSpaceAnnotationScaling;
    196  */
    197  bool IsLayoutSpaceAnnotationScalingEnabled() const;
    198 
    199  /*
    200  Returns:
    201  Value of m_bEnableHatchScaling;
    202  */
    203  bool IsHatchScalingEnabled() const;
    204 
    205  /*
    206  Parameters:
    207  bEnable - [in]
    208  Sets value of m_bEnableHatchScaling.
    209  */
    210  void EnableHatchScaling( bool bEnable );
    211 
    212  // Present but not used in V4 or V5 - removed 5 August 2010 to make room
    213  // for m_world_view_text_scale and m_bEnableAnnotationScaling
    214  //// added 12/28/05 LW
    215  //double m_dimdle;
    216  //double m_dimgap;
    217 private:
    218  // If m_bEnableAnnotationScaling is true,
    219  // and ON_OBSOLETE_V5_Annotation::m_annotative_scale is true,
    220  // and ON_OBSOLETE_V5_Annotation::m_type == ON::dtTextBlock,
    221  // and the text object is being displayed in a world
    222  // view (not a detail view and not a page view),
    223  // then the text will be scaled by m_world_view_text_scale.
    224  // The default is 1.0. Values <= 0.0 are not valid.
    225  float m_world_view_text_scale = 1.0f;
    226  float m_world_view_hatch_scale = 1.0f;
    227 
    228 private:
    229  // If m_bEnableAnnotationScaling is false:
    230  // * m_world_view_text_scale is ignored.
    231  // * text is not scaled.
    232  // * ON_DimStyle::DimScale() determines the scale
    233  // applied to all other annotation objects in all
    234  // types of views.
    235  // * The value of ON_DetailView::m_page_per_model_ratio
    236  // is applied to all objects (annotation and geometry)
    237  // in the detail view.
    238  //
    239  // If m_bEnableAnnotationScaling is true:
    240  // * m_world_view_text_scale is used as described above.
    241  // * ON_DimStyle::DimScale() determines the scale
    242  // applied to all non text annotation objects in
    243  // world views.
    244  // * ON_DimStyle::DimScale() is ignored in page and
    245  // detail views.
    246  // * ON_DetailView::m_page_per_model_ratio is ingored
    247  // for annotation objects in detail views, other
    248  // geometry is scaled.
    249  //
    250  // Default is true.
    251  unsigned char m_b_V5_EnableAnnotationScaling = 1;
    252 
    253  // [Lowell 3-28-2013] New fields for V6
    254  unsigned char m_bEnableModelSpaceAnnotationScaling = 1;
    255  unsigned char m_bEnableLayoutSpaceAnnotationScaling = 1;
    256 
    257  unsigned char m_bEnableHatchScaling = 1;
    258 
    259 private:
    260  ON__UINT32 m_reserved1 = 0;
    261  ON__UINT8 m_reserved2 = 0;
    262  ON__UINT8 m_reserved3 = 0;
    263  ON__UINT8 m_reserved4 = 0;
    264 
    265 public:
    266  ON::LengthUnitSystem m_dimunits = ON::LengthUnitSystem::None; // units used to measure the dimension
    267  int m_arrowtype = 0; // 0: filled narrow triangular arrow (= ((ON_Arrowhead::arrow_type enum value as int ) - 2))
    268  int m_angularunits = 0; // 0: degrees, 1: radians
    269  int m_lengthformat = 0; // 2 = ON_DimStyle::LengthDisplay::FeetAndInches, treat everything else as ON_DimStyle::LengthDisplay::ModelUnits
    270  int m_angleformat = 0; // 0: decimal degrees, ... ( ON_DimStyle::angle_format enum as int )
    271 
    272  //ON_INTERNAL_OBSOLETE::V5_TextDisplayMode m_settings_textalign; // In V2 files - 0: above line, 1: in line, 2: horizontal
    273  // // After V2 files - 0: normal (converts to above_line), 1: horizontal, 2: above_line, 3: in_line
    274 
    275  int m_resolution = 0; // depends on m_lengthformat
    276  // for decimal, digits past the decimal point
    277 
    278  ON_wString m_facename; // [LF_FACESIZE] // windows font name
    279 };
    280 
    281 //////////////////////////////////////////////////////////////////////////////////////////
    282 //
    283 // ON_3dmConstructionPlaneGridDefaults
    284 //
    285 // Default settings used for construction plane grids
    287 {
    288 public:
    293 
    295 
    296  bool Write( ON_BinaryArchive& ) const;
    297  bool Read( ON_BinaryArchive& );
    298 
    299  void Dump( ON_TextLog& text_log ) const;
    300 
    301  double m_grid_spacing = 1.0; // distance between grid lines
    302  double m_snap_spacing = 1.0; // when "grid snap" is enabled, the
    303  // distance between snap points. Typically
    304  // this is the same distance as grid spacing.
    305  int m_grid_line_count = 70; // number of grid lines in each direction
    306  int m_grid_thick_frequency = 5; // thick line frequency
    307  // 0: none,
    308  // 1: all lines are thick,
    309  // 2: every other is thick, ...
    310 
    311  bool m_bShowGrid = true;
    312  bool m_bShowGridAxes = true;
    313  bool m_bShowWorldAxes = true;
    314 };
    315 
    316 //////////////////////////////////////////////////////////////////////////////////////////
    317 //
    318 // ON_3dmConstructionPlane
    319 //
    321 {
    322 public:
    325 
    326  ON_3dmConstructionPlane(const ON_Plane& plane);
    327 
    328  // default copy constructor and operator= work fine
    329  //ON_3dmConstructionPlane(const ON_3dmConstructionPlane&);
    330  //ON_3dmConstructionPlane& operator=(const ON_3dmConstructionPlane&);
    331 
    332  void Default();
    333 
    334  bool Write( ON_BinaryArchive& ) const;
    335  bool Read( ON_BinaryArchive& );
    336 
    337  void Dump( ON_TextLog& text_log ) const;
    338 
    340 
    341  // construction grid appearance
    342  double m_grid_spacing; // distance between grid lines
    343  double m_snap_spacing; // when "grid snap" is enabled, the
    344  // distance between snap points. Typically
    345  // this is the same distance as grid spacing.
    346  int m_grid_line_count; // number of grid lines in each direction
    347  int m_grid_thick_frequency; // thick line frequency
    348  // 0: none,
    349  // 1: all lines are thick,
    350  // 2: every other is thick, ...
    351  bool m_bDepthBuffer; // false=grid is always drawn behind 3d geometry
    352  // true=grid is drawn at its depth as a 3d plane
    353  // and grid lines obscure things behind the grid.
    354 
    356 };
    357 
    358 #if defined(ON_DLL_TEMPLATE)
    359 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_3dmConstructionPlane>;
    360 #endif
    361 
    362 //////////////////////////////////////////////////////////////////////////////////////////
    363 //
    364 // ON_3dmViewPosition
    365 //
    366 class ON_CLASS ON_3dmViewPosition
    367 {
    368 public:
    369  // view window relative position and state in parent frame
    373  ON_3dmViewPosition& operator=(const ON_3dmViewPosition&);
    374 
    375  void Default();
    376 
    377  bool Write( ON_BinaryArchive& ) const;
    378  bool Read( ON_BinaryArchive& );
    379 
    380  // relative position of view window in main frame
    381  // if m_floating_viewport>0, this is relative position of the view window
    382  // on the virtual screen (union of potentially multiple monitors)
    383  double m_wnd_left; // 0.0 to 1.0
    384  double m_wnd_right;
    385  double m_wnd_top;
    386  double m_wnd_bottom;
    387 
    388  bool m_bMaximized; // true if view window is maximized
    389 
    390  // m_floating_viewport is used to track floating viewport information.
    391  // 0 = the view is docked in the main application window.
    392  // >0 = the view is floating. When floating, this corresponds to the
    393  // number of monitors on on the user's computer when the file was saved
    394  unsigned char m_floating_viewport;
    395 private:
    396  // reserved for future use
    397  unsigned char m_reserved_1;
    398  unsigned char m_reserved_2;
    399  unsigned char m_reserved_3;
    400 };
    401 
    402 //////////////////////////////////////////////////////////////////////////////////////////
    403 //
    404 // ON_3dmViewTraceImage
    405 //
    406 class ON_CLASS ON_3dmViewTraceImage
    407 {
    408 public:
    411  bool operator==( const ON_3dmViewTraceImage& ) const;
    412  bool operator!=( const ON_3dmViewTraceImage& ) const;
    413 
    414  void Default();
    415 
    416  bool Write( ON_BinaryArchive& ) const;
    417  bool Read( ON_BinaryArchive& );
    418 
    419  // view window relative position and state in parent frame
    421  double m_width;
    422  double m_height;
    423 
    425 
    426  bool m_bGrayScale; // true if image should be black and white
    427  bool m_bHidden; // true if image is currently hidden from view
    428  bool m_bFiltered; // true if image should be filtered (bilinear) before displayed.
    429 };
    430 
    431 
    432 //////////////////////////////////////////////////////////////////////////////////////////
    433 //
    434 // ON_3dmViewTraceImage
    435 //
    436 class ON_CLASS ON_3dmWallpaperImage
    437 {
    438 public:
    441  bool operator==( const ON_3dmWallpaperImage& ) const;
    442  bool operator!=( const ON_3dmWallpaperImage& ) const;
    443 
    444  void Default();
    445 
    446  bool Write( ON_BinaryArchive& ) const;
    447  bool Read( ON_BinaryArchive& );
    448 
    450 
    451  bool m_bGrayScale; // true if image should be black and white
    452  bool m_bHidden; // true if image is currently hidden from view
    453 };
    454 
    455 //////////////////////////////////////////////////////////////////////////////////////////
    456 //
    457 // ON_3dmView
    458 //
    459 
    460 class ON_CLASS ON_3dmPageSettings
    461 {
    462 public:
    465 
    466  bool IsValid( ON_TextLog* text_log = 0 ) const;
    467 
    468  void Default();
    469 
    471 
    472  // Overall size of the page in millimeters
    473  double m_width_mm;
    474  double m_height_mm;
    475 
    476  // Page margins in millimeters
    481 
    483 
    484  bool Write(ON_BinaryArchive& archive) const;
    485  bool Read(ON_BinaryArchive& archive);
    486 };
    487 
    489 {
    490 public:
    491  static const ON_UUID Wireframe; // {1311ADCB-D89E-4051-A3F0-F64441FB8EC6}
    492  static const ON_UUID Shaded; // {8BC8DEBE-C83B-4c47-B13C-9DB074510CAC}
    493  static const ON_UUID Rendered; // {CAE60BAE-2D51-4299-ABF7-A339FCA86F3B}
    494  static const ON_UUID Ghosted; // {FF608B97-81D3-4186-831C-41F7DC140881}
    495  static const ON_UUID XrayShade; // {B5C19D5D-0AEC-4ff7-A10E-E052E660263A}
    496  static const ON_UUID RenderedShadows; // {A5545314-9D87-428d-95AE-91052EEAD0FA}
    497  static const ON_UUID Technical; // {63612C72-778F-4afd-B81B-17426FDFE8A6}
    498  static const ON_UUID Artistic; // {B46AB226-05A0-4568-B454-4B1AB721C675}
    499  static const ON_UUID Pen; // {F4616FA5-A831-4620-A97E-9B807D5EC376}
    500  static const ON_UUID AmbientOcclusion; // {C32B72C3-41BD-4ADC-82A8-B7AEF4456A37}
    501  static const ON_UUID Raytraced; // {69E0C7A5-1C6A-46C8-B98B-8779686CD181}
    502 
    503  /*
    504  Parameters:
    505  id - [in]
    506  Returns:
    507  True if id is one of the standard display modes listed above.
    508  */
    509  static bool IsStandardDisplayModeId(
    510  ON_UUID id
    511  );
    512 
    513  /*
    514  Parameters:
    515  id - [in]
    516  Returns:
    517  The legacy V3 display mode enum that is the closest match to
    518  the display mode id.
    519  */
    520  static ON::v3_display_mode ToV3DisplayMode(
    521  ON_UUID id
    522  );
    523 
    524  /*
    525  Parameters:
    526  dm - [in]
    527  v3 display mode enum value
    528  Returns:
    529  display mode id that corresponds to the enum value.
    530  */
    531  static ON_UUID FromV3DisplayMode(
    532  ON::v3_display_mode dm
    533  );
    534 
    535 
    536 private:
    537  // prohibit instantiation
    538  ON_StandardDisplayModeId(); // no implementation
    539  ~ON_StandardDisplayModeId(); // no implementation
    540 };
    541 
    542 enum class ON_FocalBlurModes : unsigned int
    543 {
    544  None, // No focal blur.
    545  Automatic, // Autofocus on selected objects.
    546  Manual, // Fully manual focus.
    547 };
    548 
    549 class ON_CLASS ON_3dmView
    550 {
    551 public:
    552  ON_3dmView();
    553  ~ON_3dmView();
    554 
    555  // The C++ default copy constructor and operator= work fine.
    556  // Do not provide customized versions.
    557  // NO // ON_3dmView(const ON_3dmView&);
    558  // NO // ON_3dmView& operator=(const ON_3dmView&);
    559 
    560  void Default();
    561 
    562  bool Write( ON_BinaryArchive& ) const;
    563  bool Read( ON_BinaryArchive& );
    564 
    565  void Dump( ON_TextLog& text_log ) const;
    566 
    567  bool IsValid( ON_TextLog* text_log = 0 ) const;
    568 
    569  // view projection information
    571 
    572  // clipping planes
    573  // Prior to Dec 14, 2010 m_clipping_planes was not saved with the view.
    574  // After Dec 14, 2010 m_clipping_planes is saved.
    576 
    577  // If true, the the camera location, camera direction,
    578  // and lens angle should not be changed.
    579  // It is ok to adjust clipping planes.
    581 
    582  ///////////////////////////////////////////////////////////////////////
    583  //
    584  // target point
    585  //
    586 
    587  /*
    588  Returns:
    589  Target point. This point is saved on m_vp.m_target_point.
    590  The default constructor sets the target point to
    591  ON_3dPoint::UnsetPoint. You must explicitly set the target
    592  point if you want to use it.
    593  Remarks:
    594  The target point is stored on m_vp.m_target_point. The
    595  value ON_3dmView.m_target is obsolete. This function always
    596  returns the value of m_vp.m_target_point.
    597 
    598  */
    599  ON_3dPoint TargetPoint() const;
    600 
    601  /*
    602  Description:
    603  Sets the viewport target point.
    604  Parameters:
    605  target_point - [in]
    606  When in doubt, the point m_vp.FrustumCenterPoint(ON_UNSET_VALUE)
    607  is a good choice.
    608  Remarks:
    609  This point is saved on m_vp.m_target_point.
    610  */
    611  bool SetTargetPoint(ON_3dPoint target_point);
    612 
    613  //
    614  ///////////////////////////////////////////////////////////////////////
    615 
    616  ON_wString m_name; // name on window
    617 
    618  // The value of m_display_mode_id can be one of the "standard" ids
    619  // from ON_StandardDisplayModeId, nil, or a custom display mode
    620  // settings on a particular computer. If you encounter a nil id
    621  // or any other id that is not one of the "standard" display mode
    622  // ids, then your application should use a default display mode,
    623  // typically either wireframe or shaded, that is appropriate for
    624  // general model viewing. The function ON::RhinoV3DisplayMode(id)
    625  // will convert a display mode id into a legacy Rhino V3 display
    626  // mode enum value.
    628 
    629  // position of view in parent window
    630  // (relative display device coordinates)
    632 
    633  ON::view_type m_view_type; // model, page, or nested
    634 
    635  // If m_view_type == ON::page_view_type, then the m_page_settings
    636  // records the page size. Otherwise, m_page_settings should
    637  // be ignored.
    639 
    640  ///////////////////////////////////////////////////////////////////////
    641  //
    642  // Named view information
    643  //
    644  // If this view was created from a named view, then m_named_view_id
    645  // identifies the named view.
    646  //
    647  // The named views are ON_3dmView classes saved in ON_3dmSettings.m_named_views[].
    648  // A named view's id is the value returned by ON_3dmView.m_vp.ViewportId()
    649  // A named view's name is the value returned by ON_3dmView.m_name
    650  //
    651  // If this view is a named view, then m_named_view_id should be equal to
    652  // m_vp.m_viewport_id.
    653  //
    654  // If this view is not a named view and not created from a named view,
    655  // then m_named_view_id is equal to ON_nil_uuid.
    657 
    658  ///////////////////////////////////////////////////////////////////////
    659  //
    660  // Construction plane
    661  //
    666 
    667  // world axes icon
    669 
    670  // tracing image
    672 
    673  // wallpaper image
    675 
    676 public:
    677 
    678  double FocalBlurDistance(void) const;
    679  void SetFocalBlurDistance(double d);
    680 
    681  double FocalBlurAperture(void) const;
    682  void SetFocalBlurAperture(double d);
    683 
    684  double FocalBlurJitter(void) const;
    685  void SetFocalBlurJitter(double d);
    686 
    687  unsigned int FocalBlurSampleCount(void) const;
    688  void SetFocalBlurSampleCount(unsigned int count);
    689 
    690  ON_FocalBlurModes FocalBlurMode(void) const;
    691  void SetFocalBlurMode(ON_FocalBlurModes m);
    692 
    693  ON_2iSize RenderingSize() const;
    694  void SetRenderingSize(const ON_2iSize& size);
    695 
    696  //Focal blur settings - per view for renderers.
    697 private:
    698  double m_dFocalBlurDistance = 100.0;
    699  double m_dFocalBlurAperture = 64.0;
    700  double m_dFocalBlurJitter = 0.1;
    701  unsigned int m_uFocalBlurSampleCount = 10;
    702  ON_FocalBlurModes m_FocalBlurMode = ON_FocalBlurModes::None;
    703  ON_2iSize m_sizeRendering = ON_2iSize(640, 480);
    704 
    705 private:
    706  ON__INT_PTR reserved = 0;
    707 };
    708 
    709 #if defined(ON_DLL_TEMPLATE)
    710 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_3dmView>;
    711 #endif
    712 
    713 //////////////////////////////////////////////////////////////////////////////////////////
    714 //
    715 // ON_3dmRenderSettings
    716 //
    717 
    718 class ON_CLASS ON_3dmRenderSettings : public ON_Object
    719 {
    720  ON_OBJECT_DECLARE(ON_3dmRenderSettings);
    721 
    722 public:
    723  ON_3dmRenderSettings() = default;
    724  ~ON_3dmRenderSettings() = default;
    725  ON_3dmRenderSettings(const ON_3dmRenderSettings&) = default;
    726  ON_3dmRenderSettings& operator=(const ON_3dmRenderSettings&) = default;
    727 
    729 
    730  bool Write( ON_BinaryArchive& ) const override;
    731  bool Read( ON_BinaryArchive& ) override;
    732  void Dump( ON_TextLog& text_log ) const override;
    733 
    734 private:
    735  static bool UseV5ReadWrite(const ON_BinaryArchive&);
    736  bool WriteV5( ON_BinaryArchive& ) const;
    737  bool ReadV5( ON_BinaryArchive& );
    738 
    739 public:
    740  //New for V6, rendering source (render directly from a NamedView or Snapshot)
    741  //https://mcneel.myjetbrains.com/youtrack/issue/RH-39593
    742  enum class RenderingSources : unsigned int
    743  {
    744  ActiveViewport, // Get the rendering view from the currently active viewport (as in all previous versions of Rhino)
    745  SpecificViewport, // Get the rendering view from the named viewport (see NamedViewport below)
    746  NamedView, // Get the rendering view from a specific named view (see NamedView below)
    747  SnapShot, // Before rendering, restore the Snapshot specified in Snapshot below, then render.
    748  };
    749 
    750  RenderingSources RenderingSource(void) const;
    751  void SetRenderingSource(RenderingSources);
    752 
    753  ON_wString SpecificViewport(void) const;
    754  void SetSpecificViewport(const ON_wString&);
    755 
    756  ON_wString NamedView(void) const;
    757  void SetNamedView(const ON_wString&);
    758 
    759  ON_wString Snapshot(void) const;
    760  void SetSnapshot(const ON_wString&);
    761 
    762 private:
    763  RenderingSources m_rendering_source = RenderingSources::ActiveViewport;
    764  ON_wString m_specific_viewport;
    765  ON_wString m_named_view;
    766  ON_wString m_snapshot;
    767 
    768 public:
    769  bool ScaleBackgroundToFit() const;
    770  void SetScaleBackgroundToFit( bool bScaleBackgroundToFit );
    771 
    772 private:
    773  unsigned short m_reserved1 = 0;
    774 
    775 public:
    776  //////////////////////////////////////////////////////////////
    777  //
    778  // Force viewport aspect ratio:
    779  // If m_bCustomImageSize is true and m_bForceViewportAspectRatio is true
    780  // then the image height should be calculated by multiplying the m_image_width
    781  // by the viewport aspect ratio. Note that this might be affected by m_rendering_source
    782  // In this case, m_image_height should not be used.
    783  //
    784  bool m_bForceViewportAspectRatio = false;
    785  //////////////////////////////////////////////////////////////
    786  //
    787  // Custom image size:
    788  // If m_bCustomImageSize is true, then the image pixel size
    789  // is m_image_width X m_image_height pixels.
    790  // If m_bCustomImageSize is false, then the image pixel size
    791  // is the size of the viewport being rendered.
    792  //
    793  bool m_bCustomImageSize = false;
    794  int m_image_width = 800; // image width in pixels
    795  int m_image_height = 600; // image height in pixels
    796 
    797 private:
    798  unsigned int m_reserved3 = 0;
    799 public:
    800 
    801  ////////
    802  // Number of dots/inch (dots=pixels) to use when printing and
    803  // saving bitmaps. The default is 72.0 dots/inch.
    804  double m_image_dpi = 72.0;
    805 
    806  //////////
    807  // unit system to use when converting image pixel size and dpi
    808  // information into a print size. Default = inches
    809  ON::LengthUnitSystem m_image_us = ON::LengthUnitSystem::Inches;
    810 
    811  ON_Color m_ambient_light = ON_Color::Black;
    812 
    813  int m_background_style = 0; // 0 = solid color, 1 = "wallpaper" image, 2 = Gradient, 3 = Environment
    814 
    815  // m_background_color was changed from ON_Color::Gray160 to ON_Color::White for "white studio" look.
    816  // m_background_color = Top color of gradient...
    817  ON_Color m_background_color = ON_Color::White;
    818  ON_Color m_background_bottom_color = ON_Color::Gray160;
    819 
    820 
    822  // If m_background_bitmap_filename is not empty, the file cannot be found,
    823  // and m_embedded_file_id identifes an embedded image file in the model,
    824  // then that file will be used as the background bitmap.
    825  ON_UUID m_embedded_image_file_id = ON_nil_uuid;
    826 
    827  bool m_bUseHiddenLights = false;
    828 
    829  bool m_bDepthCue = false;
    830  bool m_bFlatShade = false;
    831 
    832  bool m_bRenderBackfaces = true;
    833  bool m_bRenderPoints = false;
    834  bool m_bRenderCurves = false;
    835  bool m_bRenderIsoparams = false;
    836  bool m_bRenderMeshEdges = false;
    837  bool m_bRenderAnnotation = false;
    838  bool m_bScaleBackgroundToFit = false;
    839  bool m_bTransparentBackground = false;
    840 
    841 private:
    842  unsigned char m_reserved4 = 0;
    843  unsigned int m_reserved5 = 0;
    844 public:
    845 
    846  int m_antialias_style = 1; // 0 = none, 1 = normal, 2 = medium, 3 = best
    847 
    848  int m_shadowmap_style = 1; // 0 = none, 1 = normal, 2 = best
    849  int m_shadowmap_width= 1000;
    850  int m_shadowmap_height = 1000;
    851  double m_shadowmap_offset = 0.75;
    852 
    853 
    854  // Flags that are used to determine which render settings a render
    855  // plugin uses, and which ones the display pipeline should use.
    856  // Note: Render plugins set these, and they don't need to persist
    857  // in the document...Also, when set, they turn OFF their
    858  // corresponding setting in the Display Attributes Manager's
    859  // UI pages for "Rendered" mode.
    860  bool m_bUsesAmbientAttr = true;
    861  bool m_bUsesBackgroundAttr = true;
    862  bool m_bUsesBackfaceAttr = false;
    863  bool m_bUsesPointsAttr = false;
    864  bool m_bUsesCurvesAttr = true;
    865  bool m_bUsesIsoparmsAttr = true;
    866  bool m_bUsesMeshEdgesAttr = false;
    867  bool m_bUsesAnnotationAttr = true;
    868  bool m_bUsesHiddenLightsAttr = true;
    869 
    870 private:
    871  unsigned char m_reserved6 = 0;
    872  unsigned short m_reserved7 = 0;
    873  unsigned short m_reserved8 = 0;
    874 
    875 private:
    876  ON__INT_PTR m_reserved9 = 0;
    877 };
    878 
    879 
    880 //////////////////////////////////////////////////////////////////////////////////////////
    881 //
    882 // ON_EarthAnchorPoint
    883 //
    884 
    885 class ON_CLASS ON_EarthAnchorPoint
    886 {
    887 public:
    888  ON_EarthAnchorPoint() = default;
    889  ~ON_EarthAnchorPoint() = default;
    890  ON_EarthAnchorPoint(const ON_EarthAnchorPoint&) = default;
    891  ON_EarthAnchorPoint& operator=(const ON_EarthAnchorPoint&) = default;
    892 
    893  // Latitude, longitude, and elevation are ON_UNSET_VALUE.
    895 
    896  // Latitude, longitude, and elevation are the Seattle Space Needle.
    898 
    899  static
    900  int Compare(
    901  const ON_EarthAnchorPoint*,
    902  const ON_EarthAnchorPoint*
    903  );
    904 
    905  static
    906  int CompareEarthLocation(
    907  const ON_EarthAnchorPoint*,
    908  const ON_EarthAnchorPoint*
    909  );
    910 
    911  static
    912  int CompareModelDirection(
    913  const ON_EarthAnchorPoint*,
    914  const ON_EarthAnchorPoint*
    915  );
    916 
    917  static
    918  int CompareIdentification(
    919  const ON_EarthAnchorPoint*,
    920  const ON_EarthAnchorPoint*
    921  );
    922 
    923  bool Read( ON_BinaryArchive& );
    924  bool Write( ON_BinaryArchive& ) const;
    925 
    926  /*
    927  Returns:
    928  True if the latitude, longitude, and elevation are set.
    929  */
    930  bool EarthLocationIsSet() const;
    931 
    932  /*
    933  Returns:
    934  True if model basepoint, north and east are set.
    935  */
    936  bool ModelLocationIsSet() const;
    937 
    938  /*
    939  Parameters:
    940  elevation_unit_system - [in]
    941  elevation - [in]
    942  */
    943  void SetEarthLocation(
    944  ON::EarthCoordinateSystem earth_coordinate_system,
    945  const class ON_UnitSystem& elevation_unit_system,
    946  double latitude_degrees,
    947  double longitude_degrees,
    948  double elevation
    949  );
    950 
    951  void SetEarthLocation(
    952  ON::EarthCoordinateSystem earth_coordinate_system,
    953  ON::LengthUnitSystem elevation_unit_system,
    954  double latitude_degrees,
    955  double longitude_degrees,
    956  double elevation
    957  );
    958 
    959  void SetLatitudeAndLongitude(
    960  double latitude_degrees,
    961  double longitude_degrees
    962  );
    963 
    964  /*
    965  Returns:
    966  A 3d point with coordinates (latitude in degrees, longitude in degrees, elevation in meters).
    967  Remarks:
    968  Some coordinates may be ON_UNSET_VALUE.
    969  */
    970  ON_3dPoint EarthLocation() const;
    971 
    972  /*
    973  Parameters:
    974  unset_location - [in]
    975  Location to return if EarlocationIsSet() is false.
    976  Returns:
    977  A 3d point with coordinates (latitude, longitude, elevation).
    978  */
    979  ON_3dPoint EarthLocation(
    980  ON_3dPoint unset_location
    981  ) const;
    982 
    983  /*
    984  Returns:
    985  Earth location latitude in degrees. Can be ON_UNSET_VALUE
    986  */
    987  double Latitude() const;
    988 
    989  /*
    990  Parameters:
    991  unset_latitude - [in]
    992  Value to return if the Earth location latitude is not set.
    993  Returns:
    994  Earth location latitude in degrees.
    995  */
    996  double Latitude(
    997  double unset_latitude
    998  ) const;
    999 
    1000  void SetLatitude(
    1001  double latitude_degrees
    1002  );
    1003 
    1004  /*
    1005  Returns:
    1006  Earth location longitude in degrees. Can be ON_UNSET_VALUE
    1007  */
    1008  double Longitude() const;
    1009 
    1010  /*
    1011  Parameters:
    1012  unset_longitude - [in]
    1013  Value to return if the Earth location latitude is not set.
    1014  Returns:
    1015  Earth location longitude in degrees.
    1016  */
    1017  double Longitude(
    1018  double unset_longitude
    1019  ) const;
    1020 
    1021  void SetLongitude(
    1022  double longitude_degrees
    1023  );
    1024 
    1025  /*
    1026  System used to define latiude, longitude and elevation.
    1027  */
    1028  ON::EarthCoordinateSystem EarthCoordinateSystem() const;
    1029 
    1030  /*
    1031  System used to define Earth latiude, longitude, and elevation coordinates.
    1032  */
    1033  void SetEarthCoordinateSystem(
    1034  ON::EarthCoordinateSystem earth_coordinate_system
    1035  );
    1036 
    1037  double ElevationInMeters() const;
    1038 
    1039 
    1040  /*
    1041  Parameters:
    1042  elevation_unit_system - [in]
    1043  length unit system for returned value.
    1044  Returns:
    1045  Earth location elevation in in elevation_unit_system.
    1046  The value is with
    1047  Can be ON_UNSET_VALUE
    1048  */
    1049  double Elevation(
    1050  const class ON_UnitSystem& elevation_unit_system
    1051  ) const;
    1052 
    1053  /*
    1054  Parameters:
    1055  elevation_unit_system - [in]
    1056  length unit system for returned value.
    1057  Returns:
    1058  Earth location elevation in degrees. Can be ON_UNSET_VALUE
    1059  */
    1060  double Elevation(
    1061  ON::LengthUnitSystem elevation_unit_system
    1062  ) const;
    1063 
    1064  /*
    1065  Parameters:
    1066  elevation_unit_system - [in]
    1067  length unit system for returned value.
    1068  unset_elevation - [in]
    1069  Value to return if the Earth location elevation is not set.
    1070  */
    1071  double Elevation(
    1072  const class ON_UnitSystem& elevation_unit_system,
    1073  double unset_elevation
    1074  ) const;
    1075 
    1076  /*
    1077  Parameters:
    1078  elevation_unit_system - [in]
    1079  length unit system for returned value.
    1080  unset_elevation - [in]
    1081  Value to return if the Earth location elevation is not set.
    1082  */
    1083  double Elevation(
    1084  ON::LengthUnitSystem elevation_unit_system,
    1085  double unset_elevation
    1086  ) const;
    1087 
    1088  /*
    1089  Parameters:
    1090  elevation_unit_system - [in]
    1091  elevation - [in]
    1092  */
    1093  void SetElevation(
    1094  const ON_UnitSystem& elevation_unit_system,
    1095  double elevation
    1096  );
    1097 
    1098  void SetElevation(
    1099  ON::LengthUnitSystem elevation_unit_system,
    1100  double elevation
    1101  );
    1102 
    1103  const ON_3dPoint& ModelPoint() const;
    1104  const ON_3dVector& ModelNorth() const;
    1105  const ON_3dVector& ModelEast() const;
    1106 
    1107  void SetModelPoint(
    1108  ON_3dPoint model_point
    1109  );
    1110 
    1111  void SetModelNorth(
    1112  ON_3dVector model_north
    1113  );
    1114 
    1115  void SetModelEast(
    1116  ON_3dVector model_east
    1117  );
    1118 
    1119  void SetModelLocation(
    1120  ON_3dPoint model_point,
    1121  ON_3dVector model_north,
    1122  ON_3dVector model_east
    1123  );
    1124 
    1125 private:
    1126  // Point on the Earth
    1127  // Latitude (degrees): +90 = north pole, 0 = equator, -90 = south pole
    1128  // Longitude (degrees): 0 = prime meridian (Greenwich meridian)
    1129  // Elevation (meters):
    1130  double m_earth_latitude = ON_UNSET_VALUE; // in decimal degrees
    1131  double m_earth_longitude = ON_UNSET_VALUE; // in decimal degrees
    1132  double m_earth_elevation_meters = 0.0;
    1133 
    1134  ON::EarthCoordinateSystem m_earth_coordinate_system = ON::EarthCoordinateSystem::Unset;
    1135 
    1136 private:
    1137  unsigned char m_reserved1 = 0;
    1138  unsigned char m_reserved2 = 0;
    1139  unsigned char m_reserved3 = 0;
    1140  ON__UINT32 m_reserved4 = 0;
    1141 
    1142 private:
    1143  // Corresponding model point in model coordinates.
    1144  ON_3dPoint m_model_point = ON_3dPoint::Origin; // in model coordinates
    1145 
    1146  // Earth directions in model coordinates
    1147  ON_3dVector m_model_north = ON_3dVector::YAxis; // in model coordinates
    1148  ON_3dVector m_model_east = ON_3dVector::XAxis; // in model coordinates
    1149 
    1150 public:
    1151  // Identification information about this location
    1152  ON_UUID m_id = ON_nil_uuid; // unique id for this anchor point
    1156  ON_wString m_url_tag; // UI link text for m_url
    1157 
    1158  /*
    1159  Parameters:
    1160  model_compass - [out]
    1161  A plane in model coordinates whose xaxis points East,
    1162  yaxis points North and zaxis points up. The origin
    1163  is set to m_model_basepoint.
    1164  */
    1165  bool GetModelCompass(
    1166  ON_Plane& model_compass
    1167  ) const;
    1168 
    1169  /*
    1170  Description:
    1171  Get a transformation from model coordinates to earth coordinates.
    1172  This transformation assumes the model is small enough that
    1173  the curvature of the earth can be ignored.
    1174  Parameters:
    1175  model_unit_system - [in]
    1176  model_to_earth - [out]
    1177  Transformation from model coordinates to earth locations
    1178  (degrees latitude,degrees longitude,elevation in meters)
    1179  Remarks:
    1180  If M is a point in model coordinates and E = model_to_earth*M,
    1181  then
    1182  E.x = latitude in decimal degrees
    1183  E.y = longitude in decimal degrees
    1184  E.z = elevation in meters above mean sea level
    1185 
    1186  Because the earth is not flat, there is a small amount of error
    1187  when using a linear transformation to calculate oblate spherical
    1188  coordinates. This error is small. If the distance from P to M
    1189  is d meters, then the approximation error is
    1190 
    1191  latitude error <=
    1192  longitude error <=
    1193  elevation error <= 6379000*((1 + (d/6356000)^2)-1) meters
    1194 
    1195  In particular, if every point in the model is within 1000 meters of
    1196  the m_model_basepoint, then the maximum approximation errors are
    1197 
    1198  latitude error <=
    1199  longitude error <=
    1200  elevation error <= 8 centimeters
    1201  */
    1202  bool GetModelToEarthXform(
    1203  const ON_UnitSystem& model_unit_system,
    1204  ON_Xform& model_to_earth
    1205  ) const;
    1206 };
    1207 
    1208 
    1209 
    1210 class ON_CLASS ON_3dmIOSettings
    1211 {
    1212 public:
    1213  ON_3dmIOSettings() = default;
    1214  ~ON_3dmIOSettings() = default;
    1215  ON_3dmIOSettings(const ON_3dmIOSettings&) = default;
    1216  ON_3dmIOSettings& operator=(const ON_3dmIOSettings&) = default;
    1217 
    1219 
    1220  bool Read(ON_BinaryArchive&);
    1221  bool Write(ON_BinaryArchive&) const;
    1222 
    1223  // bitmaps associated with rendering materials
    1224  bool m_bSaveTextureBitmapsInFile = false;
    1225 
    1226  // As of 7 February 2012, the m_idef_link_update setting
    1227  // controls if, when and how linked and linked_and_embedded
    1228  // instance defintions are updated when the source archive
    1229  // that was used to create the idef has changed.
    1230  int m_idef_link_update = 1;
    1231  // 1 = prompt - ask the user if the idef should be updated.
    1232  // 2 = always update - no prompting
    1233  // 3 = never update - no prompting
    1234  // Any value not equal to 1,2 or 3 shall be treated as 1.
    1235 };
    1236 
    1237 //////////////////////////////////////////////////////////////////////////////////////////
    1238 //
    1239 // ON_3dmSettings
    1240 //
    1241 
    1242 class ON_CLASS ON_3dmSettings
    1243 {
    1244 public:
    1245  ON_3dmSettings() = default;
    1246  ~ON_3dmSettings() = default;
    1247 
    1248  ON_3dmSettings(const ON_3dmSettings&) = default;
    1249  ON_3dmSettings& operator=(const ON_3dmSettings&) = default;
    1250 
    1251  static const ON_3dmSettings Default;
    1252 
    1253  bool Read(ON_BinaryArchive&);
    1254  bool Write(ON_BinaryArchive&) const;
    1255 
    1256  void Dump( ON_TextLog& ) const;
    1257 
    1258  // model URL (can be empty)
    1260 
    1261  // Model basepoint is used when the file is read as
    1262  // an instance definition and is the point that is
    1263  // mapped to the origin in the instance definition.
    1264  ON_3dPoint m_model_basepoint = ON_3dPoint::Origin;
    1265 
    1266  // If set, this is the model's location on the earth.
    1267  // This information is used when the model is used
    1268  // with GIS information.
    1270 
    1271  // Model space tolerances and unit system
    1273 
    1274  // Page space (printing/paper) tolerances and unit system
    1276 
    1277  // settings used for automatically created rendering meshes
    1279 
    1280  // saved custom settings
    1282 
    1283  /*
    1284  Returns:
    1285  ON_MeshParameters::render_mesh_fast
    1286  m_RenderMeshSettings and ON_MeshParameters::FastRenderMesh have
    1287  the same mesh geometry parameter settings.
    1288  ON_MeshParameters::render_mesh_quality
    1289  m_RenderMeshSettings and ON_MeshParameters::QualityRenderMesh have
    1290  the same mesh geometry parameter settings.
    1291  ON_MeshParameters::render_mesh_custom
    1292  m_RenderMeshSettings and m_CustomRenderMeshSettings have
    1293  the same mesh geometry parameter settings.
    1294  no_match_found_result
    1295  otherwise
    1296  */
    1297  ON_MeshParameters::MESH_STYLE RenderMeshStyle(
    1298  ON_MeshParameters::MESH_STYLE no_match_found_result
    1299  ) const;
    1300 
    1301  // settings used for automatically created analysis meshes
    1303 
    1304  // settings used when annotation objects are created
    1306 
    1309  ON_ClassArray<ON_3dmView> m_views; // current viewports
    1310  ON_UUID m_active_view_id = ON_nil_uuid; // id of "active" viewport
    1311 
    1312  // These fields determine what layer, material, color, line style, and
    1313  // wire density are used for new objects.
    1314 
    1315 public:
    1316  void SetCurrentLayerId(
    1317  ON_UUID layer_id
    1318  );
    1319  void SetV5CurrentLayerIndex(
    1320  int V5_current_layer_index
    1321  );
    1322  int CurrentLayerIndex() const;
    1323  ON_UUID CurrentLayerId() const;
    1324 private:
    1325  // The index is for reading V5 and earlier files.
    1326  int m_V5_current_layer_index = ON_UNSET_INT_INDEX;
    1327  ON_UUID m_current_layer_id = ON_nil_uuid;
    1328 
    1329 public:
    1330  void SetCurrentMaterialId(
    1331  ON_UUID material_id
    1332  );
    1333  int CurrentMaterialIndex() const;
    1334  ON_UUID CurrentMaterialId() const;
    1335 private:
    1336  // The index is for reading V5 and earlier files.
    1337  int m_V5_current_render_material_index = ON_UNSET_INT_INDEX;
    1338  ON_UUID m_current_render_material_id = ON_nil_uuid;
    1339 
    1340 public:
    1341  ON::object_material_source m_current_material_source = ON::material_from_layer;
    1342 
    1343  ON_Color m_current_color = ON_Color::Black;
    1344  ON::object_color_source m_current_color_source = ON::color_from_layer;
    1345 
    1346  ON_Color m_current_plot_color = ON_Color::UnsetColor;
    1347  ON::plot_color_source m_current_plot_color_source = ON::plot_color_from_layer;
    1348 
    1349 public:
    1350  void SetCurrentLinePatternId(
    1351  ON_UUID line_pattern_id
    1352  );
    1353  int CurrentLinePatternIndex() const;
    1354  ON_UUID CurrentLinePatternId() const;
    1355 private:
    1356  // The index is for reading V5 and earlier files.
    1357  int m_V5_current_line_pattern_index = ON_UNSET_INT_INDEX;
    1358  ON_UUID m_current_line_pattern_id = ON_nil_uuid;
    1359 
    1360 public:
    1361  ON::object_linetype_source m_current_linetype_source = ON::linetype_from_layer;
    1362 
    1363 public:
    1364  void SetCurrentTextStyleId(
    1365  ON_UUID text_style_id
    1366  );
    1367  int CurrentTextStyleIndex() const;
    1368  ON_UUID CurrentTextStyleId() const;
    1369 private:
    1370  // The index is for reading V5 and earlier files.
    1371  int m_V5_current_text_style_index = ON_UNSET_INT_INDEX;
    1372  ON_UUID m_current_text_style_id = ON_nil_uuid;
    1373 
    1374 public:
    1375  void SetCurrentDimensionStyleId(
    1376  ON_UUID dimension_style_id
    1377  );
    1378  int CurrentDimensionStyleIndex() const;
    1379  ON_UUID CurrentDimensionStyleId() const;
    1380 private:
    1381  // The index is for reading V5 and earlier files.
    1382  int m_V5_current_dimension_style_index = ON_UNSET_INT_INDEX;
    1383  ON_UUID m_current_dimension_style_id = ON_nil_uuid;
    1384 
    1385 public:
    1386  void SetCurrentHatchPatternId(
    1387  ON_UUID hatch_pattern_id
    1388  );
    1389  ON_UUID CurrentHatchPatternId() const;
    1390 private:
    1391  ON_UUID m_current_hatch_pattern_id = ON_nil_uuid;
    1392 
    1393 public:
    1394  // Surface wireframe density
    1395  //
    1396  // @untitled table
    1397  // 0 boundary + "knot" wires
    1398  // 1 boundary + "knot" wires + 1 interior wire if no interior "knots"
    1399  // N>=2 boundry + "knot" wires + (N-1) interior wires
    1400  int m_current_wire_density = 1;
    1401 
    1403 
    1404  // default settings for construction plane grids
    1406 
    1407  // World scale factor to apply to non-solid linetypes
    1408  // for model display. For plotting, the linetype settings
    1409  // are used without scaling.
    1410  double m_linetype_display_scale = 1.0;
    1411 
    1412  // Plugins that were loaded when the file was saved.
    1414 
    1416 private:
    1417  bool Read_v1(ON_BinaryArchive&);
    1418  bool Read_v2(ON_BinaryArchive&);
    1419  bool Write_v1(ON_BinaryArchive&) const;
    1420  bool Write_v2(ON_BinaryArchive&) const;
    1421 };
    1422 
    1423 #endif
    double m_width
    Definition: opennurbs_3dm_settings.h:421
    ON_wString m_url
    Definition: opennurbs_3dm_settings.h:1155
    Definition: opennurbs_3dm_settings.h:406
    static const ON_EarthAnchorPoint Unset
    Latitude, longitude, and elevation are ON_UNSET_VALUE.
    Definition: opennurbs_3dm_settings.h:894
    @@ -193,9 +191,9 @@ $(function() {
    diff --git a/6/d2/dee/class_o_n___clipping_region_points-members.html b/6/d2/dee/class_o_n___clipping_region_points-members.html index 0967d12a..b8aba19c 100644 --- a/6/d2/dee/class_o_n___clipping_region_points-members.html +++ b/6/d2/dee/class_o_n___clipping_region_points-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d2/df0/opennurbs__surfaceproxy_8h_source.html b/6/d2/df0/opennurbs__surfaceproxy_8h_source.html index 8d94181a..9ba8fca5 100644 --- a/6/d2/df0/opennurbs__surfaceproxy_8h_source.html +++ b/6/d2/df0/opennurbs__surfaceproxy_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_surfaceproxy.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_surfaceproxy.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/df4/class_o_n___text_mask.html b/6/d2/df4/class_o_n___text_mask.html index 3ef88ae6..58f3ff61 100644 --- a/6/d2/df4/class_o_n___text_mask.html +++ b/6/d2/df4/class_o_n___text_mask.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextMask Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    enum  MaskType : unsigned char { MaskType::BackgroundColor = 0, MaskType::MaskColor = 1 - } - Text mask drawn with background color or explicit color More...
    + } Text mask drawn with background color or explicit color More...
    +   diff --git a/6/d2/df5/class_o_n___file_system-members.html b/6/d2/df5/class_o_n___file_system-members.html index 0094b3c7..066f9a11 100644 --- a/6/d2/df5/class_o_n___file_system-members.html +++ b/6/d2/df5/class_o_n___file_system-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@

    @@ -553,9 +551,9 @@ Static Public Attributes

    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/d2/df8/class_o_n___check_sum-members.html b/6/d2/df8/class_o_n___check_sum-members.html index ec10a2c2..10e2c459 100644 --- a/6/d2/df8/class_o_n___check_sum-members.html +++ b/6/d2/df8/class_o_n___check_sum-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d2/dfe/class_o_n___manifest_map_item-members.html b/6/d2/dfe/class_o_n___manifest_map_item-members.html index 8ecac352..28688e15 100644 --- a/6/d2/dfe/class_o_n___manifest_map_item-members.html +++ b/6/d2/dfe/class_o_n___manifest_map_item-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d03/opennurbs__array_8h_source.html b/6/d3/d03/opennurbs__array_8h_source.html index 7928e3ce..3625be2b 100644 --- a/6/d3/d03/opennurbs__array_8h_source.html +++ b/6/d3/d03/opennurbs__array_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_array.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_array.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_array.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(ON_ARRAY_INC_)
    18 #define ON_ARRAY_INC_
    19 
    20 
    21 
    22 ////////////////////////////////////////////////////////////////
    23 //
    24 // The ON_SimpleArray<> template is more efficient than the
    25 // ON_ClassArray<> template, but ON_SimpleArray<> should not
    26 // be used for arrays of classes that require explicit
    27 // construction, destruction, or copy operators.
    28 //
    29 // Elements returned by AppendNew() are memset to zero.
    30 //
    31 // By default, ON_SimpleArray<> uses onrealloc() to manage
    32 // the dynamic array memory. If you want to use something
    33 // besides onrealloc() to manage the array memory, then override
    34 // ON_SimpleArray::Realloc().
    35 
    36 template <class T> class ON_SimpleArray
    37 {
    38 public:
    39  // construction ////////////////////////////////////////////////////////
    40 
    41  // These constructors create an array that uses onrealloc() to manage
    42  // the array memory.
    43  ON_SimpleArray() ON_NOEXCEPT;
    44 
    45  virtual
    47 
    48  // Copy constructor
    50 
    51  ////// Assignment operator
    52  ////// Making a virtual operator= was a mistake.
    53  ////// One reason might have been that the operator is virtual
    54  ////// so ON_UuidList::operator= will be called when one is
    55  ////// passed as an ON_SimpleArray<ON_UUID>& to a function?
    56  ////virtual
    58 
    59 #if defined(ON_HAS_RVALUEREF)
    60  // Clone constructor
    61  ON_SimpleArray( ON_SimpleArray<T>&& ) ON_NOEXCEPT;
    62 
    63  // Clone assignment
    65 #endif
    66 
    67  ON_SimpleArray(size_t); // size_t parameter = initial capacity
    68 
    69  // emergency bailout ///////////////////////////////////////////////////
    70  void EmergencyDestroy(void); // call only when memory used by this array
    71  // may have become invalid for reasons beyond
    72  // your control. EmergencyDestroy() zeros
    73  // anything that could possibly cause
    74  // ~ON_SimpleArray() to crash.
    75 
    76  // query ///////////////////////////////////////////////////////////////
    77 
    78  int Count() const; // number of elements in array
    79  unsigned int UnsignedCount() const;
    80 
    81  int Capacity() const; // capacity of array
    82 
    83  unsigned int SizeOfArray() const; // amount of memory in the m_a[] array
    84 
    85  unsigned int SizeOfElement() const; // amount of memory in an m_a[] array element
    86 
    87  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    88 
    89  // The operator[] does to not check for valid indices.
    90  // The caller is responsibile for insuring that 0 <= i < Capacity()
    91  T& operator[]( int );
    92  T& operator[]( unsigned int );
    93  T& operator[]( ON__INT64 );
    94  T& operator[]( ON__UINT64 );
    95 #if defined(ON_RUNTIME_APPLE)
    96  T& operator[]( size_t );
    97 #endif
    98 
    99  const T& operator[]( int ) const;
    100  const T& operator[]( unsigned int ) const;
    101  const T& operator[]( ON__INT64 ) const;
    102  const T& operator[]( ON__UINT64 ) const;
    103 #if defined(ON_RUNTIME_APPLE)
    104  const T& operator[]( size_t ) const;
    105 #endif
    106 
    107  operator T*(); // The cast operators return a pointer
    108  operator const T*() const; // to the array. If Count() is zero,
    109  // this pointer is nullptr.
    110 
    111  T* First();
    112  const T* First() const; // returns nullptr if count = 0
    113 
    114  // At(index) returns nullptr if index < 0 or index >= count
    115  T* At( int );
    116  T* At( unsigned int );
    117  T* At( ON__INT64 );
    118  T* At( ON__UINT64 );
    119  const T* At( int ) const;
    120  const T* At( unsigned int ) const;
    121  const T* At( ON__INT64 ) const;
    122  const T* At( ON__UINT64 ) const;
    123 
    124  T* Last();
    125  const T* Last() const; // returns nullptr if count = 0
    126 
    127 
    128  // array operations ////////////////////////////////////////////////////
    129 
    130  T& AppendNew(); // Most efficient way to add a new element
    131  // to the array. Increases count by 1.
    132  // Returned element is memset to zero.
    133 
    134  void Append( const T& ); // Append copy of element.
    135  // Increments count by 1.
    136 
    137  void Append( int, const T* ); // Append copy of an array T[count]
    138 
    139 
    140  void Insert( int, const T& ); // Insert copy of element. Uses
    141  // memmove() to perform any
    142  // necessary moving.
    143  // Increases count by 1.
    144 
    145  void Remove(); // Removes last element. Decrements
    146  // count by 1. Does not change capacity.
    147 
    148  virtual
    149  void Remove( int ); // Removes element. Uses memmove() to
    150  // perform any necessary shifting.
    151  // Decrements count by 1. Does not change
    152  // capacity
    153 
    154  void Empty(); // Sets count to 0, leaves capacity untouched.
    155 
    156  void Reverse(); // reverse order
    157 
    158  void Swap(int,int); // swap elements i and j
    159 
    160  //////////
    161  // Search( e ) does a SLOW search of the array starting at array[0]
    162  // and returns the index "i" of the first element that satisfies
    163  // e == array[i]. (== is really memcmp()). If the search is not
    164  // successful, then Search() returns -1. For Search(T) to work
    165  // correctly, T must be a simple type. Use Search(p,compare())
    166  // for Ts that are structs/classes that contain pointers. Search()
    167  // is only suitable for performing infrequent searchs of small
    168  // arrays. Sort the array and use BinarySearch() for performing
    169  // efficient searches.
    170  int Search( const T& ) const;
    171 
    172  //////////
    173  // Search( p, compare ) does a SLOW search of the array starting
    174  // at array[0] and returns the index "i" of the first element
    175  // that satisfies compare(p,&array[i])==0. If the search is not
    176  // successful, then Search() returns -1. Search() is only suitable
    177  // for performing infrequent searches of small arrays. Sort the
    178  // array and use BinarySearch() for performing efficient searches.
    179  // See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T>
    180  int Search( const T*, int (*)(const T*,const T*) ) const;
    181 
    182  //////////
    183  // BinarySearch( p, compare ) does a fast search of a sorted array
    184  // and returns the smallest index "i" of the element that satisifies
    185  // 0==compare(p,&array[i]).
    186  //
    187  // BinarySearch( p, compare, count ) does a fast search of the first
    188  // count element sorted array and returns the smallest index "i" of
    189  // the element that satisifies 0==compare(p,&array[i]). The version
    190  // that takes a "count" is useful when elements are being appended
    191  // during a calculation and the appended elements are not sorted.
    192  //
    193  // If the search is successful,
    194  // BinarySearch() returns the index of the element (>=0).
    195  // If the search is not successful, BinarySearch() returns -1.
    196  // Use QuickSort( compare ) or, in rare cases and after meaningful
    197  // performance testing using optimzed release builds,
    198  // HeapSort( compare ) to sort the array.
    199  // See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T>
    200  int BinarySearch( const T*, int (*)(const T*,const T*) ) const;
    201  int BinarySearch( const T*, int (*)(const T*,const T*), int ) const;
    202 
    203  //////////
    204  // Sorts the array using the heap sort algorithm.
    205  // QuickSort() is generally the better choice.
    206  bool HeapSort( int (*)(const T*,const T*) );
    207 
    208  //////////
    209  // Sorts the array using the quick sort algorithm.
    210  // See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T>
    211  bool QuickSort( int (*)(const T*,const T*) );
    212 
    213  /*
    214  Description:
    215  Sort() fills in the index[] array so that
    216  array[index[i]] <= array[index[i+1]].
    217  The array is not modified.
    218 
    219  Parameters:
    220  sort_algorithm - [in]
    221  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
    222  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
    223  optimized release builds and are confident heap sort is
    224  significantly faster.
    225  index - [out] an array of length Count() that is returned with
    226  some permutation of (0,1,...,Count()-1).
    227  compare - [in] compare function compare(a,b,p) should return
    228  <0 if a<b, 0, if a==b, and >0 if a>b.
    229  Returns:
    230  true if successful
    231  */
    232  bool Sort(
    233  ON::sort_algorithm sort_algorithm,
    234  int* /* index[] */ ,
    235  int (*)(const T*,const T*)
    236  ) const;
    237 
    238  /*
    239  Description:
    240  Sort() fills in the index[] array so that
    241  array[index[i]] <= array[index[i+1]].
    242  The array is not modified.
    243 
    244  Parameters:
    245  sort_algorithm - [in]
    246  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
    247  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
    248  optimized release builds and are confident heap sort is
    249  significantly faster.
    250  index - [out] an array of length Count() that is returned with
    251  some permutation of (0,1,...,Count()-1).
    252  compare - [in] compare function compare(a,b,p) should return
    253  <0 if a<b, 0, if a==b, and >0 if a>b.
    254  p - [in] pointer passed as third argument to compare.
    255 
    256  Returns:
    257  true if successful
    258  */
    259  bool Sort(
    260  ON::sort_algorithm sort_algorithm,
    261  int*, // index[]
    262  int (*)(const T*,const T*,void*), // int compare(const T*,const T*,void* p)
    263  void* // p
    264  ) const;
    265 
    266  //////////
    267  // Permutes the array so that output[i] = input[index[i]].
    268  // The index[] array should be a permutation of (0,...,Count()-1).
    269  bool Permute( const int* /*index[]*/ );
    270 
    271  //////////
    272  // Zeros all array memory.
    273  // Count and capacity are not changed.
    274  void Zero();
    275 
    276  //////////
    277  // Sets all bytes in array memory to value.
    278  // Count and capacity are not changed.
    279  void MemSet(unsigned char);
    280 
    281  // memory managment ////////////////////////////////////////////////////
    282 
    283  T* Reserve( size_t ); // increase capacity to at least the requested value
    284 
    285  void Shrink(); // remove unused capacity
    286 
    287  void Destroy(); // onfree any memory and set count and capacity to zero
    288 
    289  // low level memory managment //////////////////////////////////////////
    290 
    291  // By default, ON_SimpleArray<> uses onrealloc() to manage
    292  // the dynamic array memory. If you want to use something
    293  // besides onrealloc() to manage the array memory, then override
    294  // Realloc(). The T* Realloc(ptr, capacity) should do the following:
    295  //
    296  // 1) If ptr and capacity are zero, return nullptr.
    297  // 2) If ptr is nullptr, an capacity > 0, allocate a memory block of
    298  // capacity*sizeof(T) bytes and return a pointer to this block.
    299  // If the allocation request fails, return nullptr.
    300  // 3) If ptr is not nullptr and capacity is 0, free the memory block
    301  // pointed to by ptr and return nullptr.
    302  // 4) If ptr is not nullptr and capacity > 0, then reallocate the memory
    303  // block and return a pointer to the reallocated block. If the
    304  // reallocation request fails, return nullptr.
    305  //
    306  // NOTE WELL:
    307  // Microsoft's VC 6.0 realloc() contains a bug that can cause
    308  // crashes and should be avoided. See MSDN Knowledge Base article
    309  // ID Q225099 for more information.
    310  virtual
    311  T* Realloc(T*,int); // (re)allocated capacity*sizeof(T) bytes
    312 
    313  T* Array(); // The Array() function return the
    314 
    315  const T* Array() const; // m_a pointer value.
    316 
    317  void SetCount( int ); // If value is <= Capacity(), then
    318  // sets count to specified value.
    319 
    320  T* SetCapacity( size_t ); // Shrink/grows capacity. If value
    321  // is < current Count(), then count
    322  // is reduced to value.
    323  //
    324 
    325  int NewCapacity() const; // When the dynamic array needs to grow,
    326  // this calculates the new value for m_capacity.
    327 
    328  /*
    329  Description:
    330  Expert user tool to take charge of the memory used by
    331  the dyanmic array.
    332  Returns:
    333  A pointer to the array and zeros out this class.
    334  The returned pointer is on the heap and must be
    335  deallocated by calling onfree().
    336  */
    337  T* KeepArray();
    338 
    339  /*
    340  Description:
    341  Do not use this version of SetArray(). Use the one that takes
    342  a pointer, count and capacity.
    343  */
    344  void SetArray(T*);
    345 
    346  /*
    347  Description:
    348  Expert user tool to set the memory used by the dyanmic array.
    349  Parameters:
    350  T* pointer - [in]
    351  int count [in]
    352  int capacity - [in]
    353  m_a is set to pointer, m_count is set to count, and m_capacity
    354  is set to capacity. It is critical that the pointer be one
    355  returned by onmalloc(sz), where sz >= capacity*sizeof(T[0]).
    356  */
    357  void SetArray(T*, int, int);
    358 
    359 protected:
    360  // implimentation //////////////////////////////////////////////////////
    361  void Move( int /* dest index*/, int /* src index */, int /* element count*/ );
    362  T* m_a; // pointer to array memory
    363  int m_count; // 0 <= m_count <= m_capacity
    364  int m_capacity; // actual length of m_a[]
    365 };
    366 
    367 
    368 ////////////////////////////////////////////////////////////////
    369 //
    370 
    371 #if defined(ON_DLL_TEMPLATE)
    372 
    373 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<bool>;
    374 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<char>;
    375 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<unsigned char>;
    376 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<short>;
    377 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<unsigned short>;
    378 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<int>;
    379 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<unsigned int>;
    380 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<float>;
    381 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<double>;
    382 
    383 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<bool*>;
    384 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<char*>;
    385 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<unsigned char*>;
    386 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<short*>;
    387 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<unsigned short*>;
    388 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<int*>;
    389 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<unsigned int*>;
    390 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<float*>;
    391 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<double*>;
    392 
    393 #endif
    394 
    395 
    396 
    397 ////////////////////////////////////////////////////////////////
    398 //
    399 // The ON_ClassArray<> template is designed to be used with
    400 // classes that require non-trivial construction or destruction.
    401 // Any class used with the ON_ClassArray<> template must have a
    402 // robust operator=().
    403 //
    404 // By default, ON_ClassArray<> uses onrealloc() to manage
    405 // the dynamic array memory. If you want to use something
    406 // besides onrealloc() to manage the array memory, then override
    407 // ON_ClassArray::Realloc(). In practice this means that if your
    408 // class has members with back-pointers, then you cannot use
    409 // it in the defaule ON_ClassArray. See ON_ObjectArray
    410 // for an example.
    411 //
    412 template <class T> class ON_ClassArray
    413 {
    414 public:
    415  // construction ////////////////////////////////////////////////////////
    416  ON_ClassArray() ON_NOEXCEPT;
    417  ON_ClassArray( size_t ); // size_t parameter = initial capacity
    418 
    419  // Copy constructor
    421 
    422  virtual
    423  ~ON_ClassArray(); // override for struct member deallocation, etc.
    424 
    425  // Assignment operator
    426  ON_ClassArray<T>& operator=( const ON_ClassArray<T>& );
    427 
    428 #if defined(ON_HAS_RVALUEREF)
    429  // Clone constructor
    430  ON_ClassArray( ON_ClassArray<T>&& ) ON_NOEXCEPT;
    431 
    432  // Clone Assignment operator
    433  ON_ClassArray<T>& operator=( ON_ClassArray<T>&& ) ON_NOEXCEPT;
    434 #endif
    435 
    436  // emergency bailout ///////////////////////////////////////////////////
    437  void EmergencyDestroy(void); // call only when memory used by this array
    438  // may have become invalid for reasons beyond
    439  // your control. EmergencyDestroy() zeros
    440  // anything that could possibly cause
    441  // ~ON_ClassArray() to crash.
    442 
    443  // query ///////////////////////////////////////////////////////////////
    444 
    445  int Count() const; // number of elements in array
    446  unsigned int UnsignedCount() const;
    447 
    448  int Capacity() const; // capacity of array
    449 
    450  unsigned int SizeOfArray() const; // amount of memory in the m_a[] array
    451 
    452  unsigned int SizeOfElement() const; // amount of memory in an m_a[] array element
    453 
    454  // The operator[] does to not check for valid indices.
    455  // The caller is responsibile for insuring that 0 <= i < Capacity()
    456  T& operator[]( int );
    457  T& operator[]( unsigned int );
    458  T& operator[]( ON__INT64 );
    459  T& operator[]( ON__UINT64 );
    460 #if defined(ON_RUNTIME_APPLE)
    461  T& operator[]( size_t );
    462 #endif
    463 
    464  const T& operator[]( int ) const;
    465  const T& operator[]( unsigned int ) const;
    466  const T& operator[]( ON__INT64 ) const;
    467  const T& operator[]( ON__UINT64 ) const;
    468 #if defined(ON_RUNTIME_APPLE)
    469  const T& operator[]( size_t ) const;
    470 #endif
    471 
    472  operator T*(); // The cast operators return a pointer
    473  operator const T*() const; // to the array. If Count() is zero,
    474  // this pointer is nullptr.
    475  T* First();
    476  const T* First() const; // returns nullptr if count = 0
    477 
    478  // At(index) returns nullptr if index < 0 or index >= count
    479  T* At( int );
    480  T* At( unsigned int );
    481  T* At( ON__INT64 );
    482  T* At( ON__UINT64 );
    483  const T* At( int ) const;
    484  const T* At( unsigned int ) const;
    485  const T* At( ON__INT64 ) const;
    486  const T* At( ON__UINT64 ) const;
    487 
    488  T* Last();
    489  const T* Last() const; // returns nullptr if count = 0
    490 
    491 
    492  // array operations ////////////////////////////////////////////////////
    493 
    494  T& AppendNew(); // Most efficient way to add a new class
    495  // to the array. Increases count by 1.
    496 
    497  void Append( const T& ); // Append copy of element.
    498  // Increments count by 1.
    499 
    500  void Append( int, const T*); // Append copy of an array T[count]
    501 
    502  void Insert( int, const T& ); // Insert copy of element. Uses
    503  // memmove() to perform any
    504  // necessary moving.
    505  // Increases count by 1.
    506 
    507  void Remove(); // Removes last element. Decrements
    508  // count by 1. Does not change capacity.
    509 
    510  void Remove( int ); // Removes element. Uses memmove() to
    511  // perform any necessary shifting.
    512  // Decrements count by 1. Does not change
    513  // capacity
    514 
    515  void Empty(); // Sets count to 0, leaves capacity untouched.
    516 
    517  void Reverse(); // reverse order
    518 
    519  void Swap(int,int); // swap elements i and j
    520 
    521  //////////
    522  // Search( p, compare ) does a SLOW search of the array starting
    523  // at array[0] and returns the index "i" of the first element
    524  // that satisfies compare(p,&array[i])==0. If the search is not
    525  // successful, then Search() returns -1. Search() is only suitable
    526  // for performing infrequent searches of small arrays. Sort the
    527  // array and use BinarySearch() for performing efficient searches.
    528  int Search( const T*, int (*)(const T*,const T*) ) const;
    529 
    530  //////////
    531  // BinarySearch( p, compare ) does a fast search of a sorted array
    532  // and returns the smallest index "i" of the element that satisifies
    533  // 0==compare(p,&array[i]).
    534  //
    535  // BinarySearch( p, compare, count ) does a fast search of the first
    536  // count element sorted array and returns the smallest index "i" of
    537  // the element that satisifies 0==compare(p,&array[i]). The version
    538  // that takes a "count" is useful when elements are being appended
    539  // during a calculation and the appended elements are not sorted.
    540  //
    541  // If the search is successful,
    542  // BinarySearch() returns the index of the element (>=0).
    543  // If the search is not successful, BinarySearch() returns -1.
    544  // Use QuickSort( compare ) or, in rare cases and after meaningful
    545  // performance testing using optimzed release builds,
    546  // HeapSort( compare ) to sort the array.
    547  // See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T>
    548  int BinarySearch( const T*, int (*)(const T*,const T*) ) const;
    549  int BinarySearch( const T*, int (*)(const T*,const T*), int ) const;
    550 
    551  //////////
    552  // Sorts the array using the heap sort algorithm.
    553  // See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T>
    554  // QuickSort() is generally the better choice.
    555  virtual
    556  bool HeapSort( int (*)(const T*,const T*) );
    557 
    558  //////////
    559  // Sorts the array using the heap sort algorithm.
    560  virtual
    561  bool QuickSort( int (*)(const T*,const T*) );
    562 
    563  /*
    564  Description:
    565  Sort() fills in the index[] array so that
    566  array[index[i]] <= array[index[i+1]].
    567  The array is not modified.
    568 
    569  Parameters:
    570  sort_algorithm - [in]
    571  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
    572  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
    573  optimized release builds and are confident heap sort is
    574  significantly faster.
    575  index - [out] an array of length Count() that is returned with
    576  some permutation of (0,1,...,Count()-1).
    577  compare - [in] compare function compare(a,b) should return
    578  <0 if a<b, 0, if a==b, and >0 if a>b.
    579 
    580  Returns:
    581  true if successful
    582  */
    583  bool Sort(
    584  ON::sort_algorithm sort_algorithm,
    585  int* /* index[] */ ,
    586  int (*)(const T*,const T*)
    587  ) const;
    588 
    589  /*
    590  Description:
    591  Sort() fills in the index[] array so that
    592  array[index[i]] <= array[index[i+1]].
    593  The array is not modified.
    594 
    595  Parameters:
    596  sort_algorithm - [in]
    597  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
    598  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
    599  optimized release builds and are confident heap sort is
    600  significantly faster.
    601  index - [out] an array of length Count() that is returned with
    602  some permutation of (0,1,...,Count()-1).
    603  compare - [in] compare function compare(a,b,p) should return
    604  <0 if a<b, 0, if a==b, and >0 if a>b.
    605  p - [in] pointer passed as third argument to compare.
    606 
    607  Returns:
    608  true if successful
    609  */
    610  bool Sort(
    611  ON::sort_algorithm sort_algorithm,
    612  int*, // index[]
    613  int (*)(const T*,const T*,void*), // int compare(const T*,const T*,void* p)
    614  void* // p
    615  ) const;
    616 
    617  //////////
    618  // Permutes the array so that output[i] = input[index[i]].
    619  // The index[] array should be a permutation of (0,...,Count()-1).
    620  bool Permute( const int* /*index[]*/ );
    621 
    622  //////////
    623  // Destroys all elements and fills them with values
    624  // set by the defualt constructor.
    625  // Count and capacity are not changed.
    626  void Zero();
    627 
    628  // memory managment /////////////////////////////////////////////////
    629 
    630  T* Reserve( size_t ); // increase capacity to at least the requested value
    631 
    632  void Shrink(); // remove unused capacity
    633 
    634  void Destroy(); // onfree any memory and set count and capacity to zero
    635 
    636  // low level memory managment ///////////////////////////////////////
    637 
    638  // By default, ON_ClassArray<> uses onrealloc() to manage
    639  // the dynamic array memory. If you want to use something
    640  // besides onrealloc() to manage the array memory, then override
    641  // Realloc(). The T* Realloc(ptr, capacity) should do the following:
    642  //
    643  // 1) If ptr and capacity are zero, return nullptr.
    644  // 2) If ptr is nullptr, an capacity > 0, allocate a memory block of
    645  // capacity*sizeof(T) bytes and return a pointer to this block.
    646  // If the allocation request fails, return nullptr.
    647  // 3) If ptr is not nullptr and capacity is 0, free the memory block
    648  // pointed to by ptr and return nullptr.
    649  // 4) If ptr is not nullptr and capacity > 0, then reallocate the memory
    650  // block and return a pointer to the reallocated block. If the
    651  // reallocation request fails, return nullptr.
    652  //
    653  // NOTE WELL:
    654  // Microsoft's VC 6.0 realloc() contains a bug that can cause
    655  // crashes and should be avoided. See MSDN Knowledge Base article
    656  // ID Q225099 for more information.
    657  virtual
    658  T* Realloc(T*,int); // (re)allocated capacity*sizeof(T) bytes
    659 
    660  T* Array(); // The Array() function return the
    661 
    662  const T* Array() const; // m_a pointer value.
    663 
    664  void SetCount( int ); // If value is <= Capacity(), then
    665  // sets count to specified value.
    666 
    667  T* SetCapacity( size_t ); // Shrink/grows capacity. If value
    668  // is < current Count(), then count
    669  // is reduced to value.
    670 
    671  int NewCapacity() const; // When the dynamic array needs to grow,
    672  // this calculates the new value for m_capacity.
    673 
    674  T* KeepArray(); // returns pointer to array and zeros
    675  // out this class. Caller is responsible
    676  // for calling destructor on each element
    677  // and then using onfree() to release array
    678  // memory. E.g.,
    679  //
    680  // for (int i=capacity;i>=0;i--) {
    681  // array[i].~T();
    682  // }
    683  // onfree(array);
    684 
    685  /*
    686  Description:
    687  Do not use this version of SetArray(). Use the one that takes
    688  a pointer, count and capacity: SetArray(pointer,count,capacity)
    689  */
    690  void SetArray(T*);
    691 
    692  /*
    693  Description:
    694  Expert user tool to set the memory used by the dyanmic array.
    695  Parameters:
    696  T* pointer - [in]
    697  int count - [in] 0 <= count <= capacity
    698  int capacity - [in]
    699  m_a is set to pointer, m_count is set to count, and m_capacity
    700  is set to capacity. It is critical that the pointer be one
    701  returned by onmalloc(sz), where sz >= capacity*sizeof(T[0]),
    702  and that the in-place operator new has been used to initialize
    703  each element of the array.
    704  */
    705  void SetArray(T*, int, int);
    706 
    707 protected:
    708  // implimentation //////////////////////////////////////////////////////
    709  void Move( int /* dest index*/, int /* src index */, int /* element count*/ );
    710  void ConstructDefaultElement(T*);
    711  void DestroyElement(T&);
    712  T* m_a; // pointer to array memory
    713  int m_count; // 0 <= m_count <= m_capacity
    714  int m_capacity; // actual length of m_a[]
    715 };
    716 
    717 #if defined(ON_DLL_TEMPLATE)
    718 
    719 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_String>;
    720 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_wString>;
    721 
    722 #endif
    723 
    724 /*
    725 Description:
    726  ON_Object array is used to store lists of classes that are
    727  derived from ON_Object. It differs from ON_ClassArray in
    728  that the virtual ON_Object::MemoryRelocate function is called
    729  when growing the dynamic array requires changing the location
    730  of the memory buffer used to store the elements in the array.
    731 */
    732 template <class T> class ON_ObjectArray : public ON_ClassArray<T>
    733 {
    734 public:
    735  ON_ObjectArray();
    736  ~ON_ObjectArray(); // override for struct member deallocation, etc.
    737  ON_ObjectArray( size_t ); // size_t parameter = initial capacity
    739  ON_ObjectArray<T>& operator=( const ON_ObjectArray<T>& );
    740 
    741 #if defined(ON_HAS_RVALUEREF)
    742  // Clone constructor
    744 
    745  // Clone Assignment operator
    746  ON_ObjectArray<T>& operator=( ON_ObjectArray<T>&& );
    747 #endif
    748 
    749  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    750 
    751  // virtual ON_ClassArray<T> override that
    752  // calls MemoryRelocate on each element after
    753  // the reallocation.
    754  T* Realloc(T*,int);
    755 
    756  // virtual ON_ClassArray<T> override that
    757  // calls MemoryRelocate on each element after
    758  // the heap sort.
    759  // QuickSort() is generally the better choice.
    760  bool HeapSort( int (*)(const T*,const T*) );
    761 
    762  // virtual ON_ClassArray<T> override that
    763  // calls MemoryRelocate on each element after
    764  // the quick sort.
    765  bool QuickSort( int (*)(const T*,const T*) );
    766 };
    767 
    768 class ON_CLASS ON_UuidPair
    769 {
    770 public:
    771  /*
    772  Description:
    773  Compares m_uuid[0] and ignores m_uuid[1]
    774  */
    775  static
    776  int CompareFirstUuid(const class ON_UuidPair*,const class ON_UuidPair*);
    777 
    778  /*
    779  Description:
    780  Compares m_uuid[1] and ignores m_uuid[0]
    781  */
    782  static
    783  int CompareSecondUuid(const class ON_UuidPair*,const class ON_UuidPair*);
    784 
    785  /*
    786  Description:
    787  Compares m_uuid[0] then m_uuid[1].
    788  */
    789  static
    790  int Compare(const class ON_UuidPair*,const class ON_UuidPair*);
    791 
    792  ON_UuidPair();
    793  ON_UUID m_uuid[2];
    794 };
    795 
    796 #if defined(ON_DLL_TEMPLATE)
    797 
    798 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_UUID>;
    799 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_UuidIndex>;
    800 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_UuidPtr>;
    801 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_UuidPair>;
    802 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_SimpleArray<int> >;
    803 
    804 #endif
    805 
    806 
    807 /*
    808 Description:
    809  The ON_UuidList class provides a tool to efficiently
    810  maintain a list of uuids and determine if a uuid is
    811  in the list. This class is based on the premise that
    812  there are no duplicate uuids in the list.
    813 */
    814 class ON_CLASS ON_UuidList : private ON_SimpleArray<ON_UUID>
    815 {
    816 public:
    817  ON_UuidList();
    818  ON_UuidList(int capacity);
    819  ~ON_UuidList();
    820  ON_UuidList(const ON_UuidList& src);
    821  ON_UuidList& operator=(const ON_UuidList& src);
    822 
    823  /*
    824  Description:
    825  Fast uuid compare. Not necessarily the same
    826  as ON_UuidCompare().
    827  */
    828  static
    829  int CompareUuid( const ON_UUID* a, const ON_UUID* b );
    830 
    831  /*
    832  Returns:
    833  Number of active uuids in the list.
    834  */
    835  int Count() const;
    836 
    837  /*
    838  Returns:
    839  Array of uuids in the list. Sorted with
    840  respect to ON_UuidList::CompareUuid().
    841  Remarks:
    842  Calling AddUuid() may grow the dynamic array
    843  and make the pointer invalid.
    844  */
    845  const ON_UUID* Array() const;
    846 
    847  /*
    848  Description:
    849  Provides an efficient way to empty a list so that it
    850  can be used again.
    851  */
    852  void Empty();
    853 
    854  /*
    855  Description:
    856  Destroy list. If list will be reused, Empty() is more
    857  efficient.
    858  */
    859  void Destroy();
    860 
    861  void Reserve(size_t capacity);
    862 
    863  /*
    864  Description:
    865  Makes the uuid list as efficent as possible in both search
    866  speed and memory usage. Use Compact() when a uuid list
    867  will be in use but is not likely to be modifed. A list
    868  that has been compacted can still be modified.
    869  */
    870  void Compact();
    871 
    872  /*
    873  Description:
    874  Adds a uuid to the list.
    875  Parameters:
    876  uuid - [in] id to add.
    877  bCheckForDupicates - [in] if true, then the uuid
    878  is not added if it is already in the list.
    879  If you are certain that the uuid is not in the
    880  list and you are going to have a large list of uuids,
    881  then setting bCheckForDupicates=false will
    882  speed up the addition of uuids.
    883  Returns:
    884  True if uuid was added. False if uuid was not added
    885  because it is already in the collection.
    886  */
    887  bool AddUuid(ON_UUID uuid, bool bCheckForDupicates=true);
    888 
    889  /*
    890  Description:
    891  Removes a uuid from the list.
    892  Parameters:
    893  uuid - [in] id to remove
    894  Returns:
    895  True if uuid was in the list and was removed.
    896  False if uuid was not in the list.
    897  */
    898  bool RemoveUuid(ON_UUID uuid);
    899 
    900  /*
    901  Description:
    902  Determine if a uuid is in the list.
    903  Returns:
    904  True if uuid is in the list.
    905  */
    906  bool FindUuid(ON_UUID uuid) const;
    907 
    908  /*
    909  Description:
    910  Saves the uuid list in an archive.
    911  Parameters:
    912  archive - [in] archive to write to.
    913  Returns:
    914  true if write was successful.
    915  */
    916  bool Write(
    917  class ON_BinaryArchive& archive
    918  ) const;
    919 
    920  /*
    921  Description:
    922  Saves the uuid list in an archive.
    923  Parameters:
    924  archive - [in] archive to write to.
    925  bSortBeforeWrite - [in]
    926  True if ids should be sorted before the write
    927  so future lookups will be fast. False if
    928  the current state of the sorted/unsorted bits
    929  should be preserved.
    930  Returns:
    931  true if write was successful.
    932  */
    933  bool Write(
    934  class ON_BinaryArchive& archive,
    935  bool bSortBeforeWrite
    936  ) const;
    937 
    938  /*
    939  Description:
    940  Read the uuid list from an archive.
    941  Parameters:
    942  archive - [in] archive to read from.
    943  Returns:
    944  true if the read was successful.
    945  */
    946  bool Read(
    947  class ON_BinaryArchive& archive
    948  );
    949 
    950  /*
    951  Description:
    952  Read the uuid list from an archive.
    953  Parameters:
    954  archive - [in]
    955  archive to read from.
    956  bool bSortAfterRead - [in]
    957  True if ids should be sorted after the read
    958  so future lookups will be fast. False if
    959  the state of the sorted/unsorted bits that
    960  existed at write time should be preserved.
    961  Returns:
    962  true if the read was successful.
    963  */
    964  bool Read(
    965  class ON_BinaryArchive& archive,
    966  bool bSortAferRead
    967  );
    968 
    969  /*
    970  Description:
    971  Append the uuids in this class to uuid_list.
    972  Parameters:
    973  uuid_list - [in/out]
    974  Returns:
    975  Number of uuids added to uuid_list.
    976  */
    977  int GetUuids(
    978  ON_SimpleArray<ON_UUID>& uuid_list
    979  ) const;
    980 
    981  /*
    982  Description:
    983  This tool is used in rare situations when the object ids
    984  stored in the uuid list need to be remapped.
    985  Parameters:
    986  uuid_remap - [in]
    987  Is it critical that uuid_remap[] be sorted with respect
    988  to ON_UuidPair::CompareFirstUuid.
    989  */
    990  void RemapUuids(
    991  const ON_SimpleArray<ON_UuidPair>& uuid_remap
    992  );
    993 
    994 private:
    995  void PurgeHelper();
    996  void SortHelper();
    997  ON_UUID* SearchHelper(const ON_UUID*) const;
    998  int m_sorted_count;
    999  int m_removed_count;
    1000 };
    1001 
    1002 /*
    1003 Description:
    1004  The ON_UuidList class provides a tool
    1005  to efficiently maintain a list of uuid-index
    1006  pairs and determine if a uuid is in the list.
    1007  This class is based on the premise that there are
    1008  no duplicate uuids in the list.
    1009 */
    1010 class ON_CLASS ON_UuidIndexList : private ON_SimpleArray<ON_UuidIndex>
    1011 {
    1012 public:
    1013  ON_UuidIndexList() = default;
    1014  ON_UuidIndexList(size_t capacity);
    1015  ~ON_UuidIndexList() = default;
    1016  ON_UuidIndexList(const ON_UuidIndexList& src);
    1018 
    1019  /*
    1020  Returns:
    1021  Number of active uuids in the list.
    1022  */
    1023  unsigned int Count() const;
    1024 
    1025  /*
    1026  Description:
    1027  Provides an efficient way to empty a list so that it
    1028  can be used again.
    1029  */
    1030  void RemoveAll();
    1031 
    1032  void Reserve( size_t capacity );
    1033 
    1034  /*
    1035  Description:
    1036  Adds a uuid-index pair to the list.
    1037  Parameters:
    1038  uuid - [in] id to add.
    1039  This uuid cannot be ON_max_uuid because ON_max_uuid
    1040  is
    1041  bCheckForDupicates - [in] if true, then the uuid
    1042  is not added if it is already in the list.
    1043  If you are certain that the uuid is not in the list
    1044  and you have a have a large collection of uuids,
    1045  then setting bCheckForDupicates=false will
    1046  speed up the addition of uuids.
    1047  Returns:
    1048  True if uuid was added. False if uuid was not added
    1049  because it is already in the collection.
    1050  */
    1051  bool AddUuidIndex(
    1052  ON_UUID uuid,
    1053  int index,
    1054  bool bCheckForDupicates=true);
    1055 
    1056  /*
    1057  Description:
    1058  Removes an element with a matching uuid from the list.
    1059  Parameters:
    1060  uuid - [in] id to remove
    1061  Returns:
    1062  True if an element was removed. False if the uuid
    1063  was not in the list.
    1064  */
    1065  bool RemoveUuid(
    1066  ON_UUID uuid
    1067  );
    1068 
    1069  /*
    1070  Description:
    1071  Determine if an element with a uuid is in the list.
    1072  Parameters:
    1073  index - [out] if not nullptr and a matching uuid is found,
    1074  then *index is set to the value of the index.
    1075  Returns:
    1076  True if an element was found. Returns false if
    1077  the uuid is not in the list.
    1078  */
    1079  bool FindUuid(ON_UUID uuid) const;
    1080  bool FindUuid(ON_UUID uuid, int* index) const;
    1081 
    1082  /*
    1083  Description:
    1084  Determine if a uuid-index pair is in the list.
    1085  Returns:
    1086  True if the uuid-index pair is in the list.
    1087  Returns false if the uuid-index pair is not
    1088  in the list.
    1089  */
    1090  bool FindUuidIndex(ON_UUID uuid, int index) const;
    1091 
    1092  /*
    1093  Description:
    1094  Append the uuids in this class to uuid_list.
    1095  Parameters:
    1096  uuid_list - [in/out]
    1097  Returns:
    1098  Number of uuids added to uuid_list.
    1099  */
    1100  unsigned int GetUuids(
    1101  ON_SimpleArray<ON_UUID>& uuid_list
    1102  ) const;
    1103 
    1104  /*
    1105  Description:
    1106  If you will perform lots of searches before the next
    1107  change to the list, then calling ImproveSearchSpeed()
    1108  will speed up the searches by culling removed objects
    1109  and completely sorting the list so only a binary search
    1110  is required. You may edit the list at any time after
    1111  calling ImproveSearchSpeed(). If you are performing
    1112  a few searches between edits, then excessive calling
    1113  of ImproveSearchSpeed() may actually decrease overall
    1114  program performance.
    1115  */
    1116  void ImproveSearchSpeed();
    1117 
    1118 private:
    1119  ON_UuidIndex* SearchHelper(const ON_UUID*) const;
    1120  unsigned int m_sorted_count = 0;
    1121  unsigned int m_removed_count = 0;
    1122 };
    1123 
    1124 
    1125 /*
    1126 Description:
    1127  The ON_UuidList class provides a tool
    1128  to efficiently maintain a list of uuid-pointer
    1129  pairs and determine if a uuid is in the list.
    1130  This class is based on the premise that there are
    1131  no duplicate uuids in the list.
    1132 */
    1133 class ON_CLASS ON_UuidPtrList : private ON_SimpleArray<ON_UuidPtr>
    1134 {
    1135 public:
    1136  ON_UuidPtrList() = default;
    1137  ON_UuidPtrList(size_t capacity);
    1138  ~ON_UuidPtrList() = default;
    1139  ON_UuidPtrList(const ON_UuidPtrList& src);
    1141 
    1142  /*
    1143  Returns:
    1144  Number of active uuids in the list.
    1145  */
    1146  unsigned int Count() const;
    1147 
    1148  /*
    1149  Description:
    1150  Provides an efficient way to empty a list so that it
    1151  can be used again.
    1152  */
    1153  void RemoveAll();
    1154 
    1155  void Reserve( size_t capacity );
    1156 
    1157  /*
    1158  Description:
    1159  Adds a uuid-index pair to the list.
    1160  Parameters:
    1161  uuid - [in] id to add.
    1162  This uuid cannot be ON_max_uuid because ON_max_uuid
    1163  is
    1164  bCheckForDupicates - [in] if true, then the uuid
    1165  is not added if it is already in the list.
    1166  If you are certain that the uuid is not in the list
    1167  and you have a have a large collection of uuids,
    1168  then setting bCheckForDupicates=false will
    1169  speed up the addition of uuids.
    1170  Returns:
    1171  True if uuid was added. False if uuid was not added
    1172  because it is already in the collection.
    1173  */
    1174  bool AddUuidPtr(
    1175  ON_UUID uuid,
    1176  ON__UINT_PTR ptr,
    1177  bool bCheckForDupicates=true);
    1178 
    1179  /*
    1180  Description:
    1181  Removes an element with a matching uuid from the list.
    1182  Parameters:
    1183  uuid - [in] id to remove
    1184  Returns:
    1185  True if an element was removed. False if the uuid
    1186  was not in the list.
    1187  */
    1188  bool RemoveUuid(
    1189  ON_UUID uuid
    1190  );
    1191 
    1192  /*
    1193  Description:
    1194  Determine if an element with a uuid is in the list.
    1195  Parameters:
    1196  ptr - [out] if not nullptr and a matching uuid is found,
    1197  then *ptr is set to the value of the m_ptr.
    1198  Returns:
    1199  True if an element was found. Returns false if
    1200  the uuid is not in the list.
    1201  */
    1202  bool FindUuid(ON_UUID uuid) const;
    1203  bool FindUuid(ON_UUID uuid, ON__UINT_PTR* ptr) const;
    1204 
    1205  /*
    1206  Description:
    1207  Determine if a uuid-index pair is in the list.
    1208  Returns:
    1209  True if the uuid-index pair is in the list.
    1210  Returns false if the uuid-index pair is not
    1211  in the list.
    1212  */
    1213  bool FindUuidPtr(ON_UUID uuid, ON__UINT_PTR index) const;
    1214 
    1215  /*
    1216  Description:
    1217  Append the uuids in this class to uuid_list.
    1218  Parameters:
    1219  uuid_list - [in/out]
    1220  Returns:
    1221  Number of uuids added to uuid_list.
    1222  */
    1223  unsigned int GetUuids(
    1224  ON_SimpleArray<ON_UUID>& uuid_list
    1225  ) const;
    1226 
    1227  /*
    1228  Description:
    1229  If you will perform lots of searches before the next
    1230  change to the list, then calling ImproveSearchSpeed()
    1231  will speed up the searches by culling removed objects
    1232  and completely sorting the list so only a binary search
    1233  is required. You may edit the list at any time after
    1234  calling ImproveSearchSpeed(). If you are performing
    1235  a few searches between edits, then excessive calling
    1236  of ImproveSearchSpeed() may actually decrease overall
    1237  program performance.
    1238  */
    1239  void ImproveSearchSpeed();
    1240 
    1241 private:
    1242  ON_UuidPtr* SearchHelper(const ON_UUID*) const;
    1243  unsigned int m_sorted_count = 0;
    1244  unsigned int m_removed_count = 0;
    1245 };
    1246 
    1247 
    1248 /*
    1249 Description:
    1250  The ON_UuidPairList class provides a tool
    1251  to efficiently maintain a list of uuid pairs
    1252  and determine if a uuid is in the list.
    1253  This class is based on the premise that there are
    1254  no duplicate uuids in the list.
    1255 */
    1256 class ON_CLASS ON_UuidPairList : private ON_SimpleArray<ON_UuidPair>
    1257 {
    1258 public:
    1259  ON_UuidPairList();
    1260  ON_UuidPairList(int capacity);
    1261  ~ON_UuidPairList();
    1262  ON_UuidPairList(const ON_UuidPairList& src);
    1264 
    1266 
    1267  /*
    1268  Returns:
    1269  Number of active uuids in the list.
    1270  */
    1271  int Count() const;
    1272 
    1273  /*
    1274  Description:
    1275  Provides an efficient way to empty a list so that it
    1276  can be used again.
    1277  */
    1278  void Empty();
    1279 
    1280  void Reserve( size_t capacity );
    1281 
    1282  /*
    1283  Description:
    1284  Adds a uuid-index pair to the list.
    1285  Parameters:
    1286  id1 - [in] id to add.
    1287  id2 - [in] id to add.
    1288  bCheckForDupicates - [in] if true, then the pair
    1289  is not added if id1 is already in the list.
    1290  If you are certain that the id1 is not in the list
    1291  and you have a have a large collection of uuids,
    1292  then setting bCheckForDupicates=false will
    1293  speed up the addition of uuids.
    1294  Returns:
    1295  True if the pair was added. False if the pair was not added
    1296  because it is already in the collection.
    1297  Remarks:
    1298  You cannot add the pair value ( ON_max_uuid, ON_max_uuid ). This
    1299  pair value is used to mark removed elements in the ON_UuidPairList[].
    1300  */
    1301  bool AddPair(
    1302  ON_UUID id1,
    1303  ON_UUID id2,
    1304  bool bCheckForDupicates=true
    1305  );
    1306 
    1307  /*
    1308  Description:
    1309  Removes an element with a matching id1 from the list.
    1310  Parameters:
    1311  id1 - [in] id to remove
    1312  Returns:
    1313  True if an element was removed. False if the id1
    1314  was not in the list.
    1315  */
    1316  bool RemovePair(
    1317  ON_UUID id1
    1318  );
    1319 
    1320  /*
    1321  Description:
    1322  Removes an element with a matching id pair from the list.
    1323  Parameters:
    1324  id1 - [in]
    1325  id2 - [in]
    1326  Returns:
    1327  True if an element was removed. False if the id pair
    1328  does not appear in the list.
    1329  */
    1330  bool RemovePair(
    1331  ON_UUID id1,
    1332  ON_UUID id2
    1333  );
    1334 
    1335  /*
    1336  Description:
    1337  Determine if an element with a uuid is in the list.
    1338  Parameters:
    1339  id1 - [in]
    1340  id2 - [out] if not nullptr and a matching id1 is found,
    1341  then *id2 is set to the value of the second uuid.
    1342  Returns:
    1343  True if an element was found. Returns false if
    1344  the id1 is not in the list.
    1345  */
    1346  bool FindId1(ON_UUID id1, ON_UUID* id2=0) const;
    1347 
    1348  /*
    1349  Description:
    1350  Determine if an id pair is in the list.
    1351  Returns:
    1352  True if the id pair is in the list.
    1353  False if the id pair is not in the list.
    1354  */
    1355  bool FindPair(ON_UUID id1, ON_UUID id2) const;
    1356 
    1357  /*
    1358  Description:
    1359  Append the value of the first id in each pair to uuid_list[].
    1360  Parameters:
    1361  uuid_list - [in/out]
    1362  Returns:
    1363  Number of ids appended to uuid_list[].
    1364  */
    1365  int GetId1s(
    1366  ON_SimpleArray<ON_UUID>& uuid_list
    1367  ) const;
    1368 
    1369  /*
    1370  Description:
    1371  If you will perform lots of searches before the next
    1372  change to the list, then calling ImproveSearchSpeed()
    1373  will speed up the searches by culling removed objects
    1374  and completely sorting the list so only a binary search
    1375  is required. You may edit the list at any time after
    1376  calling ImproveSearchSpeed(). If you are performing
    1377  a few searches between edits, then excessive calling
    1378  of ImproveSearchSpeed() may actually decrease overall
    1379  program performance.
    1380  */
    1381  void ImproveSearchSpeed();
    1382 
    1383  bool Write(
    1384  class ON_BinaryArchive& archive
    1385  ) const;
    1386 
    1387  bool Read(
    1388  class ON_BinaryArchive& archive
    1389  );
    1390 
    1391 private:
    1392  ON_UuidPair* SearchHelper(const ON_UUID*) const;
    1393  unsigned int m_sorted_count;
    1394  unsigned int m_removed_count;
    1395 };
    1396 
    1397 class ON_CLASS ON_2dexMap : private ON_SimpleArray<ON_2dex>
    1398 {
    1399 public:
    1400  ON_2dexMap();
    1401  ON_2dexMap(int capacity);
    1402  ~ON_2dexMap();
    1403 
    1404  int Count() const;
    1405 
    1406  void Reserve(size_t capacity);
    1407 
    1408  const ON_2dex* Array() const;
    1409 
    1410  ON_2dex operator[](int i) const;
    1411 
    1412  /*
    1413  Description:
    1414  Creates an index map with the values
    1415  (i0,j),...,(i0+count-1,j)
    1416  Parameters:
    1417  count - [in]
    1418  number of elements
    1419  i0 - [in]
    1420  i value of first element
    1421  j - [in]
    1422  j value for all elements
    1423  */
    1424  void Create(int count, int i0, int j);
    1425 
    1426  /*
    1427  Description:
    1428  Searches for an element with a matching i
    1429  and returns its j value. If no matching
    1430  element is found, then not_found_rc is returned.
    1431  Parameters:
    1432  i - [in]
    1433  value of i to search for
    1434  not_found_rc - [in]
    1435  value to return if there is not a match.
    1436  Returns:
    1437  j value
    1438  */
    1439  int FindIndex(
    1440  int i,
    1441  int not_found_rc
    1442  ) const;
    1443 
    1444  /*
    1445  Description:
    1446  Adds and element (i,j). If there is already an entry with
    1447  value (i,*), then no element is added.
    1448  Parameters:
    1449  i - [in]
    1450  i - [in]
    1451  Returns:
    1452  True if and element it added.
    1453  */
    1454  bool AddIndex(
    1455  int i,
    1456  int j
    1457  );
    1458 
    1459  /*
    1460  Description:
    1461  Searches for an element (i,*) and sets its j value to j.
    1462  If there is no element with a matching i, then false
    1463  is returned.
    1464  Parameters:
    1465  i - [in]
    1466  j - [in]
    1467  Returns:
    1468  True if and element exists and was set.
    1469  */
    1470  bool SetIndex(
    1471  int i,
    1472  int j
    1473  );
    1474 
    1475  /*
    1476  Description:
    1477  If an element (i,*) exists, its j value is set. Otherwise
    1478  a new element with value (i,j) is added.
    1479  Parameters:
    1480  i - [in]
    1481  j - [in]
    1482  */
    1483  void SetOrAddIndex(
    1484  int i,
    1485  int j
    1486  );
    1487 
    1488  /*
    1489  Description:
    1490  If an element (i,*) exists, it is removed. If there is
    1491  not an element with a matching i value, then false
    1492  is returned.
    1493  Parameters:
    1494  i - [in]
    1495  Returns:
    1496  True if the element was removed
    1497  */
    1498  bool RemoveIndex(
    1499  int i
    1500  );
    1501 
    1502  const ON_2dex* Find2dex(int i) const;
    1503 
    1504 private:
    1505  bool m_bSorted;
    1506 };
    1507 
    1508 /*
    1509 Description:
    1510  Compare function for Sort and Search methods.
    1511 Returns:
    1512  -1 if *a < *b is true
    1513  1 if *b < *a is true
    1514  0 if niether *a <*b nor *b<*a is true
    1515 Details:
    1516  Use this template functions to sort ON_SimpleArray and
    1517  ON_ClassArray objects into increasing order. The elements
    1518  of the arrays must be a type with an operator < defined.
    1519  In particular it works with built in types like double,
    1520  int and pointers.
    1521 Example:
    1522 
    1523  ON_SimpleArray<int> A;
    1524  A = ...;
    1525  // Sort A in increasing order
    1526  A.QuickSort( ON_CompareIncreasing<double> );
    1527 
    1528 See Also:
    1529  ON_CompareDecreasing
    1530 */
    1531 template< class T>
    1532 static
    1533 int ON_CompareIncreasing( const T* a, const T* b);
    1534 
    1535 /*
    1536 Description:
    1537  Compare function for Sort and Search methods.
    1538 Returns:
    1539  -1 if *b < *a is true
    1540  1 if *a < *b is true
    1541  0 if niether *a < *b nor *b < *a is true
    1542 Details:
    1543  Use this template functions to sort ON_SimpleArray and
    1544  ON_ClassArray objects into decreasing order. The elements
    1545  of the arrays must be a type with an operator < defined.
    1546  In particular it works with built in types like double,
    1547  int and pointers.
    1548 Example:
    1549 
    1550  class C
    1551  {
    1552  public:
    1553  ...
    1554  bool operator<(const C&) const;
    1555  };
    1556  ...
    1557  ON_ClassArray<C> A;
    1558  A = ...;
    1559  // Sort A in descrasing order
    1560  A.QuickSort( ON_CompareDecreasing<C> );
    1561 
    1562 See Also:
    1563  ON_CompareIncreasing
    1564 */
    1565 template< class T>
    1566 static
    1567 int ON_CompareDecreasing( const T* a, const T* b);
    1568 
    1569 
    1570 // definitions of the template functions are in a different file
    1571 // so that Microsoft's developer studio's autocomplete utility
    1572 // will work on the template functions.
    1573 #include "opennurbs_array_defs.h"
    1574 
    1575 
    1576 #endif
    void Empty()
    Sets count to 0, leaves capacity untouched.
    Definition: opennurbs_array_defs.h:558
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(ON_ARRAY_INC_)
    18 #define ON_ARRAY_INC_
    19 
    20 
    21 
    22 ////////////////////////////////////////////////////////////////
    23 //
    24 // The ON_SimpleArray<> template is more efficient than the
    25 // ON_ClassArray<> template, but ON_SimpleArray<> should not
    26 // be used for arrays of classes that require explicit
    27 // construction, destruction, or copy operators.
    28 //
    29 // Elements returned by AppendNew() are memset to zero.
    30 //
    31 // By default, ON_SimpleArray<> uses onrealloc() to manage
    32 // the dynamic array memory. If you want to use something
    33 // besides onrealloc() to manage the array memory, then override
    34 // ON_SimpleArray::Realloc().
    35 
    36 template <class T> class ON_SimpleArray
    37 {
    38 public:
    39  // construction ////////////////////////////////////////////////////////
    40 
    41  // These constructors create an array that uses onrealloc() to manage
    42  // the array memory.
    43  ON_SimpleArray() ON_NOEXCEPT;
    44 
    45  virtual
    47 
    48  // Copy constructor
    50 
    51  ////// Assignment operator
    52  ////// Making a virtual operator= was a mistake.
    53  ////// One reason might have been that the operator is virtual
    54  ////// so ON_UuidList::operator= will be called when one is
    55  ////// passed as an ON_SimpleArray<ON_UUID>& to a function?
    56  ////virtual
    58 
    59 #if defined(ON_HAS_RVALUEREF)
    60  // Clone constructor
    61  ON_SimpleArray( ON_SimpleArray<T>&& ) ON_NOEXCEPT;
    62 
    63  // Clone assignment
    65 #endif
    66 
    67  ON_SimpleArray(size_t); // size_t parameter = initial capacity
    68 
    69  // emergency bailout ///////////////////////////////////////////////////
    70  void EmergencyDestroy(void); // call only when memory used by this array
    71  // may have become invalid for reasons beyond
    72  // your control. EmergencyDestroy() zeros
    73  // anything that could possibly cause
    74  // ~ON_SimpleArray() to crash.
    75 
    76  // query ///////////////////////////////////////////////////////////////
    77 
    78  int Count() const; // number of elements in array
    79  unsigned int UnsignedCount() const;
    80 
    81  int Capacity() const; // capacity of array
    82 
    83  unsigned int SizeOfArray() const; // amount of memory in the m_a[] array
    84 
    85  unsigned int SizeOfElement() const; // amount of memory in an m_a[] array element
    86 
    87  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    88 
    89  // The operator[] does to not check for valid indices.
    90  // The caller is responsibile for insuring that 0 <= i < Capacity()
    91  T& operator[]( int );
    92  T& operator[]( unsigned int );
    93  T& operator[]( ON__INT64 );
    94  T& operator[]( ON__UINT64 );
    95 #if defined(ON_RUNTIME_APPLE)
    96  T& operator[]( size_t );
    97 #endif
    98 
    99  const T& operator[]( int ) const;
    100  const T& operator[]( unsigned int ) const;
    101  const T& operator[]( ON__INT64 ) const;
    102  const T& operator[]( ON__UINT64 ) const;
    103 #if defined(ON_RUNTIME_APPLE)
    104  const T& operator[]( size_t ) const;
    105 #endif
    106 
    107  operator T*(); // The cast operators return a pointer
    108  operator const T*() const; // to the array. If Count() is zero,
    109  // this pointer is nullptr.
    110 
    111  T* First();
    112  const T* First() const; // returns nullptr if count = 0
    113 
    114  // At(index) returns nullptr if index < 0 or index >= count
    115  T* At( int );
    116  T* At( unsigned int );
    117  T* At( ON__INT64 );
    118  T* At( ON__UINT64 );
    119  const T* At( int ) const;
    120  const T* At( unsigned int ) const;
    121  const T* At( ON__INT64 ) const;
    122  const T* At( ON__UINT64 ) const;
    123 
    124  T* Last();
    125  const T* Last() const; // returns nullptr if count = 0
    126 
    127 
    128  // array operations ////////////////////////////////////////////////////
    129 
    130  T& AppendNew(); // Most efficient way to add a new element
    131  // to the array. Increases count by 1.
    132  // Returned element is memset to zero.
    133 
    134  void Append( const T& ); // Append copy of element.
    135  // Increments count by 1.
    136 
    137  void Append( int, const T* ); // Append copy of an array T[count]
    138 
    139 
    140  void Insert( int, const T& ); // Insert copy of element. Uses
    141  // memmove() to perform any
    142  // necessary moving.
    143  // Increases count by 1.
    144 
    145  void Remove(); // Removes last element. Decrements
    146  // count by 1. Does not change capacity.
    147 
    148  virtual
    149  void Remove( int ); // Removes element. Uses memmove() to
    150  // perform any necessary shifting.
    151  // Decrements count by 1. Does not change
    152  // capacity
    153 
    154  void Empty(); // Sets count to 0, leaves capacity untouched.
    155 
    156  void Reverse(); // reverse order
    157 
    158  void Swap(int,int); // swap elements i and j
    159 
    160  //////////
    161  // Search( e ) does a SLOW search of the array starting at array[0]
    162  // and returns the index "i" of the first element that satisfies
    163  // e == array[i]. (== is really memcmp()). If the search is not
    164  // successful, then Search() returns -1. For Search(T) to work
    165  // correctly, T must be a simple type. Use Search(p,compare())
    166  // for Ts that are structs/classes that contain pointers. Search()
    167  // is only suitable for performing infrequent searchs of small
    168  // arrays. Sort the array and use BinarySearch() for performing
    169  // efficient searches.
    170  int Search( const T& ) const;
    171 
    172  //////////
    173  // Search( p, compare ) does a SLOW search of the array starting
    174  // at array[0] and returns the index "i" of the first element
    175  // that satisfies compare(p,&array[i])==0. If the search is not
    176  // successful, then Search() returns -1. Search() is only suitable
    177  // for performing infrequent searches of small arrays. Sort the
    178  // array and use BinarySearch() for performing efficient searches.
    179  // See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T>
    180  int Search( const T*, int (*)(const T*,const T*) ) const;
    181 
    182  //////////
    183  // BinarySearch( p, compare ) does a fast search of a sorted array
    184  // and returns the smallest index "i" of the element that satisifies
    185  // 0==compare(p,&array[i]).
    186  //
    187  // BinarySearch( p, compare, count ) does a fast search of the first
    188  // count element sorted array and returns the smallest index "i" of
    189  // the element that satisifies 0==compare(p,&array[i]). The version
    190  // that takes a "count" is useful when elements are being appended
    191  // during a calculation and the appended elements are not sorted.
    192  //
    193  // If the search is successful,
    194  // BinarySearch() returns the index of the element (>=0).
    195  // If the search is not successful, BinarySearch() returns -1.
    196  // Use QuickSort( compare ) or, in rare cases and after meaningful
    197  // performance testing using optimzed release builds,
    198  // HeapSort( compare ) to sort the array.
    199  // See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T>
    200  int BinarySearch( const T*, int (*)(const T*,const T*) ) const;
    201  int BinarySearch( const T*, int (*)(const T*,const T*), int ) const;
    202 
    203  //////////
    204  // Sorts the array using the heap sort algorithm.
    205  // QuickSort() is generally the better choice.
    206  bool HeapSort( int (*)(const T*,const T*) );
    207 
    208  //////////
    209  // Sorts the array using the quick sort algorithm.
    210  // See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T>
    211  bool QuickSort( int (*)(const T*,const T*) );
    212 
    213  /*
    214  Description:
    215  Sort() fills in the index[] array so that
    216  array[index[i]] <= array[index[i+1]].
    217  The array is not modified.
    218 
    219  Parameters:
    220  sort_algorithm - [in]
    221  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
    222  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
    223  optimized release builds and are confident heap sort is
    224  significantly faster.
    225  index - [out] an array of length Count() that is returned with
    226  some permutation of (0,1,...,Count()-1).
    227  compare - [in] compare function compare(a,b,p) should return
    228  <0 if a<b, 0, if a==b, and >0 if a>b.
    229  Returns:
    230  true if successful
    231  */
    232  bool Sort(
    233  ON::sort_algorithm sort_algorithm,
    234  int* /* index[] */ ,
    235  int (*)(const T*,const T*)
    236  ) const;
    237 
    238  /*
    239  Description:
    240  Sort() fills in the index[] array so that
    241  array[index[i]] <= array[index[i+1]].
    242  The array is not modified.
    243 
    244  Parameters:
    245  sort_algorithm - [in]
    246  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
    247  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
    248  optimized release builds and are confident heap sort is
    249  significantly faster.
    250  index - [out] an array of length Count() that is returned with
    251  some permutation of (0,1,...,Count()-1).
    252  compare - [in] compare function compare(a,b,p) should return
    253  <0 if a<b, 0, if a==b, and >0 if a>b.
    254  p - [in] pointer passed as third argument to compare.
    255 
    256  Returns:
    257  true if successful
    258  */
    259  bool Sort(
    260  ON::sort_algorithm sort_algorithm,
    261  int*, // index[]
    262  int (*)(const T*,const T*,void*), // int compare(const T*,const T*,void* p)
    263  void* // p
    264  ) const;
    265 
    266  //////////
    267  // Permutes the array so that output[i] = input[index[i]].
    268  // The index[] array should be a permutation of (0,...,Count()-1).
    269  bool Permute( const int* /*index[]*/ );
    270 
    271  //////////
    272  // Zeros all array memory.
    273  // Count and capacity are not changed.
    274  void Zero();
    275 
    276  //////////
    277  // Sets all bytes in array memory to value.
    278  // Count and capacity are not changed.
    279  void MemSet(unsigned char);
    280 
    281  // memory managment ////////////////////////////////////////////////////
    282 
    283  T* Reserve( size_t ); // increase capacity to at least the requested value
    284 
    285  void Shrink(); // remove unused capacity
    286 
    287  void Destroy(); // onfree any memory and set count and capacity to zero
    288 
    289  // low level memory managment //////////////////////////////////////////
    290 
    291  // By default, ON_SimpleArray<> uses onrealloc() to manage
    292  // the dynamic array memory. If you want to use something
    293  // besides onrealloc() to manage the array memory, then override
    294  // Realloc(). The T* Realloc(ptr, capacity) should do the following:
    295  //
    296  // 1) If ptr and capacity are zero, return nullptr.
    297  // 2) If ptr is nullptr, an capacity > 0, allocate a memory block of
    298  // capacity*sizeof(T) bytes and return a pointer to this block.
    299  // If the allocation request fails, return nullptr.
    300  // 3) If ptr is not nullptr and capacity is 0, free the memory block
    301  // pointed to by ptr and return nullptr.
    302  // 4) If ptr is not nullptr and capacity > 0, then reallocate the memory
    303  // block and return a pointer to the reallocated block. If the
    304  // reallocation request fails, return nullptr.
    305  //
    306  // NOTE WELL:
    307  // Microsoft's VC 6.0 realloc() contains a bug that can cause
    308  // crashes and should be avoided. See MSDN Knowledge Base article
    309  // ID Q225099 for more information.
    310  virtual
    311  T* Realloc(T*,int); // (re)allocated capacity*sizeof(T) bytes
    312 
    313  T* Array(); // The Array() function return the
    314 
    315  const T* Array() const; // m_a pointer value.
    316 
    317  void SetCount( int ); // If value is <= Capacity(), then
    318  // sets count to specified value.
    319 
    320  T* SetCapacity( size_t ); // Shrink/grows capacity. If value
    321  // is < current Count(), then count
    322  // is reduced to value.
    323  //
    324 
    325  int NewCapacity() const; // When the dynamic array needs to grow,
    326  // this calculates the new value for m_capacity.
    327 
    328  /*
    329  Description:
    330  Expert user tool to take charge of the memory used by
    331  the dyanmic array.
    332  Returns:
    333  A pointer to the array and zeros out this class.
    334  The returned pointer is on the heap and must be
    335  deallocated by calling onfree().
    336  */
    337  T* KeepArray();
    338 
    339  /*
    340  Description:
    341  Do not use this version of SetArray(). Use the one that takes
    342  a pointer, count and capacity.
    343  */
    344  void SetArray(T*);
    345 
    346  /*
    347  Description:
    348  Expert user tool to set the memory used by the dyanmic array.
    349  Parameters:
    350  T* pointer - [in]
    351  int count [in]
    352  int capacity - [in]
    353  m_a is set to pointer, m_count is set to count, and m_capacity
    354  is set to capacity. It is critical that the pointer be one
    355  returned by onmalloc(sz), where sz >= capacity*sizeof(T[0]).
    356  */
    357  void SetArray(T*, int, int);
    358 
    359 protected:
    360  // implimentation //////////////////////////////////////////////////////
    361  void Move( int /* dest index*/, int /* src index */, int /* element count*/ );
    362  T* m_a; // pointer to array memory
    363  int m_count; // 0 <= m_count <= m_capacity
    364  int m_capacity; // actual length of m_a[]
    365 };
    366 
    367 
    368 ////////////////////////////////////////////////////////////////
    369 //
    370 
    371 #if defined(ON_DLL_TEMPLATE)
    372 
    373 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<bool>;
    374 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<char>;
    375 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<unsigned char>;
    376 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<short>;
    377 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<unsigned short>;
    378 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<int>;
    379 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<unsigned int>;
    380 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<float>;
    381 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<double>;
    382 
    383 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<bool*>;
    384 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<char*>;
    385 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<unsigned char*>;
    386 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<short*>;
    387 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<unsigned short*>;
    388 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<int*>;
    389 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<unsigned int*>;
    390 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<float*>;
    391 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<double*>;
    392 
    393 #endif
    394 
    395 
    396 
    397 ////////////////////////////////////////////////////////////////
    398 //
    399 // The ON_ClassArray<> template is designed to be used with
    400 // classes that require non-trivial construction or destruction.
    401 // Any class used with the ON_ClassArray<> template must have a
    402 // robust operator=().
    403 //
    404 // By default, ON_ClassArray<> uses onrealloc() to manage
    405 // the dynamic array memory. If you want to use something
    406 // besides onrealloc() to manage the array memory, then override
    407 // ON_ClassArray::Realloc(). In practice this means that if your
    408 // class has members with back-pointers, then you cannot use
    409 // it in the defaule ON_ClassArray. See ON_ObjectArray
    410 // for an example.
    411 //
    412 template <class T> class ON_ClassArray
    413 {
    414 public:
    415  // construction ////////////////////////////////////////////////////////
    416  ON_ClassArray() ON_NOEXCEPT;
    417  ON_ClassArray( size_t ); // size_t parameter = initial capacity
    418 
    419  // Copy constructor
    421 
    422  virtual
    423  ~ON_ClassArray(); // override for struct member deallocation, etc.
    424 
    425  // Assignment operator
    427 
    428 #if defined(ON_HAS_RVALUEREF)
    429  // Clone constructor
    430  ON_ClassArray( ON_ClassArray<T>&& ) ON_NOEXCEPT;
    431 
    432  // Clone Assignment operator
    433  ON_ClassArray<T>& operator=( ON_ClassArray<T>&& ) ON_NOEXCEPT;
    434 #endif
    435 
    436  // emergency bailout ///////////////////////////////////////////////////
    437  void EmergencyDestroy(void); // call only when memory used by this array
    438  // may have become invalid for reasons beyond
    439  // your control. EmergencyDestroy() zeros
    440  // anything that could possibly cause
    441  // ~ON_ClassArray() to crash.
    442 
    443  // query ///////////////////////////////////////////////////////////////
    444 
    445  int Count() const; // number of elements in array
    446  unsigned int UnsignedCount() const;
    447 
    448  int Capacity() const; // capacity of array
    449 
    450  unsigned int SizeOfArray() const; // amount of memory in the m_a[] array
    451 
    452  unsigned int SizeOfElement() const; // amount of memory in an m_a[] array element
    453 
    454  // The operator[] does to not check for valid indices.
    455  // The caller is responsibile for insuring that 0 <= i < Capacity()
    456  T& operator[]( int );
    457  T& operator[]( unsigned int );
    458  T& operator[]( ON__INT64 );
    459  T& operator[]( ON__UINT64 );
    460 #if defined(ON_RUNTIME_APPLE)
    461  T& operator[]( size_t );
    462 #endif
    463 
    464  const T& operator[]( int ) const;
    465  const T& operator[]( unsigned int ) const;
    466  const T& operator[]( ON__INT64 ) const;
    467  const T& operator[]( ON__UINT64 ) const;
    468 #if defined(ON_RUNTIME_APPLE)
    469  const T& operator[]( size_t ) const;
    470 #endif
    471 
    472  operator T*(); // The cast operators return a pointer
    473  operator const T*() const; // to the array. If Count() is zero,
    474  // this pointer is nullptr.
    475  T* First();
    476  const T* First() const; // returns nullptr if count = 0
    477 
    478  // At(index) returns nullptr if index < 0 or index >= count
    479  T* At( int );
    480  T* At( unsigned int );
    481  T* At( ON__INT64 );
    482  T* At( ON__UINT64 );
    483  const T* At( int ) const;
    484  const T* At( unsigned int ) const;
    485  const T* At( ON__INT64 ) const;
    486  const T* At( ON__UINT64 ) const;
    487 
    488  T* Last();
    489  const T* Last() const; // returns nullptr if count = 0
    490 
    491 
    492  // array operations ////////////////////////////////////////////////////
    493 
    494  T& AppendNew(); // Most efficient way to add a new class
    495  // to the array. Increases count by 1.
    496 
    497  void Append( const T& ); // Append copy of element.
    498  // Increments count by 1.
    499 
    500  void Append( int, const T*); // Append copy of an array T[count]
    501 
    502  void Insert( int, const T& ); // Insert copy of element. Uses
    503  // memmove() to perform any
    504  // necessary moving.
    505  // Increases count by 1.
    506 
    507  void Remove(); // Removes last element. Decrements
    508  // count by 1. Does not change capacity.
    509 
    510  void Remove( int ); // Removes element. Uses memmove() to
    511  // perform any necessary shifting.
    512  // Decrements count by 1. Does not change
    513  // capacity
    514 
    515  void Empty(); // Sets count to 0, leaves capacity untouched.
    516 
    517  void Reverse(); // reverse order
    518 
    519  void Swap(int,int); // swap elements i and j
    520 
    521  //////////
    522  // Search( p, compare ) does a SLOW search of the array starting
    523  // at array[0] and returns the index "i" of the first element
    524  // that satisfies compare(p,&array[i])==0. If the search is not
    525  // successful, then Search() returns -1. Search() is only suitable
    526  // for performing infrequent searches of small arrays. Sort the
    527  // array and use BinarySearch() for performing efficient searches.
    528  int Search( const T*, int (*)(const T*,const T*) ) const;
    529 
    530  //////////
    531  // BinarySearch( p, compare ) does a fast search of a sorted array
    532  // and returns the smallest index "i" of the element that satisifies
    533  // 0==compare(p,&array[i]).
    534  //
    535  // BinarySearch( p, compare, count ) does a fast search of the first
    536  // count element sorted array and returns the smallest index "i" of
    537  // the element that satisifies 0==compare(p,&array[i]). The version
    538  // that takes a "count" is useful when elements are being appended
    539  // during a calculation and the appended elements are not sorted.
    540  //
    541  // If the search is successful,
    542  // BinarySearch() returns the index of the element (>=0).
    543  // If the search is not successful, BinarySearch() returns -1.
    544  // Use QuickSort( compare ) or, in rare cases and after meaningful
    545  // performance testing using optimzed release builds,
    546  // HeapSort( compare ) to sort the array.
    547  // See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T>
    548  int BinarySearch( const T*, int (*)(const T*,const T*) ) const;
    549  int BinarySearch( const T*, int (*)(const T*,const T*), int ) const;
    550 
    551  //////////
    552  // Sorts the array using the heap sort algorithm.
    553  // See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T>
    554  // QuickSort() is generally the better choice.
    555  virtual
    556  bool HeapSort( int (*)(const T*,const T*) );
    557 
    558  //////////
    559  // Sorts the array using the heap sort algorithm.
    560  virtual
    561  bool QuickSort( int (*)(const T*,const T*) );
    562 
    563  /*
    564  Description:
    565  Sort() fills in the index[] array so that
    566  array[index[i]] <= array[index[i+1]].
    567  The array is not modified.
    568 
    569  Parameters:
    570  sort_algorithm - [in]
    571  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
    572  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
    573  optimized release builds and are confident heap sort is
    574  significantly faster.
    575  index - [out] an array of length Count() that is returned with
    576  some permutation of (0,1,...,Count()-1).
    577  compare - [in] compare function compare(a,b) should return
    578  <0 if a<b, 0, if a==b, and >0 if a>b.
    579 
    580  Returns:
    581  true if successful
    582  */
    583  bool Sort(
    584  ON::sort_algorithm sort_algorithm,
    585  int* /* index[] */ ,
    586  int (*)(const T*,const T*)
    587  ) const;
    588 
    589  /*
    590  Description:
    591  Sort() fills in the index[] array so that
    592  array[index[i]] <= array[index[i+1]].
    593  The array is not modified.
    594 
    595  Parameters:
    596  sort_algorithm - [in]
    597  ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort
    598  Use ON::sort_algorithm::heap_sort only if you have done extensive testing with
    599  optimized release builds and are confident heap sort is
    600  significantly faster.
    601  index - [out] an array of length Count() that is returned with
    602  some permutation of (0,1,...,Count()-1).
    603  compare - [in] compare function compare(a,b,p) should return
    604  <0 if a<b, 0, if a==b, and >0 if a>b.
    605  p - [in] pointer passed as third argument to compare.
    606 
    607  Returns:
    608  true if successful
    609  */
    610  bool Sort(
    611  ON::sort_algorithm sort_algorithm,
    612  int*, // index[]
    613  int (*)(const T*,const T*,void*), // int compare(const T*,const T*,void* p)
    614  void* // p
    615  ) const;
    616 
    617  //////////
    618  // Permutes the array so that output[i] = input[index[i]].
    619  // The index[] array should be a permutation of (0,...,Count()-1).
    620  bool Permute( const int* /*index[]*/ );
    621 
    622  //////////
    623  // Destroys all elements and fills them with values
    624  // set by the defualt constructor.
    625  // Count and capacity are not changed.
    626  void Zero();
    627 
    628  // memory managment /////////////////////////////////////////////////
    629 
    630  T* Reserve( size_t ); // increase capacity to at least the requested value
    631 
    632  void Shrink(); // remove unused capacity
    633 
    634  void Destroy(); // onfree any memory and set count and capacity to zero
    635 
    636  // low level memory managment ///////////////////////////////////////
    637 
    638  // By default, ON_ClassArray<> uses onrealloc() to manage
    639  // the dynamic array memory. If you want to use something
    640  // besides onrealloc() to manage the array memory, then override
    641  // Realloc(). The T* Realloc(ptr, capacity) should do the following:
    642  //
    643  // 1) If ptr and capacity are zero, return nullptr.
    644  // 2) If ptr is nullptr, an capacity > 0, allocate a memory block of
    645  // capacity*sizeof(T) bytes and return a pointer to this block.
    646  // If the allocation request fails, return nullptr.
    647  // 3) If ptr is not nullptr and capacity is 0, free the memory block
    648  // pointed to by ptr and return nullptr.
    649  // 4) If ptr is not nullptr and capacity > 0, then reallocate the memory
    650  // block and return a pointer to the reallocated block. If the
    651  // reallocation request fails, return nullptr.
    652  //
    653  // NOTE WELL:
    654  // Microsoft's VC 6.0 realloc() contains a bug that can cause
    655  // crashes and should be avoided. See MSDN Knowledge Base article
    656  // ID Q225099 for more information.
    657  virtual
    658  T* Realloc(T*,int); // (re)allocated capacity*sizeof(T) bytes
    659 
    660  T* Array(); // The Array() function return the
    661 
    662  const T* Array() const; // m_a pointer value.
    663 
    664  void SetCount( int ); // If value is <= Capacity(), then
    665  // sets count to specified value.
    666 
    667  T* SetCapacity( size_t ); // Shrink/grows capacity. If value
    668  // is < current Count(), then count
    669  // is reduced to value.
    670 
    671  int NewCapacity() const; // When the dynamic array needs to grow,
    672  // this calculates the new value for m_capacity.
    673 
    674  T* KeepArray(); // returns pointer to array and zeros
    675  // out this class. Caller is responsible
    676  // for calling destructor on each element
    677  // and then using onfree() to release array
    678  // memory. E.g.,
    679  //
    680  // for (int i=capacity;i>=0;i--) {
    681  // array[i].~T();
    682  // }
    683  // onfree(array);
    684 
    685  /*
    686  Description:
    687  Do not use this version of SetArray(). Use the one that takes
    688  a pointer, count and capacity: SetArray(pointer,count,capacity)
    689  */
    690  void SetArray(T*);
    691 
    692  /*
    693  Description:
    694  Expert user tool to set the memory used by the dyanmic array.
    695  Parameters:
    696  T* pointer - [in]
    697  int count - [in] 0 <= count <= capacity
    698  int capacity - [in]
    699  m_a is set to pointer, m_count is set to count, and m_capacity
    700  is set to capacity. It is critical that the pointer be one
    701  returned by onmalloc(sz), where sz >= capacity*sizeof(T[0]),
    702  and that the in-place operator new has been used to initialize
    703  each element of the array.
    704  */
    705  void SetArray(T*, int, int);
    706 
    707 protected:
    708  // implimentation //////////////////////////////////////////////////////
    709  void Move( int /* dest index*/, int /* src index */, int /* element count*/ );
    710  void ConstructDefaultElement(T*);
    711  void DestroyElement(T&);
    712  T* m_a; // pointer to array memory
    713  int m_count; // 0 <= m_count <= m_capacity
    714  int m_capacity; // actual length of m_a[]
    715 };
    716 
    717 #if defined(ON_DLL_TEMPLATE)
    718 
    719 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_String>;
    720 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_wString>;
    721 
    722 #endif
    723 
    724 /*
    725 Description:
    726  ON_Object array is used to store lists of classes that are
    727  derived from ON_Object. It differs from ON_ClassArray in
    728  that the virtual ON_Object::MemoryRelocate function is called
    729  when growing the dynamic array requires changing the location
    730  of the memory buffer used to store the elements in the array.
    731 */
    732 template <class T> class ON_ObjectArray : public ON_ClassArray<T>
    733 {
    734 public:
    735  ON_ObjectArray();
    736  ~ON_ObjectArray(); // override for struct member deallocation, etc.
    737  ON_ObjectArray( size_t ); // size_t parameter = initial capacity
    740 
    741 #if defined(ON_HAS_RVALUEREF)
    742  // Clone constructor
    744 
    745  // Clone Assignment operator
    747 #endif
    748 
    749  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    750 
    751  // virtual ON_ClassArray<T> override that
    752  // calls MemoryRelocate on each element after
    753  // the reallocation.
    754  T* Realloc(T*,int);
    755 
    756  // virtual ON_ClassArray<T> override that
    757  // calls MemoryRelocate on each element after
    758  // the heap sort.
    759  // QuickSort() is generally the better choice.
    760  bool HeapSort( int (*)(const T*,const T*) );
    761 
    762  // virtual ON_ClassArray<T> override that
    763  // calls MemoryRelocate on each element after
    764  // the quick sort.
    765  bool QuickSort( int (*)(const T*,const T*) );
    766 };
    767 
    768 class ON_CLASS ON_UuidPair
    769 {
    770 public:
    771  /*
    772  Description:
    773  Compares m_uuid[0] and ignores m_uuid[1]
    774  */
    775  static
    776  int CompareFirstUuid(const class ON_UuidPair*,const class ON_UuidPair*);
    777 
    778  /*
    779  Description:
    780  Compares m_uuid[1] and ignores m_uuid[0]
    781  */
    782  static
    783  int CompareSecondUuid(const class ON_UuidPair*,const class ON_UuidPair*);
    784 
    785  /*
    786  Description:
    787  Compares m_uuid[0] then m_uuid[1].
    788  */
    789  static
    790  int Compare(const class ON_UuidPair*,const class ON_UuidPair*);
    791 
    792  ON_UuidPair();
    793  ON_UUID m_uuid[2];
    794 };
    795 
    796 #if defined(ON_DLL_TEMPLATE)
    797 
    798 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_UUID>;
    799 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_UuidIndex>;
    800 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_UuidPtr>;
    801 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_UuidPair>;
    802 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_SimpleArray<int> >;
    803 
    804 #endif
    805 
    806 
    807 /*
    808 Description:
    809  The ON_UuidList class provides a tool to efficiently
    810  maintain a list of uuids and determine if a uuid is
    811  in the list. This class is based on the premise that
    812  there are no duplicate uuids in the list.
    813 */
    814 class ON_CLASS ON_UuidList : private ON_SimpleArray<ON_UUID>
    815 {
    816 public:
    817  ON_UuidList();
    818  ON_UuidList(int capacity);
    819  ~ON_UuidList();
    820  ON_UuidList(const ON_UuidList& src);
    821  ON_UuidList& operator=(const ON_UuidList& src);
    822 
    823  /*
    824  Description:
    825  Fast uuid compare. Not necessarily the same
    826  as ON_UuidCompare().
    827  */
    828  static
    829  int CompareUuid( const ON_UUID* a, const ON_UUID* b );
    830 
    831  /*
    832  Returns:
    833  Number of active uuids in the list.
    834  */
    835  int Count() const;
    836 
    837  /*
    838  Returns:
    839  Array of uuids in the list. Sorted with
    840  respect to ON_UuidList::CompareUuid().
    841  Remarks:
    842  Calling AddUuid() may grow the dynamic array
    843  and make the pointer invalid.
    844  */
    845  const ON_UUID* Array() const;
    846 
    847  /*
    848  Description:
    849  Provides an efficient way to empty a list so that it
    850  can be used again.
    851  */
    852  void Empty();
    853 
    854  /*
    855  Description:
    856  Destroy list. If list will be reused, Empty() is more
    857  efficient.
    858  */
    859  void Destroy();
    860 
    861  void Reserve(size_t capacity);
    862 
    863  /*
    864  Description:
    865  Makes the uuid list as efficent as possible in both search
    866  speed and memory usage. Use Compact() when a uuid list
    867  will be in use but is not likely to be modifed. A list
    868  that has been compacted can still be modified.
    869  */
    870  void Compact();
    871 
    872  /*
    873  Description:
    874  Adds a uuid to the list.
    875  Parameters:
    876  uuid - [in] id to add.
    877  bCheckForDupicates - [in] if true, then the uuid
    878  is not added if it is already in the list.
    879  If you are certain that the uuid is not in the
    880  list and you are going to have a large list of uuids,
    881  then setting bCheckForDupicates=false will
    882  speed up the addition of uuids.
    883  Returns:
    884  True if uuid was added. False if uuid was not added
    885  because it is already in the collection.
    886  */
    887  bool AddUuid(ON_UUID uuid, bool bCheckForDupicates=true);
    888 
    889  /*
    890  Description:
    891  Removes a uuid from the list.
    892  Parameters:
    893  uuid - [in] id to remove
    894  Returns:
    895  True if uuid was in the list and was removed.
    896  False if uuid was not in the list.
    897  */
    898  bool RemoveUuid(ON_UUID uuid);
    899 
    900  /*
    901  Description:
    902  Determine if a uuid is in the list.
    903  Returns:
    904  True if uuid is in the list.
    905  */
    906  bool FindUuid(ON_UUID uuid) const;
    907 
    908  /*
    909  Description:
    910  Saves the uuid list in an archive.
    911  Parameters:
    912  archive - [in] archive to write to.
    913  Returns:
    914  true if write was successful.
    915  */
    916  bool Write(
    917  class ON_BinaryArchive& archive
    918  ) const;
    919 
    920  /*
    921  Description:
    922  Saves the uuid list in an archive.
    923  Parameters:
    924  archive - [in] archive to write to.
    925  bSortBeforeWrite - [in]
    926  True if ids should be sorted before the write
    927  so future lookups will be fast. False if
    928  the current state of the sorted/unsorted bits
    929  should be preserved.
    930  Returns:
    931  true if write was successful.
    932  */
    933  bool Write(
    934  class ON_BinaryArchive& archive,
    935  bool bSortBeforeWrite
    936  ) const;
    937 
    938  /*
    939  Description:
    940  Read the uuid list from an archive.
    941  Parameters:
    942  archive - [in] archive to read from.
    943  Returns:
    944  true if the read was successful.
    945  */
    946  bool Read(
    947  class ON_BinaryArchive& archive
    948  );
    949 
    950  /*
    951  Description:
    952  Read the uuid list from an archive.
    953  Parameters:
    954  archive - [in]
    955  archive to read from.
    956  bool bSortAfterRead - [in]
    957  True if ids should be sorted after the read
    958  so future lookups will be fast. False if
    959  the state of the sorted/unsorted bits that
    960  existed at write time should be preserved.
    961  Returns:
    962  true if the read was successful.
    963  */
    964  bool Read(
    965  class ON_BinaryArchive& archive,
    966  bool bSortAferRead
    967  );
    968 
    969  /*
    970  Description:
    971  Append the uuids in this class to uuid_list.
    972  Parameters:
    973  uuid_list - [in/out]
    974  Returns:
    975  Number of uuids added to uuid_list.
    976  */
    977  int GetUuids(
    978  ON_SimpleArray<ON_UUID>& uuid_list
    979  ) const;
    980 
    981  /*
    982  Description:
    983  This tool is used in rare situations when the object ids
    984  stored in the uuid list need to be remapped.
    985  Parameters:
    986  uuid_remap - [in]
    987  Is it critical that uuid_remap[] be sorted with respect
    988  to ON_UuidPair::CompareFirstUuid.
    989  */
    990  void RemapUuids(
    991  const ON_SimpleArray<ON_UuidPair>& uuid_remap
    992  );
    993 
    994 private:
    995  void PurgeHelper();
    996  void SortHelper();
    997  ON_UUID* SearchHelper(const ON_UUID*) const;
    998  int m_sorted_count;
    999  int m_removed_count;
    1000 };
    1001 
    1002 /*
    1003 Description:
    1004  The ON_UuidList class provides a tool
    1005  to efficiently maintain a list of uuid-index
    1006  pairs and determine if a uuid is in the list.
    1007  This class is based on the premise that there are
    1008  no duplicate uuids in the list.
    1009 */
    1010 class ON_CLASS ON_UuidIndexList : private ON_SimpleArray<ON_UuidIndex>
    1011 {
    1012 public:
    1013  ON_UuidIndexList() = default;
    1014  ON_UuidIndexList(size_t capacity);
    1015  ~ON_UuidIndexList() = default;
    1016  ON_UuidIndexList(const ON_UuidIndexList& src);
    1018 
    1019  /*
    1020  Returns:
    1021  Number of active uuids in the list.
    1022  */
    1023  unsigned int Count() const;
    1024 
    1025  /*
    1026  Description:
    1027  Provides an efficient way to empty a list so that it
    1028  can be used again.
    1029  */
    1030  void RemoveAll();
    1031 
    1032  void Reserve( size_t capacity );
    1033 
    1034  /*
    1035  Description:
    1036  Adds a uuid-index pair to the list.
    1037  Parameters:
    1038  uuid - [in] id to add.
    1039  This uuid cannot be ON_max_uuid because ON_max_uuid
    1040  is
    1041  bCheckForDupicates - [in] if true, then the uuid
    1042  is not added if it is already in the list.
    1043  If you are certain that the uuid is not in the list
    1044  and you have a have a large collection of uuids,
    1045  then setting bCheckForDupicates=false will
    1046  speed up the addition of uuids.
    1047  Returns:
    1048  True if uuid was added. False if uuid was not added
    1049  because it is already in the collection.
    1050  */
    1051  bool AddUuidIndex(
    1052  ON_UUID uuid,
    1053  int index,
    1054  bool bCheckForDupicates=true);
    1055 
    1056  /*
    1057  Description:
    1058  Removes an element with a matching uuid from the list.
    1059  Parameters:
    1060  uuid - [in] id to remove
    1061  Returns:
    1062  True if an element was removed. False if the uuid
    1063  was not in the list.
    1064  */
    1065  bool RemoveUuid(
    1066  ON_UUID uuid
    1067  );
    1068 
    1069  /*
    1070  Description:
    1071  Determine if an element with a uuid is in the list.
    1072  Parameters:
    1073  index - [out] if not nullptr and a matching uuid is found,
    1074  then *index is set to the value of the index.
    1075  Returns:
    1076  True if an element was found. Returns false if
    1077  the uuid is not in the list.
    1078  */
    1079  bool FindUuid(ON_UUID uuid) const;
    1080  bool FindUuid(ON_UUID uuid, int* index) const;
    1081 
    1082  /*
    1083  Description:
    1084  Determine if a uuid-index pair is in the list.
    1085  Returns:
    1086  True if the uuid-index pair is in the list.
    1087  Returns false if the uuid-index pair is not
    1088  in the list.
    1089  */
    1090  bool FindUuidIndex(ON_UUID uuid, int index) const;
    1091 
    1092  /*
    1093  Description:
    1094  Append the uuids in this class to uuid_list.
    1095  Parameters:
    1096  uuid_list - [in/out]
    1097  Returns:
    1098  Number of uuids added to uuid_list.
    1099  */
    1100  unsigned int GetUuids(
    1101  ON_SimpleArray<ON_UUID>& uuid_list
    1102  ) const;
    1103 
    1104  /*
    1105  Description:
    1106  If you will perform lots of searches before the next
    1107  change to the list, then calling ImproveSearchSpeed()
    1108  will speed up the searches by culling removed objects
    1109  and completely sorting the list so only a binary search
    1110  is required. You may edit the list at any time after
    1111  calling ImproveSearchSpeed(). If you are performing
    1112  a few searches between edits, then excessive calling
    1113  of ImproveSearchSpeed() may actually decrease overall
    1114  program performance.
    1115  */
    1116  void ImproveSearchSpeed();
    1117 
    1118 private:
    1119  ON_UuidIndex* SearchHelper(const ON_UUID*) const;
    1120  unsigned int m_sorted_count = 0;
    1121  unsigned int m_removed_count = 0;
    1122 };
    1123 
    1124 
    1125 /*
    1126 Description:
    1127  The ON_UuidList class provides a tool
    1128  to efficiently maintain a list of uuid-pointer
    1129  pairs and determine if a uuid is in the list.
    1130  This class is based on the premise that there are
    1131  no duplicate uuids in the list.
    1132 */
    1133 class ON_CLASS ON_UuidPtrList : private ON_SimpleArray<ON_UuidPtr>
    1134 {
    1135 public:
    1136  ON_UuidPtrList() = default;
    1137  ON_UuidPtrList(size_t capacity);
    1138  ~ON_UuidPtrList() = default;
    1139  ON_UuidPtrList(const ON_UuidPtrList& src);
    1141 
    1142  /*
    1143  Returns:
    1144  Number of active uuids in the list.
    1145  */
    1146  unsigned int Count() const;
    1147 
    1148  /*
    1149  Description:
    1150  Provides an efficient way to empty a list so that it
    1151  can be used again.
    1152  */
    1153  void RemoveAll();
    1154 
    1155  void Reserve( size_t capacity );
    1156 
    1157  /*
    1158  Description:
    1159  Adds a uuid-index pair to the list.
    1160  Parameters:
    1161  uuid - [in] id to add.
    1162  This uuid cannot be ON_max_uuid because ON_max_uuid
    1163  is
    1164  bCheckForDupicates - [in] if true, then the uuid
    1165  is not added if it is already in the list.
    1166  If you are certain that the uuid is not in the list
    1167  and you have a have a large collection of uuids,
    1168  then setting bCheckForDupicates=false will
    1169  speed up the addition of uuids.
    1170  Returns:
    1171  True if uuid was added. False if uuid was not added
    1172  because it is already in the collection.
    1173  */
    1174  bool AddUuidPtr(
    1175  ON_UUID uuid,
    1176  ON__UINT_PTR ptr,
    1177  bool bCheckForDupicates=true);
    1178 
    1179  /*
    1180  Description:
    1181  Removes an element with a matching uuid from the list.
    1182  Parameters:
    1183  uuid - [in] id to remove
    1184  Returns:
    1185  True if an element was removed. False if the uuid
    1186  was not in the list.
    1187  */
    1188  bool RemoveUuid(
    1189  ON_UUID uuid
    1190  );
    1191 
    1192  /*
    1193  Description:
    1194  Determine if an element with a uuid is in the list.
    1195  Parameters:
    1196  ptr - [out] if not nullptr and a matching uuid is found,
    1197  then *ptr is set to the value of the m_ptr.
    1198  Returns:
    1199  True if an element was found. Returns false if
    1200  the uuid is not in the list.
    1201  */
    1202  bool FindUuid(ON_UUID uuid) const;
    1203  bool FindUuid(ON_UUID uuid, ON__UINT_PTR* ptr) const;
    1204 
    1205  /*
    1206  Description:
    1207  Determine if a uuid-index pair is in the list.
    1208  Returns:
    1209  True if the uuid-index pair is in the list.
    1210  Returns false if the uuid-index pair is not
    1211  in the list.
    1212  */
    1213  bool FindUuidPtr(ON_UUID uuid, ON__UINT_PTR index) const;
    1214 
    1215  /*
    1216  Description:
    1217  Append the uuids in this class to uuid_list.
    1218  Parameters:
    1219  uuid_list - [in/out]
    1220  Returns:
    1221  Number of uuids added to uuid_list.
    1222  */
    1223  unsigned int GetUuids(
    1224  ON_SimpleArray<ON_UUID>& uuid_list
    1225  ) const;
    1226 
    1227  /*
    1228  Description:
    1229  If you will perform lots of searches before the next
    1230  change to the list, then calling ImproveSearchSpeed()
    1231  will speed up the searches by culling removed objects
    1232  and completely sorting the list so only a binary search
    1233  is required. You may edit the list at any time after
    1234  calling ImproveSearchSpeed(). If you are performing
    1235  a few searches between edits, then excessive calling
    1236  of ImproveSearchSpeed() may actually decrease overall
    1237  program performance.
    1238  */
    1239  void ImproveSearchSpeed();
    1240 
    1241 private:
    1242  ON_UuidPtr* SearchHelper(const ON_UUID*) const;
    1243  unsigned int m_sorted_count = 0;
    1244  unsigned int m_removed_count = 0;
    1245 };
    1246 
    1247 
    1248 /*
    1249 Description:
    1250  The ON_UuidPairList class provides a tool
    1251  to efficiently maintain a list of uuid pairs
    1252  and determine if a uuid is in the list.
    1253  This class is based on the premise that there are
    1254  no duplicate uuids in the list.
    1255 */
    1256 class ON_CLASS ON_UuidPairList : private ON_SimpleArray<ON_UuidPair>
    1257 {
    1258 public:
    1259  ON_UuidPairList();
    1260  ON_UuidPairList(int capacity);
    1261  ~ON_UuidPairList();
    1262  ON_UuidPairList(const ON_UuidPairList& src);
    1264 
    1266 
    1267  /*
    1268  Returns:
    1269  Number of active uuids in the list.
    1270  */
    1271  int Count() const;
    1272 
    1273  /*
    1274  Description:
    1275  Provides an efficient way to empty a list so that it
    1276  can be used again.
    1277  */
    1278  void Empty();
    1279 
    1280  void Reserve( size_t capacity );
    1281 
    1282  /*
    1283  Description:
    1284  Adds a uuid-index pair to the list.
    1285  Parameters:
    1286  id1 - [in] id to add.
    1287  id2 - [in] id to add.
    1288  bCheckForDupicates - [in] if true, then the pair
    1289  is not added if id1 is already in the list.
    1290  If you are certain that the id1 is not in the list
    1291  and you have a have a large collection of uuids,
    1292  then setting bCheckForDupicates=false will
    1293  speed up the addition of uuids.
    1294  Returns:
    1295  True if the pair was added. False if the pair was not added
    1296  because it is already in the collection.
    1297  Remarks:
    1298  You cannot add the pair value ( ON_max_uuid, ON_max_uuid ). This
    1299  pair value is used to mark removed elements in the ON_UuidPairList[].
    1300  */
    1301  bool AddPair(
    1302  ON_UUID id1,
    1303  ON_UUID id2,
    1304  bool bCheckForDupicates=true
    1305  );
    1306 
    1307  /*
    1308  Description:
    1309  Removes an element with a matching id1 from the list.
    1310  Parameters:
    1311  id1 - [in] id to remove
    1312  Returns:
    1313  True if an element was removed. False if the id1
    1314  was not in the list.
    1315  */
    1316  bool RemovePair(
    1317  ON_UUID id1
    1318  );
    1319 
    1320  /*
    1321  Description:
    1322  Removes an element with a matching id pair from the list.
    1323  Parameters:
    1324  id1 - [in]
    1325  id2 - [in]
    1326  Returns:
    1327  True if an element was removed. False if the id pair
    1328  does not appear in the list.
    1329  */
    1330  bool RemovePair(
    1331  ON_UUID id1,
    1332  ON_UUID id2
    1333  );
    1334 
    1335  /*
    1336  Description:
    1337  Determine if an element with a uuid is in the list.
    1338  Parameters:
    1339  id1 - [in]
    1340  id2 - [out] if not nullptr and a matching id1 is found,
    1341  then *id2 is set to the value of the second uuid.
    1342  Returns:
    1343  True if an element was found. Returns false if
    1344  the id1 is not in the list.
    1345  */
    1346  bool FindId1(ON_UUID id1, ON_UUID* id2=0) const;
    1347 
    1348  /*
    1349  Description:
    1350  Determine if an id pair is in the list.
    1351  Returns:
    1352  True if the id pair is in the list.
    1353  False if the id pair is not in the list.
    1354  */
    1355  bool FindPair(ON_UUID id1, ON_UUID id2) const;
    1356 
    1357  /*
    1358  Description:
    1359  Append the value of the first id in each pair to uuid_list[].
    1360  Parameters:
    1361  uuid_list - [in/out]
    1362  Returns:
    1363  Number of ids appended to uuid_list[].
    1364  */
    1365  int GetId1s(
    1366  ON_SimpleArray<ON_UUID>& uuid_list
    1367  ) const;
    1368 
    1369  /*
    1370  Description:
    1371  If you will perform lots of searches before the next
    1372  change to the list, then calling ImproveSearchSpeed()
    1373  will speed up the searches by culling removed objects
    1374  and completely sorting the list so only a binary search
    1375  is required. You may edit the list at any time after
    1376  calling ImproveSearchSpeed(). If you are performing
    1377  a few searches between edits, then excessive calling
    1378  of ImproveSearchSpeed() may actually decrease overall
    1379  program performance.
    1380  */
    1381  void ImproveSearchSpeed();
    1382 
    1383  bool Write(
    1384  class ON_BinaryArchive& archive
    1385  ) const;
    1386 
    1387  bool Read(
    1388  class ON_BinaryArchive& archive
    1389  );
    1390 
    1391 private:
    1392  ON_UuidPair* SearchHelper(const ON_UUID*) const;
    1393  unsigned int m_sorted_count;
    1394  unsigned int m_removed_count;
    1395 };
    1396 
    1397 class ON_CLASS ON_2dexMap : private ON_SimpleArray<ON_2dex>
    1398 {
    1399 public:
    1400  ON_2dexMap();
    1401  ON_2dexMap(int capacity);
    1402  ~ON_2dexMap();
    1403 
    1404  int Count() const;
    1405 
    1406  void Reserve(size_t capacity);
    1407 
    1408  const ON_2dex* Array() const;
    1409 
    1410  ON_2dex operator[](int i) const;
    1411 
    1412  /*
    1413  Description:
    1414  Creates an index map with the values
    1415  (i0,j),...,(i0+count-1,j)
    1416  Parameters:
    1417  count - [in]
    1418  number of elements
    1419  i0 - [in]
    1420  i value of first element
    1421  j - [in]
    1422  j value for all elements
    1423  */
    1424  void Create(int count, int i0, int j);
    1425 
    1426  /*
    1427  Description:
    1428  Searches for an element with a matching i
    1429  and returns its j value. If no matching
    1430  element is found, then not_found_rc is returned.
    1431  Parameters:
    1432  i - [in]
    1433  value of i to search for
    1434  not_found_rc - [in]
    1435  value to return if there is not a match.
    1436  Returns:
    1437  j value
    1438  */
    1439  int FindIndex(
    1440  int i,
    1441  int not_found_rc
    1442  ) const;
    1443 
    1444  /*
    1445  Description:
    1446  Adds and element (i,j). If there is already an entry with
    1447  value (i,*), then no element is added.
    1448  Parameters:
    1449  i - [in]
    1450  i - [in]
    1451  Returns:
    1452  True if and element it added.
    1453  */
    1454  bool AddIndex(
    1455  int i,
    1456  int j
    1457  );
    1458 
    1459  /*
    1460  Description:
    1461  Searches for an element (i,*) and sets its j value to j.
    1462  If there is no element with a matching i, then false
    1463  is returned.
    1464  Parameters:
    1465  i - [in]
    1466  j - [in]
    1467  Returns:
    1468  True if and element exists and was set.
    1469  */
    1470  bool SetIndex(
    1471  int i,
    1472  int j
    1473  );
    1474 
    1475  /*
    1476  Description:
    1477  If an element (i,*) exists, its j value is set. Otherwise
    1478  a new element with value (i,j) is added.
    1479  Parameters:
    1480  i - [in]
    1481  j - [in]
    1482  */
    1483  void SetOrAddIndex(
    1484  int i,
    1485  int j
    1486  );
    1487 
    1488  /*
    1489  Description:
    1490  If an element (i,*) exists, it is removed. If there is
    1491  not an element with a matching i value, then false
    1492  is returned.
    1493  Parameters:
    1494  i - [in]
    1495  Returns:
    1496  True if the element was removed
    1497  */
    1498  bool RemoveIndex(
    1499  int i
    1500  );
    1501 
    1502  const ON_2dex* Find2dex(int i) const;
    1503 
    1504 private:
    1505  bool m_bSorted;
    1506 };
    1507 
    1508 /*
    1509 Description:
    1510  Compare function for Sort and Search methods.
    1511 Returns:
    1512  -1 if *a < *b is true
    1513  1 if *b < *a is true
    1514  0 if niether *a <*b nor *b<*a is true
    1515 Details:
    1516  Use this template functions to sort ON_SimpleArray and
    1517  ON_ClassArray objects into increasing order. The elements
    1518  of the arrays must be a type with an operator < defined.
    1519  In particular it works with built in types like double,
    1520  int and pointers.
    1521 Example:
    1522 
    1523  ON_SimpleArray<int> A;
    1524  A = ...;
    1525  // Sort A in increasing order
    1526  A.QuickSort( ON_CompareIncreasing<double> );
    1527 
    1528 See Also:
    1529  ON_CompareDecreasing
    1530 */
    1531 template< class T>
    1532 static
    1533 int ON_CompareIncreasing( const T* a, const T* b);
    1534 
    1535 /*
    1536 Description:
    1537  Compare function for Sort and Search methods.
    1538 Returns:
    1539  -1 if *b < *a is true
    1540  1 if *a < *b is true
    1541  0 if niether *a < *b nor *b < *a is true
    1542 Details:
    1543  Use this template functions to sort ON_SimpleArray and
    1544  ON_ClassArray objects into decreasing order. The elements
    1545  of the arrays must be a type with an operator < defined.
    1546  In particular it works with built in types like double,
    1547  int and pointers.
    1548 Example:
    1549 
    1550  class C
    1551  {
    1552  public:
    1553  ...
    1554  bool operator<(const C&) const;
    1555  };
    1556  ...
    1557  ON_ClassArray<C> A;
    1558  A = ...;
    1559  // Sort A in descrasing order
    1560  A.QuickSort( ON_CompareDecreasing<C> );
    1561 
    1562 See Also:
    1563  ON_CompareIncreasing
    1564 */
    1565 template< class T>
    1566 static
    1567 int ON_CompareDecreasing( const T* a, const T* b);
    1568 
    1569 
    1570 // definitions of the template functions are in a different file
    1571 // so that Microsoft's developer studio's autocomplete utility
    1572 // will work on the template functions.
    1573 #include "opennurbs_array_defs.h"
    1574 
    1575 
    1576 #endif
    void Empty()
    Sets count to 0, leaves capacity untouched.
    Definition: opennurbs_array_defs.h:558
    int Capacity() const
    capacity of array
    Definition: opennurbs_array_defs.h:173
    virtual ~ON_SimpleArray()
    Definition: opennurbs_array_defs.h:90
    Definition: opennurbs_array.h:1010
    @@ -130,9 +128,9 @@ $(function() {
    diff --git a/6/d3/d04/class_o_n__3d_ray.html b/6/d3/d04/class_o_n__3d_ray.html index c196c61d..5e9c737d 100644 --- a/6/d3/d04/class_o_n__3d_ray.html +++ b/6/d3/d04/class_o_n__3d_ray.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dRay Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d3/d0a/class_o_n___binary_archive-members.html b/6/d3/d0a/class_o_n___binary_archive-members.html index 6b2b25dd..d868713e 100644 --- a/6/d3/d0a/class_o_n___binary_archive-members.html +++ b/6/d3/d0a/class_o_n___binary_archive-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d13/class_o_n___xform.html b/6/d3/d13/class_o_n___xform.html index cd72c66e..78e7cbf6 100644 --- a/6/d3/d13/class_o_n___xform.html +++ b/6/d3/d13/class_o_n___xform.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Xform Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Description: Computes 3d point clipping flags and returns an int with bits set to indicate if the point is outside of the clipping box.

    Parameters: point - [in] 3d clipping coordinate point

    -

    Returns:
    -
    - bit point location 1 x < -1 2 x > +1 4 y < -1 8 y > +1 16 z < -1 32 z > +1

    +

    Returns: bit point location 1 x < -1 2 x > +1 4 y < -1 8 y > +1 16 z < -1 32 z > +1

    @@ -1030,9 +1026,7 @@ Static Public Attributes

    Description: Computes 3d clipping flags for a 3d bounding box and returns an int with bits set to indicate if the bounding box is outside of the clipping box.

    Parameters: boxmin - [in] 3d boxmin corner boxmax - [in] 3d boxmax corner

    -

    Returns:
    -
    - bit box location 1 boxmax x < -1 2 boxmin x > +1 4 boxmax y < -1 8 boxmin y > +1 16 boxmax z < -1 32 boxmin z > +1

    +

    Returns: bit box location 1 boxmax x < -1 2 boxmin x > +1 4 boxmax y < -1 8 boxmin y > +1 16 boxmax z < -1 32 boxmin z > +1

    @@ -1053,9 +1047,7 @@ Static Public Attributes

    Description: Computes homogeneous point clipping flags and returns an int with bits set to indicate if the point is outside of the clipping box.

    Parameters: point - [in] 4d homogeneous clipping coordinate point

    -

    Returns:
    -
    - bit point location 1 x/w < -1 2 x/w > +1 4 y/w < -1 8 y/w > +1 16 z/w < -1 32 z/w > +1

    +

    Returns: bit point location 1 x/w < -1 2 x/w > +1 4 y/w < -1 8 y/w > +1 16 z/w < -1 32 z/w > +1

    @@ -2094,8 +2086,7 @@ Static Public Attributes

    Description: The Rotation() function is overloaded and provides several ways to compute a rotation transformation. A positive rotation angle indicates a counter-clockwise (right hand rule) rotation about the axis of rotation.

    Parameters: sin_angle - sin(rotation angle) cos_angle - cos(rotation angle) rotation_axis - 3d unit axis of rotation rotation_center - 3d center of rotation

    -

    Remarks: In the overloads that take frames, the frames should be right hand orthonormal frames (unit vectors with Z = X x Y).
    - The resulting rotation fixes the origin (0,0,0), maps initial X to final X, initial Y to final Y, and initial Z to final Z.

    +

    Remarks: In the overloads that take frames, the frames should be right hand orthonormal frames (unit vectors with Z = X x Y). The resulting rotation fixes the origin (0,0,0), maps initial X to final X, initial Y to final Y, and initial Z to final Z.

    In the overload that takes frames with center points, if the initial and final center are equal, then that center point is the fixed point of the rotation. If the initial and final point differ, then the resulting transform is the composition of a rotation fixing P0 and translation from P0 to P1. The resulting transformation maps P0 to P1, P0+X0 to P1+X1, ...

    The rotation transformations that map frames to frames are not the same as the change of basis transformations for those frames. See ON_Xform::ChangeBasis().

    @@ -3072,9 +3063,9 @@ Static Public Attributes
    diff --git a/6/d3/d18/class_o_n___brep_loop_array-members.html b/6/d3/d18/class_o_n___brep_loop_array-members.html index dd943d49..0c2dc09c 100644 --- a/6/d3/d18/class_o_n___brep_loop_array-members.html +++ b/6/d3/d18/class_o_n___brep_loop_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d1b/class_o_n___uuid_pair-members.html b/6/d3/d1b/class_o_n___uuid_pair-members.html index 39445dca..6fa72907 100644 --- a/6/d3/d1b/class_o_n___uuid_pair-members.html +++ b/6/d3/d1b/class_o_n___uuid_pair-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d1f/class_o_n___detail_view-members.html b/6/d3/d1f/class_o_n___detail_view-members.html index 5c82ebab..dfd3da13 100644 --- a/6/d3/d1f/class_o_n___detail_view-members.html +++ b/6/d3/d1f/class_o_n___detail_view-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d23/class_o_n___object_array-members.html b/6/d3/d23/class_o_n___object_array-members.html index 0d5d2070..9f169d32 100644 --- a/6/d3/d23/class_o_n___object_array-members.html +++ b/6/d3/d23/class_o_n___object_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d2f/class_o_n___xform-members.html b/6/d3/d2f/class_o_n___xform-members.html index 1e9791ec..b11989cd 100644 --- a/6/d3/d2f/class_o_n___xform-members.html +++ b/6/d3/d2f/class_o_n___xform-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d32/class_o_n___user_string_list.html b/6/d3/d32/class_o_n___user_string_list.html index 3de3129f..9c34e221 100644 --- a/6/d3/d32/class_o_n___user_string_list.html +++ b/6/d3/d32/class_o_n___user_string_list.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UserStringList Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d38/class_o_n___rtf_string_builder.html b/6/d3/d38/class_o_n___rtf_string_builder.html index 1f843b55..231a9e0a 100644 --- a/6/d3/d38/class_o_n___rtf_string_builder.html +++ b/6/d3/d38/class_o_n___rtf_string_builder.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RtfStringBuilder Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d38/struct_o_n___brep_trim_point-members.html b/6/d3/d38/struct_o_n___brep_trim_point-members.html index b1166fec..8d2492de 100644 --- a/6/d3/d38/struct_o_n___brep_trim_point-members.html +++ b/6/d3/d38/struct_o_n___brep_trim_point-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d3b/class_o_n___aggregate_component_status-members.html b/6/d3/d3b/class_o_n___aggregate_component_status-members.html index 324a558d..7ec66aea 100644 --- a/6/d3/d3b/class_o_n___aggregate_component_status-members.html +++ b/6/d3/d3b/class_o_n___aggregate_component_status-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d3c/class_o_n___class_id.html b/6/d3/d3c/class_o_n___class_id.html index 288aa938..954b551f 100644 --- a/6/d3/d3c/class_o_n___class_id.html +++ b/6/d3/d3c/class_o_n___class_id.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ClassId Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    used for runtime class identification

    -

    Description: OpenNURBS classes derived from ON_Object use ON_ClassId to store run-time type information
    - The ON_OBJECT_DECLARE and ON_OBJECT_IMPLEMENT macros generate the code that creates and initializes the ON_ClassId for each class.

    +

    Description: OpenNURBS classes derived from ON_Object use ON_ClassId to store run-time type information

    +

    The ON_OBJECT_DECLARE and ON_OBJECT_IMPLEMENT macros generate the code that creates and initializes the ON_ClassId for each class.

    The ON_Object::IsKindOf() and ON_Object::Cast() functions use this run-time type information.

    Constructor & Destructor Documentation

    @@ -489,8 +487,7 @@ Static Public Member Functions
    -

    Description: Each class derived from ON_Object has a corresponding ON_ClassId stored in a linked list. If a class definition is going to disappear (which happens when the derived object definition is in a DLL that uses openNURBS as a DLL and the DLL containing the derived object's definition is unloaded), then the class's ON_ClassId needs to be removed from the class list. ON_ClassId::Purge( mark ) removes all ON_ClassIds with a a prescribed mark and returns the number of classes that were purged.
    -Parameters: mark - [in] All ON_ClassIds with this mark will be purged. Returns: Number of classes that were purged. Example: ///< Call ON_ClassId::IncrementMark() BEFORE loading MY.DLL. int my_dll_classid_mark = ON_ClassId::IncrementMark(); load MY.DLL with classes derived from ON_Object ... ///< Call ON_ClassId::Purge() BEFORE unloading MY.DLL. ON_ClassId::Purge( my_dll_classid_mark ); unload MY.DLL

    +

    Description: Each class derived from ON_Object has a corresponding ON_ClassId stored in a linked list. If a class definition is going to disappear (which happens when the derived object definition is in a DLL that uses openNURBS as a DLL and the DLL containing the derived object's definition is unloaded), then the class's ON_ClassId needs to be removed from the class list. ON_ClassId::Purge( mark ) removes all ON_ClassIds with a a prescribed mark and returns the number of classes that were purged. Parameters: mark - [in] All ON_ClassIds with this mark will be purged. Returns: Number of classes that were purged. Example: ///< Call ON_ClassId::IncrementMark() BEFORE loading MY.DLL. int my_dll_classid_mark = ON_ClassId::IncrementMark(); load MY.DLL with classes derived from ON_Object ... ///< Call ON_ClassId::Purge() BEFORE unloading MY.DLL. ON_ClassId::Purge( my_dll_classid_mark ); unload MY.DLL

    @@ -541,9 +538,9 @@ Parameters: mark - [in] All ON_ClassIds with this mark will be purged. Returns: diff --git a/6/d3/d40/struct_o_n___mesh_part-members.html b/6/d3/d40/struct_o_n___mesh_part-members.html index 3a98f580..e64d0512 100644 --- a/6/d3/d40/struct_o_n___mesh_part-members.html +++ b/6/d3/d40/struct_o_n___mesh_part-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d50/class_o_n___object_rendering_attributes.html b/6/d3/d50/class_o_n___object_rendering_attributes.html index 94d64d02..8163db55 100644 --- a/6/d3/d50/class_o_n___object_rendering_attributes.html +++ b/6/d3/d50/class_o_n___object_rendering_attributes.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ObjectRenderingAttributes Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d52/class_o_n___simple_array-members.html b/6/d3/d52/class_o_n___simple_array-members.html index 36218048..6181b42d 100644 --- a/6/d3/d52/class_o_n___simple_array-members.html +++ b/6/d3/d52/class_o_n___simple_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d56/class_o_n___class_array-members.html b/6/d3/d56/class_o_n___class_array-members.html index 0d3e77be..9d21d9f5 100644 --- a/6/d3/d56/class_o_n___class_array-members.html +++ b/6/d3/d56/class_o_n___class_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d58/class_o_n___mesh_cache.html b/6/d3/d58/class_o_n___mesh_cache.html index ce42b2ad..bb79ab26 100644 --- a/6/d3/d58/class_o_n___mesh_cache.html +++ b/6/d3/d58/class_o_n___mesh_cache.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshCache Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d5c/class_o_n___text_content-members.html b/6/d3/d5c/class_o_n___text_content-members.html index 297f24f4..a71c76db 100644 --- a/6/d3/d5c/class_o_n___text_content-members.html +++ b/6/d3/d5c/class_o_n___text_content-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d5d/class_o_n__3dm_application.html b/6/d3/d5d/class_o_n__3dm_application.html index 5176be2e..8ea5f6ea 100644 --- a/6/d3/d5d/class_o_n__3dm_application.html +++ b/6/d3/d5d/class_o_n__3dm_application.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmApplication Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d6a/class_o_n___nurbs_curve.html b/6/d3/d6a/class_o_n___nurbs_curve.html index 4d59f222..e6124988 100644 --- a/6/d3/d6a/class_o_n___nurbs_curve.html +++ b/6/d3/d6a/class_o_n___nurbs_curve.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_NurbsCurve Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Definition of NURBS curve

    Constructor & Destructor Documentation

    @@ -1333,8 +1327,7 @@ Additional Inherited Members
    -

    Description: Where possible, analytically extends curve to include domain. Parameters: domain - [in] if domain is not included in curve domain, curve will be extended so that its domain includes domain.
    - Will not work if curve is closed. Original curve is identical to the restriction of the resulting curve to the original curve domain, Returns: true if successful.

    +

    Description: Where possible, analytically extends curve to include domain. Parameters: domain - [in] if domain is not included in curve domain, curve will be extended so that its domain includes domain. Will not work if curve is closed. Original curve is identical to the restriction of the resulting curve to the original curve domain, Returns: true if successful.

    Reimplemented from ON_Curve.

    @@ -1602,9 +1595,7 @@ Additional Inherited Members
    -

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: c - [in] type of continity to test for. If ON::continuity::C1_continuous t0 - [in] search begins at t0 t1 - [in] (t0 < t1) search ends at t1 t - [out] if a discontinuity is found, the *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search.
    - dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous.
    - ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if a discontinuity was found on the interior of the interval (t0,t1). Remarks: Overrides ON_Curve::GetNextDiscontinuity.

    +

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: c - [in] type of continity to test for. If ON::continuity::C1_continuous t0 - [in] search begins at t0 t1 - [in] (t0 < t1) search ends at t1 t - [out] if a discontinuity is found, the *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search. dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous. ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if a discontinuity was found on the interior of the interval (t0,t1). Remarks: Overrides ON_Curve::GetNextDiscontinuity.

    Reimplemented from ON_Curve.

    @@ -2071,8 +2062,7 @@ Additional Inherited Members
    -

    Description: Test continuity at a curve parameter value. Parameters: c - [in] continuity to test for t - [in] parameter to test hint - [in] evaluation hint point_tolerance - [in] if the distance between two points is greater than point_tolerance, then the curve is not C0. d1_tolerance - [in] if the difference between two first derivatives is greater than d1_tolerance, then the curve is not C1. d2_tolerance - [in] if the difference between two second derivatives is greater than d2_tolerance, then the curve is not C2. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous.
    - ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if the curve has at least the c type continuity at the parameter t. Remarks: Overrides ON_Curve::IsContinuous.

    +

    Description: Test continuity at a curve parameter value. Parameters: c - [in] continuity to test for t - [in] parameter to test hint - [in] evaluation hint point_tolerance - [in] if the distance between two points is greater than point_tolerance, then the curve is not C0. d1_tolerance - [in] if the difference between two first derivatives is greater than d1_tolerance, then the curve is not C1. d2_tolerance - [in] if the difference between two second derivatives is greater than d2_tolerance, then the curve is not C2. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous. ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if the curve has at least the c type continuity at the parameter t. Remarks: Overrides ON_Curve::IsContinuous.

    Reimplemented from ON_Curve.

    @@ -2869,8 +2859,7 @@ Additional Inherited Members
    -

    Description: Use a linear fractional transformation to reparameterize the NURBS curve. This does not change the curve's domain. Parameters: c - [in] reparameterization constant (generally speaking, c should be > 0). The control points and knots are adjusted so that output_nurbs(t) = input_nurbs(lambda(t)), where lambda(t) = c*t/( (c-1)*t + 1 ). Note that lambda(0) = 0, lambda(1) = 1, lambda'(t) > 0, lambda'(0) = c and lambda'(1) = 1/c. Returns: true if successful.
    -Remarks: The cv and knot values are values are changed so that output_nurbs(t) = input_nurbs(lambda(t)). See Also: ON_ReparameterizeRationalNurbsCurve

    +

    Description: Use a linear fractional transformation to reparameterize the NURBS curve. This does not change the curve's domain. Parameters: c - [in] reparameterization constant (generally speaking, c should be > 0). The control points and knots are adjusted so that output_nurbs(t) = input_nurbs(lambda(t)), where lambda(t) = c*t/( (c-1)*t + 1 ). Note that lambda(0) = 0, lambda(1) = 1, lambda'(t) > 0, lambda'(0) = c and lambda'(1) = 1/c. Returns: true if successful. Remarks: The cv and knot values are values are changed so that output_nurbs(t) = input_nurbs(lambda(t)). See Also: ON_ReparameterizeRationalNurbsCurve

    @@ -3735,9 +3724,9 @@ Remarks: The cv and knot values are values are changed so that output_nurbs(t) = diff --git a/6/d3/d72/opennurbs__evaluate__nurbs_8h_source.html b/6/d3/d72/opennurbs__evaluate__nurbs_8h_source.html index a223c5f5..242b802b 100644 --- a/6/d3/d72/opennurbs__evaluate__nurbs_8h_source.html +++ b/6/d3/d72/opennurbs__evaluate__nurbs_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_evaluate_nurbs.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_evaluate_nurbs.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(ON_EVALUATE_NURBS_INC_)
    18 #define ON_EVALUATE_NURBS_INC_
    19 
    20 ON_DECL
    21 bool ON_IncreaseBezierDegree(
    22  int, // dimension
    23  bool, // true if Bezier is rational
    24  int, // order (>=2)
    25  int, // cv_stride (>=dim+1)
    26  double* // cv[(order+1)*cv_stride] array
    27  );
    28 
    29 ON_DECL
    30 bool ON_RemoveBezierSingAt0( // input bezier is rational with 0/0 at start
    31  int, // dimension
    32  int, // order (>=2)
    33  int, // cv_stride (>=dim+1)
    34  double* // cv[order*cv_stride] array
    35  );
    36 
    37 ON_DECL
    38 bool ON_RemoveBezierSingAt1( // input bezier is rational with 0/0 at end
    39  int, // dimension
    40  int, // order (>=2)
    41  int, // cv_stride (>=dim+1)
    42  double* // cv[order*cv_stride] array
    43  );
    44 
    45 ON_DECL
    46 double ON_EvaluateBernsteinBasis( // returns (i choose d)*(1-t)^(d-i)*t^i
    47  int, // degree,
    48  int, // 0 <= i <= degree
    49  double // t
    50  );
    51 
    52 ON_DECL
    53 void ON_EvaluatedeCasteljau(
    54  int, // dim
    55  int, // order
    56  int, // side <= 0 return left side of bezier in cv array
    57  // > 0 return right side of bezier in cv array
    58  int, // cv_stride
    59  double*, // cv
    60  double // t 0 <= t <= 1
    61  );
    62 
    63 ON_DECL
    64 bool ON_EvaluateBezier(
    65  int, // dimension
    66  bool, // true if Bezier is rational
    67  int, // order (>=2)
    68  int, // cv_stride >= (is_rat)?dim+1:dim
    69  const double*, // cv[order*cv_stride] array
    70  double, double, // t0,t1 = domain of bezier
    71  int, // number of derivatives to compute (>=0)
    72  double, // evaluation parameter
    73  int, // v_stride (>=dimension)
    74  double* // v[(der_count+1)*v_stride] array
    75  );
    76 
    77 /*
    78 Description:
    79  Evaluate B-spline basis functions
    80 
    81 Parameters:
    82  order - [in]
    83  order >= 1
    84  d = degree = order - 1
    85  knot - [in]
    86  array of length 2*d.
    87  Generally, knot[0] <= ... <= knot[d-1] < knot[d] <= ... <= knot[2*d-1].
    88  These are the knots that are active for the span being evaluated.
    89  t - [in]
    90  Evaluation parameter.
    91  Typically knot[d-1] <= t <= knot[d].
    92  In general t may be outside the interval knot[d-1],knot[d]. This can happen
    93  when some type of extrapolation is being used and is almost always a bad
    94  idea in practical situations.
    95 
    96  N - [out]
    97  double array with capacity order*order.
    98  The returned values are:
    99 
    100  If "N" were declared as double N[order][order], then
    101 
    102  k
    103  N[d-k][i] = N (t) = value of i-th degree k basis function at t.
    104  i
    105  where 0 <= k <= d and k <= i <= d.
    106 
    107  In particular, N[0], ..., N[d] - values of degree d basis functions.
    108  The "lower left" triangle is not initialized.
    109 
    110  Actually, the above is true when knot[d-1] <= t < knot[d]. Otherwise, the
    111  value returned is the value of the polynomial that agrees with N_i^k on the
    112  half open domain [ knot[d-1], knot[d] )
    113 
    114 COMMENTS:
    115  If a degree d NURBS has n control points, then the OpenNURBS knot vector
    116  for the entire NURBS curve has length d+n-1. The knot[] paramter to this
    117  function points to the 2*d knots active for the span being evaluated.
    118 
    119  Most literature, including DeBoor and The NURBS Book,
    120  duplicate the Opennurbs start and end knot values and have knot vectors
    121  of length d+n+1. The extra two knot values are completely superfluous
    122  when degree >= 1.
    123 
    124  Assume C is a B-spline of degree d (order=d+1) with n control vertices
    125  (n>=d+1) and knot[] is its knot vector. Then
    126 
    127  C(t) = Sum( 0 <= i < n, N_{i}(t) * C_{i} )
    128 
    129  where N_{i} are the degree d b-spline basis functions and C_{i} are the control
    130  vertices. The knot[] array length d+n-1 and satisfies
    131 
    132  knot[0] <= ... <= knot[d-1] < knot[d]
    133  knot[n-2] < knot[n-1] <= ... <= knot[n+d-2]
    134  knot[i] < knot[d+i] for 0 <= i < n-1
    135  knot[i] <= knot[i+1] for 0 <= i < n+d-2
    136 
    137  The domain of C is [ knot[d-1], knot[n-1] ].
    138 
    139  The support of N_{i} is [ knot[i-1], knot[i+d] ).
    140 
    141  If d-1 <= k < n-1 and knot[k] <= t < knot[k+1], then
    142  N_{i}(t) = 0 if i <= k-d
    143  = 0 if i >= k+2
    144  = B[i-k+d-1] if k-d+1 <= i <= k+1, where B[] is computed by the call
    145  ON_EvaluateNurbsBasis( d+1, knot+k-d+1, t, B );
    146 
    147  If 0 <= j < n-d, 0 <= m <= d, knot[j+d-1] <= t < knot[j+d], and B[] is
    148  computed by the call
    149  ON_EvaluateNurbsBasis( d+1, knot+j, t, B ),
    150  then
    151  N_{j+m}(t) = B[m].
    152 */
    153 ON_DECL
    154 bool ON_EvaluateNurbsBasis(
    155  int order,
    156  const double* knot,
    157  double t,
    158  double* N
    159  );
    160 
    161 /*
    162 Description:
    163  Calculate derivatives of B-spline basis functions.
    164 INPUT:
    165  order - [in]
    166  order >= 1
    167  d = degree = order - 1
    168  knot - [in]
    169  array of length 2*d.
    170  Generally, knot[0] <= ... <= knot[d-1] < knot[d] <= ... <= knot[2*d-1].
    171  These are the knots that are active for the span being evaluated.
    172  der_count - [in]
    173  1 <= der_count < order
    174  Number of derivatives.
    175  Note all B-spline basis derivatives with der_coutn >= order are identically zero.
    176 
    177  N - [in]
    178  The input value of N[] should be the results of the call
    179  ON_EvaluateNurbsBasis( order, knot, t, N );
    180 
    181  N - [out]
    182  If "N" were declared as double N[order][order], then
    183 
    184  d
    185  N[d-k][i] = k-th derivative of N (t)
    186  i
    187 
    188  where 0 <= k <= d and 0 <= i <= d.
    189 
    190  In particular,
    191  N[0], ..., N[d] - values of degree d basis functions.
    192  N[order], ..., N[order_d] - values of first derivative.
    193 */
    194 ON_DECL
    195 bool ON_EvaluateNurbsBasisDerivatives(
    196  int order,
    197  const double* knot,
    198  int der_count,
    199  double* N
    200  );
    201 
    202 /*
    203 Description:
    204  Evaluate a NURBS curve span.
    205 Parameters:
    206  dim - [in]
    207  dimension (> 0).
    208  is_rat - [in]
    209  true or false.
    210  order - [in]
    211  order=degree+1 (order>=2)
    212  knot - [in] NURBS knot vector.
    213  NURBS knot vector with 2*(order-1) knots, knot[order-2] != knot[order-1]
    214  cv_stride - [in]
    215  cv - [in]
    216  For 0 <= i < order the i-th control vertex is
    217 
    218  cv[n],...,cv[n+(is_rat?dim:dim+1)],
    219 
    220  where n = i*cv_stride. If is_rat is true the cv is
    221  in homogeneous form.
    222  der_count - [in]
    223  number of derivatives to evaluate (>=0)
    224  t - [in]
    225  evaluation parameter
    226  v_stride - [in]
    227  v - [out]
    228  An array of length v_stride*(der_count+1). The evaluation
    229  results are returned in this array.
    230 
    231  P = v[0],...,v[m_dim-1]
    232  Dt = v[v_stride],...
    233  Dtt = v[2*v_stride],...
    234  ...
    235 
    236  In general, Dt^i returned in v[n],...,v[n+m_dim-1], where
    237 
    238  n = v_stride*i.
    239 
    240 Returns:
    241  True if successful.
    242 See Also:
    243  ON_NurbsCurve::Evaluate
    244  ON_EvaluateNurbsSurfaceSpan
    245  ON_EvaluateNurbsCageSpan
    246 */
    247 ON_DECL
    248 bool ON_EvaluateNurbsSpan(
    249  int dim,
    250  bool is_rat,
    251  int order,
    252  const double* knot,
    253  int cv_stride,
    254  const double* cv,
    255  int der_count,
    256  double t,
    257  int v_stride,
    258  double* v
    259  );
    260 
    261 /*
    262 Description:
    263  Evaluate a NURBS surface bispan.
    264 Parameters:
    265  dim - [in] >0
    266  is_rat - [in] true of false
    267  order0 - [in] >= 2
    268  order1 - [in] >= 2
    269  knot0 - [in]
    270  NURBS knot vector with 2*(order0-1) knots, knot0[order0-2] != knot0[order0-1]
    271  knot1 - [in]
    272  NURBS knot vector with 2*(order1-1) knots, knot1[order1-2] != knot1[order1-1]
    273  cv_stride0 - [in]
    274  cv_stride1 - [in]
    275  cv - [in]
    276  For 0 <= i < order0 and 0 <= j < order1, the (i,j) control vertex is
    277 
    278  cv[n],...,cv[n+(is_rat?dim:dim+1)],
    279 
    280  where n = i*cv_stride0 + j*cv_stride1. If is_rat is true the cv is
    281  in homogeneous form.
    282 
    283  der_count - [in] (>=0)
    284  s - [in]
    285  t - [in] (s,t) is the evaluation parameter
    286  v_stride - [in] (>=dim)
    287  v - [out] An array of length v_stride*(der_count+1)*(der_count+2)/2.
    288  The evaluation results are stored in this array.
    289 
    290  P = v[0],...,v[m_dim-1]
    291  Ds = v[v_stride],...
    292  Dt = v[2*v_stride],...
    293  Dss = v[3*v_stride],...
    294  Dst = v[4*v_stride],...
    295  Dtt = v[5*v_stride],...
    296 
    297  In general, Ds^i Dt^j is returned in v[n],...,v[n+m_dim-1], where
    298 
    299  n = v_stride*( (i+j)*(i+j+1)/2 + j).
    300 
    301 Returns:
    302  True if succcessful.
    303 See Also:
    304  ON_NurbsSurface::Evaluate
    305  ON_EvaluateNurbsSpan
    306  ON_EvaluateNurbsCageSpan
    307 */
    308 ON_DECL
    309 bool ON_EvaluateNurbsSurfaceSpan(
    310  int dim,
    311  bool is_rat,
    312  int order0,
    313  int order1,
    314  const double* knot0,
    315  const double* knot1,
    316  int cv_stride0,
    317  int cv_stride1,
    318  const double* cv,
    319  int der_count,
    320  double s,
    321  double t,
    322  int v_stride,
    323  double* v
    324  );
    325 
    326 
    327 
    328 /*
    329 Description:
    330  Evaluate a NURBS cage trispan.
    331 Parameters:
    332  dim - [in] >0
    333  is_rat - [in] true of false
    334  order0 - [in] >= 2
    335  order1 - [in] >= 2
    336  order2 - [in] >= 2
    337  knot0 - [in]
    338  NURBS knot vector with 2*(order0-1) knots, knot0[order0-2] != knot0[order0-1]
    339  knot1 - [in]
    340  NURBS knot vector with 2*(order1-1) knots, knot1[order1-2] != knot1[order1-1]
    341  knot2 - [in]
    342  NURBS knot vector with 2*(order1-1) knots, knot2[order2-2] != knot2[order2-1]
    343  cv_stride0 - [in]
    344  cv_stride1 - [in]
    345  cv_stride2 - [in]
    346  cv - [in]
    347  For 0 <= i < order0, 0 <= j < order1, and 0 <= k < order2,
    348  the (i,j,k)-th control vertex is
    349 
    350  cv[n],...,cv[n+(is_rat?dim:dim+1)],
    351 
    352  where n = i*cv_stride0 + j*cv_stride1 *k*cv_stride2.
    353  If is_rat is true the cv is in homogeneous form.
    354 
    355  der_count - [in] (>=0)
    356  r - [in]
    357  s - [in]
    358  t - [in] (r,s,t) is the evaluation parameter
    359  v_stride - [in] (>=dim)
    360  v - [out] An array of length v_stride*(der_count+1)*(der_count+2)*(der_count+3)/6.
    361  The evaluation results are stored in this array.
    362 
    363  P = v[0],...,v[m_dim-1]
    364  Dr = v[v_stride],...
    365  Ds = v[2*v_stride],...
    366  Dt = v[3*v_stride],...
    367  Drr = v[4*v_stride],...
    368  Drs = v[5*v_stride],...
    369  Drt = v[6*v_stride],...
    370  Dss = v[7*v_stride],...
    371  Dst = v[8*v_stride],...
    372  Dtt = v[9*v_stride],...
    373 
    374  In general, Dr^i Ds^j Dt^k is returned in v[n],...,v[n+dim-1], where
    375 
    376  d = (i+j+k)
    377  n = v_stride*( d*(d+1)*(d+2)/6 + (j+k)*(j+k+1)/2 + k)
    378 
    379 Returns:
    380  True if succcessful.
    381 See Also:
    382  ON_NurbsCage::Evaluate
    383  ON_EvaluateNurbsSpan
    384  ON_EvaluateNurbsSurfaceSpan
    385 */
    386 ON_DECL
    387 bool ON_EvaluateNurbsCageSpan(
    388  int dim,
    389  bool is_rat,
    390  int order0, int order1, int order2,
    391  const double* knot0,
    392  const double* knot1,
    393  const double* knot2,
    394  int cv_stride0, int cv_stride1, int cv_stride2,
    395  const double* cv,
    396  int der_count,
    397  double t0, double t1, double t2,
    398  int v_stride,
    399  double* v
    400  );
    401 
    402 
    403 ON_DECL
    404 bool ON_EvaluateNurbsDeBoor( // for expert users only - no support available
    405  int, // cv_dim ( dim+1 for rational cvs )
    406  int, // order (>=2)
    407  int, // cv_stride (>=cv_dim)
    408  double*, // cv array - values changed to result of applying De Boor's algorithm
    409  const double*, // knot array
    410  int, // side,
    411  // -1 return left side of B-spline span in cv array
    412  // +1 return right side of B-spline span in cv array
    413  // -2 return left side of B-spline span in cv array
    414  // Ignore values of knots[0,...,order-3] and assume
    415  // left end of span has a fully multiple knot with
    416  // value "mult_k".
    417  // +2 return right side of B-spline span in cv array
    418  // Ignore values of knots[order,...,2*order-2] and
    419  // assume right end of span has a fully multiple
    420  // knot with value "mult_k".
    421  double, // mult_k - used when side is +2 or -2. See above for usage.
    422  double // t
    423  // If side < 0, then the cv's for the portion of the NURB span to
    424  // the LEFT of t are computed. If side > 0, then the cv's for the
    425  // portion the span to the RIGHT of t are computed. The following
    426  // table summarizes the restrictions on t:
    427  //
    428  // value of side condition t must satisfy
    429  // -2 mult_k < t and mult_k < knots[order-1]
    430  // -1 knots[order-2] < t
    431  // +1 t < knots[order-1]
    432  // +2 t < mult_k and knots[order-2] < mult_k
    433  );
    434 
    435 
    436 ON_DECL
    437 bool ON_EvaluateNurbsBlossom(int, // cvdim,
    438  int, // order,
    439  int, // cv_stride,
    440  const double*, //CV, size cv_stride*order
    441  const double*, //knot, nondecreasing, size 2*(order-1)
    442  // knot[order-2] != knot[order-1]
    443  const double*, //t, input parameters size order-1
    444  double* // P
    445 
    446  // DeBoor algorithm with different input at each step.
    447  // returns false for bad input.
    448  );
    449 
    450 
    451 ON_DECL
    452 void ON_ConvertNurbSpanToBezier(
    453  int, // cvdim (dim+1 for rational curves)
    454  int, // order,
    455  int, // cvstride (>=cvdim)
    456  double*, // cv array - input has NURBS cvs, output has Bezier cvs
    457  const double*, // (2*order-2) knots for the NURBS span
    458  double, // t0, NURBS span parameter of start point
    459  double // t1, NURBS span parameter of end point
    460  );
    461 #endif
    diff --git a/6/d3/d74/opennurbs__planesurface_8h_source.html b/6/d3/d74/opennurbs__planesurface_8h_source.html index 0976619a..1c0b2009 100644 --- a/6/d3/d74/opennurbs__planesurface_8h_source.html +++ b/6/d3/d74/opennurbs__planesurface_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_planesurface.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_planesurface.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d78/class_o_n__3d_point_array-members.html b/6/d3/d78/class_o_n__3d_point_array-members.html index 03eb0a95..73c02ae2 100644 --- a/6/d3/d78/class_o_n__3d_point_array-members.html +++ b/6/d3/d78/class_o_n__3d_point_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d7c/opennurbs__memory_8h_source.html b/6/d3/d7c/opennurbs__memory_8h_source.html index 97930788..280189ac 100644 --- a/6/d3/d7c/opennurbs__memory_8h_source.html +++ b/6/d3/d7c/opennurbs__memory_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_memory.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_memory.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_MEMORY_INC_)
    18 #define OPENNURBS_MEMORY_INC_
    19 
    20 #if defined (cplusplus) || defined(_cplusplus) || defined(__cplusplus)
    21 extern "C" {
    22 #endif
    23 
    24 ON_DECL
    25 size_t ON_MemoryPageSize();
    26 
    27 
    28 /*
    29 Allocate memory that is intentionally never returned
    30 should not be considered a memory leak. Typically this is
    31 for an application workspace.
    32 */
    33 ON_DECL
    34 void* onmalloc_forever( size_t );
    35 
    36 ON_DECL
    37 void* onmalloc( size_t );
    38 
    39 ON_DECL
    40 void* oncalloc( size_t, size_t );
    41 
    42 ON_DECL
    43 void onfree( void* );
    44 
    45 ON_DECL
    46 void* onrealloc( void*, size_t );
    47 
    48 ON_DECL
    49 void* onmemdup( const void*, size_t );
    50 
    51 ON_DECL
    52 char* onstrdup( const char* );
    53 
    54 ON_DECL
    55 wchar_t* onwcsdup( const wchar_t* );
    56 
    57 ON_DECL
    58 unsigned char* onmbsdup( const unsigned char* );
    59 
    60 #if defined (cplusplus) || defined(_cplusplus) || defined(__cplusplus)
    61 }
    62 
    63 class ON_CLASS ON_MemoryAllocationTracking
    64 {
    65 public:
    66  /*
    67  Descrption:
    68  Windows Debug Builds:
    69  The constructor saves the current state of memory allocation tracking
    70  and then enables/disables memory allocation tracking.
    71  Otherwise:
    72  Does nothting.
    73  */
    74  ON_MemoryAllocationTracking(
    75  bool bEnableAllocationTracking
    76  );
    77 
    78  /*
    79  Descrption:
    80  Windows Debug Builds:
    81  The desctructor restores the saved state of memory allocation tracking.
    82  Otherwise:
    83  Does nothting.
    84  */
    85  ~ON_MemoryAllocationTracking();
    86 
    87 private:
    88  static unsigned int m_g_stack_depth;
    89  static int m_g_crt_dbg_flag0;
    90  const unsigned int m_this_statck_depth;
    91  const int m_this_crt_dbg_flag0;
    92 
    93 private:
    94  ON_MemoryAllocationTracking() = delete;
    95  ON_MemoryAllocationTracking(const ON_MemoryAllocationTracking&) = delete;
    96  ON_MemoryAllocationTracking& operator=(const ON_MemoryAllocationTracking&) = delete;
    97 };
    98 
    99 #endif
    100 
    101 #endif
    diff --git a/6/d3/d7e/class_o_n___text_builder-members.html b/6/d3/d7e/class_o_n___text_builder-members.html index 8ed26f0e..58449eee 100644 --- a/6/d3/d7e/class_o_n___text_builder-members.html +++ b/6/d3/d7e/class_o_n___text_builder-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d7f/struct_o_n___r_tree_sphere.html b/6/d3/d7f/struct_o_n___r_tree_sphere.html index fe21bb4e..98c744b3 100644 --- a/6/d3/d7f/struct_o_n___r_tree_sphere.html +++ b/6/d3/d7f/struct_o_n___r_tree_sphere.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RTreeSphere Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d80/class_o_n___obj_ref.html b/6/d3/d80/class_o_n___obj_ref.html index d03df911..432accec 100644 --- a/6/d3/d80/class_o_n___obj_ref.html +++ b/6/d3/d80/class_o_n___obj_ref.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ObjRef Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d82/class_o_n___text_content.html b/6/d3/d82/class_o_n___text_content.html index 54cd2e8b..14f7d55e 100644 --- a/6/d3/d82/class_o_n___text_content.html +++ b/6/d3/d82/class_o_n___text_content.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextContent Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Some objects cache bounding box information. If you modify an object, then call ClearBoundingBox() to inform the object that any cached bounding boxes are invalid.
    - Remarks: Generally, ClearBoundingBox() overrides simply invalidate a cached bounding box and then wait for a call to GetBBox() before recomputing the bounding box.

    +

    Description: Some objects cache bounding box information. If you modify an object, then call ClearBoundingBox() to inform the object that any cached bounding boxes are invalid.

    +

    Remarks: Generally, ClearBoundingBox() overrides simply invalidate a cached bounding box and then wait for a call to GetBBox() before recomputing the bounding box.

    The default implementation does nothing.

    Reimplemented from ON_Geometry.

    @@ -2245,8 +2243,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -2321,9 +2319,9 @@ Additional Inherited Members diff --git a/6/d3/d87/class_o_n___aerial_photo_image_frustum.html b/6/d3/d87/class_o_n___aerial_photo_image_frustum.html index d29e3160..8cfbbdfd 100644 --- a/6/d3/d87/class_o_n___aerial_photo_image_frustum.html +++ b/6/d3/d87/class_o_n___aerial_photo_image_frustum.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: ON_AerialPhotoImageFrustum Class Reference @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archiveserialize definition to binary archive
    openNURBS SDK Help +  6.0
    - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_AerialPhotoImageFrustum()

    @@ -254,9 +250,9 @@ Public Attributes
    diff --git a/6/d3/d88/class_o_n___display_material_ref.html b/6/d3/d88/class_o_n___display_material_ref.html index 3446a9d1..ce42e710 100644 --- a/6/d3/d88/class_o_n___display_material_ref.html +++ b/6/d3/d88/class_o_n___display_material_ref.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_DisplayMaterialRef Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    -

    Class ON_DisplayMaterialRef
    -Description: Objects can have per viewport display properties that override a viewport's default display properties. These overrides are stored on ON_3dmObjectAttributes as a list of ON_DisplayMaterialRefs.

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    Class ON_DisplayMaterialRef Description: Objects can have per viewport display properties that override a viewport's default display properties. These overrides are stored on ON_3dmObjectAttributes as a list of ON_DisplayMaterialRefs.

    Example: For example, by default a viewport might display objects using a wireframe, but one special object may need to be shaded. In this case the special object would have a display material ref with the "wireframe" viewport's id and the id of a display material that specified shading.

    Constructor & Destructor Documentation

    @@ -174,7 +165,7 @@ Description: Objects can have per viewport display properties that override a vi
    -

    ◆ operator<()

    +

    ◆ operator<()

    @@ -192,7 +183,7 @@ Description: Objects can have per viewport display properties that override a vi
    -

    ◆ operator<=()

    +

    ◆ operator<=()

    @@ -228,7 +219,7 @@ Description: Objects can have per viewport display properties that override a vi
    -

    ◆ operator>()

    +

    ◆ operator>()

    @@ -246,7 +237,7 @@ Description: Objects can have per viewport display properties that override a vi
    -

    ◆ operator>=()

    +

    ◆ operator>=()

    @@ -321,9 +312,9 @@ Description: Objects can have per viewport display properties that override a vi
    diff --git a/6/d3/d8b/class_o_n___standard_display_mode_id-members.html b/6/d3/d8b/class_o_n___standard_display_mode_id-members.html index b51b5c1d..e856cb91 100644 --- a/6/d3/d8b/class_o_n___standard_display_mode_id-members.html +++ b/6/d3/d8b/class_o_n___standard_display_mode_id-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d3/d90/class_o_n___bezier_curve-members.html b/6/d3/d90/class_o_n___bezier_curve-members.html index f6672322..ebf8c937 100644 --- a/6/d3/d90/class_o_n___bezier_curve-members.html +++ b/6/d3/d90/class_o_n___bezier_curve-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d96/class_o_n___tensor_product-members.html b/6/d3/d96/class_o_n___tensor_product-members.html index 7b962746..94569cee 100644 --- a/6/d3/d96/class_o_n___tensor_product-members.html +++ b/6/d3/d96/class_o_n___tensor_product-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d98/class_o_n___annotation-members.html b/6/d3/d98/class_o_n___annotation-members.html index 30e6eed2..10417fa9 100644 --- a/6/d3/d98/class_o_n___annotation-members.html +++ b/6/d3/d98/class_o_n___annotation-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/d9a/opennurbs__pointcloud_8h_source.html b/6/d3/d9a/opennurbs__pointcloud_8h_source.html index b588e10f..f9f84477 100644 --- a/6/d3/d9a/opennurbs__pointcloud_8h_source.html +++ b/6/d3/d9a/opennurbs__pointcloud_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_pointcloud.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_pointcloud.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/da1/opennurbs__error_8h_source.html b/6/d3/da1/opennurbs__error_8h_source.html index 25d29761..9b6fd75b 100644 --- a/6/d3/da1/opennurbs__error_8h_source.html +++ b/6/d3/da1/opennurbs__error_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_error.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_error.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_ERROR_INC_)
    18 #define OPENNURBS_ERROR_INC_
    19 
    20 /*
    21 // Macros used to log errors and warnings. The ON_Warning() and ON_Error()
    22 // functions are defined in opennurbs_error.cpp.
    23 */
    24 #define ON_ERROR(msg) ON_ErrorEx(__FILE__,__LINE__,OPENNURBS__FUNCTION__,msg)
    25 #define ON_WARNING(msg) ON_WarningEx(__FILE__,__LINE__,OPENNURBS__FUNCTION__,msg)
    26 #define ON_ASSERT_OR_RETURN(cond,returncode) do{if (!(cond)) {ON_ErrorEx(__FILE__,__LINE__,OPENNURBS__FUNCTION__, #cond " is false");return(returncode);}}while(0)
    27 #define ON_ASSERT_OR_RETURNVOID(cond) do{if (!(cond)) {ON_ErrorEx(__FILE__,__LINE__,OPENNURBS__FUNCTION__, #cond " is false");return;}}while(0)
    28 
    29 // Do not use ON_ASSERT. If a condition can be checked by ON_ASSERT, then the
    30 // code must be written detect and respond to that condition. This define will
    31 // be deleted ASAP. It is being used to detect situations where a crash will
    32 // occur and then letting the crash occur.
    33 #define ON_ASSERT(cond) ON_REMOVE_ASAP_AssertEx(cond,__FILE__,__LINE__,OPENNURBS__FUNCTION__, #cond " is false")
    34 
    35 
    36 ON_BEGIN_EXTERNC
    37 
    38 /*
    39 // All error/warning messages are sent to ON_ErrorMessage(). Replace the
    40 // default handler (defined in opennurbs_error_message.cpp) with something
    41 // that is appropriate for debugging your application.
    42 */
    43 ON_DECL
    44 void ON_ErrorMessage(
    45  int, /* 0 = warning message, 1 = serious error message, 2 = assert failure */
    46  const char*
    47  );
    48 
    49 /*
    50 Returns:
    51  Number of opennurbs errors since program started.
    52 */
    53 ON_DECL
    54 int ON_GetErrorCount(void);
    55 
    56 /*
    57 Returns:
    58  Number of opennurbs warnings since program started.
    59 */
    60 ON_DECL
    61 int ON_GetWarningCount(void);
    62 
    63 /*
    64 Returns:
    65  Number of math library or floating point errors that have
    66  been handled since program started.
    67 */
    68 ON_DECL
    69 int ON_GetMathErrorCount(void);
    70 
    71 
    72 ON_DECL
    73 int ON_GetDebugErrorMessage(void);
    74 
    75 ON_DECL
    76 void ON_EnableDebugErrorMessage( int bEnableDebugErrorMessage );
    77 
    78 ON_DECL
    79 void ON_VARGS_FUNC_CDECL ON_Error(
    80  const char* file_name, /* __FILE__ will do fine */
    81  int line_number, /* __LINE__ will do fine */
    82  const char* format, /* format string */
    83  ... /* format ags */
    84  );
    85 
    86 ON_DECL
    87 void ON_VARGS_FUNC_CDECL ON_ErrorEx(
    88  const char* file_name, /* __FILE__ will do fine */
    89  int line_number, /* __LINE__ will do fine */
    90  const char* function_name, /* OPENNURBS__FUNCTION__ will do fine */
    91  const char* format, /* format string */
    92  ... /* format ags */
    93  );
    94 
    95 ON_DECL
    96 void ON_VARGS_FUNC_CDECL ON_Warning(
    97  const char* file_name, /* __FILE__ will do fine */
    98  int line_number, /* __LINE__ will do fine */
    99  const char* format, /* format string */
    100  ... /* format ags */
    101  );
    102 
    103 ON_DECL
    104 void ON_VARGS_FUNC_CDECL ON_WarningEx(
    105  const char* file_name, /* __FILE__ will do fine */
    106  int line_number, /* __LINE__ will do fine */
    107  const char* function_name, /*OPENNURBS__FUNCTION__ will do fine */
    108  const char* format, /* format string */
    109  ... /* format ags */
    110  );
    111 
    112 // Ideally - these "assert" functions will be deleted when the SDK can be changed.
    113 ON_DECL
    114 void ON_VARGS_FUNC_CDECL ON_REMOVE_ASAP_AssertEx(
    115  int, // if false, error is flagged
    116  const char* file_name, /* __FILE__ will do fine */
    117  int line_number, /* __LINE__ will do fine */
    118  const char* function_name, /* OPENNURBS__FUNCTION__ will do fine */
    119  const char* format, /* format string */
    120  ... /* format ags */
    121  );
    122 
    123 ON_DECL
    124 void ON_MathError(
    125  const char*, /* sModuleName */
    126  const char*, /* sErrorType */
    127  const char* /* sFunctionName */
    128  );
    129 
    130 ON_END_EXTERNC
    131 
    132 #endif
    diff --git a/6/d3/da3/class_o_n___clipping_plane_info.html b/6/d3/da3/class_o_n___clipping_plane_info.html index 78d4559b..b2962270 100644 --- a/6/d3/da3/class_o_n___clipping_plane_info.html +++ b/6/d3/da3/class_o_n___clipping_plane_info.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ClippingPlaneInfo Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/da7/opennurbs__optimize_8h_source.html b/6/d3/da7/opennurbs__optimize_8h_source.html index 55941017..a2ec55da 100644 --- a/6/d3/da7/opennurbs__optimize_8h_source.html +++ b/6/d3/da7/opennurbs__optimize_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_optimize.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_optimize.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/dac/class_o_n__3dm_page_settings-members.html b/6/d3/dac/class_o_n__3dm_page_settings-members.html index d2abb602..54200f59 100644 --- a/6/d3/dac/class_o_n__3dm_page_settings-members.html +++ b/6/d3/dac/class_o_n__3dm_page_settings-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/dac/class_o_n___brep_trim.html b/6/d3/dac/class_o_n___brep_trim.html index d48c4964..f0231c31 100644 --- a/6/d3/dac/class_o_n___brep_trim.html +++ b/6/d3/dac/class_o_n___brep_trim.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepTrim Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
      trim_type_count = 8, force_32_bit_trim_type = 0xFFFFFFFF
    - } - types of trim - access through m_type member. Also see m_iso and ON_Surface::ISO More...
    + } types of trim - access through m_type member. Also see m_iso and ON_Surface::ISO More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -699,8 +697,7 @@ Additional Inherited Members

    Interface.

    Not necessary Base clasee does the same. / virtual ON_Curve::SetStartPoint override bool SetStartPoint( ON_3dPoint start_point ) override;

    -

    / virtual ON_Curve::SetEndPoint override bool SetEndPoint( ON_3dPoint end_point ) override;
    -Description: Expert user tool that replaces the 2d curve geometry of a trim Parameters; c2i - [in] brep 2d curve index of new curve Returns: True if successful. Example:

          ON_Curve* pCurve = ...;
    +

    / virtual ON_Curve::SetEndPoint override bool SetEndPoint( ON_3dPoint end_point ) override; Description: Expert user tool that replaces the 2d curve geometry of a trim Parameters; c2i - [in] brep 2d curve index of new curve Returns: True if successful. Example:

          ON_Curve* pCurve = ...;
           int c2i = brep.AddTrimCurve(pCurve);
           trim.ChangeTrimCurve(c2i);
     

    Remarks: Sets m_c2i, calls SetProxyCurve, cleans runtime caches, and updates m_pbox.

    @@ -777,8 +774,7 @@ Description: Expert user tool that replaces the 2d curve geometry of a trim Para
    -

    Expert interface
    -Description: Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. Parameters: bDelete - [in] if true, any cached information is properly deleted. If false, any cached information is simply discarded. This is useful when the cached information may be in alternate memory pools that are managed in nonstandard ways.

    +

    Expert interface Description: Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. Parameters: bDelete - [in] if true, any cached information is properly deleted. If false, any cached information is simply discarded. This is useful when the cached information may be in alternate memory pools that are managed in nonstandard ways.

    Reimplemented from ON_Object.

    @@ -1334,8 +1330,8 @@ Description: Expert user function. If you are using openNURBS in its default con
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -1642,9 +1638,9 @@ Description: Expert user function. If you are using openNURBS in its default con
    diff --git a/6/d3/dad/opennurbs__archive_8h_source.html b/6/d3/dad/opennurbs__archive_8h_source.html index ad196ddd..d275c0c3 100644 --- a/6/d3/dad/opennurbs__archive_8h_source.html +++ b/6/d3/dad/opennurbs__archive_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_archive.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_archive.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/db0/class_o_n___rtf_first_char.html b/6/d3/db0/class_o_n___rtf_first_char.html index 046601c1..a13d5ad4 100644 --- a/6/d3/db0/class_o_n___rtf_first_char.html +++ b/6/d3/db0/class_o_n___rtf_first_char.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RtfFirstChar Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/db2/class_o_n___brep_face-members.html b/6/d3/db2/class_o_n___brep_face-members.html index 09520b7e..181c94fb 100644 --- a/6/d3/db2/class_o_n___brep_face-members.html +++ b/6/d3/db2/class_o_n___brep_face-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/db8/class_o_n___brep_vertex_array-members.html b/6/d3/db8/class_o_n___brep_vertex_array-members.html index a3afc651..4cfd6b90 100644 --- a/6/d3/db8/class_o_n___brep_vertex_array-members.html +++ b/6/d3/db8/class_o_n___brep_vertex_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/db9/class_o_n__3dm_annotation_context-members.html b/6/d3/db9/class_o_n__3dm_annotation_context-members.html index 1b95025d..231fa819 100644 --- a/6/d3/db9/class_o_n__3dm_annotation_context-members.html +++ b/6/d3/db9/class_o_n__3dm_annotation_context-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/dce/opennurbs__base64_8h_source.html b/6/d3/dce/opennurbs__base64_8h_source.html index 744f0fea..4d1dde26 100644 --- a/6/d3/dce/opennurbs__base64_8h_source.html +++ b/6/d3/dce/opennurbs__base64_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_base64.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_base64.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/dd0/opennurbs__linecurve_8h_source.html b/6/d3/dd0/opennurbs__linecurve_8h_source.html index 024c6a68..5fa983b1 100644 --- a/6/d3/dd0/opennurbs__linecurve_8h_source.html +++ b/6/d3/dd0/opennurbs__linecurve_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_linecurve.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_linecurve.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/dd1/class_o_n___document_user_string_list-members.html b/6/d3/dd1/class_o_n___document_user_string_list-members.html index eab841bc..e29c65e9 100644 --- a/6/d3/dd1/class_o_n___document_user_string_list-members.html +++ b/6/d3/dd1/class_o_n___document_user_string_list-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/dd2/class_o_n___brep_region_array-members.html b/6/d3/dd2/class_o_n___brep_region_array-members.html index b4a7e9f2..036b8b87 100644 --- a/6/d3/dd2/class_o_n___brep_region_array-members.html +++ b/6/d3/dd2/class_o_n___brep_region_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/dd8/opennurbs__cone_8h_source.html b/6/d3/dd8/opennurbs__cone_8h_source.html index ad201754..b69f850a 100644 --- a/6/d3/dd8/opennurbs__cone_8h_source.html +++ b/6/d3/dd8/opennurbs__cone_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_cone.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_cone.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/ddf/class_o_n___arc.html b/6/d3/ddf/class_o_n___arc.html index 6ea2f34b..2ccd7ae0 100644 --- a/6/d3/ddf/class_o_n___arc.html +++ b/6/d3/ddf/class_o_n___arc.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Arc Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////
    -Description: An ON_Arc is a subcurve of 3d circle. Details: The curve is parameterized by an angle expressed in radians. For an IsValid() arc the total subtended angle AngleRadians() = Domain()(1) - Domain()(0) must satisfy 0< AngleRadians() <2*Pi .

    -

    The parameterization of the ON_Arc is inherited from the ON_Circle it is derived from. In particular t -> center + cos(t)*radius*xaxis + sin(t)*radius*yaxis
    - where xaxis and yaxis, (part of ON_Circle::m_plane) form an othonormal frame of the plane containing the circle.

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// Description: An ON_Arc is a subcurve of 3d circle. Details: The curve is parameterized by an angle expressed in radians. For an IsValid() arc the total subtended angle AngleRadians() = Domain()(1) - Domain()(0) must satisfy 0< AngleRadians() <2*Pi .

    +

    The parameterization of the ON_Arc is inherited from the ON_Circle it is derived from. In particular t -> center + cos(t)*radius*xaxis + sin(t)*radius*yaxis where xaxis and yaxis, (part of ON_Circle::m_plane) form an othonormal frame of the plane containing the circle.

    Constructor & Destructor Documentation

    ◆ ON_Arc() [1/9]

    @@ -560,8 +552,7 @@ Description: An ON_Arc
    -

    Description: Construct an arc parallel to plane from a center point, radius, and angle in radians.
    - The arc starts at center+radius*plane.xaxis. Parameters: plane - [in] The plane x, y and z axis are used to defines the circle plane's x, y and z axis. The plane origin is ignorned. center - [in] circle's center point radius - [in] angle_in_radians - [in]

    +

    Description: Construct an arc parallel to plane from a center point, radius, and angle in radians. The arc starts at center+radius*plane.xaxis. Parameters: plane - [in] The plane x, y and z axis are used to defines the circle plane's x, y and z axis. The plane origin is ignorned. center - [in] circle's center point radius - [in] angle_in_radians - [in]

    @@ -903,8 +894,7 @@ Description: An ON_Arc
    -

    Description: Create an arc parallel to plane from a center point, radius, and angle in radians.
    - The arc starts at center+radius*plane.xaxis. Parameters: plane - [in] The plane x, y and z axis are used to defines the circle plane's x, y and z axis. The plane origin is ignorned. center - [in] circle's center point radius - [in] angle_in_radians - [in]

    +

    Description: Create an arc parallel to plane from a center point, radius, and angle in radians. The arc starts at center+radius*plane.xaxis. Parameters: plane - [in] The plane x, y and z axis are used to defines the circle plane's x, y and z axis. The plane origin is ignorned. center - [in] circle's center point radius - [in] angle_in_radians - [in]

    @@ -1164,8 +1154,7 @@ Description: An ON_Arc
    -

    Description: Get arc's 3d axis aligned bounding box or the union of the input box with the arc's bounding box. Parameters: bbox - [in/out] 3d axis aligned bounding box bGrowBox - [in] (default=false) If true, then the union of the input bbox and the arc's bounding box is returned in bbox.
    - If false, the arc's bounding box is returned in bbox. Returns: true if arc has bounding box and calculation was successful.

    +

    Description: Get arc's 3d axis aligned bounding box or the union of the input box with the arc's bounding box. Parameters: bbox - [in/out] 3d axis aligned bounding box bGrowBox - [in] (default=false) If true, then the union of the input bbox and the arc's bounding box is returned in bbox. If false, the arc's bounding box is returned in bbox. Returns: true if arc has bounding box and calculation was successful.

    @@ -1184,8 +1173,7 @@ Description: An ON_Arc
    -

    Description: Get a rational degree 2 NURBS curve representation of the arc. Note that the parameterization of NURBS curve does not match arc's transcendental paramaterization.
    - Use GetRadianFromNurbFormParameter() and GetParameterFromRadian() to convert between the NURBS curve parameter and the transcendental parameter Parameters: nurbs_curve - [out] nurbs_curve returned here. Returns: 0 for failure and 2 for success.

    +

    Description: Get a rational degree 2 NURBS curve representation of the arc. Note that the parameterization of NURBS curve does not match arc's transcendental paramaterization. Use GetRadianFromNurbFormParameter() and GetParameterFromRadian() to convert between the NURBS curve parameter and the transcendental parameter Parameters: nurbs_curve - [out] nurbs_curve returned here. Returns: 0 for failure and 2 for success.

    @@ -1298,8 +1286,7 @@ Description: An ON_Arc
    -

    Description: Get tight bounding box. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false)
    - If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the arc's tight bounding box. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed arc is calculated. The arc is not modified. Returns: True if a valid tight_bbox is returned.

    +

    Description: Get tight bounding box. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false) If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the arc's tight bounding box. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed arc is calculated. The arc is not modified. Returns: True if a valid tight_bbox is returned.

    @@ -1451,8 +1438,7 @@ Description: An ON_Arc
    -

    Returns: Area of the arc's sector.
    -Remarks: The arc's sector is the region bounded by the arc, the line segment from the arc's end to the center, and the line segment from the center to the arc's start.

    +

    Returns: Area of the arc's sector. Remarks: The arc's sector is the region bounded by the arc, the line segment from the arc's end to the center, and the line segment from the center to the arc's start.

    @@ -1470,8 +1456,7 @@ Remarks: The arc's sector is the region bounded by the arc, the line segment fro
    -

    Returns: Area centroid of the arc's sector.
    -Remarks: The arc's sector is the region bounded by the arc, the line segment from the arc's end to the center, and the line segment from the center to the arc's start.

    +

    Returns: Area centroid of the arc's sector. Remarks: The arc's sector is the region bounded by the arc, the line segment from the arc's end to the center, and the line segment from the center to the arc's start.

    @@ -1507,8 +1492,7 @@ Remarks: The arc's sector is the region bounded by the arc, the line segment fro
    -

    Returns: Area centroid of the arc's segment.
    -Remarks: The arc's segment is the region bounded by the arc and the line segment from the arc's end to the arc's start.

    +

    Returns: Area centroid of the arc's segment. Remarks: The arc's segment is the region bounded by the arc and the line segment from the arc's end to the arc's start.

    @@ -1687,9 +1671,9 @@ Remarks: The arc's segment is the region bounded by the arc and the line segment diff --git a/6/d3/de1/opennurbs__internal__unicode__cp_8h_source.html b/6/d3/de1/opennurbs__internal__unicode__cp_8h_source.html index 88fc163d..443b40b9 100644 --- a/6/d3/de1/opennurbs__internal__unicode__cp_8h_source.html +++ b/6/d3/de1/opennurbs__internal__unicode__cp_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_internal_unicode_cp.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_internal_unicode_cp.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_INTERNAL_UNICODE_CP_INC_)
    18 #define OPENNURBS_INTERNAL_UNICODE_CP_INC_
    19 
    20 #if !defined(ON_COMPILING_OPENNURBS)
    21 // This check is included in all opennurbs source .c and .cpp files to insure
    22 // ON_COMPILING_OPENNURBS is defined when opennurbs source is compiled.
    23 // When opennurbs source is being compiled, ON_COMPILING_OPENNURBS is defined
    24 // and the opennurbs .h files alter what is declared and how it is declared.
    25 #error ON_COMPILING_OPENNURBS must be defined when compiling opennurbs
    26 #endif
    27 
    28 #if !defined(ON_RUNTIME_WIN)
    29 #error Do not use for Windows builds.
    30 #endif
    31 
    32 #if !defined(ON_RUNTIME_WIN)
    33 // When we do not have access to Windows code page tools,
    34 // we have to add in code to get convert Windows and Apple
    35 // multibyte encodings to UNICODE encodings.
    36 //
    37 // In practice, the primary use of the double byte code page support
    38 // is in parsing rich text (RTF) in ON_TextContent classes created
    39 // on computers with Eastern European and Asian locales as the default
    40 // locale.
    41 //
    42 // Many Western European and Americas locales are handled by the
    43 // single byte code pages 1252 and 10000. Code pages for other
    44 // locales will be added as needed because embedding the large
    45 // double byte tables makes the resulting libraries large.
    46 //
    47 // At this time opennurbs does not ship the
    48 // code page N to UNICODE translation tables as separate files
    49 // that can be loaded on demand because of the added installation
    50 // and runtime lookup complexities.
    51 //
    52 // When possible, Rhino and opennurbs replace code page
    53 // encodings with UNICODE in RTF. All runtimes strings
    54 // use UNICODE UTF-8, UTF-16, or UTF-32 encodings.
    55 // Whenever posssible, the UNICODE encoding is used
    56 // to retrieve glyph information from fonts.
    57 #define ON_DOUBLE_BYTE_CODE_PAGE_SUPPORT
    58 #endif
    59 
    60 #if defined(ON_DOUBLE_BYTE_CODE_PAGE_SUPPORT)
    61 
    62 /////////////////////////////////////////////////////////
    63 //
    64 // Code page 932
    65 //
    66 
    67 bool ON_IsPotentialWindowsCodePage932SingleByteEncoding(
    68  ON__UINT32 x
    69 );
    70 
    71 bool ON_IsPotentialWindowsCodePage932DoubleByteEncoding(
    72  ON__UINT32 lead_byte,
    73  ON__UINT32 trailing_byte
    74 );
    75 
    76 /*
    77 Description:
    78  Convert a Windows code page 932 encoded value to a UNICODE code point.
    79  This code page is often used for Japanese glpyhs.
    80 
    81 Parameters:
    82  code_page_932_character_value - [in]
    83  Valid values are 0 to 0xFDFE with some exceptions in that range.
    84  unicode_code_point - [out]
    85  ON_UnicodeCodePoint::ON_ReplacementCharacter is returned when code_page_932_character_value is not valid.
    86 
    87 Returns:
    88  1: if code_page_932_character_value and the corresponding UNICODE code point is returned in *unicode_code_point.
    89  0: otherwise and *unicode_code_point = ON_UnicodeCodePoint::ON_ReplacementCharacter.
    90 
    91 Remarks:
    92  Windows code page 932: https://msdn.microsoft.com/en-us/library/cc194887.aspx
    93  Conversions to Unicode are based on the Unicode.org mapping of Shift JIS
    94  ftp://ftp.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/SHIFTJIS.TXT
    95 */
    96 #if defined(ON_COMPILER_MSC) && defined(NDEBUG)
    97  // Work around Release build optimization bug in Visual Studio 2017.
    98 __declspec(noinline)
    99 #endif
    100 int ON_MapWindowsCodePage932ToUnicode(
    101  ON__UINT32 code_page_932_character_value,
    102  ON__UINT32* unicode_code_point
    103 );
    104 
    105 /////////////////////////////////////////////////////////
    106 //
    107 // Code page 949
    108 //
    109 
    110 bool ON_IsPotentialWindowsCodePage949SingleByteEncoding(
    111  ON__UINT32 x
    112 );
    113 
    114 bool ON_IsPotentialWindowsCodePage949DoubleByteEncoding(
    115  ON__UINT32 lead_byte,
    116  ON__UINT32 trailing_byte
    117 );
    118 
    119 /*
    120 Description:
    121  Convert a Windows code page 949 encoded value to a UNICODE code point.
    122  This code page is often used for Korean glpyhs.
    123 
    124 Parameters:
    125  code_page_949_character_value - [in]
    126  Valid values are 0 to 0xFDFE with some exceptions in that range.
    127  unicode_code_point - [out]
    128  ON_UnicodeCodePoint::ON_ReplacementCharacter is returned when code_page_949_character_value is not valid.
    129 
    130 Returns:
    131  1: if code_page_949_character_value and the corresponding UNICODE code point is returned in *unicode_code_point.
    132  0: otherwise and *unicode_code_point = ON_UnicodeCodePoint::ON_ReplacementCharacter.
    133 
    134 Remarks:
    135  Windows code page 949: https://msdn.microsoft.com/en-us/library/cc194941.aspx
    136  Conversions to Unicode are based on the Unicode.org mapping of Windows-949
    137  ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP949.TXT
    138 */
    139 #if defined(ON_COMPILER_MSC) && defined(NDEBUG)
    140  // Work around Release build optimization bug in Visual Studio 2017.
    141 __declspec(noinline)
    142 #endif
    143 int ON_MapWindowsCodePage949ToUnicode(
    144  ON__UINT32 code_page_949_character_value,
    145  ON__UINT32* unicode_code_point
    146 );
    147 
    148 
    149 #endif
    150 
    151 #endif
    diff --git a/6/d3/de6/class_o_n___text-members.html b/6/d3/de6/class_o_n___text-members.html index b248ad09..ad488666 100644 --- a/6/d3/de6/class_o_n___text-members.html +++ b/6/d3/de6/class_o_n___text-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/dec/class_o_n___plug_in_ref-members.html b/6/d3/dec/class_o_n___plug_in_ref-members.html index 939d68a7..9587409d 100644 --- a/6/d3/dec/class_o_n___plug_in_ref-members.html +++ b/6/d3/dec/class_o_n___plug_in_ref-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/dec/class_o_n___surface_array-members.html b/6/d3/dec/class_o_n___surface_array-members.html index b0225366..c48b5619 100644 --- a/6/d3/dec/class_o_n___surface_array-members.html +++ b/6/d3/dec/class_o_n___surface_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/df5/class_o_n___glyph_map.html b/6/d3/df5/class_o_n___glyph_map.html index f8c58e5e..da1cdd69 100644 --- a/6/d3/df5/class_o_n___glyph_map.html +++ b/6/d3/df5/class_o_n___glyph_map.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_GlyphMap Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/df7/class_o_n__2f_vector-members.html b/6/d3/df7/class_o_n__2f_vector-members.html index ad7dacd6..5212feb0 100644 --- a/6/d3/df7/class_o_n__2f_vector-members.html +++ b/6/d3/df7/class_o_n__2f_vector-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/dfa/class_o_n___sum_surface-members.html b/6/d3/dfa/class_o_n___sum_surface-members.html index 2069e8d0..35e94341 100644 --- a/6/d3/dfa/class_o_n___sum_surface-members.html +++ b/6/d3/dfa/class_o_n___sum_surface-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d3/dfd/class_o_n_x___model.html b/6/d3/dfd/class_o_n_x___model.html index f55f1e36..24f38f37 100644 --- a/6/d3/dfd/class_o_n_x___model.html +++ b/6/d3/dfd/class_o_n_x___model.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ONX_Model Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Description: Add an copy of the model_geometry and attrbutes to this model.

    Parameters: managed_geometry_object - [in] managed_geometry_object must point to an instance geometric object (curve, surface, brep, mesh, points, ...), a render light, an annotation object, or a detail object created by operator new and on the heap. It will be deleted when the this ONX_Model and the last ON_ModelComponentReference are destroyed.

    -

    managed_attributes - [in] managed_attributes should be nullptr or point to an instance created by operator new and on the heap. It will be deleted when the this ONX_Model and the last ON_ModelComponentReference are destroyed.
    - bResolveIdAndNameConflicts - [in] If bResolveIdAndNameConflicts is false, then managed_attributes must be nullptr or managed_attributes->m_uuid must be non-nil and not used in this model. If bResolveIdAndNameConflicts is true, then id will be modified as needed.

    +

    managed_attributes - [in] managed_attributes should be nullptr or point to an instance created by operator new and on the heap. It will be deleted when the this ONX_Model and the last ON_ModelComponentReference are destroyed.

    +

    bResolveIdAndNameConflicts - [in] If bResolveIdAndNameConflicts is false, then managed_attributes must be nullptr or managed_attributes->m_uuid must be non-nil and not used in this model. If bResolveIdAndNameConflicts is true, then id will be modified as needed.

    Returns: A reference to the added model component. If the reference is empty (ON_ModelComponent::IsEmpty() is true) then the input was not valid.

    @@ -1599,8 +1597,7 @@ Friends

    / Read settings, layer information, and other tables / with information that is referenced by model object / attributes. bModelRead = model.IncrementalReadBegin( archive, error_log );

    if ( bModelRead ) { object_filter = ON::mesh_object ///< read meshes | ON::curve_object ///< and curves ; for(;;) { / read the next model object ON_ModelGeometryComponent* pModelObject = model.IncrementalReadModelObject(object_filter,0); if ( 0 == pModelObject ) break;

    ... ///< work with this model object

    -

    / done with this object. pModelObject = 0; model.m_object_table.Remove(); }
    - } ON::CloseFile( fp ); } See Also: ONX_Model::IsValid ONX_Model::Write ONX_Model::m_crc_error_count

    +

    / done with this object. pModelObject = 0; model.m_object_table.Remove(); } } ON::CloseFile( fp ); } See Also: ONX_Model::IsValid ONX_Model::Write ONX_Model::m_crc_error_count

    @@ -1698,8 +1695,7 @@ Friends

    Description: Reads the next item in the model geometry table.

    -

    Parameters: archive - [in] bManageModelGeometryComponent - [in] true: The ONX_Model destructor will delete the ON_ModelGeometryComponent components created by this function. false: The caller must delete the ON_ModelGeometryComponent components after the ONX_Model is destroyed. bManageGeometry - [in] true: The ON_ModelGeometryComponent destructor will delete the ON_Geometry classes created by this function. false: The caller must delete the ON_Geometry classes after the ONX_Model and ON_ModelGeometryComponent components are destroyed. bManageAttributes - [in] true: The ON_ModelGeometryComponent destructor will delete the ON_3dmObjectAttributes classes created by this function. false: The caller must delete the ON_3dmObjectAttributes classes after the ONX_Model and ON_ModelGeometryComponent components are destroyed. model_object_type_filter - [in] If model_object_type_filter is not zero, then it is a bitfield filter made by bitwise oring ON::object_type values to select which types of objects will be read from the model object table. model_geometry_reference - [out] A reference to an ON_ModelGeometryComponent. This referenced ON_ModelGeometryComponent component is also added to the ONX_Model. Call ONX_Model.RemoveComponent() if you want to discard it before continuing.
    -Returns: True Succesful. If model_geometry_reference.IsEmpty() is true, then no more geometry objects are available and you should call IncrementalReadFinish(). False An error occured and reading should terminate. Remarks: You must call IncrementalReadBegin() before making any calls to IncrementalReadModelObject().

    +

    Parameters: archive - [in] bManageModelGeometryComponent - [in] true: The ONX_Model destructor will delete the ON_ModelGeometryComponent components created by this function. false: The caller must delete the ON_ModelGeometryComponent components after the ONX_Model is destroyed. bManageGeometry - [in] true: The ON_ModelGeometryComponent destructor will delete the ON_Geometry classes created by this function. false: The caller must delete the ON_Geometry classes after the ONX_Model and ON_ModelGeometryComponent components are destroyed. bManageAttributes - [in] true: The ON_ModelGeometryComponent destructor will delete the ON_3dmObjectAttributes classes created by this function. false: The caller must delete the ON_3dmObjectAttributes classes after the ONX_Model and ON_ModelGeometryComponent components are destroyed. model_object_type_filter - [in] If model_object_type_filter is not zero, then it is a bitfield filter made by bitwise oring ON::object_type values to select which types of objects will be read from the model object table. model_geometry_reference - [out] A reference to an ON_ModelGeometryComponent. This referenced ON_ModelGeometryComponent component is also added to the ONX_Model. Call ONX_Model.RemoveComponent() if you want to discard it before continuing. Returns: True Succesful. If model_geometry_reference.IsEmpty() is true, then no more geometry objects are available and you should call IncrementalReadFinish(). False An error occured and reading should terminate. Remarks: You must call IncrementalReadBegin() before making any calls to IncrementalReadModelObject().

    @@ -2026,8 +2022,7 @@ Returns: True Succesful. If model_geometry_reference.IsEmpty() is true, then no
    -

    END model definitions
    -Returns: Bounding box of every object in m_object_table[].

    +

    END model definitions Returns: Bounding box of every object in m_object_table[].

    @@ -2513,8 +2508,7 @@ Returns: Bounding box of every object in m_object_table[].

    -

    BEGIN model document level user string tools
    -Description: Attach a user string to the document. Parameters: key - [in] id used to retrieve this string. string_value - [in] If nullptr, the string with this id will be removed. Returns: True if successful.

    +

    BEGIN model document level user string tools Description: Attach a user string to the document. Parameters: key - [in] id used to retrieve this string. string_value - [in] If nullptr, the string with this id will be removed. Returns: True if successful.

    @@ -2896,9 +2890,9 @@ Description: Attach a user string to the document. Parameters: key - [in] id use diff --git a/6/d4/d07/class_o_n__3dm_wallpaper_image-members.html b/6/d4/d07/class_o_n__3dm_wallpaper_image-members.html index 42ee8198..a629155a 100644 --- a/6/d4/d07/class_o_n__3dm_wallpaper_image-members.html +++ b/6/d4/d07/class_o_n__3dm_wallpaper_image-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d10/class_o_n__3dm_view_trace_image.html b/6/d4/d10/class_o_n__3dm_view_trace_image.html index 83983d55..e5bcdfdb 100644 --- a/6/d4/d10/class_o_n__3dm_view_trace_image.html +++ b/6/d4/d10/class_o_n__3dm_view_trace_image.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmViewTraceImage Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d10/class_o_n___plane_surface-members.html b/6/d4/d10/class_o_n___plane_surface-members.html index 90146e83..0c75780c 100644 --- a/6/d4/d10/class_o_n___plane_surface-members.html +++ b/6/d4/d10/class_o_n___plane_surface-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d1c/class_o_n___unit_system.html b/6/d4/d1c/class_o_n___unit_system.html index 812d6287..2db54829 100644 --- a/6/d4/d1c/class_o_n___unit_system.html +++ b/6/d4/d1c/class_o_n___unit_system.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UnitSystem Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d1e/class_o_n___serial_number_map.html b/6/d4/d1e/class_o_n___serial_number_map.html index 69986c73..ec9df63d 100644 --- a/6/d4/d1e/class_o_n___serial_number_map.html +++ b/6/d4/d1e/class_o_n___serial_number_map.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SerialNumberMap Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////
    -Description: ON_SerialNumberMap provides a way to map set of unique serial number - uuid pairs to application defined values so that adding, finding and removing serial numbers is fast and efficient. The class is designed to handle several millions of unique serial numbers. There are no restrictions on what order numbers are added and removed. The minimum memory footprint is less than 150KB and doesn't increase until you have more than 8000 serial numbers. It is possible to have an active serial number and an inactive id.

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// Description: ON_SerialNumberMap provides a way to map set of unique serial number - uuid pairs to application defined values so that adding, finding and removing serial numbers is fast and efficient. The class is designed to handle several millions of unique serial numbers. There are no restrictions on what order numbers are added and removed. The minimum memory footprint is less than 150KB and doesn't increase until you have more than 8000 serial numbers. It is possible to have an active serial number and an inactive id.

    Constructor & Destructor Documentation

    ◆ ON_SerialNumberMap()

    @@ -209,8 +202,7 @@ Description: -

    Description: Add a serial number to the map. Parameters: sn - [in] serial number to add. Returns: If the serial number is valid (>0), a pointer to its element is returned. When a new element is added, every byte of the m_value field is set to 0. If the serial number was already active, its element is also returned. If you need to distinguish between new and previously existing elements, then set an m_value field to something besides 0 after you add a new serial number. The id associated with this serial number will be zero and cannot be found using FindId(). Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class.
    - If you need to save information in the returned SN_ELEMENT for future use, you must copy the information into storage you are managing.

    +

    Description: Add a serial number to the map. Parameters: sn - [in] serial number to add. Returns: If the serial number is valid (>0), a pointer to its element is returned. When a new element is added, every byte of the m_value field is set to 0. If the serial number was already active, its element is also returned. If you need to distinguish between new and previously existing elements, then set an m_value field to something besides 0 after you add a new serial number. The id associated with this serial number will be zero and cannot be found using FindId(). Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class. If you need to save information in the returned SN_ELEMENT for future use, you must copy the information into storage you are managing.

    You may change the value of the SN_ELEMENT's m_value field. You must NEVER change any other SN_ELEMENT fields or you will break searching and possibly cause crashes.

    @@ -241,8 +233,7 @@ Description:

    Parameters: sn - [in] serial number to add. id - [in] suggested id to add. If id is zero or already in use, another id will be assigned to the element. Returns: If the serial number is valid (>0), a pointer to its element is returned. When a new element is added, every byte of the m_value field is set to 0. If the serial number was already active, its element is also returned. If you need to distinguish between new and previously existing elements, then set an m_value field to something besides 0 after you add a new serial number. If the id parameter is nil, then a new uuid is created and added. If the id parameter is not nil but is active on another element, a new uuid is created and added. You can inspect the value of m_id on the returned element to determine the id AddSerialNumberAndId() assigned to the element.

    -

    Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class.
    - If you need to save information in the returned SN_ELEMENT for future use, you must copy the information into storage you are managing.

    +

    Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class. If you need to save information in the returned SN_ELEMENT for future use, you must copy the information into storage you are managing.

    You may change the value of the SN_ELEMENT's m_value field. You must NEVER change any other SN_ELEMENT fields or you will break searching and possibly cause crashes.

    @@ -298,8 +289,7 @@ Description: -

    Parameters: id - [in] id number to search for. Returns: If the id is active, a pointer to its element is returned. Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class.
    - If you need to save information in the returned
    SN_ELEMENT for future use, you must copy the information into storage you are managing.

    +

    Parameters: id - [in] id number to search for. Returns: If the id is active, a pointer to its element is returned. Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class. If you need to save information in the returned SN_ELEMENT for future use, you must copy the information into storage you are managing.

    You may change the value of the SN_ELEMENT's m_value field. You must NEVER change any other SN_ELEMENT fields or you will break searching and possibly cause crashes.

    @@ -319,8 +309,7 @@ Description: -

    Parameters: sn - [in] serial number to search for. Returns: If the serial number is active, a pointer to its element is returned. Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class.
    - If you need to save information in the returned
    SN_ELEMENT for future use, you must copy the information into storage you are managing.

    +

    Parameters: sn - [in] serial number to search for. Returns: If the serial number is active, a pointer to its element is returned. Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class. If you need to save information in the returned SN_ELEMENT for future use, you must copy the information into storage you are managing.

    You may change the value of the SN_ELEMENT's m_value field. You must NEVER change any other SN_ELEMENT fields or you will break searching and possibly cause crashes.

    @@ -339,8 +328,7 @@ Description: -

    Returns: The active element with the smallest serial number, or null if the list is empty. Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class.
    - If you need to save information in the returned
    SN_ELEMENT for future use, you must copy the information into storage you are managing.

    +

    Returns: The active element with the smallest serial number, or null if the list is empty. Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class. If you need to save information in the returned SN_ELEMENT for future use, you must copy the information into storage you are managing.

    You may change the value of the SN_ELEMENT's m_value field. You must NEVER change any other SN_ELEMENT fields or you will break searching and possibly cause crashes.

    @@ -429,8 +417,7 @@ Description: -

    Returns: The active element with the biggest serial number, or null if the list is empty. Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class.
    - If you need to save information in the returned
    SN_ELEMENT for future use, you must copy the information into storage you are managing.

    +

    Returns: The active element with the biggest serial number, or null if the list is empty. Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class. If you need to save information in the returned SN_ELEMENT for future use, you must copy the information into storage you are managing.

    You may change the value of the SN_ELEMENT's m_value field. You must NEVER change any other SN_ELEMENT fields or you will break searching and possibly cause crashes.

    @@ -460,8 +447,7 @@ Description: -

    Parameters: sn - [in] If > 0, this is the serial number of the element with the id. If 0, the field is ignored. id - [in] id to search for. Returns: If the id was active, it is removed and a pointer to its element is returned. The element's serial remains active. To remove both the id and serial number, use RemoveSerialNumberAndId(). Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class.
    - If you need to save information in the returned SN_ELEMENT for future use, you must copy the information into storage you are managing.

    +

    Parameters: sn - [in] If > 0, this is the serial number of the element with the id. If 0, the field is ignored. id - [in] id to search for. Returns: If the id was active, it is removed and a pointer to its element is returned. The element's serial remains active. To remove both the id and serial number, use RemoveSerialNumberAndId(). Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class. If you need to save information in the returned SN_ELEMENT for future use, you must copy the information into storage you are managing.

    You may change the value of the SN_ELEMENT's m_value field. You must NEVER change any other SN_ELEMENT fields or you will break searching and possibly cause crashes.

    @@ -481,8 +467,7 @@ Description: -

    Parameters: sn - [in] serial number of the element to remove. Returns: If the serial number was active, it is removed and a pointer to its element is returned. If the element's id was active, the id is also removed. Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class.
    - If you need to save information in the returned
    SN_ELEMENT for future use, you must copy the information into storage you are managing.

    +

    Parameters: sn - [in] serial number of the element to remove. Returns: If the serial number was active, it is removed and a pointer to its element is returned. If the element's id was active, the id is also removed. Restrictions: The returned pointer may become invalid after any subsequent calls to any function in this class. If you need to save information in the returned SN_ELEMENT for future use, you must copy the information into storage you are managing.

    You may change the value of the SN_ELEMENT's m_value field. You must NEVER change any other SN_ELEMENT fields or you will break searching and possibly cause crashes.

    @@ -490,9 +475,9 @@ Description: diff --git a/6/d4/d1e/class_o_n___text_style-members.html b/6/d4/d1e/class_o_n___text_style-members.html index b957c472..5aa63d66 100644 --- a/6/d4/d1e/class_o_n___text_style-members.html +++ b/6/d4/d1e/class_o_n___text_style-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d2b/class_o_n___hatch_loop-members.html b/6/d4/d2b/class_o_n___hatch_loop-members.html index 7f86f9a6..66d1acff 100644 --- a/6/d4/d2b/class_o_n___hatch_loop-members.html +++ b/6/d4/d2b/class_o_n___hatch_loop-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d2c/class_o_n___text_run.html b/6/d4/d2c/class_o_n___text_run.html index d934b593..3b2eb611 100644 --- a/6/d4/d2c/class_o_n___text_run.html +++ b/6/d4/d2c/class_o_n___text_run.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextRun Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d2c/opennurbs__textobject_8h_source.html b/6/d4/d2c/opennurbs__textobject_8h_source.html index 44b55e03..29f61c13 100644 --- a/6/d4/d2c/opennurbs__textobject_8h_source.html +++ b/6/d4/d2c/opennurbs__textobject_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_textobject.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_textobject.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d2d/class_o_n__4d_point_array-members.html b/6/d4/d2d/class_o_n__4d_point_array-members.html index 682f516e..487faa58 100644 --- a/6/d4/d2d/class_o_n__4d_point_array-members.html +++ b/6/d4/d2d/class_o_n__4d_point_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d2e/class_o_n___space_morph-members.html b/6/d4/d2e/class_o_n___space_morph-members.html index de7e9562..b163ad01 100644 --- a/6/d4/d2e/class_o_n___space_morph-members.html +++ b/6/d4/d2e/class_o_n___space_morph-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d30/class_o_n___manifest_map_item.html b/6/d4/d30/class_o_n___manifest_map_item.html index 7af5b83a..b3f87d08 100644 --- a/6/d4/d30/class_o_n___manifest_map_item.html +++ b/6/d4/d30/class_o_n___manifest_map_item.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ManifestMapItem Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d31/class_o_n___uuid_index_list-members.html b/6/d4/d31/class_o_n___uuid_index_list-members.html index ae5793cb..6481ffd5 100644 --- a/6/d4/d31/class_o_n___uuid_index_list-members.html +++ b/6/d4/d31/class_o_n___uuid_index_list-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d32/opennurbs__internal__defines_8h_source.html b/6/d4/d32/opennurbs__internal__defines_8h_source.html index e249cfbe..130403e3 100644 --- a/6/d4/d32/opennurbs__internal__defines_8h_source.html +++ b/6/d4/d32/opennurbs__internal__defines_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_internal_defines.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_internal_defines.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d42/class_o_n___mesh_curvature_stats.html b/6/d4/d42/class_o_n___mesh_curvature_stats.html index 0fa965da..121f3df5 100644 --- a/6/d4/d42/class_o_n___mesh_curvature_stats.html +++ b/6/d4/d42/class_o_n___mesh_curvature_stats.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshCurvatureStats Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d44/class_o_n___torus.html b/6/d4/d44/class_o_n___torus.html index ac4cbd42..a2e47b15 100644 --- a/6/d4/d44/class_o_n___torus.html +++ b/6/d4/d44/class_o_n___torus.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Torus Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d48/class_o_n___plane.html b/6/d4/d48/class_o_n___plane.html index dd049f4e..a62d512e 100644 --- a/6/d4/d48/class_o_n___plane.html +++ b/6/d4/d48/class_o_n___plane.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Plane Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_Plane() [1/6]

    @@ -1483,9 +1479,9 @@ Static Public Attributes
    diff --git a/6/d4/d56/opennurbs__private__wrap_8h_source.html b/6/d4/d56/opennurbs__private__wrap_8h_source.html index 30c5095d..31edd787 100644 --- a/6/d4/d56/opennurbs__private__wrap_8h_source.html +++ b/6/d4/d56/opennurbs__private__wrap_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_private_wrap.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_private_wrap.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 #error OBSOLETE FILE
    diff --git a/6/d4/d5a/class_o_n___curve.html b/6/d4/d5a/class_o_n___curve.html index 618a579a..d6ad2451 100644 --- a/6/d4/d5a/class_o_n___curve.html +++ b/6/d4/d5a/class_o_n___curve.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Curve Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Get a duplicate of the curve. Returns: A duplicate of the curve.
    -Remarks: The caller must delete the returned curve. For non-ON_CurveProxy objects, this simply duplicates the curve using ON_Object::Duplicate. For ON_CurveProxy objects, this duplicates the actual proxy curve geometry and, if necessary, trims and reverse the result to that the returned curve's parameterization and locus match the proxy curve's.

    +

    Description: Get a duplicate of the curve. Returns: A duplicate of the curve. Remarks: The caller must delete the returned curve. For non-ON_CurveProxy objects, this simply duplicates the curve using ON_Object::Duplicate. For ON_CurveProxy objects, this duplicates the actual proxy curve geometry and, if necessary, trims and reverse the result to that the returned curve's parameterization and locus match the proxy curve's.

    Reimplemented in ON_CurveProxy, ON_PolyEdgeSegment, ON_PolyCurve, and ON_PolyEdgeCurve.

    @@ -1038,8 +1035,7 @@ Remarks: The caller must delete the returned curve. For non-ON_CurveProxy object
    -

    Description: Pure virtual function. Default returns false. Where possible, analytically extends curve to include domain. Parameters: domain - [in] if domain is not included in curve domain, curve will be extended so that its domain includes domain.
    - Will not work if curve is closed. Original curve is identical to the restriction of the resulting curve to the original curve domain, Returns: true if successful.

    +

    Description: Pure virtual function. Default returns false. Where possible, analytically extends curve to include domain. Parameters: domain - [in] if domain is not included in curve domain, curve will be extended so that its domain includes domain. Will not work if curve is closed. Original curve is identical to the restriction of the resulting curve to the original curve domain, Returns: true if successful.

    Reimplemented in ON_NurbsCurve, ON_PolylineCurve, ON_PolyCurve, ON_ArcCurve, and ON_LineCurve.

    @@ -1283,8 +1279,7 @@ Remarks: The caller must delete the returned curve. For non-ON_CurveProxy object
    -

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search.
    - dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. If 'c', the type of continuity to test for is ON::continuity::Gsmooth_continuous and the curvature changes from curved to 0 or 0 to curved and there is no tangency kink dtype is returns 3 cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    +

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search. dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. If 'c', the type of continuity to test for is ON::continuity::Gsmooth_continuous and the curvature changes from curved to 0 or 0 to curved and there is no tangency kink dtype is returns 3 cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    true if a parametric discontinuity was found strictly between t0 and t1. Note well that all curves are parametrically continuous at the ends of their domains.

    Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous):

    true if a locus discontinuity was found strictly between t0 and t1 or at t1 is the at the end of a curve. Note well that all open curves (IsClosed()=false) are locus discontinuous at the ends of their domains. All closed curves (IsClosed()=true) are at least C0_locus_continuous at the ends of their domains.

    @@ -1590,9 +1585,7 @@ Remarks: The caller must delete the returned curve. For non-ON_CurveProxy object
    -

    Description: Does a NURBS curve representation of this curve. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the curve's to wthe desired accuracy 2 success - NURBS point locus matches the curve's and the domain of the NURBS curve is correct.
    - However, This curve's parameterization and the NURBS curve parameterization may not match. This situation happens when getting NURBS representations of curves that have a transendental parameterization like circles Remarks: This is a low-level virtual function.
    -See Also: ON_Curve::GetNurbForm ON_Curve::NurbsCurve

    +

    Description: Does a NURBS curve representation of this curve. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the curve's to wthe desired accuracy 2 success - NURBS point locus matches the curve's and the domain of the NURBS curve is correct. However, This curve's parameterization and the NURBS curve parameterization may not match. This situation happens when getting NURBS representations of curves that have a transendental parameterization like circles Remarks: This is a low-level virtual function. See Also: ON_Curve::GetNurbForm ON_Curve::NurbsCurve

    Reimplemented in ON_NurbsCurve, ON_PolylineCurve, ON_PolyCurve, ON_CurveProxy, ON_LineCurve, and ON_ArcCurve.

    @@ -1828,8 +1821,7 @@ See Also: -

    Description: Test continuity at a curve parameter value. Parameters: c - [in] type of continuity to test for. Read ON::continuity comments for details. t - [in] parameter to test hint - [in] evaluation hint point_tolerance - [in] if the distance between two points is greater than point_tolerance, then the curve is not C0. d1_tolerance - [in] if the difference between two first derivatives is greater than d1_tolerance, then the curve is not C1. d2_tolerance - [in] if the difference between two second derivatives is greater than d2_tolerance, then the curve is not C2. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous.
    - ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if the curve has at least the c type continuity at the parameter t.

    +

    Description: Test continuity at a curve parameter value. Parameters: c - [in] type of continuity to test for. Read ON::continuity comments for details. t - [in] parameter to test hint - [in] evaluation hint point_tolerance - [in] if the distance between two points is greater than point_tolerance, then the curve is not C0. d1_tolerance - [in] if the difference between two first derivatives is greater than d1_tolerance, then the curve is not C1. d2_tolerance - [in] if the difference between two second derivatives is greater than d2_tolerance, then the curve is not C2. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous. ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if the curve has at least the c type continuity at the parameter t.

    Reimplemented in ON_NurbsCurve, ON_CurveProxy, ON_PolylineCurve, ON_PolyCurve, and ON_ArcCurve.

    @@ -2254,8 +2246,7 @@ See Also: -

    Description: Splits (divides) the curve at the specified parameter.
    - The parameter must be in the interior of the curve's domain. The pointers passed to Split must either be nullptr or point to an
    ON_Curve object of the same type. If the pointer is nullptr, then a curve will be created in Split(). You may pass "this" as left_side or right_side. Parameters: t - [in] parameter to split the curve at in the interval returned by Domain(). left_side - [out] left portion of curve returned here right_side - [out] right portion of curve returned here Returns: true - The curve was split into two pieces.
    - false - The curve could not be split. For example if the parameter is too close to an endpoint.

    +

    Description: Splits (divides) the curve at the specified parameter. The parameter must be in the interior of the curve's domain. The pointers passed to Split must either be nullptr or point to an ON_Curve object of the same type. If the pointer is nullptr, then a curve will be created in Split(). You may pass "this" as left_side or right_side. Parameters: t - [in] parameter to split the curve at in the interval returned by Domain(). left_side - [out] left portion of curve returned here right_side - [out] right portion of curve returned here Returns: true - The curve was split into two pieces. false - The curve could not be split. For example if the parameter is too close to an endpoint.

    Example: For example, if crv were an ON_NurbsCurve, then

      ON_NurbsCurve right_side;
       crv.Split( crv.Domain().Mid() &crv, &right_side );
     

    would split crv at the parametric midpoint, put the left side in crv, and return the right side in right_side.

    @@ -2649,9 +2638,9 @@ within tolerance of m_t[index].
    diff --git a/6/d4/d5e/class_o_n___angle_value-members.html b/6/d4/d5e/class_o_n___angle_value-members.html index af0b4880..9c314666 100644 --- a/6/d4/d5e/class_o_n___angle_value-members.html +++ b/6/d4/d5e/class_o_n___angle_value-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d62/class_o_n___curve_proxy_history.html b/6/d4/d62/class_o_n___curve_proxy_history.html index d084e631..5a04fc8a 100644 --- a/6/d4/d62/class_o_n___curve_proxy_history.html +++ b/6/d4/d62/class_o_n___curve_proxy_history.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_CurveProxyHistory Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_CurveProxyHistory()

    @@ -302,9 +298,9 @@ Public Attributes
    diff --git a/6/d4/d65/class_o_n___simple_fixed_size_pool_iterator-members.html b/6/d4/d65/class_o_n___simple_fixed_size_pool_iterator-members.html index 4a2808cd..e3ae4c4d 100644 --- a/6/d4/d65/class_o_n___simple_fixed_size_pool_iterator-members.html +++ b/6/d4/d65/class_o_n___simple_fixed_size_pool_iterator-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d67/class_o_n___triangle-members.html b/6/d4/d67/class_o_n___triangle-members.html index 2fdc4af6..b802a939 100644 --- a/6/d4/d67/class_o_n___triangle-members.html +++ b/6/d4/d67/class_o_n___triangle-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d6b/opennurbs__subd__data_8h_source.html b/6/d4/d6b/opennurbs__subd__data_8h_source.html index 79c4f5d4..73d8574c 100644 --- a/6/d4/d6b/opennurbs__subd__data_8h_source.html +++ b/6/d4/d6b/opennurbs__subd__data_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_subd_data.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_subd_data.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d6f/class_o_n___line.html b/6/d4/d6f/class_o_n___line.html index 47ef5849..d74986d2 100644 --- a/6/d4/d6f/class_o_n___line.html +++ b/6/d4/d6f/class_o_n___line.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Line Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_Line() [1/3]

    @@ -463,8 +459,7 @@ Static Public Attributes
    -

    Description: Get line's 3d axis aligned bounding box or the union of the input box with the object's bounding box. Parameters: bbox - [in/out] 3d axis aligned bounding box bGrowBox - [in] (default=false) If true, then the union of the input bbox and the object's bounding box is returned in bbox.
    - If false, the object's bounding box is returned in bbox. Returns: true if object has bounding box and calculation was successful.

    +

    Description: Get line's 3d axis aligned bounding box or the union of the input box with the object's bounding box. Parameters: bbox - [in/out] 3d axis aligned bounding box bGrowBox - [in] (default=false) If true, then the union of the input bbox and the object's bounding box is returned in bbox. If false, the object's bounding box is returned in bbox. Returns: true if object has bounding box and calculation was successful.

    @@ -499,8 +494,7 @@ Static Public Attributes
    -

    Description: Get tight bounding box. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false)
    - If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the line's tight bounding box. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed line is calculated. The line is not modified. Returns: True if a valid tight_bbox is returned.

    +

    Description: Get tight bounding box. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false) If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the line's tight bounding box. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed line is calculated. The line is not modified. Returns: True if a valid tight_bbox is returned.

    @@ -1015,9 +1009,9 @@ Static Public Attributes diff --git a/6/d4/d77/class_o_n__3dm_view_trace_image-members.html b/6/d4/d77/class_o_n__3dm_view_trace_image-members.html index 6f12155b..61186c25 100644 --- a/6/d4/d77/class_o_n__3dm_view_trace_image-members.html +++ b/6/d4/d77/class_o_n__3dm_view_trace_image-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d7d/struct_o_n___r_tree_search_result.html b/6/d4/d7d/struct_o_n___r_tree_search_result.html index c18d7274..75ca4fbf 100644 --- a/6/d4/d7d/struct_o_n___r_tree_search_result.html +++ b/6/d4/d7d/struct_o_n___r_tree_search_result.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RTreeSearchResult Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d80/class_o_n___line_curve-members.html b/6/d4/d80/class_o_n___line_curve-members.html index dcf7c48b..99dff9b9 100644 --- a/6/d4/d80/class_o_n___line_curve-members.html +++ b/6/d4/d80/class_o_n___line_curve-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d85/class_o_n__3dm_archive_table_status.html b/6/d4/d85/class_o_n__3dm_archive_table_status.html index 6b324b91..c89252ca 100644 --- a/6/d4/d85/class_o_n__3dm_archive_table_status.html +++ b/6/d4/d85/class_o_n__3dm_archive_table_status.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmArchiveTableStatus Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d8b/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o_h_e_a_d_e_r.html b/6/d4/d8b/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o_h_e_a_d_e_r.html index 020106c5..e1a73260 100644 --- a/6/d4/d8b/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o_h_e_a_d_e_r.html +++ b/6/d4/d8b/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o_h_e_a_d_e_r.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_WindowsBITMAPINFOHEADER Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    WORD = bits per pixel (0,1,4,8,16,24,32 are valid) 1 See http://msdn.microsoft.com/default.asp
    - 4 See http://msdn.microsoft.com/default.asp
    - 8 The bitmap has a maximum of 256 colors, and the bmiColors member contains up to 256 entries. In this case, each byte in the array represents a single pixel. 16 See http://msdn.microsoft.com/default.asp
    - 24 If biClrUsed=0 and biCompression=BI_RGB(0), then each 3-byte triplet in the bitmap array represents the relative intensities of blue, green, and red, respectively, for a pixel. For other possibilities, see http://msdn.microsoft.com/default.asp
    - 32 If biClrUsed=0 and biCompression=BI_RGB(0), then each 4-byte DWORD in the bitmap array represents the relative intensities of blue, green, and red, respectively, for a pixel. The high byte in each DWORD is not used.
    - If biClrUsed=3, biCompression=BITFIELDS(3), biColors[0] = red mask (0x00FF0000), biColors[1] = green mask (0x0000FF00), and biColors[2] = blue mask (0x000000FF), then tese masks are used with each 4-byte DWORD in the bitmap array to determine the pixel's relative intensities. ///<
    - For other possibilities, see http://msdn.microsoft.com/default.asp

    +

    WORD = bits per pixel (0,1,4,8,16,24,32 are valid) 1 See http://msdn.microsoft.com/default.asp 4 See http://msdn.microsoft.com/default.asp 8 The bitmap has a maximum of 256 colors, and the bmiColors member contains up to 256 entries. In this case, each byte in the array represents a single pixel. 16 See http://msdn.microsoft.com/default.asp 24 If biClrUsed=0 and biCompression=BI_RGB(0), then each 3-byte triplet in the bitmap array represents the relative intensities of blue, green, and red, respectively, for a pixel. For other possibilities, see http://msdn.microsoft.com/default.asp 32 If biClrUsed=0 and biCompression=BI_RGB(0), then each 4-byte DWORD in the bitmap array represents the relative intensities of blue, green, and red, respectively, for a pixel. The high byte in each DWORD is not used. If biClrUsed=3, biCompression=BITFIELDS(3), biColors[0] = red mask (0x00FF0000), biColors[1] = green mask (0x0000FF00), and biColors[2] = blue mask (0x000000FF), then tese masks are used with each 4-byte DWORD in the bitmap array to determine the pixel's relative intensities. ///< For other possibilities, see http://msdn.microsoft.com/default.asp

    @@ -285,9 +277,9 @@ Public Attributes diff --git a/6/d4/d8e/class_o_n___surface_proxy-members.html b/6/d4/d8e/class_o_n___surface_proxy-members.html index 267bccef..7b50d0ed 100644 --- a/6/d4/d8e/class_o_n___surface_proxy-members.html +++ b/6/d4/d8e/class_o_n___surface_proxy-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d8f/class_o_n___lock-members.html b/6/d4/d8f/class_o_n___lock-members.html index 59375d34..bc3a7d69 100644 --- a/6/d4/d8f/class_o_n___lock-members.html +++ b/6/d4/d8f/class_o_n___lock-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d8f/opennurbs__uuid_8h_source.html b/6/d4/d8f/opennurbs__uuid_8h_source.html index c150f63e..3061627d 100644 --- a/6/d4/d8f/opennurbs__uuid_8h_source.html +++ b/6/d4/d8f/opennurbs__uuid_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_uuid.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_uuid.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/d91/struct_o_n___r_a_n_d_o_m___n_u_m_b_e_r___c_o_n_t_e_x_t.html b/6/d4/d91/struct_o_n___r_a_n_d_o_m___n_u_m_b_e_r___c_o_n_t_e_x_t.html index 929c6001..f441265e 100644 --- a/6/d4/d91/struct_o_n___r_a_n_d_o_m___n_u_m_b_e_r___c_o_n_t_e_x_t.html +++ b/6/d4/d91/struct_o_n___r_a_n_d_o_m___n_u_m_b_e_r___c_o_n_t_e_x_t.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RANDOM_NUMBER_CONTEXT Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Member Data Documentation

    ◆ mt

    @@ -115,9 +111,9 @@ Public Attributes
    diff --git a/6/d4/d93/class_o_n___brep_region.html b/6/d4/d93/class_o_n___brep_region.html index 5cacb761..5c038cde 100644 --- a/6/d4/d93/class_o_n___brep_region.html +++ b/6/d4/d93/class_o_n___brep_region.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepRegion Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Get the boundary of a region as a brep object.
    - If the region is finite, the boundary will be a closed manifold brep. The boundary may have more than one connected component. Parameters: brep - [in] if not nullptr, the brep form is put into this brep. Returns: the region boundary as a brep or nullptr if the calculation fails.

    +

    Description: Get the boundary of a region as a brep object. If the region is finite, the boundary will be a closed manifold brep. The boundary may have more than one connected component. Parameters: brep - [in] if not nullptr, the brep form is put into this brep. Returns: the region boundary as a brep or nullptr if the calculation fails.

    @@ -474,8 +471,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -615,9 +612,9 @@ Additional Inherited Members
    diff --git a/6/d4/d96/class_o_n___curve_array-members.html b/6/d4/d96/class_o_n___curve_array-members.html index 1a7c9b8c..009d8cd0 100644 --- a/6/d4/d96/class_o_n___curve_array-members.html +++ b/6/d4/d96/class_o_n___curve_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/da0/class_o_n___hatch_line-members.html b/6/d4/da0/class_o_n___hatch_line-members.html index a887d326..1fbcec45 100644 --- a/6/d4/da0/class_o_n___hatch_line-members.html +++ b/6/d4/da0/class_o_n___hatch_line-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/da0/class_o_n___model_component-members.html b/6/d4/da0/class_o_n___model_component-members.html index 24e92151..8458e082 100644 --- a/6/d4/da0/class_o_n___model_component-members.html +++ b/6/d4/da0/class_o_n___model_component-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/daa/class_o_n___clipping_region-members.html b/6/d4/daa/class_o_n___clipping_region-members.html index 7f5e574c..ccc1bddf 100644 --- a/6/d4/daa/class_o_n___clipping_region-members.html +++ b/6/d4/daa/class_o_n___clipping_region-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/dac/class_o_n__2dex_map.html b/6/d4/dac/class_o_n__2dex_map.html index 3cdfb953..f2c4ad57 100644 --- a/6/d4/dac/class_o_n__2dex_map.html +++ b/6/d4/dac/class_o_n__2dex_map.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2dexMap Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/dac/class_o_n___interval-members.html b/6/d4/dac/class_o_n___interval-members.html index fb6f7861..9fd0ad32 100644 --- a/6/d4/dac/class_o_n___interval-members.html +++ b/6/d4/dac/class_o_n___interval-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/dae/class_o_n___user_data_holder.html b/6/d4/dae/class_o_n___user_data_holder.html index d0d33417..96c71921 100644 --- a/6/d4/dae/class_o_n___user_data_holder.html +++ b/6/d4/dae/class_o_n___user_data_holder.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UserDataHolder Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/db4/class_o_n___brep_region_array.html b/6/d4/db4/class_o_n___brep_region_array.html index 8b1a2871..5e600091 100644 --- a/6/d4/db4/class_o_n___brep_region_array.html +++ b/6/d4/db4/class_o_n___brep_region_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepRegionArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/db5/class_o_n___plane_surface.html b/6/d4/db5/class_o_n___plane_surface.html index e47431d1..d2e8c28c 100644 --- a/6/d4/db5/class_o_n___plane_surface.html +++ b/6/d4/db5/class_o_n___plane_surface.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_PlaneSurface Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    N_iso = 6, iso_count = 7
    - } - pure virtual class for surface objects More...
    + } pure virtual class for surface objects More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -867,8 +865,7 @@ Additional Inherited Members
    -

    Description: Where possible, analytically extends surface to include domain. Parameters: dir - [in] 0 new Domain(0) will include domain. (the first surface parameter). 1 new Domain(1) will include domain. (the second surface parameter). domain - [in] if domain is not included in surface domain, surface will be extended so that its domain includes domain.
    - Will not work if surface is closed in direction dir. Original surface is identical to the restriction of the resulting surface to the original surface domain, Returns: true if successful.

    +

    Description: Where possible, analytically extends surface to include domain. Parameters: dir - [in] 0 new Domain(0) will include domain. (the first surface parameter). 1 new Domain(1) will include domain. (the second surface parameter). domain - [in] if domain is not included in surface domain, surface will be extended so that its domain includes domain. Will not work if surface is closed in direction dir. Original surface is identical to the restriction of the resulting surface to the original surface domain, Returns: true if successful.

    Reimplemented from ON_Surface.

    @@ -1014,8 +1011,7 @@ Additional Inherited Members
    -

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search.
    - dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    +

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search. dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    true if a parametric discontinuity was found strictly between t0 and t1. Note well that all curves are parametrically continuous at the ends of their domains.

    Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous):

    true if a locus discontinuity was found strictly between t0 and t1 or at t1 is the at the end of a curve. Note well that all open curves (IsClosed()=false) are locus discontinuous at the ends of their domains. All closed curves (IsClosed()=true) are at least C0_locus_continuous at the ends of their domains.

    @@ -1218,8 +1214,7 @@ Additional Inherited Members
    -

    Description: Is there a NURBS surface representation of this surface. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the surface's 2 success - NURBS point locus matches the surface's and the domain of the NURBS surface is correct.
    - However, This surface's parameterization and the NURBS surface parameterization may not match. This situation happens when getting NURBS representations of surfaces that have a transendental parameterization like spheres, cylinders, and cones. Remarks: This is a low-level virtual function. See Also: ON_Surface::GetNurbForm ON_Surface::NurbsSurface

    +

    Description: Is there a NURBS surface representation of this surface. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the surface's 2 success - NURBS point locus matches the surface's and the domain of the NURBS surface is correct. However, This surface's parameterization and the NURBS surface parameterization may not match. This situation happens when getting NURBS representations of surfaces that have a transendental parameterization like spheres, cylinders, and cones. Remarks: This is a low-level virtual function. See Also: ON_Surface::GetNurbForm ON_Surface::NurbsSurface

    Reimplemented from ON_Surface.

    @@ -1925,8 +1920,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -2008,9 +2003,9 @@ Additional Inherited Members diff --git a/6/d4/dba/class_o_n___name_hash-members.html b/6/d4/dba/class_o_n___name_hash-members.html index aa4685d6..8a67ecd4 100644 --- a/6/d4/dba/class_o_n___name_hash-members.html +++ b/6/d4/dba/class_o_n___name_hash-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archiveopen binary file
    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/d4/dbb/class_o_n___stacked_text.html b/6/d4/dbb/class_o_n___stacked_text.html index fde89482..dc0b9f2b 100644 --- a/6/d4/dbb/class_o_n___stacked_text.html +++ b/6/d4/dbb/class_o_n___stacked_text.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_StackedText Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Member Enumeration Documentation

    ◆ StackStyle

    @@ -366,9 +362,9 @@ Friends
    diff --git a/6/d4/dbe/class_o_n___cage_morph.html b/6/d4/dbe/class_o_n___cage_morph.html index 1d4b65db..3c7813a6 100644 --- a/6/d4/dbe/class_o_n___cage_morph.html +++ b/6/d4/dbe/class_o_n___cage_morph.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_CageMorph Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/dc0/class_o_n___model_geometry_component-members.html b/6/d4/dc0/class_o_n___model_geometry_component-members.html index 3ce6214c..af6e6757 100644 --- a/6/d4/dc0/class_o_n___model_geometry_component-members.html +++ b/6/d4/dc0/class_o_n___model_geometry_component-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/dc1/class_o_n___curve_proxy_history-members.html b/6/d4/dc1/class_o_n___curve_proxy_history-members.html index d8f69dc5..456bec07 100644 --- a/6/d4/dc1/class_o_n___curve_proxy_history-members.html +++ b/6/d4/dc1/class_o_n___curve_proxy_history-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/dca/opennurbs__detail_8h_source.html b/6/d4/dca/opennurbs__detail_8h_source.html index cdf9c355..d452b44d 100644 --- a/6/d4/dca/opennurbs__detail_8h_source.html +++ b/6/d4/dca/opennurbs__detail_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_detail.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_detail.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/dd7/class_o_n___morph_control.html b/6/d4/dd7/class_o_n___morph_control.html index 5f40df97..fea2c0f2 100644 --- a/6/d4/dd7/class_o_n___morph_control.html +++ b/6/d4/dd7/class_o_n___morph_control.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MorphControl Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Localizers
    -Description: Adds localizer with support near the controling NURBS object. Parameters: support_distance - [in] >= 0 If the distance a point to the controls NURBS curve/surface/cage is less than or equal to support_distance, then MorphPoint() deformation has 100% effect.

    +

    Localizers Description: Adds localizer with support near the controling NURBS object. Parameters: support_distance - [in] >= 0 If the distance a point to the controls NURBS curve/surface/cage is less than or equal to support_distance, then MorphPoint() deformation has 100% effect.

    falloff_distance - [in] > 0 If the distance a point to the controls NURBS curve/surface/cage is more than support_distance+falloff_distance, then MorphPoint() deformation does not move the point. As the distance varies from support_distance to support_distance+falloff_distance the deformation attenuates from 100% to 0%.

    @@ -613,8 +610,8 @@ Description: Adds localizer with support near the controling NURBS object. Param
    -

    Description: Some objects cache bounding box information. If you modify an object, then call ClearBoundingBox() to inform the object that any cached bounding boxes are invalid.
    - Remarks: Generally, ClearBoundingBox() overrides simply invalidate a cached bounding box and then wait for a call to GetBBox() before recomputing the bounding box.

    +

    Description: Some objects cache bounding box information. If you modify an object, then call ClearBoundingBox() to inform the object that any cached bounding boxes are invalid.

    +

    Remarks: Generally, ClearBoundingBox() overrides simply invalidate a cached bounding box and then wait for a call to GetBBox() before recomputing the bounding box.

    The default implementation does nothing.

    Reimplemented from ON_Geometry.

    @@ -717,8 +714,7 @@ Description: Adds localizer with support near the controling NURBS object. Param
    -

    Expert interface
    -Description: Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. Parameters: bDelete - [in] if true, any cached information is properly deleted. If false, any cached information is simply discarded. This is useful when the cached information may be in alternate memory pools that are managed in nonstandard ways.

    +

    Expert interface Description: Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. Parameters: bDelete - [in] if true, any cached information is properly deleted. If false, any cached information is simply discarded. This is useful when the cached information may be in alternate memory pools that are managed in nonstandard ways.

    Reimplemented from ON_Object.

    @@ -1266,8 +1262,8 @@ Description: Expert user function. If you are using openNURBS in its default con
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -1483,9 +1479,9 @@ Description: Expert user function. If you are using openNURBS in its default con
    diff --git a/6/d4/ddf/opennurbs__beam_8h_source.html b/6/d4/ddf/opennurbs__beam_8h_source.html index 1816fecd..2186bb19 100644 --- a/6/d4/ddf/opennurbs__beam_8h_source.html +++ b/6/d4/ddf/opennurbs__beam_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_beam.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_beam.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/ddf/opennurbs__string__value_8h_source.html b/6/d4/ddf/opennurbs__string__value_8h_source.html index c0de4241..d9ced1a1 100644 --- a/6/d4/ddf/opennurbs__string__value_8h_source.html +++ b/6/d4/ddf/opennurbs__string__value_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_string_value.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_string_value.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/de1/class_o_n___font_glyph-members.html b/6/d4/de1/class_o_n___font_glyph-members.html index ae25c583..39c578bd 100644 --- a/6/d4/de1/class_o_n___font_glyph-members.html +++ b/6/d4/de1/class_o_n___font_glyph-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    CodePoint() constON_FontGlyph CodePointIsSet() constON_FontGlyph - CompareCodePointAndFont(const ON_FontGlyph &lhs, const ON_FontGlyph &rhs)ON_FontGlyphstatic + CompareCodePointAndFont(ON_FontGlyph &lhs, ON_FontGlyph &rhs)ON_FontGlyphstatic Dump(bool bIncludeCharMaps, ON_TextLog &text_log) constON_FontGlyph Font() constON_FontGlyph FontGlyphId() constON_FontGlyph @@ -103,9 +101,9 @@ $(function() {
    diff --git a/6/d4/de7/class_o_n___progress_step_counter-members.html b/6/d4/de7/class_o_n___progress_step_counter-members.html index b2d032bd..e65ecabf 100644 --- a/6/d4/de7/class_o_n___progress_step_counter-members.html +++ b/6/d4/de7/class_o_n___progress_step_counter-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/dea/class_o_n___surface_proxy.html b/6/d4/dea/class_o_n___surface_proxy.html index 7c2fda3e..93688ab5 100644 --- a/6/d4/dea/class_o_n___surface_proxy.html +++ b/6/d4/dea/class_o_n___surface_proxy.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SurfaceProxy Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    N_iso = 6, iso_count = 7
    - } - pure virtual class for surface objects More...
    + } pure virtual class for surface objects More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -392,11 +390,7 @@ Additional Inherited Members

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Definition of surface proxy object

    Constructor & Destructor Documentation

    @@ -677,8 +671,7 @@ Additional Inherited Members
    -

    Description: Get a duplicate of the surface. Returns: A duplicate of the surface.
    -Remarks: The caller must delete the returned surface. For non-ON_SurfaceProxy objects, this simply duplicates the surface using ON_Object::Duplicate. For ON_SurfaceProxy objects, this duplicates the actual proxy surface geometry and, if necessary, transposes the result to that the returned surfaces's parameterization and locus match the proxy surface's.

    +

    Description: Get a duplicate of the surface. Returns: A duplicate of the surface. Remarks: The caller must delete the returned surface. For non-ON_SurfaceProxy objects, this simply duplicates the surface using ON_Object::Duplicate. For ON_SurfaceProxy objects, this duplicates the actual proxy surface geometry and, if necessary, transposes the result to that the returned surfaces's parameterization and locus match the proxy surface's.

    Reimplemented from ON_Surface.

    @@ -875,8 +868,7 @@ Remarks: The caller must delete the returned surface. For non-ON_SurfaceProxy ob
    -

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search.
    - dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    +

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search. dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    true if a parametric discontinuity was found strictly between t0 and t1. Note well that all curves are parametrically continuous at the ends of their domains.

    Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous):

    true if a locus discontinuity was found strictly between t0 and t1 or at t1 is the at the end of a curve. Note well that all open curves (IsClosed()=false) are locus discontinuous at the ends of their domains. All closed curves (IsClosed()=true) are at least C0_locus_continuous at the ends of their domains.

    @@ -1179,8 +1171,7 @@ Remarks: The caller must delete the returned surface. For non-ON_SurfaceProxy ob
    -

    Description: Is there a NURBS surface representation of this surface. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the surface's 2 success - NURBS point locus matches the surface's and the domain of the NURBS surface is correct.
    - However, This surface's parameterization and the NURBS surface parameterization may not match. This situation happens when getting NURBS representations of surfaces that have a transendental parameterization like spheres, cylinders, and cones. Remarks: This is a low-level virtual function. See Also: ON_Surface::GetNurbForm ON_Surface::NurbsSurface

    +

    Description: Is there a NURBS surface representation of this surface. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the surface's 2 success - NURBS point locus matches the surface's and the domain of the NURBS surface is correct. However, This surface's parameterization and the NURBS surface parameterization may not match. This situation happens when getting NURBS representations of surfaces that have a transendental parameterization like spheres, cylinders, and cones. Remarks: This is a low-level virtual function. See Also: ON_Surface::GetNurbForm ON_Surface::NurbsSurface

    Reimplemented from ON_Surface.

    @@ -1808,8 +1799,8 @@ Remarks: The caller must delete the returned surface. For non-ON_SurfaceProxy ob
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -1824,9 +1815,9 @@ Remarks: The caller must delete the returned surface. For non-ON_SurfaceProxy ob diff --git a/6/d4/deb/class_o_n___viewport.html b/6/d4/deb/class_o_n___viewport.html index 0756ec88..dca5f48d 100644 --- a/6/d4/deb/class_o_n___viewport.html +++ b/6/d4/deb/class_o_n___viewport.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: ON_Viewport Class Reference @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archiveopen binary file
    openNURBS SDK Help +  6.0
    - + +

    Detailed Description

    NoKeywords
    -


    -
    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    defines ON_Viewport Class ON_Viewport

    This object represents a viewing frustum

    Constructor & Destructor Documentation

    @@ -2629,10 +2621,7 @@ Additional Inherited Members
    -

    Description:
    - Get suggested values for setting the perspective minimum near distance and minimum near/far ratio. Parameters:
    - camera_location - [in] depth_buffer_bit_depth - [in] typically 32, 24, 16 or 8, but any positive value can be passed in. min_near_dist - [out] Suggest value for passing to SetPerspectiveMinNearDist().
    - min_near_over_far - [out] Suggest value for passing to SetPerspectiveMinNearOverFar().

    +

    Description: Get suggested values for setting the perspective minimum near distance and minimum near/far ratio. Parameters: camera_location - [in] depth_buffer_bit_depth - [in] typically 32, 24, 16 or 8, but any positive value can be passed in. min_near_dist - [out] Suggest value for passing to SetPerspectiveMinNearDist(). min_near_over_far - [out] Suggest value for passing to SetPerspectiveMinNearOverFar().

    @@ -4096,8 +4085,7 @@ Additional Inherited Members
    -

    Description: Set near and far clipping distance subject to constraints. Parameters: near_dist - [in] (>0) desired near clipping distance far_dist - [in] (>near_dist) desired near clipping distance min_near_dist - [in] If min_near_dist <= 0.0, it is ignored. If min_near_dist > 0 and near_dist < min_near_dist, then the frustum's near_dist will be increased to min_near_dist. min_near_over_far - [in] If min_near_over_far <= 0.0, it is ignored. If near_dist < far_dist*min_near_over_far, then near_dist is increased and/or far_dist is decreased so that near_dist = far_dist*min_near_over_far. If near_dist < target_dist < far_dist, then near_dist near_dist is increased and far_dist is decreased so that projection precision will be good at target_dist. Otherwise, near_dist is simply set to far_dist*min_near_over_far. target_dist - [in]
    - If target_dist <= 0.0, it is ignored. If target_dist > 0, it is used as described in the description of the min_near_over_far parameter. relative_depth_bias - [in] If relative_depth_bias <= 0.0, it is ignored. If relative_depth_bias > 0, it is assumed that the requested near_dist and far_dist were calculated assuming no depth bias and the values will be appropriately adjusted to ensure the frustum's near and far clipping planes will not clip biased objects.

    +

    Description: Set near and far clipping distance subject to constraints. Parameters: near_dist - [in] (>0) desired near clipping distance far_dist - [in] (>near_dist) desired near clipping distance min_near_dist - [in] If min_near_dist <= 0.0, it is ignored. If min_near_dist > 0 and near_dist < min_near_dist, then the frustum's near_dist will be increased to min_near_dist. min_near_over_far - [in] If min_near_over_far <= 0.0, it is ignored. If near_dist < far_dist*min_near_over_far, then near_dist is increased and/or far_dist is decreased so that near_dist = far_dist*min_near_over_far. If near_dist < target_dist < far_dist, then near_dist near_dist is increased and far_dist is decreased so that projection precision will be good at target_dist. Otherwise, near_dist is simply set to far_dist*min_near_over_far. target_dist - [in] If target_dist <= 0.0, it is ignored. If target_dist > 0, it is used as described in the description of the min_near_over_far parameter. relative_depth_bias - [in] If relative_depth_bias <= 0.0, it is ignored. If relative_depth_bias > 0, it is assumed that the requested near_dist and far_dist were calculated assuming no depth bias and the values will be appropriately adjusted to ensure the frustum's near and far clipping planes will not clip biased objects.

    @@ -4336,8 +4324,7 @@ Additional Inherited Members
    -

    Description: Sets the viewport's id to the value used to uniquely identify this viewport. Parameters: viewport_id - [in]
    -Returns: True if the viewport's id was successfully set and false otherwise (ie. the viewport uuid has already been set). Remarks: There is no approved way to change the viewport id once it is set in order to maintain consistency across multiple viewports and those routines that manage them.

    +

    Description: Sets the viewport's id to the value used to uniquely identify this viewport. Parameters: viewport_id - [in] Returns: True if the viewport's id was successfully set and false otherwise (ie. the viewport uuid has already been set). Remarks: There is no approved way to change the viewport id once it is set in order to maintain consistency across multiple viewports and those routines that manage them.

    @@ -4366,8 +4353,7 @@ Returns: True if the viewport's id was successfully set and false otherwise (ie.
    -

    Description: Apply scaling factors to parallel projection clipping coordinates by setting the m_clip_mod transformation.
    -Parameters: x - [in] x > 0 y - [in] y > 0 Example: If you want to compress the view projection across the viewing plane, then set x = 0.5, y = 1.0, and z = 1.0. Returns: True if successful. False if input is invalid or the view is a perspective view.

    +

    Description: Apply scaling factors to parallel projection clipping coordinates by setting the m_clip_mod transformation. Parameters: x - [in] x > 0 y - [in] y > 0 Example: If you want to compress the view projection across the viewing plane, then set x = 0.5, y = 1.0, and z = 1.0. Returns: True if successful. False if input is invalid or the view is a perspective view.

    @@ -4510,8 +4496,7 @@ Parameters: x - [in] x > 0 y - [in] y > 0 Example: If you want to compress
    -

    Returns: A sha1 hash of all the settings that effect view projection matrices. view projection, camera location, camera X,Y,Z frame, frustum, port.
    - If two ON_Viewport classes have identical values ViewProjectionContentHash(), then they will have identical view projection matrices and generate identical images from the same model content.

    +

    Returns: A sha1 hash of all the settings that effect view projection matrices. view projection, camera location, camera X,Y,Z frame, frustum, port. If two ON_Viewport classes have identical values ViewProjectionContentHash(), then they will have identical view projection matrices and generate identical images from the same model content.

    @@ -5435,9 +5420,9 @@ Parameters: x - [in] x > 0 y - [in] y > 0 Example: If you want to compress diff --git a/6/d4/ded/class_o_n___progress_step_counter.html b/6/d4/ded/class_o_n___progress_step_counter.html index fd160562..830336a5 100644 --- a/6/d4/ded/class_o_n___progress_step_counter.html +++ b/6/d4/ded/class_o_n___progress_step_counter.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ProgressStepCounter Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/dee/opennurbs__polylinecurve_8h_source.html b/6/d4/dee/opennurbs__polylinecurve_8h_source.html index 0c94fae3..5c802f60 100644 --- a/6/d4/dee/opennurbs__polylinecurve_8h_source.html +++ b/6/d4/dee/opennurbs__polylinecurve_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_polylinecurve.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_polylinecurve.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/df4/class_o_n___brep_trim_array.html b/6/d4/df4/class_o_n___brep_trim_array.html index 4a4f59f4..4f57f7a6 100644 --- a/6/d4/df4/class_o_n___brep_trim_array.html +++ b/6/d4/df4/class_o_n___brep_trim_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepTrimArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/df4/class_o_n___string-members.html b/6/d4/df4/class_o_n___string-members.html index 6413af8e..310cfb50 100644 --- a/6/d4/df4/class_o_n___string-members.html +++ b/6/d4/df4/class_o_n___string-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d4/df4/opennurbs__xform_8h_source.html b/6/d4/df4/opennurbs__xform_8h_source.html index 1eccf61d..20af004c 100644 --- a/6/d4/df4/opennurbs__xform_8h_source.html +++ b/6/d4/df4/opennurbs__xform_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_xform.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_xform.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_xform.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // defines ON_Xform (4 x 4 transformation matrix)
    20 //
    21 ////////////////////////////////////////////////////////////////
    22 
    23 #if !defined(ON_XFORM_INC_)
    24 #define ON_XFORM_INC_
    25 
    26 class ON_Matrix;
    27 
    28 class ON_CLASS ON_Xform
    29 {
    30 public:
    31  // ON_Xform IdentityTransformation diagonal = (1,1,1,1)
    33 
    34  // ON_Xform ZeroTransformation diagonal = (0,0,0,1)
    36 
    37  // ON_Xform::Zero4x4 - every coefficient is 0.0.
    38  static const ON_Xform Zero4x4;
    39 
    40  // ON_Xform::Unset - every coefficient is ON_UNSET_VALUE
    41  static const ON_Xform Unset;
    42 
    43  // ON_Xform::Nan - every coefficient is ON_DBL_QNAN
    44  static const ON_Xform Nan;
    45 
    46  double m_xform[4][4]; // [i][j] = row i, column j. I.e.,
    47  //
    48  // [0][0] [0][1] [0][2] [0][3]
    49  // [1][0] [1][1] [1][2] [1][3]
    50  // [2][0] [2][1] [2][2] [2][3]
    51  // [3][0] [3][1] [3][2] [3][3]
    52 
    53  // Default constructor transformation has diagonal (0,0,0,1)
    54  ON_Xform();
    55  ~ON_Xform() = default;
    56  ON_Xform(const ON_Xform&) = default;
    57  ON_Xform& operator=(const ON_Xform&) = default;
    58 
    59  bool operator==(const ON_Xform& rhs) const;
    60 
    61  bool operator!=(const ON_Xform& rhs) const;
    62 
    63  // Constructs transformation with diagonal (x,x,x,1)
    64  explicit ON_Xform(
    65  double x
    66  );
    67 
    68  /*
    69  Returns:
    70  Transformation with diagonal (d,d,d,1).
    71  */
    72  static const ON_Xform DiagonalTransformation(
    73  double d
    74  );
    75 
    76  /*
    77  Returns:
    78  Transformation with diagonal (d0,d1,d2,1.0).
    79  */
    80  static const ON_Xform DiagonalTransformation(
    81  double d0,
    82  double d1,
    83  double d2
    84  );
    85 
    86  /*
    87  Returns:
    88  Transformation with diagonal (d0,d1,d2,1.0).
    89  */
    90  static const ON_Xform DiagonalTransformation(
    91  const ON_3dVector& diagnoal
    92  );
    93 
    94 #if defined(ON_COMPILER_MSC)
    95  // Microsoft's compiler won't pass double m[4][4] as a const double[4][4] arg.
    96  // Gnu's compiler handles this.
    97  explicit ON_Xform( double[4][4] ); // from standard double m[4][4]
    98  explicit ON_Xform( float[4][4] ); // from standard float m[4][4]
    99 #endif
    100 
    101  explicit ON_Xform( const double[4][4] ); // from standard double m[4][4]
    102  explicit ON_Xform( const float[4][4] ); // from standard float m[4][4]
    103 
    104  explicit ON_Xform( const double* ); // from array of 16 doubles (row0,row1,row2,row3)
    105  explicit ON_Xform( const float* ); // from array of 16 floats (row0,row1,row2,row3)
    106 
    107  explicit ON_Xform( const ON_Matrix& ); // from upper left 4x4 of an
    108  // arbitrary matrix. Any missing
    109  // rows/columns are set to identity.
    110  ON_Xform(const ON_3dPoint& P, // as a frame.
    111  const ON_3dVector& X,
    112  const ON_3dVector& Y,
    113  const ON_3dVector& Z);
    114 
    115  double* operator[](int);
    116  const double* operator[](int) const;
    117 
    118  // xform = scalar results in a diagonal 3x3 with bottom row = 0,0,0,1
    119  ON_Xform& operator=( const ON_Matrix& ); // from upper left 4x4 of an
    120  // arbitrary matrix. Any missing
    121  // rows/columns are set to identity.
    122 
    123  // All non-commutative operations have "this" as left hand side and
    124  // argument as right hand side.
    125  ON_2dPoint operator*( const ON_2dPoint& ) const;
    126  ON_3dPoint operator*( const ON_3dPoint& ) const;
    127  ON_4dPoint operator*( const ON_4dPoint& ) const;
    128 
    129  ON_2dVector operator*( const ON_2dVector& ) const;
    130  ON_3dVector operator*( const ON_3dVector& ) const;
    131 
    132  ON_Xform operator*( const ON_Xform& /*rhs*/ ) const;
    133  ON_Xform operator+( const ON_Xform& ) const;
    134  ON_Xform operator-( const ON_Xform& /*rhs*/ ) const;
    135 
    136  /*
    137  Description:
    138  Test the entries of the transformation matrix
    139  to see if they are valid number.
    140  Returns:
    141  True if ON_IsValid() is true for every coefficient in the transformation matrix.
    142  */
    143  bool IsValid() const;
    144 
    145  /*
    146  Description:
    147  Test the entries of the transformation matrix
    148  to see if they are valid number.
    149  Returns:
    150  True if any coefficient in the transformation matrix is a nan.
    151  */
    152  bool IsNan() const;
    153 
    154  bool IsValidAndNotZeroAndNotIdentity(
    155  double zero_tolerance = 0.0
    156  ) const;
    157 
    158  /*
    159  Returns:
    160  true if matrix is the identity transformation
    161 
    162  1 0 0 0
    163  0 1 0 0
    164  0 0 1 0
    165  0 0 0 1
    166  Remarks:
    167  An element of the matrix is "zero" if fabs(x) <= zero_tolerance.
    168  An element of the matrix is "one" if fabs(1.0-x) <= zero_tolerance.
    169  If the matrix contains a nan, false is returned.
    170  */
    171  bool IsIdentity( double zero_tolerance = 0.0) const;
    172 
    173  /*
    174  Returns:
    175  true if the matrix is valid and is not the identity transformation
    176  Remarks:
    177  An element of the matrix is "zero" if fabs(x) <= zero_tolerance.
    178  An element of the matrix is "one" if fabs(1.0-x) <= zero_tolerance.
    179  If the matrix contains a nan, false is returned.
    180  */
    181  bool IsNotIdentity( double zero_tolerance = 0.0) const;
    182 
    183  /*
    184  Returns:
    185  true if matrix is a pure translation
    186 
    187  1 0 0 dx
    188  0 1 0 dy
    189  0 0 1 dz
    190  0 0 0 1
    191  Remarks:
    192  The test for zero is fabs(x) <= zero_tolerance.
    193  The test for one is fabs(x-1) <= zero_tolerance.
    194  */
    195  bool IsTranslation( double zero_tolerance = 0.0) const;
    196 
    197  /*
    198  Returns:
    199  true if matrix is ON_Xform::Zero4x4, ON_Xform::ZeroTransformation,
    200  or some other type of zero. The value xform[3][3] can be anything.
    201  0 0 0 0
    202  0 0 0 0
    203  0 0 0 0
    204  0 0 0 *
    205  */
    206  bool IsZero() const;
    207 
    208  /*
    209  Returns:
    210  true if matrix is ON_Xform::Zero4x4
    211  The value xform[3][3] must be zero.
    212  0 0 0 0
    213  0 0 0 0
    214  0 0 0 0
    215  0 0 0 0
    216  */
    217  bool IsZero4x4() const;
    218 
    219  /*
    220  Returns:
    221  true if matrix is ON_Xform::ZeroTransformation
    222  The value xform[3][3] must be 1.
    223  0 0 0 0
    224  0 0 0 0
    225  0 0 0 0
    226  0 0 0 1
    227  */
    228  bool IsZeroTransformation() const;
    229 
    230 
    231  /*
    232  Description:
    233  A similarity transformation can be broken into a sequence
    234  of dialations, translations, rotations, and reflections.
    235  Returns:
    236  +1: This transformation is an orientation preserving similarity.
    237  -1: This transformation is an orientation reversing similarity.
    238  0: This transformation is not a similarity.
    239  */
    240  int IsSimilarity() const;
    241 
    242  /*
    243  Description:
    244  A transformation is affine if it is valid and its last row is
    245  0 0 0 1
    246  An affine transformation can be broken into a linear transformation and a translation.
    247  Example:
    248  A perspective transformation is not affine.
    249  Returns:
    250  True if this is an affine transformation.
    251  */
    252  bool IsAffine() const;
    253 
    254  /*
    255  Description:
    256  Well ordered dictionary compare that is nan aware.
    257  */
    258  int Compare( const ON_Xform& other ) const;
    259 
    260  // matrix operations
    261  void Transpose(); // transposes 4x4 matrix
    262 
    263  int
    264  Rank( // returns 0 to 4
    265  double* = nullptr // If not nullptr, returns minimum pivot
    266  ) const;
    267 
    268  double
    269  Determinant( // returns determinant of 4x4 matrix
    270  double* = nullptr // If not nullptr, returns minimum pivot
    271  ) const;
    272 
    273  bool
    274  Invert( // If matrix is non-singular, returns true,
    275  // otherwise returns false and sets matrix to
    276  // pseudo inverse.
    277  double* = nullptr // If not nullptr, returns minimum pivot
    278  );
    279 
    280  ON_Xform
    281  Inverse( // If matrix is non-singular, returns inverse,
    282  // otherwise returns pseudo inverse.
    283  double* = nullptr // If not nullptr, returns minimum pivot
    284  ) const;
    285 
    286  /*
    287  Description:
    288  When transforming 3d point and surface or mesh normals
    289  two different transforms must be used.
    290  If P_xform transforms the point, then the inverse
    291  transpose of P_xform must be used to tranform normal
    292  vectors.
    293  Parameters:
    294  N_xform - [out]
    295  Returns:
    296  The determinant of the transformation.
    297  If non-zero, "this" is invertable and N_xform can be calculated.
    298  False if "this" is not invertable, in which case
    299  the returned N_xform = this with the right hand column
    300  and bottom row zeroed out.
    301  */
    302  double GetSurfaceNormalXform( ON_Xform& N_xform ) const;
    303 
    304  /*
    305  Description:
    306  If a texture mapping is applied to an object, the object
    307  is subsequently transformed by T, and the texture mapping
    308  needs to be recalculated, then two transforms are required
    309  to recalcalculate the texture mapping.
    310  Parameters:
    311  P_xform - [out]
    312  Transform to apply to points before applying the
    313  texture mapping transformation.
    314  N_xform - [out]
    315  Transform to apply to surface normals before applying
    316  the texture mapping transformation.
    317  Returns:
    318  The determinant of the "this" transformation.
    319  If non-zero, "this" is invertable and P_xform and N_xform
    320  were calculated.
    321  False if "this" is not invertable, in which case
    322  the returned P_xform and N_xform are the identity.
    323  */
    324  double GetMappingXforms( ON_Xform& P_xform, ON_Xform& N_xform ) const;
    325 
    326  // Description:
    327  // Computes matrix * transpose([x,y,z,w]).
    328  //
    329  // Parameters:
    330  // x - [in]
    331  // y - [in]
    332  // z - [in]
    333  // z - [in]
    334  // ans - [out] = matrix * transpose([x,y,z,w])
    335  void ActOnLeft(
    336  double, // x
    337  double, // y
    338  double, // z
    339  double, // w
    340  double[4] // ans
    341  ) const;
    342 
    343  // Description:
    344  // Computes [x,y,z,w] * matrix.
    345  //
    346  // Parameters:
    347  // x - [in]
    348  // y - [in]
    349  // z - [in]
    350  // z - [in]
    351  // ans - [out] = [x,y,z,w] * matrix
    352  void ActOnRight(
    353  double, // x
    354  double, // y
    355  double, // z
    356  double, // w
    357  double[4] // ans
    358  ) const;
    359 
    360  ////////////////////////////////////////////////////////////////
    361  // standard transformations
    362 
    363 
    364  // diagonal is (1,1,1,1)
    365  ON_DEPRECATED_MSG("Use xform = ON_Xform::IdentityTransformation;")
    366  void Identity();
    367 
    368  ON_DEPRECATED_MSG("Use xform = ON_Xform::DiagonalTransformation(d);")
    369  void Diagonal(double d);
    370 
    371  /*
    372  Description:
    373  Create non-uniform scale transformation with the origin as
    374  a fixed point.
    375  Parameters:
    376  fixed_point - [in]
    377  x_scale_factor - [in]
    378  y_scale_factor - [in]
    379  z_scale_factor - [in]
    380  Remarks:
    381  The diagonal is (x_scale_factor, y_scale_factor, z_scale_factor, 1)
    382  */
    383  ON_DEPRECATED_MSG("Use xform = ON_Xform::DiagonalTransformation(x_scale_factor,z_scale_factor,z_scale_factor);")
    384  void Scale(
    385  double x_scale_factor,
    386  double y_scale_factor,
    387  double z_scale_factor
    388  );
    389 
    390  /*
    391  Description:
    392  Create non-uniform scale transformation with the origin as the fixed point.
    393  Parameters:
    394  fixed_point - [in]
    395  scale_vector - [in]
    396  Remarks:
    397  The diagonal is (scale_vector.x, scale_vector.y, scale_vector.z, 1)
    398  */
    399  ON_DEPRECATED_MSG("Use xform = ON_Xform::DiagonalTransformation(scale_vector);")
    400  void Scale(
    401  const ON_3dVector& scale_vector
    402  );
    403 
    404  /*
    405  Description:
    406  Create uniform scale transformation with a specified
    407  fixed point.
    408  Parameters:
    409  fixed_point - [in]
    410  scale_factor - [in]
    411  */
    412  ON_DEPRECATED_MSG("Use xform = ON_Xform::ScaleTransformation(fixed_point,scale_factor)")
    413  void Scale
    414  (
    415  ON_3dPoint fixed_point,
    416  double scale_factor
    417  );
    418 
    419  static const ON_Xform ScaleTransformation(
    420  const ON_3dPoint& fixed_point,
    421  double scale_factor
    422  );
    423 
    424  static const ON_Xform ScaleTransformation(
    425  const ON_3dPoint& fixed_point,
    426  double x_scale_factor,
    427  double y_scale_factor,
    428  double z_scale_factor
    429  );
    430 
    431  /*
    432  Description:
    433  Create non-uniform scale transformation with a specified
    434  fixed point.
    435  Parameters:
    436  plane - [in] plane.origin is the fixed point
    437  x_scale_factor - [in] plane.xaxis scale factor
    438  y_scale_factor - [in] plane.yaxis scale factor
    439  z_scale_factor - [in] plane.zaxis scale factor
    440  */
    441  static const ON_Xform ScaleTransformation
    442  (
    443  const ON_Plane& plane,
    444  double x_scale_factor,
    445  double y_scale_factor,
    446  double z_scale_factor
    447  );
    448 
    449  /*
    450  Description:
    451  Create non-uniform scale transformation with a specified
    452  fixed point.
    453  Parameters:
    454  plane - [in] plane.origin is the fixed point
    455  x_scale_factor - [in] plane.xaxis scale factor
    456  y_scale_factor - [in] plane.yaxis scale factor
    457  z_scale_factor - [in] plane.zaxis scale factor
    458  */
    459  ON_DEPRECATED_MSG("Use xform = ON_Xform::ScaleTransformation(plane,x_scale_factor,y_scale_factor,z_scale_factor)")
    460  void Scale
    461  (
    462  const ON_Plane& plane,
    463  double x_scale_factor,
    464  double y_scale_factor,
    465  double z_scale_factor
    466  );
    467 
    468  /*
    469  Description:
    470  Create shear transformation.
    471  Parameters:
    472  plane - [in] plane.origin is the fixed point
    473  x1 - [in] plane.xaxis scale factor
    474  y1 - [in] plane.yaxis scale factor
    475  z1 - [in] plane.zaxis scale factor
    476  */
    477  static const ON_Xform ShearTransformation(
    478  const ON_Plane& plane,
    479  const ON_3dVector& x1,
    480  const ON_3dVector& y1,
    481  const ON_3dVector& z1
    482  );
    483 
    484  ON_DEPRECATED_MSG("Use xform = ON_Xform::ShearTransformation(plane,x1,y1,z1);")
    485  void Shear
    486  (
    487  const ON_Plane& plane,
    488  const ON_3dVector& x1,
    489  const ON_3dVector& y1,
    490  const ON_3dVector& z1
    491  );
    492 
    493  ON_DEPRECATED_MSG("Use xform = ON_Xform::TranslationTransformation(delta);")
    494  void Translation(
    495  const ON_3dVector& delta
    496  );
    497 
    498  ON_DEPRECATED_MSG("Use xform = ON_Xform::TranslationTransformation(dx,dy,dz);")
    499  void Translation(
    500  double dx,
    501  double dy,
    502  double dz
    503  );
    504 
    505  // Right column is (delta.x, delta.y, 0, 1).
    506  static const ON_Xform TranslationTransformation(
    507  const ON_2dVector& delta
    508  );
    509 
    510  // Right column is (delta.x, delta.y, delta.z, 1).
    511  static const ON_Xform TranslationTransformation(
    512  const ON_3dVector& delta
    513  );
    514 
    515  // Right column is (dx, dy, dz, 1).
    516  static const ON_Xform TranslationTransformation(
    517  double dx,
    518  double dy,
    519  double dz
    520  );
    521 
    522  // Description:
    523  // Get transformation that projects to a plane
    524  // Parameters:
    525  // plane - [in] plane to project to
    526  // Remarks:
    527  // This transformaton maps a 3d point P to the
    528  // point plane.ClosestPointTo(Q).
    529  void PlanarProjection(
    530  const ON_Plane& plane
    531  );
    532 
    533  // Description:
    534  // The Rotation() function is overloaded and provides several
    535  // ways to compute a rotation transformation. A positive
    536  // rotation angle indicates a counter-clockwise (right hand rule)
    537  // rotation about the axis of rotation.
    538  //
    539  // Parameters:
    540  // sin_angle - sin(rotation angle)
    541  // cos_angle - cos(rotation angle)
    542  // rotation_axis - 3d unit axis of rotation
    543  // rotation_center - 3d center of rotation
    544  //
    545  // Remarks:
    546  // In the overloads that take frames, the frames should
    547  // be right hand orthonormal frames
    548  // (unit vectors with Z = X x Y).
    549  // The resulting rotation fixes
    550  // the origin (0,0,0), maps initial X to
    551  // final X, initial Y to final Y, and initial Z to final Z.
    552  //
    553  // In the overload that takes frames with center points,
    554  // if the initial and final center are equal, then that
    555  // center point is the fixed point of the rotation. If
    556  // the initial and final point differ, then the resulting
    557  // transform is the composition of a rotation fixing P0
    558  // and translation from P0 to P1. The resulting
    559  // transformation maps P0 to P1, P0+X0 to P1+X1, ...
    560  //
    561  // The rotation transformations that map frames to frames
    562  // are not the same as the change of basis transformations
    563  // for those frames. See ON_Xform::ChangeBasis().
    564  //
    565  void Rotation(
    566  double sin_angle,
    567  double cos_angle,
    568  ON_3dVector rotation_axis,
    569  ON_3dPoint rotation_center
    570  );
    571 
    572  // Parameters:
    573  // angle - rotation angle in radians
    574  // rotation_axis - 3d unit axis of rotation
    575  // rotation_center - 3d center of rotation
    576  void Rotation(
    577  double angle_radians,
    578  ON_3dVector rotation_axis,
    579  ON_3dPoint rotation_center
    580  );
    581 
    582  /*
    583  Description:
    584  Calculate the minimal transformation that rotates
    585  start_dir to end_dir while fixing rotation_center.
    586  */
    587  void Rotation(
    588  ON_3dVector start_dir,
    589  ON_3dVector end_dir,
    590  ON_3dPoint rotation_center
    591  );
    592 
    593  // Parameters:
    594  // X0 - initial frame X
    595  // Y0 - initial frame Y
    596  // Z0 - initial frame Z
    597  // X1 - final frame X
    598  // Y1 - final frame Y
    599  // Z1 - final frame Z
    600  //
    601  void Rotation(
    602  const ON_3dVector& X0,
    603  const ON_3dVector& Y0,
    604  const ON_3dVector& Z0,
    605  const ON_3dVector& X1,
    606  const ON_3dVector& Y1,
    607  const ON_3dVector& Z1
    608  );
    609 
    610  // Parameters:
    611  // P0 - initial frame center
    612  // X0 - initial frame X
    613  // Y0 - initial frame Y
    614  // Z0 - initial frame Z
    615  // P1 - initial frame center
    616  // X1 - final frame X
    617  // Y1 - final frame Y
    618  // Z1 - final frame Z
    619  void Rotation(
    620  const ON_3dPoint& P0,
    621  const ON_3dVector& X0,
    622  const ON_3dVector& Y0,
    623  const ON_3dVector& Z0,
    624  const ON_3dPoint& P1,
    625  const ON_3dVector& X1,
    626  const ON_3dVector& Y1,
    627  const ON_3dVector& Z1
    628  );
    629 
    630  /*
    631  Description:
    632  Create rotation transformation that maps plane0 to plane1.
    633  Parameters:
    634  plane0 - [in]
    635  plane1 - [in]
    636  */
    637  void Rotation(
    638  const ON_Plane& plane0,
    639  const ON_Plane& plane1
    640  );
    641 
    642  /*
    643  Description:
    644  Create mirror transformation matrix.
    645  Parameters:
    646  point_on_mirror_plane - [in] point on mirror plane
    647  normal_to_mirror_plane - [in] normal to mirror plane
    648  Remarks:
    649  The mirror transform maps a point Q to
    650  Q - (2*(Q-P)oN)*N, where
    651  P = point_on_mirror_plane and N = normal_to_mirror_plane.
    652  */
    653  void Mirror(
    654  ON_3dPoint point_on_mirror_plane,
    655  ON_3dVector normal_to_mirror_plane
    656  );
    657 
    658  // Description: The ChangeBasis() function is overloaded
    659  // and provides several
    660  // ways to compute a change of basis transformation.
    661  //
    662  // Parameters:
    663  // plane0 - inital plane
    664  // plane1 - final plane
    665  //
    666  // Returns:
    667  // @untitled table
    668  // true success
    669  // false vectors for initial frame are not a basis
    670  //
    671  // Remarks:
    672  // If you have points defined with respect to planes, the
    673  // version of ChangeBasis() that takes two planes computes
    674  // the transformation to change coordinates from one plane to
    675  // another. The predefined world plane ON_world_plane can
    676  // be used as an argument.
    677  //
    678  // If P = plane0.Evaluate( a0,b0,c0 ) and
    679  //
    680  // (a1,b1,c1) = ChangeBasis(plane0,plane1)*ON_3dPoint(a0,b0,c0),
    681  //
    682  // then P = plane1.Evaluate( a1, b1, c1 )
    683  //
    684  // The version of ChangeBasis() that takes six vectors
    685  // maps (a0,b0,c0) to (a1,b1,c1) where
    686  // a0*X0 + b0*Y0 + c0*Z0 = a1*X1 + b1*Y1 + c1*Z1
    687  //
    688  // The version of ChangeBasis() that takes six vectors
    689  // with center points
    690  // maps (a0,b0,c0) to (a1,b1,c1) where
    691  // P0 + a0*X0 + b0*Y0 + c0*Z0 = P1 + a1*X1 + b1*Y1 + c1*Z1
    692  //
    693  // The change of basis transformation is not the same as
    694  // the rotation transformation that rotates one orthonormal
    695  // frame to another. See ON_Xform::Rotation().
    696  bool ChangeBasis(
    697  const ON_Plane& plane0,
    698  const ON_Plane& plane1
    699  );
    700 
    701  // Description:
    702  // Get a change of basis transformation.
    703  // Parameters:
    704  // X0 - initial basis X (X0,Y0,Z0 can be any 3d basis)
    705  // Y0 - initial basis Y
    706  // Z0 - initial basis Z
    707  // X1 - final basis X (X1,Y1,Z1 can be any 3d basis)
    708  // Y1 - final basis Y
    709  // Z1 - final basis Z
    710  // Remarks:
    711  // Change of basis transformations and rotation transformations
    712  // are often confused. This is a change of basis transformation.
    713  // If Q = a0*X0 + b0*Y0 + c0*Z0 = a1*X1 + b1*Y1 + c1*Z1
    714  // then this transform will map the point (a0,b0,c0) to (a1,b1,c1)
    715  bool ChangeBasis(
    716  const ON_3dVector& X0,
    717  const ON_3dVector& Y0,
    718  const ON_3dVector& Z0,
    719  const ON_3dVector& X1,
    720  const ON_3dVector& Y1,
    721  const ON_3dVector& Z1
    722  );
    723 
    724  // Parameters:
    725  // P0 - initial center
    726  // X0 - initial basis X (X0,Y0,Z0 can be any 3d basis)
    727  // Y0 - initial basis Y
    728  // Z0 - initial basis Z
    729  // P1 - final center
    730  // X1 - final basis X (X1,Y1,Z1 can be any 3d basis)
    731  // Y1 - final basis Y
    732  // Z1 - final basis Z
    733  // Remarks:
    734  // Change of basis transformations and rotation transformations
    735  // are often confused. This is a change of basis transformation.
    736  // If Q = P0 + a0*X0 + b0*Y0 + c0*Z0 = P1 + a1*X1 + b1*Y1 + c1*Z1
    737  // then this transform will map the point (a0,b0,c0) to (a1,b1,c1)
    738  bool ChangeBasis(
    739  const ON_3dPoint& P0,
    740  const ON_3dVector& X0,
    741  const ON_3dVector& Y0,
    742  const ON_3dVector& Z0,
    743  const ON_3dPoint& P1,
    744  const ON_3dVector& X1,
    745  const ON_3dVector& Y1,
    746  const ON_3dVector& Z1
    747  );
    748 
    749  // standard viewing transformations
    750  void WorldToCamera(
    751  const ON_3dPoint&, // CameraLocation
    752  const ON_3dVector&, // unit CameraX vector (right)
    753  const ON_3dVector&, // unit CameraY vector (up)
    754  const ON_3dVector& // unit CameraZ vector (from screen to camera)
    755  );
    756  void CameraToWorld(
    757  const ON_3dPoint&, // CameraLocation
    758  const ON_3dVector&, // unit CameraX vector (right)
    759  const ON_3dVector&, // unit CameraY vector (up)
    760  const ON_3dVector& // unit CameraZ vector (from screen to camera)
    761  );
    762  bool CameraToClip( // maps viewport frustum to -1 <= x,y,z <= 1 box
    763  bool bIsPerspective, // true for perspective, false for orthographic
    764  double, double, // left != right (usually left < right )
    765  double, double, // bottom != top (usually bottom < top )
    766  double, double // near != far (usually 0 < near < far )
    767  );
    768 
    769  // maps -1 <= x,y,z <= 1 box to viewport frustum
    770  bool ClipToCamera(
    771  bool bIsPerspective, // true for perspective, false for orthographic
    772  double, double, // left != right (usually left < right )
    773  double, double, // bottom != top (usually bottom < top )
    774  double, double // near != far an bot are non-zero (usually 0 < near < far )
    775  );
    776 
    777  // Computes transform that maps the clipping box
    778  //
    779  // -1<x<1,-1<y<1,-1<z<1
    780  //
    781  // to the screen box
    782  //
    783  // (left,right) X (bottom,top) X (near,far)
    784  bool ClipToScreen(
    785  double, // left
    786  double, // right
    787  double, // bottom
    788  double, // top
    789  double, // near_z
    790  double // far_z
    791  );
    792 
    793  // Computes transform that maps the screen box
    794  //
    795  // (left,right) X (bottom,top) X (near,far)
    796  //
    797  // to the clipping box
    798  //
    799  // -1<x<1,-1<y<1,-1<z<1
    800  bool ScreenToClip(
    801  double, // left
    802  double, // right
    803  double, // bottom
    804  double, // top
    805  double, // near_z
    806  double // far_z
    807  );
    808 
    809  // Description: Computes homogeneous point clipping flags and
    810  // returns an int with bits set to indicate if the point
    811  // is outside of the clipping box.
    812  //
    813  // Parameters:
    814  // point - [in] 4d homogeneous clipping coordinate point
    815  //
    816  // Returns:
    817  // @table
    818  // bit point location
    819  // 1 x/w < -1
    820  // 2 x/w > +1
    821  // 4 y/w < -1
    822  // 8 y/w > +1
    823  // 16 z/w < -1
    824  // 32 z/w > +1
    825  //
    826  int ClipFlag4d(
    827  const double* // point
    828  ) const;
    829 
    830  // Parameters:
    831  // count - [in] number of 4d points
    832  // stride - [in] (>=4)
    833  // points - [in] 4d clipping coordinate points
    834  // (array of stride*count doubles)
    835  // bTestZ - [in] (default=true) if false, do not test "z" coordinate
    836  //
    837  int ClipFlag4d(
    838  int, // count
    839  int, // stride
    840  const double*, // points
    841  bool bTestZ = true // bTeztZ
    842  ) const;
    843 
    844  // Description:
    845  // Computes 3d point clipping flags and
    846  // returns an int with bits set to indicate if the point
    847  // is outside of the clipping box.
    848  //
    849  // Parameters:
    850  // point - [in] 3d clipping coordinate point
    851  //
    852  // Returns:
    853  // @table
    854  // bit point location
    855  // 1 x < -1
    856  // 2 x > +1
    857  // 4 y < -1
    858  // 8 y > +1
    859  // 16 z < -1
    860  // 32 z > +1
    861  int ClipFlag3d(
    862  const double* // point
    863  ) const;
    864 
    865  // Parameters:
    866  // count - [in] number of 3d points
    867  // stride - [in] (>=3)
    868  // points - [in] 3d clipping coordinate points (array of stride*count doubles)
    869  // bTestZ - [in] (default=true) if false, do not test "z" coordinate
    870  //
    871  int ClipFlag3d(
    872  int, // count
    873  int, // stride
    874  const double*, // points
    875  bool bTestZ = true // bTestZ
    876  ) const;
    877 
    878  // Description: Computes 3d clipping flags for a 3d bounding
    879  // box and returns an int with bits set to indicate if
    880  // the bounding box is outside of the clipping box.
    881  //
    882  // Parameters:
    883  // boxmin - [in] 3d boxmin corner
    884  // boxmax - [in] 3d boxmax corner
    885  //
    886  // Returns:
    887  // @table
    888  // bit box location
    889  // 1 boxmax x < -1
    890  // 2 boxmin x > +1
    891  // 4 boxmax y < -1
    892  // 8 boxmin y > +1
    893  // 16 boxmax z < -1
    894  // 32 boxmin z > +1
    895  int ClipFlag3dBox(
    896  const double*, // boxmin
    897  const double* // boxmax
    898  ) const;
    899 
    900 
    901  /*
    902  Description:
    903  Calculates the transformation that linearly maps
    904  old_interval to new_interval.
    905  Parameters:
    906  dir - [in] 0 = x, 1 = y, 2= z;
    907  old_interval - [in]
    908  new_interval - [in]
    909  */
    910  bool IntervalChange(
    911  int dir,
    912  ON_Interval old_interval,
    913  ON_Interval new_interval
    914  );
    915 };
    916 
    917 ON_DECL
    918 const ON_Xform operator*(double c, const ON_Xform& xform);
    919 
    920 ON_DECL
    921 const ON_Xform operator*(const ON_Xform& xform, double c);
    922 
    923 class ON_CLASS ON_ClippingRegion
    924 {
    925 public:
    927 
    928  /*
    929  Description:
    930  Sets the object to clip transformation to
    931  the viewport's workd to clip transformation.
    932  */
    933  bool SetObjectToClipTransformation(
    934  const class ON_Viewport& viewport
    935  );
    936 
    937  bool SetObjectToClipTransformation(
    938  const ON_Xform object_to_clip_transformation
    939  );
    940 
    941  ON_Xform ObjectToClipTransformation() const;
    942  ON_Xform InverseObjectToClipTransformation() const;
    943 
    944 private:
    945  // The transformation m_xform transforms the view frustum,
    946  // in object coordinates to the (-1,+1)^3 clipping
    947  // coordinate box.
    948  ON_Xform m_xform;
    949  mutable ON_Xform m_inverse_xform; // = m_xform.Inverse().
    950 
    951 public:
    952  /*
    953  Parameters:
    954  clip_plane_tolerance - [in]
    955  3d world coordinates tolerance to use when testing
    956  objects to see if the planes in m_clip_plane[] hide
    957  the objects.
    958  Remarks:
    959  The constructor sets this value to zero. Rhino uses
    960  values around 1e-5.
    961  */
    962  void SetClipPlaneTolerance( double clip_plane_tolerance );
    963 
    964  /*
    965  Returns:
    966  3d world coordinates tolerance to use when testing
    967  objects to see if the planes in m_clip_plane[] hide
    968  the objects.
    969  Remarks:
    970  The constructor sets this value to zero. Rhino uses
    971  values around 1e-5.
    972  */
    973  double ClipPlaneTolerance() const;
    974 
    975  enum
    976  {
    977  max_clip_plane_count = 16, // must be <= 25
    978  frustum_bitmask = 0x0000003F,
    979  near_plane_bitmask = 0x00000020,
    980  far_plane_bitmask = 0x00000010,
    981  clip_plane_bitmask = 0x7FFFFFC0,
    982  negw_bitmask = 0x80000000
    983  };
    984 
    985  // Up to 25 additional clipping planes in object coordinates.
    986  // The convex region that is the intersection of the positive
    987  // side of these planes is the active region.
    988  int m_clip_plane_count; // (0 <= m_clip_plane_count <= max_clip_plane_count)
    989 
    990 private:
    991  double m_clip_plane_tolerance;
    992 
    993 public:
    994  ON_PlaneEquation m_clip_plane[max_clip_plane_count];
    995 
    996  /*
    997  Description:
    998  The "view frustum" is the frustum the m_xform transformation
    999  maps to clipping coordinate box (-1,+1)^3. These functions
    1000  determine if some portion of the convex hull of the test points
    1001  is inside the view frustum.
    1002  Parameters:
    1003  P - [in] point
    1004  box - [in] bounding box
    1005  count - [in] number of points
    1006  p - [in] array of points
    1007  bEnableClippingPlanes - [in]
    1008  If true, then the additional clipping planes are tested.
    1009  If false, then the additional clipping planes are ignored.
    1010  Returns:
    1011  0 = No part of the of the convex hull of the tested points
    1012  is in the view frustum.
    1013  1 = A portion of the convex hull of the otested points may
    1014  be in the view frustum.
    1015  2 = The entire convex hull of the tested points is in the
    1016  view frustum.
    1017  */
    1018  int InViewFrustum(
    1019  ON_3dPoint P
    1020  ) const;
    1021  int InViewFrustum(
    1022  const ON_BoundingBox& bbox
    1023  ) const;
    1024  int InViewFrustum(
    1025  int count,
    1026  const ON_3fPoint* p
    1027  ) const;
    1028  int InViewFrustum(
    1029  int count,
    1030  const ON_3dPoint* p
    1031  ) const;
    1032  int InViewFrustum(
    1033  int count,
    1034  const ON_4dPoint* p
    1035  ) const;
    1036 
    1037  /*
    1038  Description:
    1039  The "clip plane region" is the convex hull of the planes in
    1040  the m_clip_plane[] array. These functions determine if
    1041  some portion of the convex hull of the test points is inside
    1042  the clip plane region.
    1043  Parameters:
    1044  P - [in] point
    1045  box - [in] bounding box
    1046  count - [in] number of points
    1047  p - [in] array of points
    1048  bEnableClippingPlanes - [in]
    1049  If true, then the additional clipping planes are tested.
    1050  If false, then the additional clipping planes are ignored.
    1051  Returns:
    1052  0 = No part of the of the convex hull of the tested points
    1053  is in the clip plane region.
    1054  1 = A portion of the convex hull of the tested points may
    1055  be in the clip plane region.
    1056  2 = The entire convex hull of the tested points is in the
    1057  clip plane region.
    1058  */
    1059  int InClipPlaneRegion(
    1060  ON_3dPoint P
    1061  ) const;
    1062  int InClipPlaneRegion(
    1063  const ON_BoundingBox& bbox
    1064  ) const;
    1065  int InClipPlaneRegion(
    1066  int count,
    1067  const ON_3fPoint* p
    1068  ) const;
    1069  int InClipPlaneRegion(
    1070  int count,
    1071  const ON_3dPoint* p
    1072  ) const;
    1073  int InClipPlaneRegion(
    1074  int count,
    1075  const ON_4dPoint* p
    1076  ) const;
    1077 
    1078 
    1079  /*
    1080  Description:
    1081  The "visible area" is the intersection of the view frustum,
    1082  defined by m_xform, and the clipping region, defined by the
    1083  m_clip_plane[] array. These functions determing if some
    1084  portion of the convex hull of the test points is visible.
    1085  Parameters:
    1086  P - [in] point
    1087  box - [in] bounding box
    1088  count - [in] number of points
    1089  p - [in] array of points
    1090  Returns:
    1091  0 = no part of the object is in the region.
    1092  1 = a portion of the object is in the region
    1093  2 = entire object is in clipping region
    1094  */
    1095  int IsVisible(
    1096  ON_3dPoint P
    1097  ) const;
    1098  int IsVisible(
    1099  const ON_BoundingBox& bbox
    1100  ) const;
    1101  int IsVisible(
    1102  int count,
    1103  const ON_3fPoint* p
    1104  ) const;
    1105  int IsVisible(
    1106  int count,
    1107  const ON_3dPoint* p
    1108  ) const;
    1109  int IsVisible(
    1110  int count,
    1111  const ON_4dPoint* p
    1112  ) const;
    1113 
    1114  /*
    1115  Description:
    1116  Transform a list of 4d homogenous points while testing
    1117  for visibility.
    1118  Parameters:
    1119  count - [in] number of points
    1120  p - [in/out] array of points to test and transform
    1121  If 0 is returned, some of the points may not
    1122  be transformed. In all other cases, the output
    1123  points are transformed by m_xform.
    1124  pflags - [out]
    1125  0 when the point is in the visible region.
    1126  Otherwise the bits are set to indicate which planes clip the
    1127  intput point.
    1128  0x01 left of the view frusturm
    1129  0x02 right of the view frustum
    1130  0x04 below the view frustum
    1131  0x08 above the view frustum
    1132  0x10 behind the view frustum (too far)
    1133  0x20 in front of the view frustum (too near)
    1134 
    1135  0x10 below m_clip_plane[0]
    1136  0x20 below m_clip_plane[1]
    1137  ...
    1138  0x40000000 below m_clip_plane[24]
    1139 
    1140  0x80000000 transformation created a non-positive weight
    1141  Returns:
    1142  0 = convex hull of the points is not in the region.
    1143  The m_cull_bits field reports which plane or planes
    1144  culled the point set.
    1145  1 = a portion of the convex hull is in the region.
    1146  The m_cull_bits field reports which plane or planes
    1147  culled the point set.
    1148  2 = all points are in the region.
    1149  The m_cull_bits field will be zero.
    1150  */
    1151  int TransformPoints( int count, ON_4dPoint* p ) const;
    1152  int TransformPoints( int count, ON_4dPoint* p, unsigned int* pflags ) const;
    1153 
    1154 
    1155  /*
    1156  Description:
    1157  Transform a pont and return the clipping information.
    1158  Parameters:
    1159  P - [in] point ot transform
    1160  Q - [out] transformed point
    1161  Returns:
    1162  0 when the point is in the visible region.
    1163  Otherwise the bits are set to indicate which planes clip the
    1164  intput point.
    1165  0x01 left of the view frusturm
    1166  0x02 right of the view frustum
    1167  0x04 below the view frustum
    1168  0x08 above the view frustum
    1169  0x10 behind the view frustum (too far)
    1170  0x20 in front of the view frustum (too near)
    1171 
    1172  0x10 below m_clip_plane[0]
    1173  0x20 below m_clip_plane[1]
    1174  ...
    1175  0x40000000 below m_clip_plane[24]
    1176 
    1177  0x80000000 transformation created a non-positive weight
    1178  */
    1179  unsigned int TransformPoint(
    1180  const ON_4dPoint& P,
    1181  ON_4dPoint& Q
    1182  ) const;
    1183  unsigned int TransformPoint(
    1184  const ON_3dPoint& P,
    1185  ON_3dPoint& Q
    1186  ) const;
    1187  unsigned int TransformPoint(
    1188  const ON_3fPoint& P,
    1189  ON_3dPoint& Q
    1190  ) const;
    1191 
    1192  /*
    1193  Description:
    1194  Calculate the interval for the segment of a line that
    1195  is in the clip plane region.
    1196  Parameters:
    1197  P0 - [in] start point
    1198  P1 - [in] end point
    1199  t0 - [out] start parameter
    1200  t1 - [out] end parameter
    1201  Returns:
    1202  True if some portion of the line is visible and
    1203  0.0 <= *t0 <= *t1 <= 1.0.
    1204  */
    1205  bool GetLineClipPlaneParamters(
    1206  ON_4dPoint P0,
    1207  ON_4dPoint P1,
    1208  double* t0,
    1209  double* t1
    1210  ) const;
    1211 
    1212 };
    1213 
    1214 /*
    1215 Description:
    1216  ON_ClippingRegionPoints is a container for storing or referencing
    1217  clip points and clip flags.
    1218  The values are typically calcuated by ON_ClippingRegion.TransformPoint().
    1219 */
    1221 {
    1222 public:
    1224 
    1225  ON_ClippingRegionPoints() = default;
    1228  ON_ClippingRegionPoints& operator=(const ON_ClippingRegionPoints& src);
    1229 
    1230 #if defined(ON_HAS_RVALUEREF)
    1231  // rvalue copy constructor
    1233 
    1234  // The rvalue assignment operator calls ON_Object::operator=(ON_Object&&)
    1235  // which could throw exceptions. See the implementation of
    1236  // ON_Object::operator=(ON_Object&&) for details.
    1238 #endif
    1239 
    1240  unsigned int PointCapacity() const;
    1241 
    1242  unsigned int PointCout() const;
    1243 
    1244  /*
    1245  Description:
    1246  Sets point count and aggragate flags falues to zero but does not
    1247  deallocate the memory buffer. When an ON_ClippingRegionPoints will be used
    1248  multiple times, it is more efficient to call Clear() between
    1249  uses than calling Destroy().
    1250  */
    1251  void Clear();
    1252 
    1253  /*
    1254  Description:
    1255  Clear() and deallocate the memory buffer.
    1256  */
    1257  void Destroy();
    1258 
    1259  /*
    1260  Returns:
    1261  Clip point location.
    1262  */
    1263  ON_3dPoint ClipPoint(
    1264  unsigned int point_index
    1265  ) const;
    1266 
    1267  /*
    1268  Returns:
    1269  Clip flag
    1270  */
    1271  unsigned int ClipFlag(
    1272  unsigned int point_index
    1273  ) const;
    1274 
    1275  /*
    1276  Description:
    1277  Append the clipping point and clipping flag calculated by
    1278  clipping_region.TransformPoint(world_point,...).
    1279  */
    1280  bool AppendClipPoint(
    1281  const class ON_ClippingRegion& clipping_region,
    1282  ON_3dPoint world_point
    1283  );
    1284 
    1285  /*
    1286  Description:
    1287  Append the clipping points and clipping flags calculated by
    1288  clipping_region.TransformPoint(world_point,...) for every input
    1289  world point.
    1290  */
    1291  bool AppendClipPoints(
    1292  const class ON_ClippingRegion& clipping_region,
    1293  const ON_SimpleArray<ON_3dPoint>& world_points
    1294  );
    1295 
    1296  /*
    1297  Description:
    1298  Append the clipping points and clipping flags calculated by
    1299  clipping_region.TransformPoint(world_point,...) for every input
    1300  world point.
    1301  */
    1302  bool AppendClipPoints(
    1303  const class ON_ClippingRegion& clipping_region,
    1304  size_t world_point_count,
    1305  const ON_3dPoint* world_points
    1306  );
    1307 
    1308  /*
    1309  Description:
    1310  Append the clipping points and clipping flags calculated by
    1311  clipping_region.TransformPoint(world_point,...) for every input
    1312  world point.
    1313  */
    1314  bool AppendClipPoints(
    1315  const class ON_ClippingRegion& clipping_region,
    1316  size_t world_point_count,
    1317  size_t world_point_stride,
    1318  const double* world_points
    1319  );
    1320 
    1321  /*
    1322  Description:
    1323  Append the clipping point and clipping flag value.
    1324  */
    1325  bool AppendClipPoint(
    1326  ON_3dPoint clip_point,
    1327  unsigned int clip_flag
    1328  );
    1329 
    1330 public:
    1331  // These functions and data members are public so they can be used
    1332  // by experts to reference information that is managed by other entities.
    1333  // If you access or modify them, you are responsible for making
    1334  // sure you do it correctly. All the interface functions above
    1335  // assume the values below are correctly set.
    1336 
    1337  /*
    1338  Reserve buffer capacity.
    1339  */
    1340  bool ReserveBufferPointCapacity(
    1341  size_t buffer_point_capacity
    1342  );
    1343 
    1344  // All the information below is automatically managed if you use
    1345  // the AppendClipPoint() or AppendClipPoints() functions to add
    1346  // clipping points.
    1347  unsigned int m_point_count = 0;
    1348  unsigned int m_point_capacity = 0;
    1349  ON_3dPoint* m_clip_points = nullptr;
    1350  unsigned int* m_clip_flags = nullptr;
    1351 
    1352  unsigned int m_and_clip_flags = 0;
    1353  unsigned int m_or_clip_flags = 0;
    1354 
    1355 private:
    1356  size_t m_buffer_point_capacity = 0;
    1357  void* m_buffer = nullptr;
    1358 };
    1359 
    1360 class ON_CLASS ON_PickPoint
    1361 {
    1362 public:
    1363  static const ON_PickPoint Unset;
    1364 
    1365  ON_PickPoint() = default;
    1366  ~ON_PickPoint() = default;
    1367  ON_PickPoint(const ON_PickPoint&)= default;
    1368  ON_PickPoint& operator=(const ON_PickPoint&) = default;
    1369 
    1370  /*
    1371  Returns:
    1372  +1: a is a better pick pont than b.
    1373  -1: b is a better pick point than a.
    1374  0: a and b are the same.
    1375  */
    1376  static int Compare(
    1377  const ON_PickPoint& a,
    1378  const ON_PickPoint& b
    1379  );
    1380 
    1381  /*
    1382  Returns:
    1383  True if this is set.
    1384  */
    1385  bool IsSet() const;
    1386 
    1387  /*
    1388  Returns:
    1389  True if this is not set.
    1390  */
    1391  bool IsNotSet() const;
    1392 
    1394  double m_t[4]; // parameters (unused values are set to ON_UNSET_VALUE)
    1395  double m_depth = ON_UNSET_VALUE; // larger values are in front of smaller values.
    1396  double m_distance = 1.0e300; // smaller values are closer to pick ray.
    1397 };
    1398 
    1399 class ON_CLASS ON_Localizer
    1400 {
    1401 public:
    1402  ON_Localizer();
    1403  ~ON_Localizer();
    1404 
    1405  ON_Localizer(const ON_Localizer&);
    1406  ON_Localizer& operator=(const ON_Localizer&);
    1407 
    1408  void Destroy();
    1409  bool Read(ON_BinaryArchive&);
    1410  bool Write(ON_BinaryArchive&) const;
    1411 
    1412  /*
    1413  Descrption:
    1414  Creates a cylindrical localizer.
    1415  If d = distance from the point to the line,
    1416  then the localizer has the following behavior:
    1417 
    1418  point distance localizer value
    1419  d <= r0 < r1 or d >= r0 > r1 0
    1420  d >= r1 > r0 or d <= r1 < r0 1
    1421 
    1422  For values of d between r0 and r1, the localizer
    1423  smoothly transitions between 0 to 1.
    1424 
    1425  Parameters:
    1426  P - [in] cylinder axis point
    1427  D - [in] cylinder axis direction
    1428  r0 - [in]
    1429  r1 - [in]
    1430  r0 and r1 are radii that control where the localizer is nonzero.
    1431  Both r0 and r1 must be postive and the cannot be equal.
    1432  If 0 < r0 < r1, then the localizer is zero for points
    1433  inside the cylinder of radius r0 and one for points outside
    1434  the cylinder of radius r1.
    1435  If 0 < r1 < r0, then the localizer is one for points
    1436  inside the cylinder of radius r1 and zero for points outside
    1437  the cylinder of radius r0.
    1438 
    1439  Returns:
    1440  True if the input is value and the localizer is initialized.
    1441  */
    1442  bool CreateCylinderLocalizer( ON_3dPoint P, ON_3dVector D, double r0, double r1 );
    1443 
    1444  /*
    1445  Descrption:
    1446  Creates a planar localizer.
    1447  If d = signed distance from the point to the plane,
    1448  then the localizer has the following behavior:
    1449 
    1450  point distance localizer value
    1451  d <= h0 < h1 or d >= h0 > h1 0
    1452  d >= h1 > h0 or d <= h1 < h0 1
    1453 
    1454  For values of d between h0 and h1, the localizer
    1455  smoothly transitions between 0 to 1.
    1456 
    1457  Parameters:
    1458  P - [in] point on plane
    1459  N - [in] normal to plane
    1460  h0 - [in]
    1461  h1 - [in]
    1462  h0 and h1 are signed distances that control where the
    1463  localizer is nonzero.
    1464 
    1465  Returns:
    1466  True if the input is value and the localizer is initialized.
    1467  */
    1468  bool CreatePlaneLocalizer( ON_3dPoint P, ON_3dVector N, double h0, double h1 );
    1469 
    1470  /*
    1471  Descrption:
    1472  Creates a spherical localizer.
    1473  If d = distance from the point to the center of the sphere,
    1474  then the localizer has the following behavior:
    1475 
    1476  point distance localizer value
    1477  d <= r0 < r1 or d >= r0 > r1 0
    1478  d >= r1 > r0 or d <= r1 < r0 1
    1479 
    1480  For values of d between r0 and r1, the localizer
    1481  smoothly transitions between 0 to 1.
    1482 
    1483  Parameters:
    1484  P - [in] center of sphere
    1485  r0 - [in]
    1486  r1 - [in]
    1487  r0 and r1 are radii that control where the localizer is nonzero.
    1488  Both r0 and r1 must be postive and the cannot be equal.
    1489  If 0 < r0 < r1, then the localizer is zero for points
    1490  inside the cylinder of radius r0 and one for points outside
    1491  the cylinder of radius r1.
    1492  If 0 < r1 < r0, then the localizer is one for points
    1493  inside the cylinder of radius r1 and zero for points outside
    1494  the cylinder of radius r0.
    1495 
    1496  Returns:
    1497  True if the input is value and the localizer is initialized.
    1498  */
    1499  bool CreateSphereLocalizer( ON_3dPoint P, double r0, double r1 );
    1500 
    1501  /*
    1502  Description:
    1503  Evaluators.
    1504  Parameters:
    1505  P - [in]
    1506  Evaluation point
    1507  distance - [in]
    1508  Evaluation distance
    1509  Returns:
    1510  Value of the localizer.
    1511  */
    1512  double Value(ON_3dPoint P) const;
    1513  double Value(double distance) const;
    1514 
    1515  /*
    1516  Parameters:
    1517  bbox - [in]
    1518  Returns:
    1519  True if localizer is identically zero inside bbox.
    1520  */
    1521  bool IsZero( const ON_BoundingBox& bbox ) const;
    1522 
    1523  enum TYPE
    1524  {
    1525  no_type = 0,
    1526  sphere_type = 1,
    1527  plane_type = 2,
    1528  cylinder_type = 3,
    1529  curve_type = 4,
    1530  surface_type = 5,
    1531  distance_type = 6,
    1532  force_32bit_localizer_type = 0xFFFFFFFF
    1533  };
    1534 
    1536 
    1542 };
    1543 
    1544 
    1545 class ON_CLASS ON_SpaceMorph
    1546 {
    1547 public:
    1548  ON_SpaceMorph();
    1549  virtual ~ON_SpaceMorph();
    1550 
    1551 
    1552  /*
    1553  Description:
    1554  Provides a quick way to determine if a morph function
    1555  is the identity (doesn't move the points) on a region
    1556  of space.
    1557  Parameters:
    1558  bbox - [in] region of space to test.
    1559  Returns:
    1560  The default always returns false. If you override
    1561  this function, then return true when every point
    1562  in the bounding box is fixed by the morph.
    1563  */
    1564  virtual
    1565  bool IsIdentity( const ON_BoundingBox& bbox ) const;
    1566 
    1567  /*
    1568  Description:
    1569  A slower way to determine if a morph function
    1570  is the identity (doesn't move the points) on a set of points, to within a tolerance
    1571  Parameters:
    1572  Points - [in] Set of points to test.
    1573  tol - [in] Distance tolerance.
    1574  Returns:
    1575  True if none of the points move a distance of tol or more under the morph function.
    1576  Uses MorphPoint()
    1577  */
    1578  bool IsIdentity(const ON_SimpleArray<ON_3dPoint>& Points, double tol) const;
    1579 
    1580 
    1581  /*
    1582  Description:
    1583  A slower way to determine if a morph function
    1584  is the identity (doesn't move the points) on a surface, to within a tolerance
    1585  Parameters:
    1586  Srf - [in] Surface to be tested.
    1587  tol - [in] Distance tolerance.
    1588  Returns:
    1589  Uses MorphPoint() on a dense sample of points.
    1590  True if none of the points move a distance of tol or more under the morph function.
    1591  Remark:
    1592  Call IsIdentity(Srf.BoundingBox()) first.
    1593  Use this on surfaces whose nurb form is rational or has a different parameterization.
    1594  */
    1595  bool IsIdentity(const class ON_Surface& Srf, double tol) const;
    1596 
    1597  /*
    1598  Description:
    1599  A slower way to determine if a morph function
    1600  is the identity (doesn't move the points) on a curve, to within a tolerance.
    1601  Parameters:
    1602  Crv - [in] Curve to be tested.
    1603  tol - [in] Distance tolerance.
    1604  Returns:
    1605  Uses MorphPoint() on a dense sample of points.
    1606  True if none of the points move a distance of tol or more under the morph function.
    1607  Remark:
    1608  Call IsIdentity(Crv.BoundingBox()) first.
    1609  Use this on curves whose nurb form is rational or has a different parameterization.
    1610  */
    1611  bool IsIdentity(const class ON_Curve& Crv, double tol) const;
    1612 
    1613 
    1614  /*
    1615  Description:
    1616  Returns the desired accuracy of the morph.
    1617  This value is primarily used for deforming
    1618  surfaces and breps.
    1619  Returns:
    1620  3d fitting tolerance.
    1621  Remarks:
    1622  The default is 0.0 and any value <= 0.0 is
    1623  ignored by morphing functions.
    1624  The value returned by Tolerance() does not
    1625  affect the way meshes and points are morphed.
    1626  */
    1627  double Tolerance() const;
    1628 
    1629  /*
    1630  Description:
    1631  Set the 3d fitting tolerance used when morphing
    1632  surfaces and breps.
    1633  Parameters:
    1634  tolerance - [in] values < 0.0 are treated as 0.0.
    1635  */
    1636  void SetTolerance(
    1637  double tolerance
    1638  );
    1639 
    1640  /*
    1641  Returns:
    1642  True if the morph should be done as quickly as
    1643  possible because the result is being used for
    1644  some type of dynamic preview. If QuickPreview
    1645  is true, the tolerance may be ignored.
    1646  Remarks:
    1647  The value returned by QuickPreview() does not
    1648  affect the way meshes and points are morphed.
    1649  The default is false.
    1650  */
    1651  bool QuickPreview() const;
    1652 
    1653  /*
    1654  Description:
    1655  Set the quick preview value.
    1656  Parameters:
    1657  bQuickPreview - [in]
    1658  */
    1659  void SetQuickPreview(
    1660  bool bQuickPreview
    1661  );
    1662 
    1663  /*
    1664  Returns:
    1665  True if the morph should be done in a way that
    1666  preserves the structure of the geometry.
    1667  In particular, for NURBS objects, true
    1668  means that only the control points are moved.
    1669  Remarks:
    1670  The value returned by PreserveStructure() does not
    1671  affect the way meshes and points are morphed.
    1672  The default is false.
    1673  */
    1674  bool PreserveStructure() const;
    1675 
    1676  /*
    1677  Description:
    1678  Set the preserve structure value.
    1679  Parameters:
    1680  bPreserveStructure - [in]
    1681  */
    1682  void SetPreserveStructure(
    1683  bool bPreserveStructure
    1684  );
    1685 
    1686 private:
    1687  double m_tolerance = 0.0;
    1688  ON__UINT_PTR m_reserved1 = 0; // Some reserved field could provide more Morph type information. RH-4091
    1689  unsigned int m_reserved2 = 0;
    1690  bool m_bQuickPreview = false;
    1691  bool m_bPreserveStructure = false;
    1692  char m_reserved3 = 0;
    1693  char m_reserved4 = 0;
    1694 };
    1695 
    1696 #if defined(ON_DLL_TEMPLATE)
    1697 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Xform>;
    1698 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Localizer>;
    1699 #endif
    1700 
    1701 #endif
    int m_clip_plane_count
    (0 <= m_clip_plane_count <= max_clip_plane_count)
    Definition: opennurbs_xform.h:988
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // defines ON_Xform (4 x 4 transformation matrix)
    20 //
    21 ////////////////////////////////////////////////////////////////
    22 
    23 #if !defined(ON_XFORM_INC_)
    24 #define ON_XFORM_INC_
    25 
    26 class ON_Matrix;
    27 
    28 class ON_CLASS ON_Xform
    29 {
    30 public:
    31  // ON_Xform IdentityTransformation diagonal = (1,1,1,1)
    33 
    34  // ON_Xform ZeroTransformation diagonal = (0,0,0,1)
    36 
    37  // ON_Xform::Zero4x4 - every coefficient is 0.0.
    38  static const ON_Xform Zero4x4;
    39 
    40  // ON_Xform::Unset - every coefficient is ON_UNSET_VALUE
    41  static const ON_Xform Unset;
    42 
    43  // ON_Xform::Nan - every coefficient is ON_DBL_QNAN
    44  static const ON_Xform Nan;
    45 
    46  double m_xform[4][4]; // [i][j] = row i, column j. I.e.,
    47  //
    48  // [0][0] [0][1] [0][2] [0][3]
    49  // [1][0] [1][1] [1][2] [1][3]
    50  // [2][0] [2][1] [2][2] [2][3]
    51  // [3][0] [3][1] [3][2] [3][3]
    52 
    53  // Default constructor transformation has diagonal (0,0,0,1)
    54  ON_Xform();
    55  ~ON_Xform() = default;
    56  ON_Xform(const ON_Xform&) = default;
    57  ON_Xform& operator=(const ON_Xform&) = default;
    58 
    59  bool operator==(const ON_Xform& rhs) const;
    60 
    61  bool operator!=(const ON_Xform& rhs) const;
    62 
    63  // Constructs transformation with diagonal (x,x,x,1)
    64  explicit ON_Xform(
    65  double x
    66  );
    67 
    68  /*
    69  Returns:
    70  Transformation with diagonal (d,d,d,1).
    71  */
    72  static const ON_Xform DiagonalTransformation(
    73  double d
    74  );
    75 
    76  /*
    77  Returns:
    78  Transformation with diagonal (d0,d1,d2,1.0).
    79  */
    80  static const ON_Xform DiagonalTransformation(
    81  double d0,
    82  double d1,
    83  double d2
    84  );
    85 
    86  /*
    87  Returns:
    88  Transformation with diagonal (d0,d1,d2,1.0).
    89  */
    90  static const ON_Xform DiagonalTransformation(
    91  const ON_3dVector& diagnoal
    92  );
    93 
    94 #if defined(ON_COMPILER_MSC)
    95  // Microsoft's compiler won't pass double m[4][4] as a const double[4][4] arg.
    96  // Gnu's compiler handles this.
    97  explicit ON_Xform( double[4][4] ); // from standard double m[4][4]
    98  explicit ON_Xform( float[4][4] ); // from standard float m[4][4]
    99 #endif
    100 
    101  explicit ON_Xform( const double[4][4] ); // from standard double m[4][4]
    102  explicit ON_Xform( const float[4][4] ); // from standard float m[4][4]
    103 
    104  explicit ON_Xform( const double* ); // from array of 16 doubles (row0,row1,row2,row3)
    105  explicit ON_Xform( const float* ); // from array of 16 floats (row0,row1,row2,row3)
    106 
    107  explicit ON_Xform( const ON_Matrix& ); // from upper left 4x4 of an
    108  // arbitrary matrix. Any missing
    109  // rows/columns are set to identity.
    110  ON_Xform(const ON_3dPoint& P, // as a frame.
    111  const ON_3dVector& X,
    112  const ON_3dVector& Y,
    113  const ON_3dVector& Z);
    114 
    115  double* operator[](int);
    116  const double* operator[](int) const;
    117 
    118  // xform = scalar results in a diagonal 3x3 with bottom row = 0,0,0,1
    119  ON_Xform& operator=( const ON_Matrix& ); // from upper left 4x4 of an
    120  // arbitrary matrix. Any missing
    121  // rows/columns are set to identity.
    122 
    123  // All non-commutative operations have "this" as left hand side and
    124  // argument as right hand side.
    125  ON_2dPoint operator*( const ON_2dPoint& ) const;
    126  ON_3dPoint operator*( const ON_3dPoint& ) const;
    127  ON_4dPoint operator*( const ON_4dPoint& ) const;
    128 
    129  ON_2dVector operator*( const ON_2dVector& ) const;
    130  ON_3dVector operator*( const ON_3dVector& ) const;
    131 
    132  ON_Xform operator*( const ON_Xform& /*rhs*/ ) const;
    133  ON_Xform operator+( const ON_Xform& ) const;
    134  ON_Xform operator-( const ON_Xform& /*rhs*/ ) const;
    135 
    136  /*
    137  Description:
    138  Test the entries of the transformation matrix
    139  to see if they are valid number.
    140  Returns:
    141  True if ON_IsValid() is true for every coefficient in the transformation matrix.
    142  */
    143  bool IsValid() const;
    144 
    145  /*
    146  Description:
    147  Test the entries of the transformation matrix
    148  to see if they are valid number.
    149  Returns:
    150  True if any coefficient in the transformation matrix is a nan.
    151  */
    152  bool IsNan() const;
    153 
    154  bool IsValidAndNotZeroAndNotIdentity(
    155  double zero_tolerance = 0.0
    156  ) const;
    157 
    158  /*
    159  Returns:
    160  true if matrix is the identity transformation
    161 
    162  1 0 0 0
    163  0 1 0 0
    164  0 0 1 0
    165  0 0 0 1
    166  Remarks:
    167  An element of the matrix is "zero" if fabs(x) <= zero_tolerance.
    168  An element of the matrix is "one" if fabs(1.0-x) <= zero_tolerance.
    169  If the matrix contains a nan, false is returned.
    170  */
    171  bool IsIdentity( double zero_tolerance = 0.0) const;
    172 
    173  /*
    174  Returns:
    175  true if the matrix is valid and is not the identity transformation
    176  Remarks:
    177  An element of the matrix is "zero" if fabs(x) <= zero_tolerance.
    178  An element of the matrix is "one" if fabs(1.0-x) <= zero_tolerance.
    179  If the matrix contains a nan, false is returned.
    180  */
    181  bool IsNotIdentity( double zero_tolerance = 0.0) const;
    182 
    183  /*
    184  Returns:
    185  true if matrix is a pure translation
    186 
    187  1 0 0 dx
    188  0 1 0 dy
    189  0 0 1 dz
    190  0 0 0 1
    191  Remarks:
    192  The test for zero is fabs(x) <= zero_tolerance.
    193  The test for one is fabs(x-1) <= zero_tolerance.
    194  */
    195  bool IsTranslation( double zero_tolerance = 0.0) const;
    196 
    197  /*
    198  Returns:
    199  true if matrix is ON_Xform::Zero4x4, ON_Xform::ZeroTransformation,
    200  or some other type of zero. The value xform[3][3] can be anything.
    201  0 0 0 0
    202  0 0 0 0
    203  0 0 0 0
    204  0 0 0 *
    205  */
    206  bool IsZero() const;
    207 
    208  /*
    209  Returns:
    210  true if matrix is ON_Xform::Zero4x4
    211  The value xform[3][3] must be zero.
    212  0 0 0 0
    213  0 0 0 0
    214  0 0 0 0
    215  0 0 0 0
    216  */
    217  bool IsZero4x4() const;
    218 
    219  /*
    220  Returns:
    221  true if matrix is ON_Xform::ZeroTransformation
    222  The value xform[3][3] must be 1.
    223  0 0 0 0
    224  0 0 0 0
    225  0 0 0 0
    226  0 0 0 1
    227  */
    228  bool IsZeroTransformation() const;
    229 
    230 
    231  /*
    232  Description:
    233  A similarity transformation can be broken into a sequence
    234  of dialations, translations, rotations, and reflections.
    235  Returns:
    236  +1: This transformation is an orientation preserving similarity.
    237  -1: This transformation is an orientation reversing similarity.
    238  0: This transformation is not a similarity.
    239  */
    240  int IsSimilarity() const;
    241 
    242  /*
    243  Description:
    244  A transformation is affine if it is valid and its last row is
    245  0 0 0 1
    246  An affine transformation can be broken into a linear transformation and a translation.
    247  Example:
    248  A perspective transformation is not affine.
    249  Returns:
    250  True if this is an affine transformation.
    251  */
    252  bool IsAffine() const;
    253 
    254  /*
    255  Description:
    256  Well ordered dictionary compare that is nan aware.
    257  */
    258  int Compare( const ON_Xform& other ) const;
    259 
    260  // matrix operations
    261  void Transpose(); // transposes 4x4 matrix
    262 
    263  int
    264  Rank( // returns 0 to 4
    265  double* = nullptr // If not nullptr, returns minimum pivot
    266  ) const;
    267 
    268  double
    269  Determinant( // returns determinant of 4x4 matrix
    270  double* = nullptr // If not nullptr, returns minimum pivot
    271  ) const;
    272 
    273  bool
    274  Invert( // If matrix is non-singular, returns true,
    275  // otherwise returns false and sets matrix to
    276  // pseudo inverse.
    277  double* = nullptr // If not nullptr, returns minimum pivot
    278  );
    279 
    280  ON_Xform
    281  Inverse( // If matrix is non-singular, returns inverse,
    282  // otherwise returns pseudo inverse.
    283  double* = nullptr // If not nullptr, returns minimum pivot
    284  ) const;
    285 
    286  /*
    287  Description:
    288  When transforming 3d point and surface or mesh normals
    289  two different transforms must be used.
    290  If P_xform transforms the point, then the inverse
    291  transpose of P_xform must be used to tranform normal
    292  vectors.
    293  Parameters:
    294  N_xform - [out]
    295  Returns:
    296  The determinant of the transformation.
    297  If non-zero, "this" is invertable and N_xform can be calculated.
    298  False if "this" is not invertable, in which case
    299  the returned N_xform = this with the right hand column
    300  and bottom row zeroed out.
    301  */
    302  double GetSurfaceNormalXform( ON_Xform& N_xform ) const;
    303 
    304  /*
    305  Description:
    306  If a texture mapping is applied to an object, the object
    307  is subsequently transformed by T, and the texture mapping
    308  needs to be recalculated, then two transforms are required
    309  to recalcalculate the texture mapping.
    310  Parameters:
    311  P_xform - [out]
    312  Transform to apply to points before applying the
    313  texture mapping transformation.
    314  N_xform - [out]
    315  Transform to apply to surface normals before applying
    316  the texture mapping transformation.
    317  Returns:
    318  The determinant of the "this" transformation.
    319  If non-zero, "this" is invertable and P_xform and N_xform
    320  were calculated.
    321  False if "this" is not invertable, in which case
    322  the returned P_xform and N_xform are the identity.
    323  */
    324  double GetMappingXforms( ON_Xform& P_xform, ON_Xform& N_xform ) const;
    325 
    326  // Description:
    327  // Computes matrix * transpose([x,y,z,w]).
    328  //
    329  // Parameters:
    330  // x - [in]
    331  // y - [in]
    332  // z - [in]
    333  // z - [in]
    334  // ans - [out] = matrix * transpose([x,y,z,w])
    335  void ActOnLeft(
    336  double, // x
    337  double, // y
    338  double, // z
    339  double, // w
    340  double[4] // ans
    341  ) const;
    342 
    343  // Description:
    344  // Computes [x,y,z,w] * matrix.
    345  //
    346  // Parameters:
    347  // x - [in]
    348  // y - [in]
    349  // z - [in]
    350  // z - [in]
    351  // ans - [out] = [x,y,z,w] * matrix
    352  void ActOnRight(
    353  double, // x
    354  double, // y
    355  double, // z
    356  double, // w
    357  double[4] // ans
    358  ) const;
    359 
    360  ////////////////////////////////////////////////////////////////
    361  // standard transformations
    362 
    363 
    364  // diagonal is (1,1,1,1)
    365  ON_DEPRECATED_MSG("Use xform = ON_Xform::IdentityTransformation;")
    366  void Identity();
    367 
    368  ON_DEPRECATED_MSG("Use xform = ON_Xform::DiagonalTransformation(d);")
    369  void Diagonal(double d);
    370 
    371  /*
    372  Description:
    373  Create non-uniform scale transformation with the origin as
    374  a fixed point.
    375  Parameters:
    376  fixed_point - [in]
    377  x_scale_factor - [in]
    378  y_scale_factor - [in]
    379  z_scale_factor - [in]
    380  Remarks:
    381  The diagonal is (x_scale_factor, y_scale_factor, z_scale_factor, 1)
    382  */
    383  ON_DEPRECATED_MSG("Use xform = ON_Xform::DiagonalTransformation(x_scale_factor,z_scale_factor,z_scale_factor);")
    384  void Scale(
    385  double x_scale_factor,
    386  double y_scale_factor,
    387  double z_scale_factor
    388  );
    389 
    390  /*
    391  Description:
    392  Create non-uniform scale transformation with the origin as the fixed point.
    393  Parameters:
    394  fixed_point - [in]
    395  scale_vector - [in]
    396  Remarks:
    397  The diagonal is (scale_vector.x, scale_vector.y, scale_vector.z, 1)
    398  */
    399  ON_DEPRECATED_MSG("Use xform = ON_Xform::DiagonalTransformation(scale_vector);")
    400  void Scale(
    401  const ON_3dVector& scale_vector
    402  );
    403 
    404  /*
    405  Description:
    406  Create uniform scale transformation with a specified
    407  fixed point.
    408  Parameters:
    409  fixed_point - [in]
    410  scale_factor - [in]
    411  */
    412  ON_DEPRECATED_MSG("Use xform = ON_Xform::ScaleTransformation(fixed_point,scale_factor)")
    413  void Scale
    414  (
    415  ON_3dPoint fixed_point,
    416  double scale_factor
    417  );
    418 
    419  static const ON_Xform ScaleTransformation(
    420  const ON_3dPoint& fixed_point,
    421  double scale_factor
    422  );
    423 
    424  static const ON_Xform ScaleTransformation(
    425  const ON_3dPoint& fixed_point,
    426  double x_scale_factor,
    427  double y_scale_factor,
    428  double z_scale_factor
    429  );
    430 
    431  /*
    432  Description:
    433  Create non-uniform scale transformation with a specified
    434  fixed point.
    435  Parameters:
    436  plane - [in] plane.origin is the fixed point
    437  x_scale_factor - [in] plane.xaxis scale factor
    438  y_scale_factor - [in] plane.yaxis scale factor
    439  z_scale_factor - [in] plane.zaxis scale factor
    440  */
    441  static const ON_Xform ScaleTransformation
    442  (
    443  const ON_Plane& plane,
    444  double x_scale_factor,
    445  double y_scale_factor,
    446  double z_scale_factor
    447  );
    448 
    449  /*
    450  Description:
    451  Create non-uniform scale transformation with a specified
    452  fixed point.
    453  Parameters:
    454  plane - [in] plane.origin is the fixed point
    455  x_scale_factor - [in] plane.xaxis scale factor
    456  y_scale_factor - [in] plane.yaxis scale factor
    457  z_scale_factor - [in] plane.zaxis scale factor
    458  */
    459  ON_DEPRECATED_MSG("Use xform = ON_Xform::ScaleTransformation(plane,x_scale_factor,y_scale_factor,z_scale_factor)")
    460  void Scale
    461  (
    462  const ON_Plane& plane,
    463  double x_scale_factor,
    464  double y_scale_factor,
    465  double z_scale_factor
    466  );
    467 
    468  /*
    469  Description:
    470  Create shear transformation.
    471  Parameters:
    472  plane - [in] plane.origin is the fixed point
    473  x1 - [in] plane.xaxis scale factor
    474  y1 - [in] plane.yaxis scale factor
    475  z1 - [in] plane.zaxis scale factor
    476  */
    477  static const ON_Xform ShearTransformation(
    478  const ON_Plane& plane,
    479  const ON_3dVector& x1,
    480  const ON_3dVector& y1,
    481  const ON_3dVector& z1
    482  );
    483 
    484  ON_DEPRECATED_MSG("Use xform = ON_Xform::ShearTransformation(plane,x1,y1,z1);")
    485  void Shear
    486  (
    487  const ON_Plane& plane,
    488  const ON_3dVector& x1,
    489  const ON_3dVector& y1,
    490  const ON_3dVector& z1
    491  );
    492 
    493  ON_DEPRECATED_MSG("Use xform = ON_Xform::TranslationTransformation(delta);")
    494  void Translation(
    495  const ON_3dVector& delta
    496  );
    497 
    498  ON_DEPRECATED_MSG("Use xform = ON_Xform::TranslationTransformation(dx,dy,dz);")
    499  void Translation(
    500  double dx,
    501  double dy,
    502  double dz
    503  );
    504 
    505  // Right column is (delta.x, delta.y, 0, 1).
    506  static const ON_Xform TranslationTransformation(
    507  const ON_2dVector& delta
    508  );
    509 
    510  // Right column is (delta.x, delta.y, delta.z, 1).
    511  static const ON_Xform TranslationTransformation(
    512  const ON_3dVector& delta
    513  );
    514 
    515  // Right column is (dx, dy, dz, 1).
    516  static const ON_Xform TranslationTransformation(
    517  double dx,
    518  double dy,
    519  double dz
    520  );
    521 
    522  // Description:
    523  // Get transformation that projects to a plane
    524  // Parameters:
    525  // plane - [in] plane to project to
    526  // Remarks:
    527  // This transformaton maps a 3d point P to the
    528  // point plane.ClosestPointTo(Q).
    529  void PlanarProjection(
    530  const ON_Plane& plane
    531  );
    532 
    533  // Description:
    534  // The Rotation() function is overloaded and provides several
    535  // ways to compute a rotation transformation. A positive
    536  // rotation angle indicates a counter-clockwise (right hand rule)
    537  // rotation about the axis of rotation.
    538  //
    539  // Parameters:
    540  // sin_angle - sin(rotation angle)
    541  // cos_angle - cos(rotation angle)
    542  // rotation_axis - 3d unit axis of rotation
    543  // rotation_center - 3d center of rotation
    544  //
    545  // Remarks:
    546  // In the overloads that take frames, the frames should
    547  // be right hand orthonormal frames
    548  // (unit vectors with Z = X x Y).
    549  // The resulting rotation fixes
    550  // the origin (0,0,0), maps initial X to
    551  // final X, initial Y to final Y, and initial Z to final Z.
    552  //
    553  // In the overload that takes frames with center points,
    554  // if the initial and final center are equal, then that
    555  // center point is the fixed point of the rotation. If
    556  // the initial and final point differ, then the resulting
    557  // transform is the composition of a rotation fixing P0
    558  // and translation from P0 to P1. The resulting
    559  // transformation maps P0 to P1, P0+X0 to P1+X1, ...
    560  //
    561  // The rotation transformations that map frames to frames
    562  // are not the same as the change of basis transformations
    563  // for those frames. See ON_Xform::ChangeBasis().
    564  //
    565  void Rotation(
    566  double sin_angle,
    567  double cos_angle,
    568  ON_3dVector rotation_axis,
    569  ON_3dPoint rotation_center
    570  );
    571 
    572  // Parameters:
    573  // angle - rotation angle in radians
    574  // rotation_axis - 3d unit axis of rotation
    575  // rotation_center - 3d center of rotation
    576  void Rotation(
    577  double angle_radians,
    578  ON_3dVector rotation_axis,
    579  ON_3dPoint rotation_center
    580  );
    581 
    582  /*
    583  Description:
    584  Calculate the minimal transformation that rotates
    585  start_dir to end_dir while fixing rotation_center.
    586  */
    587  void Rotation(
    588  ON_3dVector start_dir,
    589  ON_3dVector end_dir,
    590  ON_3dPoint rotation_center
    591  );
    592 
    593  // Parameters:
    594  // X0 - initial frame X
    595  // Y0 - initial frame Y
    596  // Z0 - initial frame Z
    597  // X1 - final frame X
    598  // Y1 - final frame Y
    599  // Z1 - final frame Z
    600  //
    601  void Rotation(
    602  const ON_3dVector& X0,
    603  const ON_3dVector& Y0,
    604  const ON_3dVector& Z0,
    605  const ON_3dVector& X1,
    606  const ON_3dVector& Y1,
    607  const ON_3dVector& Z1
    608  );
    609 
    610  // Parameters:
    611  // P0 - initial frame center
    612  // X0 - initial frame X
    613  // Y0 - initial frame Y
    614  // Z0 - initial frame Z
    615  // P1 - initial frame center
    616  // X1 - final frame X
    617  // Y1 - final frame Y
    618  // Z1 - final frame Z
    619  void Rotation(
    620  const ON_3dPoint& P0,
    621  const ON_3dVector& X0,
    622  const ON_3dVector& Y0,
    623  const ON_3dVector& Z0,
    624  const ON_3dPoint& P1,
    625  const ON_3dVector& X1,
    626  const ON_3dVector& Y1,
    627  const ON_3dVector& Z1
    628  );
    629 
    630  /*
    631  Description:
    632  Create rotation transformation that maps plane0 to plane1.
    633  Parameters:
    634  plane0 - [in]
    635  plane1 - [in]
    636  */
    637  void Rotation(
    638  const ON_Plane& plane0,
    639  const ON_Plane& plane1
    640  );
    641 
    642  /*
    643  Description:
    644  Create mirror transformation matrix.
    645  Parameters:
    646  point_on_mirror_plane - [in] point on mirror plane
    647  normal_to_mirror_plane - [in] normal to mirror plane
    648  Remarks:
    649  The mirror transform maps a point Q to
    650  Q - (2*(Q-P)oN)*N, where
    651  P = point_on_mirror_plane and N = normal_to_mirror_plane.
    652  */
    653  void Mirror(
    654  ON_3dPoint point_on_mirror_plane,
    655  ON_3dVector normal_to_mirror_plane
    656  );
    657 
    658  // Description: The ChangeBasis() function is overloaded
    659  // and provides several
    660  // ways to compute a change of basis transformation.
    661  //
    662  // Parameters:
    663  // plane0 - inital plane
    664  // plane1 - final plane
    665  //
    666  // Returns:
    667  // @untitled table
    668  // true success
    669  // false vectors for initial frame are not a basis
    670  //
    671  // Remarks:
    672  // If you have points defined with respect to planes, the
    673  // version of ChangeBasis() that takes two planes computes
    674  // the transformation to change coordinates from one plane to
    675  // another. The predefined world plane ON_world_plane can
    676  // be used as an argument.
    677  //
    678  // If P = plane0.Evaluate( a0,b0,c0 ) and
    679  //
    680  // (a1,b1,c1) = ChangeBasis(plane0,plane1)*ON_3dPoint(a0,b0,c0),
    681  //
    682  // then P = plane1.Evaluate( a1, b1, c1 )
    683  //
    684  // The version of ChangeBasis() that takes six vectors
    685  // maps (a0,b0,c0) to (a1,b1,c1) where
    686  // a0*X0 + b0*Y0 + c0*Z0 = a1*X1 + b1*Y1 + c1*Z1
    687  //
    688  // The version of ChangeBasis() that takes six vectors
    689  // with center points
    690  // maps (a0,b0,c0) to (a1,b1,c1) where
    691  // P0 + a0*X0 + b0*Y0 + c0*Z0 = P1 + a1*X1 + b1*Y1 + c1*Z1
    692  //
    693  // The change of basis transformation is not the same as
    694  // the rotation transformation that rotates one orthonormal
    695  // frame to another. See ON_Xform::Rotation().
    696  bool ChangeBasis(
    697  const ON_Plane& plane0,
    698  const ON_Plane& plane1
    699  );
    700 
    701  // Description:
    702  // Get a change of basis transformation.
    703  // Parameters:
    704  // X0 - initial basis X (X0,Y0,Z0 can be any 3d basis)
    705  // Y0 - initial basis Y
    706  // Z0 - initial basis Z
    707  // X1 - final basis X (X1,Y1,Z1 can be any 3d basis)
    708  // Y1 - final basis Y
    709  // Z1 - final basis Z
    710  // Remarks:
    711  // Change of basis transformations and rotation transformations
    712  // are often confused. This is a change of basis transformation.
    713  // If Q = a0*X0 + b0*Y0 + c0*Z0 = a1*X1 + b1*Y1 + c1*Z1
    714  // then this transform will map the point (a0,b0,c0) to (a1,b1,c1)
    715  bool ChangeBasis(
    716  const ON_3dVector& X0,
    717  const ON_3dVector& Y0,
    718  const ON_3dVector& Z0,
    719  const ON_3dVector& X1,
    720  const ON_3dVector& Y1,
    721  const ON_3dVector& Z1
    722  );
    723 
    724  // Parameters:
    725  // P0 - initial center
    726  // X0 - initial basis X (X0,Y0,Z0 can be any 3d basis)
    727  // Y0 - initial basis Y
    728  // Z0 - initial basis Z
    729  // P1 - final center
    730  // X1 - final basis X (X1,Y1,Z1 can be any 3d basis)
    731  // Y1 - final basis Y
    732  // Z1 - final basis Z
    733  // Remarks:
    734  // Change of basis transformations and rotation transformations
    735  // are often confused. This is a change of basis transformation.
    736  // If Q = P0 + a0*X0 + b0*Y0 + c0*Z0 = P1 + a1*X1 + b1*Y1 + c1*Z1
    737  // then this transform will map the point (a0,b0,c0) to (a1,b1,c1)
    738  bool ChangeBasis(
    739  const ON_3dPoint& P0,
    740  const ON_3dVector& X0,
    741  const ON_3dVector& Y0,
    742  const ON_3dVector& Z0,
    743  const ON_3dPoint& P1,
    744  const ON_3dVector& X1,
    745  const ON_3dVector& Y1,
    746  const ON_3dVector& Z1
    747  );
    748 
    749  // standard viewing transformations
    750  void WorldToCamera(
    751  const ON_3dPoint&, // CameraLocation
    752  const ON_3dVector&, // unit CameraX vector (right)
    753  const ON_3dVector&, // unit CameraY vector (up)
    754  const ON_3dVector& // unit CameraZ vector (from screen to camera)
    755  );
    756  void CameraToWorld(
    757  const ON_3dPoint&, // CameraLocation
    758  const ON_3dVector&, // unit CameraX vector (right)
    759  const ON_3dVector&, // unit CameraY vector (up)
    760  const ON_3dVector& // unit CameraZ vector (from screen to camera)
    761  );
    762  bool CameraToClip( // maps viewport frustum to -1 <= x,y,z <= 1 box
    763  bool bIsPerspective, // true for perspective, false for orthographic
    764  double, double, // left != right (usually left < right )
    765  double, double, // bottom != top (usually bottom < top )
    766  double, double // near != far (usually 0 < near < far )
    767  );
    768 
    769  // maps -1 <= x,y,z <= 1 box to viewport frustum
    770  bool ClipToCamera(
    771  bool bIsPerspective, // true for perspective, false for orthographic
    772  double, double, // left != right (usually left < right )
    773  double, double, // bottom != top (usually bottom < top )
    774  double, double // near != far an bot are non-zero (usually 0 < near < far )
    775  );
    776 
    777  // Computes transform that maps the clipping box
    778  //
    779  // -1<x<1,-1<y<1,-1<z<1
    780  //
    781  // to the screen box
    782  //
    783  // (left,right) X (bottom,top) X (near,far)
    784  bool ClipToScreen(
    785  double, // left
    786  double, // right
    787  double, // bottom
    788  double, // top
    789  double, // near_z
    790  double // far_z
    791  );
    792 
    793  // Computes transform that maps the screen box
    794  //
    795  // (left,right) X (bottom,top) X (near,far)
    796  //
    797  // to the clipping box
    798  //
    799  // -1<x<1,-1<y<1,-1<z<1
    800  bool ScreenToClip(
    801  double, // left
    802  double, // right
    803  double, // bottom
    804  double, // top
    805  double, // near_z
    806  double // far_z
    807  );
    808 
    809  // Description: Computes homogeneous point clipping flags and
    810  // returns an int with bits set to indicate if the point
    811  // is outside of the clipping box.
    812  //
    813  // Parameters:
    814  // point - [in] 4d homogeneous clipping coordinate point
    815  //
    816  // Returns:
    817  // @table
    818  // bit point location
    819  // 1 x/w < -1
    820  // 2 x/w > +1
    821  // 4 y/w < -1
    822  // 8 y/w > +1
    823  // 16 z/w < -1
    824  // 32 z/w > +1
    825  //
    826  int ClipFlag4d(
    827  const double* // point
    828  ) const;
    829 
    830  // Parameters:
    831  // count - [in] number of 4d points
    832  // stride - [in] (>=4)
    833  // points - [in] 4d clipping coordinate points
    834  // (array of stride*count doubles)
    835  // bTestZ - [in] (default=true) if false, do not test "z" coordinate
    836  //
    837  int ClipFlag4d(
    838  int, // count
    839  int, // stride
    840  const double*, // points
    841  bool bTestZ = true // bTeztZ
    842  ) const;
    843 
    844  // Description:
    845  // Computes 3d point clipping flags and
    846  // returns an int with bits set to indicate if the point
    847  // is outside of the clipping box.
    848  //
    849  // Parameters:
    850  // point - [in] 3d clipping coordinate point
    851  //
    852  // Returns:
    853  // @table
    854  // bit point location
    855  // 1 x < -1
    856  // 2 x > +1
    857  // 4 y < -1
    858  // 8 y > +1
    859  // 16 z < -1
    860  // 32 z > +1
    861  int ClipFlag3d(
    862  const double* // point
    863  ) const;
    864 
    865  // Parameters:
    866  // count - [in] number of 3d points
    867  // stride - [in] (>=3)
    868  // points - [in] 3d clipping coordinate points (array of stride*count doubles)
    869  // bTestZ - [in] (default=true) if false, do not test "z" coordinate
    870  //
    871  int ClipFlag3d(
    872  int, // count
    873  int, // stride
    874  const double*, // points
    875  bool bTestZ = true // bTestZ
    876  ) const;
    877 
    878  // Description: Computes 3d clipping flags for a 3d bounding
    879  // box and returns an int with bits set to indicate if
    880  // the bounding box is outside of the clipping box.
    881  //
    882  // Parameters:
    883  // boxmin - [in] 3d boxmin corner
    884  // boxmax - [in] 3d boxmax corner
    885  //
    886  // Returns:
    887  // @table
    888  // bit box location
    889  // 1 boxmax x < -1
    890  // 2 boxmin x > +1
    891  // 4 boxmax y < -1
    892  // 8 boxmin y > +1
    893  // 16 boxmax z < -1
    894  // 32 boxmin z > +1
    895  int ClipFlag3dBox(
    896  const double*, // boxmin
    897  const double* // boxmax
    898  ) const;
    899 
    900 
    901  /*
    902  Description:
    903  Calculates the transformation that linearly maps
    904  old_interval to new_interval.
    905  Parameters:
    906  dir - [in] 0 = x, 1 = y, 2= z;
    907  old_interval - [in]
    908  new_interval - [in]
    909  */
    910  bool IntervalChange(
    911  int dir,
    912  ON_Interval old_interval,
    913  ON_Interval new_interval
    914  );
    915 };
    916 
    917 ON_DECL
    918 const ON_Xform operator*(double c, const ON_Xform& xform);
    919 
    920 ON_DECL
    921 const ON_Xform operator*(const ON_Xform& xform, double c);
    922 
    923 class ON_CLASS ON_ClippingRegion
    924 {
    925 public:
    926  ON_ClippingRegion();
    927 
    928  /*
    929  Description:
    930  Sets the object to clip transformation to
    931  the viewport's workd to clip transformation.
    932  */
    933  bool SetObjectToClipTransformation(
    934  const class ON_Viewport& viewport
    935  );
    936 
    937  bool SetObjectToClipTransformation(
    938  const ON_Xform object_to_clip_transformation
    939  );
    940 
    941  ON_Xform ObjectToClipTransformation() const;
    942  ON_Xform InverseObjectToClipTransformation() const;
    943 
    944 private:
    945  // The transformation m_xform transforms the view frustum,
    946  // in object coordinates to the (-1,+1)^3 clipping
    947  // coordinate box.
    948  ON_Xform m_xform;
    949  mutable ON_Xform m_inverse_xform; // = m_xform.Inverse().
    950 
    951 public:
    952  /*
    953  Parameters:
    954  clip_plane_tolerance - [in]
    955  3d world coordinates tolerance to use when testing
    956  objects to see if the planes in m_clip_plane[] hide
    957  the objects.
    958  Remarks:
    959  The constructor sets this value to zero. Rhino uses
    960  values around 1e-5.
    961  */
    962  void SetClipPlaneTolerance( double clip_plane_tolerance );
    963 
    964  /*
    965  Returns:
    966  3d world coordinates tolerance to use when testing
    967  objects to see if the planes in m_clip_plane[] hide
    968  the objects.
    969  Remarks:
    970  The constructor sets this value to zero. Rhino uses
    971  values around 1e-5.
    972  */
    973  double ClipPlaneTolerance() const;
    974 
    975  enum
    976  {
    977  max_clip_plane_count = 16, // must be <= 25
    978  frustum_bitmask = 0x0000003F,
    979  near_plane_bitmask = 0x00000020,
    980  far_plane_bitmask = 0x00000010,
    981  clip_plane_bitmask = 0x7FFFFFC0,
    982  negw_bitmask = 0x80000000
    983  };
    984 
    985  // Up to 25 additional clipping planes in object coordinates.
    986  // The convex region that is the intersection of the positive
    987  // side of these planes is the active region.
    988  int m_clip_plane_count; // (0 <= m_clip_plane_count <= max_clip_plane_count)
    989 
    990 private:
    991  double m_clip_plane_tolerance;
    992 
    993 public:
    994  ON_PlaneEquation m_clip_plane[max_clip_plane_count];
    995 
    996  /*
    997  Description:
    998  The "view frustum" is the frustum the m_xform transformation
    999  maps to clipping coordinate box (-1,+1)^3. These functions
    1000  determine if some portion of the convex hull of the test points
    1001  is inside the view frustum.
    1002  Parameters:
    1003  P - [in] point
    1004  box - [in] bounding box
    1005  count - [in] number of points
    1006  p - [in] array of points
    1007  bEnableClippingPlanes - [in]
    1008  If true, then the additional clipping planes are tested.
    1009  If false, then the additional clipping planes are ignored.
    1010  Returns:
    1011  0 = No part of the of the convex hull of the tested points
    1012  is in the view frustum.
    1013  1 = A portion of the convex hull of the otested points may
    1014  be in the view frustum.
    1015  2 = The entire convex hull of the tested points is in the
    1016  view frustum.
    1017  */
    1018  int InViewFrustum(
    1019  ON_3dPoint P
    1020  ) const;
    1021  int InViewFrustum(
    1022  const ON_BoundingBox& bbox
    1023  ) const;
    1024  int InViewFrustum(
    1025  int count,
    1026  const ON_3fPoint* p
    1027  ) const;
    1028  int InViewFrustum(
    1029  int count,
    1030  const ON_3dPoint* p
    1031  ) const;
    1032  int InViewFrustum(
    1033  int count,
    1034  const ON_4dPoint* p
    1035  ) const;
    1036 
    1037  /*
    1038  Description:
    1039  The "clip plane region" is the convex hull of the planes in
    1040  the m_clip_plane[] array. These functions determine if
    1041  some portion of the convex hull of the test points is inside
    1042  the clip plane region.
    1043  Parameters:
    1044  P - [in] point
    1045  box - [in] bounding box
    1046  count - [in] number of points
    1047  p - [in] array of points
    1048  bEnableClippingPlanes - [in]
    1049  If true, then the additional clipping planes are tested.
    1050  If false, then the additional clipping planes are ignored.
    1051  Returns:
    1052  0 = No part of the of the convex hull of the tested points
    1053  is in the clip plane region.
    1054  1 = A portion of the convex hull of the tested points may
    1055  be in the clip plane region.
    1056  2 = The entire convex hull of the tested points is in the
    1057  clip plane region.
    1058  */
    1059  int InClipPlaneRegion(
    1060  ON_3dPoint P
    1061  ) const;
    1062  int InClipPlaneRegion(
    1063  const ON_BoundingBox& bbox
    1064  ) const;
    1065  int InClipPlaneRegion(
    1066  int count,
    1067  const ON_3fPoint* p
    1068  ) const;
    1069  int InClipPlaneRegion(
    1070  int count,
    1071  const ON_3dPoint* p
    1072  ) const;
    1073  int InClipPlaneRegion(
    1074  int count,
    1075  const ON_4dPoint* p
    1076  ) const;
    1077 
    1078 
    1079  /*
    1080  Description:
    1081  The "visible area" is the intersection of the view frustum,
    1082  defined by m_xform, and the clipping region, defined by the
    1083  m_clip_plane[] array. These functions determing if some
    1084  portion of the convex hull of the test points is visible.
    1085  Parameters:
    1086  P - [in] point
    1087  box - [in] bounding box
    1088  count - [in] number of points
    1089  p - [in] array of points
    1090  Returns:
    1091  0 = no part of the object is in the region.
    1092  1 = a portion of the object is in the region
    1093  2 = entire object is in clipping region
    1094  */
    1095  int IsVisible(
    1096  ON_3dPoint P
    1097  ) const;
    1098  int IsVisible(
    1099  const ON_BoundingBox& bbox
    1100  ) const;
    1101  int IsVisible(
    1102  int count,
    1103  const ON_3fPoint* p
    1104  ) const;
    1105  int IsVisible(
    1106  int count,
    1107  const ON_3dPoint* p
    1108  ) const;
    1109  int IsVisible(
    1110  int count,
    1111  const ON_4dPoint* p
    1112  ) const;
    1113 
    1114  /*
    1115  Description:
    1116  Transform a list of 4d homogenous points while testing
    1117  for visibility.
    1118  Parameters:
    1119  count - [in] number of points
    1120  p - [in/out] array of points to test and transform
    1121  If 0 is returned, some of the points may not
    1122  be transformed. In all other cases, the output
    1123  points are transformed by m_xform.
    1124  pflags - [out]
    1125  0 when the point is in the visible region.
    1126  Otherwise the bits are set to indicate which planes clip the
    1127  intput point.
    1128  0x01 left of the view frusturm
    1129  0x02 right of the view frustum
    1130  0x04 below the view frustum
    1131  0x08 above the view frustum
    1132  0x10 behind the view frustum (too far)
    1133  0x20 in front of the view frustum (too near)
    1134 
    1135  0x10 below m_clip_plane[0]
    1136  0x20 below m_clip_plane[1]
    1137  ...
    1138  0x40000000 below m_clip_plane[24]
    1139 
    1140  0x80000000 transformation created a non-positive weight
    1141  Returns:
    1142  0 = convex hull of the points is not in the region.
    1143  The m_cull_bits field reports which plane or planes
    1144  culled the point set.
    1145  1 = a portion of the convex hull is in the region.
    1146  The m_cull_bits field reports which plane or planes
    1147  culled the point set.
    1148  2 = all points are in the region.
    1149  The m_cull_bits field will be zero.
    1150  */
    1151  int TransformPoints( int count, ON_4dPoint* p ) const;
    1152  int TransformPoints( int count, ON_4dPoint* p, unsigned int* pflags ) const;
    1153 
    1154 
    1155  /*
    1156  Description:
    1157  Transform a pont and return the clipping information.
    1158  Parameters:
    1159  P - [in] point ot transform
    1160  Q - [out] transformed point
    1161  Returns:
    1162  0 when the point is in the visible region.
    1163  Otherwise the bits are set to indicate which planes clip the
    1164  intput point.
    1165  0x01 left of the view frusturm
    1166  0x02 right of the view frustum
    1167  0x04 below the view frustum
    1168  0x08 above the view frustum
    1169  0x10 behind the view frustum (too far)
    1170  0x20 in front of the view frustum (too near)
    1171 
    1172  0x10 below m_clip_plane[0]
    1173  0x20 below m_clip_plane[1]
    1174  ...
    1175  0x40000000 below m_clip_plane[24]
    1176 
    1177  0x80000000 transformation created a non-positive weight
    1178  */
    1179  unsigned int TransformPoint(
    1180  const ON_4dPoint& P,
    1181  ON_4dPoint& Q
    1182  ) const;
    1183  unsigned int TransformPoint(
    1184  const ON_3dPoint& P,
    1185  ON_3dPoint& Q
    1186  ) const;
    1187  unsigned int TransformPoint(
    1188  const ON_3fPoint& P,
    1189  ON_3dPoint& Q
    1190  ) const;
    1191 
    1192  /*
    1193  Description:
    1194  Calculate the interval for the segment of a line that
    1195  is in the clip plane region.
    1196  Parameters:
    1197  P0 - [in] start point
    1198  P1 - [in] end point
    1199  t0 - [out] start parameter
    1200  t1 - [out] end parameter
    1201  Returns:
    1202  True if some portion of the line is visible and
    1203  0.0 <= *t0 <= *t1 <= 1.0.
    1204  */
    1205  bool GetLineClipPlaneParamters(
    1206  ON_4dPoint P0,
    1207  ON_4dPoint P1,
    1208  double* t0,
    1209  double* t1
    1210  ) const;
    1211 
    1212 };
    1213 
    1214 /*
    1215 Description:
    1216  ON_ClippingRegionPoints is a container for storing or referencing
    1217  clip points and clip flags.
    1218  The values are typically calcuated by ON_ClippingRegion.TransformPoint().
    1219 */
    1221 {
    1222 public:
    1224 
    1225  ON_ClippingRegionPoints() = default;
    1228  ON_ClippingRegionPoints& operator=(const ON_ClippingRegionPoints& src);
    1229 
    1230 #if defined(ON_HAS_RVALUEREF)
    1231  // rvalue copy constructor
    1233 
    1234  // The rvalue assignment operator calls ON_Object::operator=(ON_Object&&)
    1235  // which could throw exceptions. See the implementation of
    1236  // ON_Object::operator=(ON_Object&&) for details.
    1238 #endif
    1239 
    1240  unsigned int PointCapacity() const;
    1241 
    1242  unsigned int PointCout() const;
    1243 
    1244  /*
    1245  Description:
    1246  Sets point count and aggragate flags falues to zero but does not
    1247  deallocate the memory buffer. When an ON_ClippingRegionPoints will be used
    1248  multiple times, it is more efficient to call Clear() between
    1249  uses than calling Destroy().
    1250  */
    1251  void Clear();
    1252 
    1253  /*
    1254  Description:
    1255  Clear() and deallocate the memory buffer.
    1256  */
    1257  void Destroy();
    1258 
    1259  /*
    1260  Returns:
    1261  Clip point location.
    1262  */
    1263  ON_3dPoint ClipPoint(
    1264  unsigned int point_index
    1265  ) const;
    1266 
    1267  /*
    1268  Returns:
    1269  Clip flag
    1270  */
    1271  unsigned int ClipFlag(
    1272  unsigned int point_index
    1273  ) const;
    1274 
    1275  /*
    1276  Description:
    1277  Append the clipping point and clipping flag calculated by
    1278  clipping_region.TransformPoint(world_point,...).
    1279  */
    1280  bool AppendClipPoint(
    1281  const class ON_ClippingRegion& clipping_region,
    1282  ON_3dPoint world_point
    1283  );
    1284 
    1285  /*
    1286  Description:
    1287  Append the clipping points and clipping flags calculated by
    1288  clipping_region.TransformPoint(world_point,...) for every input
    1289  world point.
    1290  */
    1291  bool AppendClipPoints(
    1292  const class ON_ClippingRegion& clipping_region,
    1293  const ON_SimpleArray<ON_3dPoint>& world_points
    1294  );
    1295 
    1296  /*
    1297  Description:
    1298  Append the clipping points and clipping flags calculated by
    1299  clipping_region.TransformPoint(world_point,...) for every input
    1300  world point.
    1301  */
    1302  bool AppendClipPoints(
    1303  const class ON_ClippingRegion& clipping_region,
    1304  size_t world_point_count,
    1305  const ON_3dPoint* world_points
    1306  );
    1307 
    1308  /*
    1309  Description:
    1310  Append the clipping points and clipping flags calculated by
    1311  clipping_region.TransformPoint(world_point,...) for every input
    1312  world point.
    1313  */
    1314  bool AppendClipPoints(
    1315  const class ON_ClippingRegion& clipping_region,
    1316  size_t world_point_count,
    1317  size_t world_point_stride,
    1318  const double* world_points
    1319  );
    1320 
    1321  /*
    1322  Description:
    1323  Append the clipping point and clipping flag value.
    1324  */
    1325  bool AppendClipPoint(
    1326  ON_3dPoint clip_point,
    1327  unsigned int clip_flag
    1328  );
    1329 
    1330 public:
    1331  // These functions and data members are public so they can be used
    1332  // by experts to reference information that is managed by other entities.
    1333  // If you access or modify them, you are responsible for making
    1334  // sure you do it correctly. All the interface functions above
    1335  // assume the values below are correctly set.
    1336 
    1337  /*
    1338  Reserve buffer capacity.
    1339  */
    1340  bool ReserveBufferPointCapacity(
    1341  size_t buffer_point_capacity
    1342  );
    1343 
    1344  // All the information below is automatically managed if you use
    1345  // the AppendClipPoint() or AppendClipPoints() functions to add
    1346  // clipping points.
    1347  unsigned int m_point_count = 0;
    1348  unsigned int m_point_capacity = 0;
    1349  ON_3dPoint* m_clip_points = nullptr;
    1350  unsigned int* m_clip_flags = nullptr;
    1351 
    1352  unsigned int m_and_clip_flags = 0;
    1353  unsigned int m_or_clip_flags = 0;
    1354 
    1355 private:
    1356  size_t m_buffer_point_capacity = 0;
    1357  void* m_buffer = nullptr;
    1358 };
    1359 
    1360 class ON_CLASS ON_PickPoint
    1361 {
    1362 public:
    1363  static const ON_PickPoint Unset;
    1364 
    1365  ON_PickPoint() = default;
    1366  ~ON_PickPoint() = default;
    1367  ON_PickPoint(const ON_PickPoint&)= default;
    1368  ON_PickPoint& operator=(const ON_PickPoint&) = default;
    1369 
    1370  /*
    1371  Returns:
    1372  +1: a is a better pick pont than b.
    1373  -1: b is a better pick point than a.
    1374  0: a and b are the same.
    1375  */
    1376  static int Compare(
    1377  const ON_PickPoint& a,
    1378  const ON_PickPoint& b
    1379  );
    1380 
    1381  /*
    1382  Returns:
    1383  True if this is set.
    1384  */
    1385  bool IsSet() const;
    1386 
    1387  /*
    1388  Returns:
    1389  True if this is not set.
    1390  */
    1391  bool IsNotSet() const;
    1392 
    1394  double m_t[4]; // parameters (unused values are set to ON_UNSET_VALUE)
    1395  double m_depth = ON_UNSET_VALUE; // larger values are in front of smaller values.
    1396  double m_distance = 1.0e300; // smaller values are closer to pick ray.
    1397 };
    1398 
    1399 class ON_CLASS ON_Localizer
    1400 {
    1401 public:
    1402  ON_Localizer();
    1403  ~ON_Localizer();
    1404 
    1405  ON_Localizer(const ON_Localizer&);
    1406  ON_Localizer& operator=(const ON_Localizer&);
    1407 
    1408  void Destroy();
    1409  bool Read(ON_BinaryArchive&);
    1410  bool Write(ON_BinaryArchive&) const;
    1411 
    1412  /*
    1413  Descrption:
    1414  Creates a cylindrical localizer.
    1415  If d = distance from the point to the line,
    1416  then the localizer has the following behavior:
    1417 
    1418  point distance localizer value
    1419  d <= r0 < r1 or d >= r0 > r1 0
    1420  d >= r1 > r0 or d <= r1 < r0 1
    1421 
    1422  For values of d between r0 and r1, the localizer
    1423  smoothly transitions between 0 to 1.
    1424 
    1425  Parameters:
    1426  P - [in] cylinder axis point
    1427  D - [in] cylinder axis direction
    1428  r0 - [in]
    1429  r1 - [in]
    1430  r0 and r1 are radii that control where the localizer is nonzero.
    1431  Both r0 and r1 must be postive and the cannot be equal.
    1432  If 0 < r0 < r1, then the localizer is zero for points
    1433  inside the cylinder of radius r0 and one for points outside
    1434  the cylinder of radius r1.
    1435  If 0 < r1 < r0, then the localizer is one for points
    1436  inside the cylinder of radius r1 and zero for points outside
    1437  the cylinder of radius r0.
    1438 
    1439  Returns:
    1440  True if the input is value and the localizer is initialized.
    1441  */
    1442  bool CreateCylinderLocalizer( ON_3dPoint P, ON_3dVector D, double r0, double r1 );
    1443 
    1444  /*
    1445  Descrption:
    1446  Creates a planar localizer.
    1447  If d = signed distance from the point to the plane,
    1448  then the localizer has the following behavior:
    1449 
    1450  point distance localizer value
    1451  d <= h0 < h1 or d >= h0 > h1 0
    1452  d >= h1 > h0 or d <= h1 < h0 1
    1453 
    1454  For values of d between h0 and h1, the localizer
    1455  smoothly transitions between 0 to 1.
    1456 
    1457  Parameters:
    1458  P - [in] point on plane
    1459  N - [in] normal to plane
    1460  h0 - [in]
    1461  h1 - [in]
    1462  h0 and h1 are signed distances that control where the
    1463  localizer is nonzero.
    1464 
    1465  Returns:
    1466  True if the input is value and the localizer is initialized.
    1467  */
    1468  bool CreatePlaneLocalizer( ON_3dPoint P, ON_3dVector N, double h0, double h1 );
    1469 
    1470  /*
    1471  Descrption:
    1472  Creates a spherical localizer.
    1473  If d = distance from the point to the center of the sphere,
    1474  then the localizer has the following behavior:
    1475 
    1476  point distance localizer value
    1477  d <= r0 < r1 or d >= r0 > r1 0
    1478  d >= r1 > r0 or d <= r1 < r0 1
    1479 
    1480  For values of d between r0 and r1, the localizer
    1481  smoothly transitions between 0 to 1.
    1482 
    1483  Parameters:
    1484  P - [in] center of sphere
    1485  r0 - [in]
    1486  r1 - [in]
    1487  r0 and r1 are radii that control where the localizer is nonzero.
    1488  Both r0 and r1 must be postive and the cannot be equal.
    1489  If 0 < r0 < r1, then the localizer is zero for points
    1490  inside the cylinder of radius r0 and one for points outside
    1491  the cylinder of radius r1.
    1492  If 0 < r1 < r0, then the localizer is one for points
    1493  inside the cylinder of radius r1 and zero for points outside
    1494  the cylinder of radius r0.
    1495 
    1496  Returns:
    1497  True if the input is value and the localizer is initialized.
    1498  */
    1499  bool CreateSphereLocalizer( ON_3dPoint P, double r0, double r1 );
    1500 
    1501  /*
    1502  Description:
    1503  Evaluators.
    1504  Parameters:
    1505  P - [in]
    1506  Evaluation point
    1507  distance - [in]
    1508  Evaluation distance
    1509  Returns:
    1510  Value of the localizer.
    1511  */
    1512  double Value(ON_3dPoint P) const;
    1513  double Value(double distance) const;
    1514 
    1515  /*
    1516  Parameters:
    1517  bbox - [in]
    1518  Returns:
    1519  True if localizer is identically zero inside bbox.
    1520  */
    1521  bool IsZero( const ON_BoundingBox& bbox ) const;
    1522 
    1523  enum TYPE
    1524  {
    1525  no_type = 0,
    1526  sphere_type = 1,
    1527  plane_type = 2,
    1528  cylinder_type = 3,
    1529  curve_type = 4,
    1530  surface_type = 5,
    1531  distance_type = 6,
    1532  force_32bit_localizer_type = 0xFFFFFFFF
    1533  };
    1534 
    1536 
    1542 };
    1543 
    1544 
    1545 class ON_CLASS ON_SpaceMorph
    1546 {
    1547 public:
    1548  ON_SpaceMorph();
    1549  virtual ~ON_SpaceMorph();
    1550 
    1551 
    1552  /*
    1553  Description:
    1554  Provides a quick way to determine if a morph function
    1555  is the identity (doesn't move the points) on a region
    1556  of space.
    1557  Parameters:
    1558  bbox - [in] region of space to test.
    1559  Returns:
    1560  The default always returns false. If you override
    1561  this function, then return true when every point
    1562  in the bounding box is fixed by the morph.
    1563  */
    1564  virtual
    1565  bool IsIdentity( const ON_BoundingBox& bbox ) const;
    1566 
    1567  /*
    1568  Description:
    1569  A slower way to determine if a morph function
    1570  is the identity (doesn't move the points) on a set of points, to within a tolerance
    1571  Parameters:
    1572  Points - [in] Set of points to test.
    1573  tol - [in] Distance tolerance.
    1574  Returns:
    1575  True if none of the points move a distance of tol or more under the morph function.
    1576  Uses MorphPoint()
    1577  */
    1578  bool IsIdentity(const ON_SimpleArray<ON_3dPoint>& Points, double tol) const;
    1579 
    1580 
    1581  /*
    1582  Description:
    1583  A slower way to determine if a morph function
    1584  is the identity (doesn't move the points) on a surface, to within a tolerance
    1585  Parameters:
    1586  Srf - [in] Surface to be tested.
    1587  tol - [in] Distance tolerance.
    1588  Returns:
    1589  Uses MorphPoint() on a dense sample of points.
    1590  True if none of the points move a distance of tol or more under the morph function.
    1591  Remark:
    1592  Call IsIdentity(Srf.BoundingBox()) first.
    1593  Use this on surfaces whose nurb form is rational or has a different parameterization.
    1594  */
    1595  bool IsIdentity(const class ON_Surface& Srf, double tol) const;
    1596 
    1597  /*
    1598  Description:
    1599  A slower way to determine if a morph function
    1600  is the identity (doesn't move the points) on a curve, to within a tolerance.
    1601  Parameters:
    1602  Crv - [in] Curve to be tested.
    1603  tol - [in] Distance tolerance.
    1604  Returns:
    1605  Uses MorphPoint() on a dense sample of points.
    1606  True if none of the points move a distance of tol or more under the morph function.
    1607  Remark:
    1608  Call IsIdentity(Crv.BoundingBox()) first.
    1609  Use this on curves whose nurb form is rational or has a different parameterization.
    1610  */
    1611  bool IsIdentity(const class ON_Curve& Crv, double tol) const;
    1612 
    1613 
    1614  /*
    1615  Description:
    1616  Returns the desired accuracy of the morph.
    1617  This value is primarily used for deforming
    1618  surfaces and breps.
    1619  Returns:
    1620  3d fitting tolerance.
    1621  Remarks:
    1622  The default is 0.0 and any value <= 0.0 is
    1623  ignored by morphing functions.
    1624  The value returned by Tolerance() does not
    1625  affect the way meshes and points are morphed.
    1626  */
    1627  double Tolerance() const;
    1628 
    1629  /*
    1630  Description:
    1631  Set the 3d fitting tolerance used when morphing
    1632  surfaces and breps.
    1633  Parameters:
    1634  tolerance - [in] values < 0.0 are treated as 0.0.
    1635  */
    1636  void SetTolerance(
    1637  double tolerance
    1638  );
    1639 
    1640  /*
    1641  Returns:
    1642  True if the morph should be done as quickly as
    1643  possible because the result is being used for
    1644  some type of dynamic preview. If QuickPreview
    1645  is true, the tolerance may be ignored.
    1646  Remarks:
    1647  The value returned by QuickPreview() does not
    1648  affect the way meshes and points are morphed.
    1649  The default is false.
    1650  */
    1651  bool QuickPreview() const;
    1652 
    1653  /*
    1654  Description:
    1655  Set the quick preview value.
    1656  Parameters:
    1657  bQuickPreview - [in]
    1658  */
    1659  void SetQuickPreview(
    1660  bool bQuickPreview
    1661  );
    1662 
    1663  /*
    1664  Returns:
    1665  True if the morph should be done in a way that
    1666  preserves the structure of the geometry.
    1667  In particular, for NURBS objects, true
    1668  means that only the control points are moved.
    1669  Remarks:
    1670  The value returned by PreserveStructure() does not
    1671  affect the way meshes and points are morphed.
    1672  The default is false.
    1673  */
    1674  bool PreserveStructure() const;
    1675 
    1676  /*
    1677  Description:
    1678  Set the preserve structure value.
    1679  Parameters:
    1680  bPreserveStructure - [in]
    1681  */
    1682  void SetPreserveStructure(
    1683  bool bPreserveStructure
    1684  );
    1685 
    1686 private:
    1687  double m_tolerance = 0.0;
    1688  ON__UINT_PTR m_reserved1 = 0; // Some reserved field could provide more Morph type information. RH-4091
    1689  unsigned int m_reserved2 = 0;
    1690  bool m_bQuickPreview = false;
    1691  bool m_bPreserveStructure = false;
    1692  char m_reserved3 = 0;
    1693  char m_reserved4 = 0;
    1694 };
    1695 
    1696 #if defined(ON_DLL_TEMPLATE)
    1697 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Xform>;
    1698 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Localizer>;
    1699 #endif
    1700 
    1701 #endif
    int m_clip_plane_count
    (0 <= m_clip_plane_count <= max_clip_plane_count)
    Definition: opennurbs_xform.h:988
    ON_3dVector m_V
    Definition: opennurbs_xform.h:1539
    Definition: opennurbs_nurbssurface.h:62
    @@ -113,9 +111,9 @@ $(function() {
    diff --git a/6/d4/df9/class_o_n___triangle.html b/6/d4/df9/class_o_n___triangle.html index 376d458d..0229e7a1 100644 --- a/6/d4/df9/class_o_n___triangle.html +++ b/6/d4/df9/class_o_n___triangle.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Triangle Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d5/d00/opennurbs__fsp_8h_source.html b/6/d5/d00/opennurbs__fsp_8h_source.html index 69946009..1de94aec 100644 --- a/6/d5/d00/opennurbs__fsp_8h_source.html +++ b/6/d5/d00/opennurbs__fsp_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_fsp.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_fsp.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_fsp.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 #if !defined(OPENNURBS_FSP_INC_)
    17 #define OPENNURBS_FSP_INC_
    18 
    19 class ON_CLASS ON_FixedSizePool
    20 {
    21 public:
    24 
    25 #if defined(ON_HAS_RVALUEREF)
    27  ON_FixedSizePool& operator=(ON_FixedSizePool&&);
    28 #endif
    29 
    30  /*
    31  Description:
    32  Create a fixed size memory pool.
    33  Parameters:
    34  sizeof_element - [in]
    35  number of bytes in each element. This parameter must be greater than zero.
    36  In general, use sizeof(element type). If you pass a "raw" number as
    37  sizeof_element, then be certain that it is the right size to insure the
    38  fields in your elements will be properly aligned.
    39  element_count_estimate - [in] (0 = good default)
    40  If you know how many elements you will need, pass that number here.
    41  It is better to slightly overestimate than to slightly underestimate.
    42  If you do not have a good estimate, then use zero.
    43  block_element_capacity - [in] (0 = good default)
    44  If block_element_capacity is zero, Create() will calculate a block
    45  size that is efficent for most applications. If you are an expert
    46  user and want to specify the number of elements per block,
    47  then pass the number of elements per block here. When
    48  block_element_capacity > 0 and element_count_estimate > 0, the first
    49  block will have a capacity of at least element_count_estimate; in this
    50  case do not ask for extraordinarly large amounts of contiguous heap.
    51  Remarks:
    52  You must call Create() on an unused ON_FixedSizePool or call Destroy()
    53  before calling create.
    54  Returns:
    55  True if successful and the pool can be used.
    56  */
    57  bool Create(
    58  size_t sizeof_element,
    59  size_t element_count_estimate,
    60  size_t block_element_capacity
    61  );
    62 
    63  /*
    64  Returns:
    65  Size of the elements in this pool.
    66  */
    67  size_t SizeofElement() const;
    68 
    69  /*
    70  Returns:
    71  A pointer to sizeof_element bytes. The memory is zeroed.
    72  */
    73  void* AllocateElement();
    74 
    75  /*
    76  Returns:
    77  A pointer to sizeof_element bytes. The values in the returned block are undefined.
    78  */
    79  void* AllocateDirtyElement();
    80 
    81  /*
    82  Description:
    83  Return an element to the pool.
    84  Parameters:
    85  p - [in]
    86  A pointer returned by AllocateElement().
    87  It is critical that p be from this pool and that
    88  you return a pointer no more than one time.
    89  Remarks:
    90  If you find the following remarks confusing, but you really want to use
    91  ReturnElement(), then here are some simple guidelines.
    92  1) SizeofElement() must be >= 16
    93  2) SizeofElement() must be a multiple of 8.
    94  3) Do not use FirstElement() and NextElement() to iterate through
    95  the pool.
    96 
    97  If 1 to 3 don't work for you, then you need to understand the following
    98  information before using ReturnElement().
    99 
    100  ON_FixedMemoryPool uses the first sizeof(void*) bytes of the
    101  returned element for bookkeeping purposes. Therefore, if you
    102  are going to use ReturnElement(), then SizeofElement() must be
    103  at least sizeof(void*). If you are using a platform that requires
    104  pointers to be aligned on sizeof(void*) boundaries, then
    105  SizeofElement() must be a multiple of sizeof(void*).
    106  If you are going to use ReturnElement() and then use FirstElement()
    107  and NextElement() to iterate through the list of elements, then you
    108  need to set a value in the returned element to indicate that it
    109  needs to be skipped during the iteration. This value cannot be
    110  located in the fist sizeof(void*) bytes of the element. If the
    111  element is a class with a vtable, you cannot call a virtual
    112  function on a returned element because the vtable pointer is
    113  trashed when ReturnElement() modifies the fist sizeof(void*) bytes.
    114  */
    115  void ReturnElement(void* p);
    116 
    117  /*
    118  Description:
    119  Return all allocated elements to the pool. No heap is freed and
    120  the pool remains initialized and ready for AllocateElement()
    121  to be called.
    122  */
    123  void ReturnAll();
    124 
    125  /*
    126  Description:
    127  Destroy the pool and free all the heap. The pool cannot be used again
    128  until Create() is called.
    129  */
    130  void Destroy();
    131 
    132  /*
    133  Returns:
    134  Number of active elements. (Elements that have been returned are not active.)
    135  */
    136  size_t ActiveElementCount() const;
    137 
    138  /*
    139  Returns:
    140  Total number of elements = number of active elements + number of returned elements.
    141  */
    142  size_t TotalElementCount() const;
    143 
    144  /*
    145  Description:
    146  Get the i-th elment in the fixed size pool.
    147  Parameters:
    148  element_index - [in]
    149  Returns:
    150  A pointer to the element with the specified index.
    151  The first element has element_index = 0 and is the element
    152  returned by the first call to AllocateElement().
    153  The last element has element_index = ElementCount()-1.
    154  If element_index is out of range, nullptr is returned.
    155  Remarks:
    156  It is faster to use ON_FixedSizePoolIterator.FirstElement() and
    157  ON_FixedSizePoolIterator.NextElement() to iterate through the
    158  entire list of elements. This function is relatively
    159  efficient when there are a few large blocks in the pool
    160  or element_index is small compared to the number of elements
    161  in the first few blocks.
    162 
    163  If ReturnElement() is not used or no AllocateElement() calls
    164  are made after any use of ReturnElement(), then the i-th
    165  element is the one returned by the (i+1)-th call to
    166  AllocateElement()
    167  */
    168  void* Element(
    169  size_t element_index
    170  ) const;
    171 
    172 
    173  /*
    174  Description:
    175  Get the fixed size pool index of an element.
    176  Parameters:
    177  element_pointer - [in]
    178  Returns:
    179  An index >= 0 and < ON_MAX_SIZE_T if the element_pointer
    180  points to an element managed by the this fixed size pool.
    181  ON_MAX_SIZE_T otherwise.
    182  Remarks:
    183  It is faster to use ON_FixedSizePoolIterator.FirstElement() and
    184  ON_FixedSizePoolIterator.NextElement() to iterate through the
    185  entire list of elements. This function is relatively
    186  efficient when there are a few large blocks in the pool
    187  or element_pointer is an element in the first few blocks.
    188 
    189  If ReturnElement() is not used or no AllocateElement() calls
    190  are made after any use of ReturnElement(), then the i-th
    191  element is the one returned by the (i+1)-th call to
    192  AllocateElement().
    193  */
    194  size_t ElementIndex(
    195  const void* element_pointer
    196  ) const;
    197 
    198  /*
    199  Description:
    200  If you are certain that all elements in hte pool (active and returned)
    201  have an unsigned id that is unique and increasing, then you may use
    202  this function to find them.
    203  Parameters:
    204  id_offset - [in]
    205  offset into the element where the id is stored.
    206  id - [in]
    207  id to search for
    208  */
    209  void* ElementFromId(
    210  size_t id_offset,
    211  unsigned int id
    212  ) const;
    213 
    214 public:
    215  // Primarily used for debugging
    216  bool IsValid() const;
    217 
    218 private:
    220 
    221  void* m_first_block;
    222 
    223  // ReturnElement() adds to the m_al_element stack.
    224  // AllocateElement() will use the stack before using m_al_element_array[]
    225  void* m_al_element_stack;
    226 
    227  void* m_al_block; // current element allocation block.
    228  // m_al_element_array[] is in m_al_block and has length m_al_count.
    229  void* m_al_element_array;
    230  size_t m_al_count;
    231  size_t m_sizeof_element;
    232  size_t m_block_element_count; // block element count
    233  size_t m_active_element_count; // number of active elements
    234  size_t m_total_element_count; // total number of elements (active + returned)
    235 
    236 private:
    237  // returns capacity of elements in existing block
    238  size_t BlockElementCapacity( const void* block ) const;
    239 
    240  // returns number of allocated of elements in existing block
    241  size_t BlockElementCount( const void* block ) const;
    242 
    243 private:
    244  // prohibit copy construction and operator=.
    245  ON_FixedSizePool(const ON_FixedSizePool&) = delete;
    246  ON_FixedSizePool& operator=(const ON_FixedSizePool&) = delete;
    247 };
    248 
    250 {
    251 public:
    253  ON_FixedSizePoolIterator( const class ON_FixedSizePool& fsp );
    254 
    255  const class ON_FixedSizePool* FixedSizePool();
    256 
    257  void Create(const ON_FixedSizePool* fsp);
    258 
    259  /*
    260  Description:
    261  Get the first element when iterating through the list of elements.
    262  Parameters:
    263  element_index - [in]
    264  If you use the version of FirstElement() that has an
    265  element_index parameter, then the iteration begins at
    266  that element.
    267  Example:
    268  The loop will iteratate through all the elements returned from
    269  AllocateElement(), including any that have be returned to the pool
    270  using ReturnElement().
    271 
    272  // iterate through all elements in the pool
    273  // This iteration will go through TotalElements() items.
    274  for ( void* p = FirstElement(); 0 != p; p = NextElement() )
    275  {
    276  // If you are not using ReturnElement(), then you may process
    277  // "p" immediately. If you have used ReturnElement(), then you
    278  // must check some value in p located after the first sizeof(void*)
    279  // bytes to see if p is active.
    280  if ( p is not active )
    281  continue;
    282 
    283  ... process p
    284  }
    285 
    286  Returns:
    287  The first element when iterating through the list of elements.
    288  Remarks:
    289  FirstElement() and NextElement() will return elements that have
    290  been returned to the pool using ReturnElement(). If you use
    291  ReturnElement(), then be sure to mark the element so it can be
    292  identified and skipped.
    293 
    294  Do not make any calls to FirstBlock() or NextBlock() when using
    295  FirstElement() and NextElement() to iteratate through elements.
    296  */
    297  void* FirstElement();
    298  void* FirstElement( size_t element_index );
    299 
    300  /*
    301  Description:
    302  Get the next element when iterating through the list of elements.
    303  If FirstElement() is not called, then the first call to
    304  NextElement() returns the first element.
    305  Example:
    306  See the FirstElement() documentation.
    307  Returns:
    308  The next element when iterating through the list of elements.
    309  Remarks:
    310  FirstElement() and NextElement() will return elements that have
    311  been returned to the pool using ReturnElement(). If you use
    312  ReturnElement(), then be sure to mark the element so it can be
    313  identified and skipped.
    314 
    315  Do not make any calls to FirstBlock() or NextBlock() when using
    316  FirstElement() and NextElement() to iteratate through elements.
    317  */
    318  void* NextElement();
    319 
    320  /*
    321  Returns:
    322  The most recently returned value from a call to FirstElement()
    323  or NextElement().
    324  Remarks:
    325  Do not make any calls to FirstBlock() or NextBlock() when using
    326  FirstElement() and NextElement() to iteratate through elements.
    327  */
    328  void* CurrentElement() const;
    329 
    330  /*
    331  Description:
    332  Sets the state of the iterator to the initial state that
    333  exists after construction. This is useful if the iterator
    334  has been used the get one or more elements and then
    335  the referenced fixed size pool is modified or code wants
    336  to begin iteration again a used a call to NextElement()
    337  to return the first element.
    338  */
    339  void Reset();
    340 
    341 
    342  /*
    343  Description:
    344  Get a pointer to the first element in the first block.
    345  Parameters:
    346  block_element_count - [out] (can be null)
    347  If not null, the number of elements allocated from the
    348  first block is returned in block_element_count.
    349  Note that if you have used ReturnElement(), some
    350  of these elemements may have been returned.
    351  Example:
    352  The loop will iteratate through all the blocks.
    353 
    354  // iterate through all blocks in the pool
    355  size_t block_element_count = 0;
    356  for ( void* p = FirstBlock(&block_element_count);
    357  0 != p;
    358  p = NextBlock(&block_element_count)
    359  )
    360  {
    361  ElementType* e = (ElementType*)p;
    362  for ( size_t i = 0;
    363  i < block_element_count;
    364  i++, e = ((const char*)e) + SizeofElement()
    365  )
    366  {
    367  ...
    368  }
    369  }
    370 
    371  Returns:
    372  The first block when iterating the list of blocks.
    373  Remarks:
    374  The heap for a fixed size memory pool is simply a linked
    375  list of blocks. FirstBlock() and NextBlock() can be used
    376  to iterate through the list of blocks.
    377 
    378  Do not make any calls to FirstElement() or NextElement() when using
    379  FirstBlock() and NextBlock() to iteratate through blocks.
    380  */
    381  void* FirstBlock( size_t* block_element_count );
    382 
    383  /*
    384  Description:
    385  Get the next block when iterating through the blocks.
    386  Parameters:
    387  block_element_count - [out] (can be null)
    388  If not null, the number of elements allocated from the
    389  block is returned in block_element_count. Note that if
    390  you have used ReturnElement(), some of these elemements
    391  may have been returned.
    392  Example:
    393  See the FirstBlock() documentation.
    394  Returns:
    395  The next block when iterating through the blocks.
    396  Remarks:
    397  Do not make any calls to FirstElement() or NextElement() when using
    398  FirstBlock() and NextBlock() to iteratate through blocks.
    399  */
    400  void* NextBlock( size_t* block_element_count );
    401 
    402 private:
    403  const class ON_FixedSizePool* m_fsp;
    404  void* m_it_block;
    405  void* m_it_element;
    406 };
    407 
    408 
    409 template <class T> class ON_SimpleFixedSizePool : private ON_FixedSizePool
    410 {
    411 public:
    412  // construction ////////////////////////////////////////////////////////
    413 
    416 
    417  /*
    418  Description:
    419  Create a fixed size memory pool.
    420  Parameters:
    421  element_count_estimate - [in] (0 = good default)
    422  If you know how many elements you will need, pass that number here.
    423  It is better to slightly overestimate than to slightly underestimate.
    424  If you do not have a good estimate, then use zero.
    425  block_element_count - [in] (0 = good default)
    426  If block_element_count is zero, Create() will calculate a block
    427  size that is efficent for most applications. If you are an expert
    428  user and want to specify the number of blocks, then pass the number
    429  of elements per block here. When block_element_count > 0 and
    430  element_count_estimate > 0, the first block will be large enough
    431  element_count_estimate*sizeof(T) bytes; in this case do not
    432  ask for extraordinarly large amounts of contiguous heap.
    433  Remarks:
    434  You must call Create() on an unused ON_FixedSizePool or call Destroy()
    435  before calling create.
    436  Returns:
    437  True if successful and the pool can be used.
    438  */
    439  bool Create(
    440  size_t element_count_estimate,
    441  size_t block_element_count
    442  );
    443 
    444  /*
    445  Returns:
    446  Size of the elements in this pool.
    447  */
    448  size_t SizeofElement() const;
    449 
    450  /*
    451  Returns:
    452  A pointer to sizeof_element bytes. The memory is zeroed.
    453  */
    454  T* AllocateElement();
    455 
    456  /*
    457  Description:
    458  Return an element to the pool.
    459  Parameters:
    460  p - [in]
    461  A pointer returned by AllocateElement().
    462  It is critical that p be from this pool and that
    463  you return a pointer no more than one time.
    464  Remarks:
    465  If you find the following remarks confusing, but you really want to use
    466  ReturnElement(), then here are some simple guidelines.
    467  1) SizeofElement() must be >= 16
    468  2) SizeofElement() must be a multiple of 8.
    469  3) Do not use FirstElement() and NextElement() to iterate through
    470  the pool.
    471 
    472  If 1 to 3 don't work for you, then you need to understand the following
    473  information before using ReturnElement().
    474 
    475  ON_FixedMemoryPool uses the first sizeof(void*) bytes of the
    476  returned element for bookkeeping purposes. Therefore, if you
    477  are going to use ReturnElement(), then SizeofElement() must be
    478  at least sizeof(void*). If you are using a platform that requires
    479  pointers to be aligned on sizeof(void*) boundaries, then
    480  SizeofElement() must be a multiple of sizeof(void*).
    481  If you are going to use ReturnElement() and then use FirstElement()
    482  and NextElement() to iterate through the list of elements, then you
    483  need to set a value in the returned element to indicate that it
    484  needs to be skipped during the iteration. This value cannot be
    485  located in the fist sizeof(void*) bytes of the element. If the
    486  element is a class with a vtable, you cannot call a virtual
    487  function on a returned element because the vtable pointer is
    488  trashed when ReturnElement() modifies the fist sizeof(void*) bytes.
    489  */
    490  void ReturnElement(T* p);
    491 
    492  /*
    493  Description:
    494  Return all allocated elements to the pool. No heap is freed and
    495  the pool remains initialized and ready for AllocateElement()
    496  to be called.
    497  */
    498  void ReturnAll();
    499 
    500  /*
    501  Description:
    502  Destroy the pool and free all the heap. The pool cannot be used again
    503  until Create() is called.
    504  */
    505  void Destroy();
    506 
    507  /*
    508  Returns:
    509  Number of active elements. (Elements that have been returned are not active.)
    510  */
    511  size_t ActiveElementCount() const;
    512 
    513  /*
    514  Returns:
    515  Total number of elements = number of active elements + number of returned elements.
    516  */
    517  size_t TotalElementCount() const;
    518 
    519  /*
    520  Description:
    521  Get the i-th elment in the pool.
    522  Parameters:
    523  element_index - [in]
    524  Returns:
    525  A pointer to the i-th element. The first element has index = 0
    526  and is the element returned by the first call to AllocateElement().
    527  The last element has index = ElementCount()-1.
    528  If i is out of range, null is returned.
    529  Remarks:
    530  It is faster to use FirstElement() and NextElement() to iterate
    531  through the entire list of elements. This function is relatively
    532  efficient when there are a few large blocks in the pool
    533  or element_index is small compared to the number of elements
    534  in the first few blocks.
    535 
    536  If ReturnElement() is not used or AllocateElement() calls to
    537  are made after any use of ReturnElement(), then the i-th
    538  element is the one returned by the (i+1)-th call to
    539  AllocateElement().
    540  */
    541  T* Element(size_t element_index) const;
    542 
    543  size_t ElementIndex(
    544  T*
    545  ) const;
    546 
    547 private:
    548  // prohibit copy construction and operator=.
    551 };
    552 
    554 {
    555 public:
    558 
    559  /*
    560  Description:
    561  Get the first element when iterating through the list of elements.
    562  Parameters:
    563  element_index - [in]
    564  If you use the version of FirstElement() that has an
    565  element_index parameter, then the iteration begins at
    566  that element.
    567  Example:
    568  The loop will iteratate through all the elements returned from
    569  AllocateElement(), including any that have be returned to the pool
    570  using ReturnElement().
    571 
    572  // iterate through all elements in the pool
    573  // This iteration will go through TotalElements() items.
    574  for ( void* p = FirstElement(); 0 != p; p = NextElement() )
    575  {
    576  // If you are not using ReturnElement(), then you may process
    577  // "p" immediately. If you have used ReturnElement(), then you
    578  // must check some value in p located after the first sizeof(void*)
    579  // bytes to see if p is active.
    580  if ( p is not active )
    581  continue;
    582 
    583  ... process p
    584  }
    585 
    586  Returns:
    587  The first element when iterating through the list of elements.
    588  Remarks:
    589  FirstElement() and NextElement() will return elements that have
    590  been returned to the pool using ReturnElement(). If you use
    591  ReturnElement(), then be sure to mark the element so it can be
    592  identified and skipped.
    593 
    594  Do not make any calls to FirstBlock() or NextBlock() when using
    595  FirstElement() and NextElement() to iteratate through elements.
    596  */
    597  T* FirstElement();
    598  T* FirstElement( size_t element_index );
    599 
    600  /*
    601  Description:
    602  Get the next element when iterating through the list of elements.
    603  If FirstElement() is not called, then the first call to
    604  NextElement() returns the first element.
    605  Example:
    606  See the FirstElement() documentation.
    607  Returns:
    608  The next element when iterating through the list of elements.
    609  Remarks:
    610  FirstElement() and NextElement() will return elements that have
    611  been returned to the pool using ReturnElement(). If you use
    612  ReturnElement(), then be sure to mark the element so it can be
    613  identified and skipped.
    614 
    615  Do not make any calls to FirstBlock() or NextBlock() when using
    616  FirstElement() and NextElement() to iteratate through elements.
    617  */
    618  T* NextElement();
    619 
    620  /*
    621  Returns:
    622  The most recently returned value from a call to FirstElement()
    623  or NextElement().
    624  Remarks:
    625  Do not make any calls to FirstBlock() or NextBlock() when using
    626  FirstElement() and NextElement() to iteratate through elements.
    627  */
    628  T* CurrentElement();
    629 
    630  /*
    631  Description:
    632  Sets the state of the iterator to the initail state that
    633  exists after construction. This is useful if the iterator
    634  has been used the get one or more elements and then
    635  the referenced fixed size pool is modified or code wants
    636  to begin iteration again a used a call to NextElement()
    637  to return the first element.
    638  */
    639  void Reset();
    640 
    641 
    642  /*
    643  Description:
    644  Get a pointer to the first element in the first block.
    645  Parameters:
    646  block_element_count - [out] (can be null)
    647  If not null, the number of elements allocated from the
    648  first block is returned in block_element_count.
    649  Note that if you have used ReturnElement(), some
    650  of these elemements may have been returned.
    651  Example:
    652  The loop will iteratate through all the blocks.
    653 
    654  // iterate through all blocks in the pool
    655  size_t block_element_count = 0;
    656  for ( void* p = FirstBlock(&block_element_count);
    657  0 != p;
    658  p = NextBlock(&block_element_count)
    659  )
    660  {
    661  ElementType* e = (ElementType*)p;
    662  for ( size_t i = 0;
    663  i < block_element_count;
    664  i++, e = ((const char*)e) + SizeofElement()
    665  )
    666  {
    667  ...
    668  }
    669  }
    670 
    671  Returns:
    672  The first block when iterating the list of blocks.
    673  Remarks:
    674  The heap for a fixed size memory pool is simply a linked
    675  list of blocks. FirstBlock() and NextBlock() can be used
    676  to iterate through the list of blocks.
    677 
    678  Do not make any calls to FirstElement() or NextElement() when using
    679  FirstBlock() and NextBlock() to iteratate through blocks.
    680  */
    681  T* FirstBlock( size_t* block_element_count );
    682 
    683  /*
    684  Description:
    685  Get the next block when iterating through the blocks.
    686  Parameters:
    687  block_element_count - [out] (can be null)
    688  If not null, the number of elements allocated from the
    689  block is returned in block_element_count. Note that if
    690  you have used ReturnElement(), some of these elemements
    691  may have been returned.
    692  Example:
    693  See the FirstBlock() documentation.
    694  Returns:
    695  The next block when iterating through the blocks.
    696  Remarks:
    697  Do not make any calls to FirstElement() or NextElement() when using
    698  FirstBlock() and NextBlock() to iteratate through blocks.
    699  */
    700  T* NextBlock( size_t* block_element_count );
    701 
    702 private:
    703  // no implementation (you can use a copy construtor)
    704  class ON_SimpleFixedSizePoolIterator<T>& operator=(const class ON_SimpleFixedSizePoolIterator<T>&);
    705 };
    706 
    707 // definitions of the template functions are in a different file
    708 // so that Microsoft's developer studio's autocomplete utility
    709 // will work on the template functions.
    710 #include "opennurbs_fsp_defs.h"
    711 
    712 #endif
    713 
    size_t SizeofElement() const
    Definition: opennurbs_fsp_defs.h:41
    -
    T * FirstElement()
    Definition: opennurbs_fsp_defs.h:105
    -
    void Destroy()
    Definition: opennurbs_fsp_defs.h:65
    -
    T * AllocateElement()
    Definition: opennurbs_fsp_defs.h:47
    -
    T * NextBlock(size_t *block_element_count)
    Definition: opennurbs_fsp_defs.h:143
    -
    ON_SimpleFixedSizePoolIterator(const class ON_SimpleFixedSizePool< T > &fsp)
    Definition: opennurbs_fsp_defs.h:95
    -
    bool Create(size_t element_count_estimate, size_t block_element_count)
    Definition: opennurbs_fsp_defs.h:32
    -
    size_t ActiveElementCount() const
    Definition: opennurbs_fsp_defs.h:71
    -
    Definition: opennurbs_fsp.h:19
    -
    void ReturnElement(T *p)
    Definition: opennurbs_fsp_defs.h:53
    -
    T * Element(size_t element_index) const
    Definition: opennurbs_fsp_defs.h:83
    -
    void ReturnAll()
    Definition: opennurbs_fsp_defs.h:59
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 #if !defined(OPENNURBS_FSP_INC_)
    17 #define OPENNURBS_FSP_INC_
    18 
    19 class ON_CLASS ON_FixedSizePool
    20 {
    21 public:
    24 
    25 #if defined(ON_HAS_RVALUEREF)
    27  ON_FixedSizePool& operator=(ON_FixedSizePool&&);
    28 #endif
    29 
    30  /*
    31  Description:
    32  Create a fixed size memory pool.
    33  Parameters:
    34  sizeof_element - [in]
    35  number of bytes in each element. This parameter must be greater than zero.
    36  In general, use sizeof(element type). If you pass a "raw" number as
    37  sizeof_element, then be certain that it is the right size to insure the
    38  fields in your elements will be properly aligned.
    39  element_count_estimate - [in] (0 = good default)
    40  If you know how many elements you will need, pass that number here.
    41  It is better to slightly overestimate than to slightly underestimate.
    42  If you do not have a good estimate, then use zero.
    43  block_element_capacity - [in] (0 = good default)
    44  If block_element_capacity is zero, Create() will calculate a block
    45  size that is efficent for most applications. If you are an expert
    46  user and want to specify the number of elements per block,
    47  then pass the number of elements per block here. When
    48  block_element_capacity > 0 and element_count_estimate > 0, the first
    49  block will have a capacity of at least element_count_estimate; in this
    50  case do not ask for extraordinarly large amounts of contiguous heap.
    51  Remarks:
    52  You must call Create() on an unused ON_FixedSizePool or call Destroy()
    53  before calling create.
    54  Returns:
    55  True if successful and the pool can be used.
    56  */
    57  bool Create(
    58  size_t sizeof_element,
    59  size_t element_count_estimate,
    60  size_t block_element_capacity
    61  );
    62 
    63  /*
    64  Returns:
    65  Size of the elements in this pool.
    66  */
    67  size_t SizeofElement() const;
    68 
    69  /*
    70  Returns:
    71  A pointer to sizeof_element bytes. The memory is zeroed.
    72  */
    73  void* AllocateElement();
    74 
    75  /*
    76  Returns:
    77  A pointer to sizeof_element bytes. The values in the returned block are undefined.
    78  */
    79  void* AllocateDirtyElement();
    80 
    81  /*
    82  Description:
    83  Return an element to the pool.
    84  Parameters:
    85  p - [in]
    86  A pointer returned by AllocateElement().
    87  It is critical that p be from this pool and that
    88  you return a pointer no more than one time.
    89  Remarks:
    90  If you find the following remarks confusing, but you really want to use
    91  ReturnElement(), then here are some simple guidelines.
    92  1) SizeofElement() must be >= 16
    93  2) SizeofElement() must be a multiple of 8.
    94  3) Do not use FirstElement() and NextElement() to iterate through
    95  the pool.
    96 
    97  If 1 to 3 don't work for you, then you need to understand the following
    98  information before using ReturnElement().
    99 
    100  ON_FixedMemoryPool uses the first sizeof(void*) bytes of the
    101  returned element for bookkeeping purposes. Therefore, if you
    102  are going to use ReturnElement(), then SizeofElement() must be
    103  at least sizeof(void*). If you are using a platform that requires
    104  pointers to be aligned on sizeof(void*) boundaries, then
    105  SizeofElement() must be a multiple of sizeof(void*).
    106  If you are going to use ReturnElement() and then use FirstElement()
    107  and NextElement() to iterate through the list of elements, then you
    108  need to set a value in the returned element to indicate that it
    109  needs to be skipped during the iteration. This value cannot be
    110  located in the fist sizeof(void*) bytes of the element. If the
    111  element is a class with a vtable, you cannot call a virtual
    112  function on a returned element because the vtable pointer is
    113  trashed when ReturnElement() modifies the fist sizeof(void*) bytes.
    114  */
    115  void ReturnElement(void* p);
    116 
    117  /*
    118  Description:
    119  Return all allocated elements to the pool. No heap is freed and
    120  the pool remains initialized and ready for AllocateElement()
    121  to be called.
    122  */
    123  void ReturnAll();
    124 
    125  /*
    126  Description:
    127  Destroy the pool and free all the heap. The pool cannot be used again
    128  until Create() is called.
    129  */
    130  void Destroy();
    131 
    132  /*
    133  Returns:
    134  Number of active elements. (Elements that have been returned are not active.)
    135  */
    136  size_t ActiveElementCount() const;
    137 
    138  /*
    139  Returns:
    140  Total number of elements = number of active elements + number of returned elements.
    141  */
    142  size_t TotalElementCount() const;
    143 
    144  /*
    145  Description:
    146  Get the i-th elment in the fixed size pool.
    147  Parameters:
    148  element_index - [in]
    149  Returns:
    150  A pointer to the element with the specified index.
    151  The first element has element_index = 0 and is the element
    152  returned by the first call to AllocateElement().
    153  The last element has element_index = ElementCount()-1.
    154  If element_index is out of range, nullptr is returned.
    155  Remarks:
    156  It is faster to use ON_FixedSizePoolIterator.FirstElement() and
    157  ON_FixedSizePoolIterator.NextElement() to iterate through the
    158  entire list of elements. This function is relatively
    159  efficient when there are a few large blocks in the pool
    160  or element_index is small compared to the number of elements
    161  in the first few blocks.
    162 
    163  If ReturnElement() is not used or no AllocateElement() calls
    164  are made after any use of ReturnElement(), then the i-th
    165  element is the one returned by the (i+1)-th call to
    166  AllocateElement()
    167  */
    168  void* Element(
    169  size_t element_index
    170  ) const;
    171 
    172 
    173  /*
    174  Description:
    175  Get the fixed size pool index of an element.
    176  Parameters:
    177  element_pointer - [in]
    178  Returns:
    179  An index >= 0 and < ON_MAX_SIZE_T if the element_pointer
    180  points to an element managed by the this fixed size pool.
    181  ON_MAX_SIZE_T otherwise.
    182  Remarks:
    183  It is faster to use ON_FixedSizePoolIterator.FirstElement() and
    184  ON_FixedSizePoolIterator.NextElement() to iterate through the
    185  entire list of elements. This function is relatively
    186  efficient when there are a few large blocks in the pool
    187  or element_pointer is an element in the first few blocks.
    188 
    189  If ReturnElement() is not used or no AllocateElement() calls
    190  are made after any use of ReturnElement(), then the i-th
    191  element is the one returned by the (i+1)-th call to
    192  AllocateElement().
    193  */
    194  size_t ElementIndex(
    195  const void* element_pointer
    196  ) const;
    197 
    198  /*
    199  Description:
    200  If you are certain that all elements in hte pool (active and returned)
    201  have an unsigned id that is unique and increasing, then you may use
    202  this function to find them.
    203  Parameters:
    204  id_offset - [in]
    205  offset into the element where the id is stored.
    206  id - [in]
    207  id to search for
    208  */
    209  void* ElementFromId(
    210  size_t id_offset,
    211  unsigned int id
    212  ) const;
    213 
    214 public:
    215  // Primarily used for debugging
    216  bool IsValid() const;
    217 
    218 private:
    220 
    221  void* m_first_block;
    222 
    223  // ReturnElement() adds to the m_al_element stack.
    224  // AllocateElement() will use the stack before using m_al_element_array[]
    225  void* m_al_element_stack;
    226 
    227  void* m_al_block; // current element allocation block.
    228  // m_al_element_array[] is in m_al_block and has length m_al_count.
    229  void* m_al_element_array;
    230  size_t m_al_count;
    231  size_t m_sizeof_element;
    232  size_t m_block_element_count; // block element count
    233  size_t m_active_element_count; // number of active elements
    234  size_t m_total_element_count; // total number of elements (active + returned)
    235 
    236 private:
    237  // returns capacity of elements in existing block
    238  size_t BlockElementCapacity( const void* block ) const;
    239 
    240  // returns number of allocated of elements in existing block
    241  size_t BlockElementCount( const void* block ) const;
    242 
    243 private:
    244  // prohibit copy construction and operator=.
    245  ON_FixedSizePool(const ON_FixedSizePool&) = delete;
    246  ON_FixedSizePool& operator=(const ON_FixedSizePool&) = delete;
    247 };
    248 
    250 {
    251 public:
    253  ON_FixedSizePoolIterator( const class ON_FixedSizePool& fsp );
    254 
    255  const class ON_FixedSizePool* FixedSizePool();
    256 
    257  void Create(const ON_FixedSizePool* fsp);
    258 
    259  /*
    260  Description:
    261  Get the first element when iterating through the list of elements.
    262  Parameters:
    263  element_index - [in]
    264  If you use the version of FirstElement() that has an
    265  element_index parameter, then the iteration begins at
    266  that element.
    267  Example:
    268  The loop will iteratate through all the elements returned from
    269  AllocateElement(), including any that have be returned to the pool
    270  using ReturnElement().
    271 
    272  // iterate through all elements in the pool
    273  // This iteration will go through TotalElements() items.
    274  for ( void* p = FirstElement(); 0 != p; p = NextElement() )
    275  {
    276  // If you are not using ReturnElement(), then you may process
    277  // "p" immediately. If you have used ReturnElement(), then you
    278  // must check some value in p located after the first sizeof(void*)
    279  // bytes to see if p is active.
    280  if ( p is not active )
    281  continue;
    282 
    283  ... process p
    284  }
    285 
    286  Returns:
    287  The first element when iterating through the list of elements.
    288  Remarks:
    289  FirstElement() and NextElement() will return elements that have
    290  been returned to the pool using ReturnElement(). If you use
    291  ReturnElement(), then be sure to mark the element so it can be
    292  identified and skipped.
    293 
    294  Do not make any calls to FirstBlock() or NextBlock() when using
    295  FirstElement() and NextElement() to iteratate through elements.
    296  */
    297  void* FirstElement();
    298  void* FirstElement( size_t element_index );
    299 
    300  /*
    301  Description:
    302  Get the next element when iterating through the list of elements.
    303  If FirstElement() is not called, then the first call to
    304  NextElement() returns the first element.
    305  Example:
    306  See the FirstElement() documentation.
    307  Returns:
    308  The next element when iterating through the list of elements.
    309  Remarks:
    310  FirstElement() and NextElement() will return elements that have
    311  been returned to the pool using ReturnElement(). If you use
    312  ReturnElement(), then be sure to mark the element so it can be
    313  identified and skipped.
    314 
    315  Do not make any calls to FirstBlock() or NextBlock() when using
    316  FirstElement() and NextElement() to iteratate through elements.
    317  */
    318  void* NextElement();
    319 
    320  /*
    321  Returns:
    322  The most recently returned value from a call to FirstElement()
    323  or NextElement().
    324  Remarks:
    325  Do not make any calls to FirstBlock() or NextBlock() when using
    326  FirstElement() and NextElement() to iteratate through elements.
    327  */
    328  void* CurrentElement() const;
    329 
    330  /*
    331  Description:
    332  Sets the state of the iterator to the initial state that
    333  exists after construction. This is useful if the iterator
    334  has been used the get one or more elements and then
    335  the referenced fixed size pool is modified or code wants
    336  to begin iteration again a used a call to NextElement()
    337  to return the first element.
    338  */
    339  void Reset();
    340 
    341 
    342  /*
    343  Description:
    344  Get a pointer to the first element in the first block.
    345  Parameters:
    346  block_element_count - [out] (can be null)
    347  If not null, the number of elements allocated from the
    348  first block is returned in block_element_count.
    349  Note that if you have used ReturnElement(), some
    350  of these elemements may have been returned.
    351  Example:
    352  The loop will iteratate through all the blocks.
    353 
    354  // iterate through all blocks in the pool
    355  size_t block_element_count = 0;
    356  for ( void* p = FirstBlock(&block_element_count);
    357  0 != p;
    358  p = NextBlock(&block_element_count)
    359  )
    360  {
    361  ElementType* e = (ElementType*)p;
    362  for ( size_t i = 0;
    363  i < block_element_count;
    364  i++, e = ((const char*)e) + SizeofElement()
    365  )
    366  {
    367  ...
    368  }
    369  }
    370 
    371  Returns:
    372  The first block when iterating the list of blocks.
    373  Remarks:
    374  The heap for a fixed size memory pool is simply a linked
    375  list of blocks. FirstBlock() and NextBlock() can be used
    376  to iterate through the list of blocks.
    377 
    378  Do not make any calls to FirstElement() or NextElement() when using
    379  FirstBlock() and NextBlock() to iteratate through blocks.
    380  */
    381  void* FirstBlock( size_t* block_element_count );
    382 
    383  /*
    384  Description:
    385  Get the next block when iterating through the blocks.
    386  Parameters:
    387  block_element_count - [out] (can be null)
    388  If not null, the number of elements allocated from the
    389  block is returned in block_element_count. Note that if
    390  you have used ReturnElement(), some of these elemements
    391  may have been returned.
    392  Example:
    393  See the FirstBlock() documentation.
    394  Returns:
    395  The next block when iterating through the blocks.
    396  Remarks:
    397  Do not make any calls to FirstElement() or NextElement() when using
    398  FirstBlock() and NextBlock() to iteratate through blocks.
    399  */
    400  void* NextBlock( size_t* block_element_count );
    401 
    402 private:
    403  const class ON_FixedSizePool* m_fsp;
    404  void* m_it_block;
    405  void* m_it_element;
    406 };
    407 
    408 
    409 template <class T> class ON_SimpleFixedSizePool : private ON_FixedSizePool
    410 {
    411 public:
    412  // construction ////////////////////////////////////////////////////////
    413 
    416 
    417  /*
    418  Description:
    419  Create a fixed size memory pool.
    420  Parameters:
    421  element_count_estimate - [in] (0 = good default)
    422  If you know how many elements you will need, pass that number here.
    423  It is better to slightly overestimate than to slightly underestimate.
    424  If you do not have a good estimate, then use zero.
    425  block_element_count - [in] (0 = good default)
    426  If block_element_count is zero, Create() will calculate a block
    427  size that is efficent for most applications. If you are an expert
    428  user and want to specify the number of blocks, then pass the number
    429  of elements per block here. When block_element_count > 0 and
    430  element_count_estimate > 0, the first block will be large enough
    431  element_count_estimate*sizeof(T) bytes; in this case do not
    432  ask for extraordinarly large amounts of contiguous heap.
    433  Remarks:
    434  You must call Create() on an unused ON_FixedSizePool or call Destroy()
    435  before calling create.
    436  Returns:
    437  True if successful and the pool can be used.
    438  */
    439  bool Create(
    440  size_t element_count_estimate,
    441  size_t block_element_count
    442  );
    443 
    444  /*
    445  Returns:
    446  Size of the elements in this pool.
    447  */
    448  size_t SizeofElement() const;
    449 
    450  /*
    451  Returns:
    452  A pointer to sizeof_element bytes. The memory is zeroed.
    453  */
    454  T* AllocateElement();
    455 
    456  /*
    457  Description:
    458  Return an element to the pool.
    459  Parameters:
    460  p - [in]
    461  A pointer returned by AllocateElement().
    462  It is critical that p be from this pool and that
    463  you return a pointer no more than one time.
    464  Remarks:
    465  If you find the following remarks confusing, but you really want to use
    466  ReturnElement(), then here are some simple guidelines.
    467  1) SizeofElement() must be >= 16
    468  2) SizeofElement() must be a multiple of 8.
    469  3) Do not use FirstElement() and NextElement() to iterate through
    470  the pool.
    471 
    472  If 1 to 3 don't work for you, then you need to understand the following
    473  information before using ReturnElement().
    474 
    475  ON_FixedMemoryPool uses the first sizeof(void*) bytes of the
    476  returned element for bookkeeping purposes. Therefore, if you
    477  are going to use ReturnElement(), then SizeofElement() must be
    478  at least sizeof(void*). If you are using a platform that requires
    479  pointers to be aligned on sizeof(void*) boundaries, then
    480  SizeofElement() must be a multiple of sizeof(void*).
    481  If you are going to use ReturnElement() and then use FirstElement()
    482  and NextElement() to iterate through the list of elements, then you
    483  need to set a value in the returned element to indicate that it
    484  needs to be skipped during the iteration. This value cannot be
    485  located in the fist sizeof(void*) bytes of the element. If the
    486  element is a class with a vtable, you cannot call a virtual
    487  function on a returned element because the vtable pointer is
    488  trashed when ReturnElement() modifies the fist sizeof(void*) bytes.
    489  */
    490  void ReturnElement(T* p);
    491 
    492  /*
    493  Description:
    494  Return all allocated elements to the pool. No heap is freed and
    495  the pool remains initialized and ready for AllocateElement()
    496  to be called.
    497  */
    498  void ReturnAll();
    499 
    500  /*
    501  Description:
    502  Destroy the pool and free all the heap. The pool cannot be used again
    503  until Create() is called.
    504  */
    505  void Destroy();
    506 
    507  /*
    508  Returns:
    509  Number of active elements. (Elements that have been returned are not active.)
    510  */
    511  size_t ActiveElementCount() const;
    512 
    513  /*
    514  Returns:
    515  Total number of elements = number of active elements + number of returned elements.
    516  */
    517  size_t TotalElementCount() const;
    518 
    519  /*
    520  Description:
    521  Get the i-th elment in the pool.
    522  Parameters:
    523  element_index - [in]
    524  Returns:
    525  A pointer to the i-th element. The first element has index = 0
    526  and is the element returned by the first call to AllocateElement().
    527  The last element has index = ElementCount()-1.
    528  If i is out of range, null is returned.
    529  Remarks:
    530  It is faster to use FirstElement() and NextElement() to iterate
    531  through the entire list of elements. This function is relatively
    532  efficient when there are a few large blocks in the pool
    533  or element_index is small compared to the number of elements
    534  in the first few blocks.
    535 
    536  If ReturnElement() is not used or AllocateElement() calls to
    537  are made after any use of ReturnElement(), then the i-th
    538  element is the one returned by the (i+1)-th call to
    539  AllocateElement().
    540  */
    541  T* Element(size_t element_index) const;
    542 
    543  size_t ElementIndex(
    544  T*
    545  ) const;
    546 
    547 private:
    548  // prohibit copy construction and operator=.
    551 };
    552 
    554 {
    555 public:
    558 
    559  /*
    560  Description:
    561  Get the first element when iterating through the list of elements.
    562  Parameters:
    563  element_index - [in]
    564  If you use the version of FirstElement() that has an
    565  element_index parameter, then the iteration begins at
    566  that element.
    567  Example:
    568  The loop will iteratate through all the elements returned from
    569  AllocateElement(), including any that have be returned to the pool
    570  using ReturnElement().
    571 
    572  // iterate through all elements in the pool
    573  // This iteration will go through TotalElements() items.
    574  for ( void* p = FirstElement(); 0 != p; p = NextElement() )
    575  {
    576  // If you are not using ReturnElement(), then you may process
    577  // "p" immediately. If you have used ReturnElement(), then you
    578  // must check some value in p located after the first sizeof(void*)
    579  // bytes to see if p is active.
    580  if ( p is not active )
    581  continue;
    582 
    583  ... process p
    584  }
    585 
    586  Returns:
    587  The first element when iterating through the list of elements.
    588  Remarks:
    589  FirstElement() and NextElement() will return elements that have
    590  been returned to the pool using ReturnElement(). If you use
    591  ReturnElement(), then be sure to mark the element so it can be
    592  identified and skipped.
    593 
    594  Do not make any calls to FirstBlock() or NextBlock() when using
    595  FirstElement() and NextElement() to iteratate through elements.
    596  */
    597  T* FirstElement();
    598  T* FirstElement( size_t element_index );
    599 
    600  /*
    601  Description:
    602  Get the next element when iterating through the list of elements.
    603  If FirstElement() is not called, then the first call to
    604  NextElement() returns the first element.
    605  Example:
    606  See the FirstElement() documentation.
    607  Returns:
    608  The next element when iterating through the list of elements.
    609  Remarks:
    610  FirstElement() and NextElement() will return elements that have
    611  been returned to the pool using ReturnElement(). If you use
    612  ReturnElement(), then be sure to mark the element so it can be
    613  identified and skipped.
    614 
    615  Do not make any calls to FirstBlock() or NextBlock() when using
    616  FirstElement() and NextElement() to iteratate through elements.
    617  */
    618  T* NextElement();
    619 
    620  /*
    621  Returns:
    622  The most recently returned value from a call to FirstElement()
    623  or NextElement().
    624  Remarks:
    625  Do not make any calls to FirstBlock() or NextBlock() when using
    626  FirstElement() and NextElement() to iteratate through elements.
    627  */
    628  T* CurrentElement();
    629 
    630  /*
    631  Description:
    632  Sets the state of the iterator to the initail state that
    633  exists after construction. This is useful if the iterator
    634  has been used the get one or more elements and then
    635  the referenced fixed size pool is modified or code wants
    636  to begin iteration again a used a call to NextElement()
    637  to return the first element.
    638  */
    639  void Reset();
    640 
    641 
    642  /*
    643  Description:
    644  Get a pointer to the first element in the first block.
    645  Parameters:
    646  block_element_count - [out] (can be null)
    647  If not null, the number of elements allocated from the
    648  first block is returned in block_element_count.
    649  Note that if you have used ReturnElement(), some
    650  of these elemements may have been returned.
    651  Example:
    652  The loop will iteratate through all the blocks.
    653 
    654  // iterate through all blocks in the pool
    655  size_t block_element_count = 0;
    656  for ( void* p = FirstBlock(&block_element_count);
    657  0 != p;
    658  p = NextBlock(&block_element_count)
    659  )
    660  {
    661  ElementType* e = (ElementType*)p;
    662  for ( size_t i = 0;
    663  i < block_element_count;
    664  i++, e = ((const char*)e) + SizeofElement()
    665  )
    666  {
    667  ...
    668  }
    669  }
    670 
    671  Returns:
    672  The first block when iterating the list of blocks.
    673  Remarks:
    674  The heap for a fixed size memory pool is simply a linked
    675  list of blocks. FirstBlock() and NextBlock() can be used
    676  to iterate through the list of blocks.
    677 
    678  Do not make any calls to FirstElement() or NextElement() when using
    679  FirstBlock() and NextBlock() to iteratate through blocks.
    680  */
    681  T* FirstBlock( size_t* block_element_count );
    682 
    683  /*
    684  Description:
    685  Get the next block when iterating through the blocks.
    686  Parameters:
    687  block_element_count - [out] (can be null)
    688  If not null, the number of elements allocated from the
    689  block is returned in block_element_count. Note that if
    690  you have used ReturnElement(), some of these elemements
    691  may have been returned.
    692  Example:
    693  See the FirstBlock() documentation.
    694  Returns:
    695  The next block when iterating through the blocks.
    696  Remarks:
    697  Do not make any calls to FirstElement() or NextElement() when using
    698  FirstBlock() and NextBlock() to iteratate through blocks.
    699  */
    700  T* NextBlock( size_t* block_element_count );
    701 
    702 private:
    703  // no implementation (you can use a copy construtor)
    704  class ON_SimpleFixedSizePoolIterator<T>& operator=(const class ON_SimpleFixedSizePoolIterator<T>&);
    705 };
    706 
    707 // definitions of the template functions are in a different file
    708 // so that Microsoft's developer studio's autocomplete utility
    709 // will work on the template functions.
    710 #include "opennurbs_fsp_defs.h"
    711 
    712 #endif
    713 
    Definition: opennurbs_fsp.h:19
    Definition: opennurbs_fsp.h:409
    Definition: opennurbs_fsp.h:553
    -
    ~ON_SimpleFixedSizePool()
    Definition: opennurbs_fsp_defs.h:26
    -
    ON_SimpleFixedSizePool()
    construction ////////////////////////////////////////////////////////
    Definition: opennurbs_fsp_defs.h:21
    -
    size_t TotalElementCount() const
    Definition: opennurbs_fsp_defs.h:77
    -
    T * CurrentElement()
    Definition: opennurbs_fsp_defs.h:124
    -
    size_t ElementIndex(T *) const
    Definition: opennurbs_fsp_defs.h:89
    -
    void Reset()
    Definition: opennurbs_fsp_defs.h:131
    Definition: opennurbs_fsp.h:249
    -
    T * NextElement()
    Definition: opennurbs_fsp_defs.h:118
    bool Create(size_t sizeof_element, size_t element_count_estimate, size_t block_element_capacity)
    -
    T * FirstBlock(size_t *block_element_count)
    Definition: opennurbs_fsp_defs.h:137
    diff --git a/6/d5/d03/opennurbs__dimensionformat_8h_source.html b/6/d5/d03/opennurbs__dimensionformat_8h_source.html index b8192d5d..46806679 100644 --- a/6/d5/d03/opennurbs__dimensionformat_8h_source.html +++ b/6/d5/d03/opennurbs__dimensionformat_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_dimensionformat.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_dimensionformat.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d5/d04/class_o_n___write3dm_buffer_archive-members.html b/6/d5/d04/class_o_n___write3dm_buffer_archive-members.html index 6b5a20fa..de97afc5 100644 --- a/6/d5/d04/class_o_n___write3dm_buffer_archive-members.html +++ b/6/d5/d04/class_o_n___write3dm_buffer_archive-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/d09/struct_o_n___u_u_i_d__struct-members.html b/6/d5/d09/struct_o_n___u_u_i_d__struct-members.html index a233cdf3..26200407 100644 --- a/6/d5/d09/struct_o_n___u_u_i_d__struct-members.html +++ b/6/d5/d09/struct_o_n___u_u_i_d__struct-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/d1a/class_o_n___curve_on_surface.html b/6/d5/d1a/class_o_n___curve_on_surface.html index d7c71ba5..51f7f183 100644 --- a/6/d5/d1a/class_o_n___curve_on_surface.html +++ b/6/d5/d1a/class_o_n___curve_on_surface.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_CurveOnSurface Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_CurveOnSurface() [1/2]

    @@ -1324,8 +1320,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -1388,9 +1384,9 @@ Additional Inherited Members diff --git a/6/d5/d1c/class_o_n___poly_edge_segment-members.html b/6/d5/d1c/class_o_n___poly_edge_segment-members.html index fc779559..cf53ead0 100644 --- a/6/d5/d1c/class_o_n___poly_edge_segment-members.html +++ b/6/d5/d1c/class_o_n___poly_edge_segment-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archiveopen binary file
    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/d5/d21/class_o_n___layer-members.html b/6/d5/d21/class_o_n___layer-members.html index 4498bc94..8d1f0cc0 100644 --- a/6/d5/d21/class_o_n___layer-members.html +++ b/6/d5/d21/class_o_n___layer-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/d2c/class_o_n___material_ref.html b/6/d5/d2c/class_o_n___material_ref.html index 3a5331bb..ee8c780c 100644 --- a/6/d5/d2c/class_o_n___material_ref.html +++ b/6/d5/d2c/class_o_n___material_ref.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MaterialRef Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/d36/class_o_n___fixed_size_pool-members.html b/6/d5/d36/class_o_n___fixed_size_pool-members.html index ad48c565..2095c18e 100644 --- a/6/d5/d36/class_o_n___fixed_size_pool-members.html +++ b/6/d5/d36/class_o_n___fixed_size_pool-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/d38/union_o_n___u.html b/6/d5/d38/union_o_n___u.html index 641a5665..5e57af37 100644 --- a/6/d5/d38/union_o_n___u.html +++ b/6/d5/d38/union_o_n___u.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_U Union Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/d39/class_o_n___mesh_curve_parameters.html b/6/d5/d39/class_o_n___mesh_curve_parameters.html index c285fa9d..d5f2406b 100644 --- a/6/d5/d39/class_o_n___mesh_curve_parameters.html +++ b/6/d5/d39/class_o_n___mesh_curve_parameters.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshCurveParameters Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Definition of virtual parametric curve

    Constructor & Destructor Documentation

    @@ -309,9 +303,9 @@ Public Attributes
    diff --git a/6/d5/d3c/class_o_n__3dm_goo.html b/6/d5/d3c/class_o_n__3dm_goo.html index 3d845222..36856f11 100644 --- a/6/d5/d3c/class_o_n__3dm_goo.html +++ b/6/d5/d3c/class_o_n__3dm_goo.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmGoo Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/d45/class_o_n__4d_point-members.html b/6/d5/d45/class_o_n__4d_point-members.html index b48eed9b..e53e3743 100644 --- a/6/d5/d45/class_o_n__4d_point-members.html +++ b/6/d5/d45/class_o_n__4d_point-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/d4e/class_o_n___string_buffer-members.html b/6/d5/d4e/class_o_n___string_buffer-members.html index 2e5e41b3..55af73de 100644 --- a/6/d5/d4e/class_o_n___string_buffer-members.html +++ b/6/d5/d4e/class_o_n___string_buffer-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/d4f/struct_o_n___unicode_error_parameters.html b/6/d5/d4f/struct_o_n___unicode_error_parameters.html index e0cf2568..2b0154b9 100644 --- a/6/d5/d4f/struct_o_n___unicode_error_parameters.html +++ b/6/d5/d4f/struct_o_n___unicode_error_parameters.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UnicodeErrorParameters Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    This error is masked if 0 != (4 & m_error_mask). If the error is masked, then the surrogate pair is decoded, the value of the resulting unicode code point is used, and parsing continues.

    8: An overlong UTF-8 encoding sequence was encountered and the value of the overlong sUTF-8 equence was a valid unicode code point.

    This error is masked if 0 != (8 & m_error_mask). If the error is masked, then the unicode code point is used and parsing continues.

    -

    16: An illegal UTF-8, UTF-16 or UTF-32 sequence occured, or an unsupported or invalid Windows code page value,
    - or an invalid unicode code point value resulted from decoding a UTF-8 sequence.

    +

    16: An illegal UTF-8, UTF-16 or UTF-32 sequence occured, or an unsupported or invalid Windows code page value, or an invalid unicode code point value resulted from decoding a UTF-8 sequence.

    This error is masked if 0 != (16 & m_error_mask). If the error is masked and the value of m_error_code_point is a valid unicode code point, then m_error_code_point is used and parsing continues.

    @@ -138,9 +135,9 @@ Public Attributes diff --git a/6/d5/d53/class_o_n___buffer-members.html b/6/d5/d53/class_o_n___buffer-members.html index 035099ee..c3ae9333 100644 --- a/6/d5/d53/class_o_n___buffer-members.html +++ b/6/d5/d53/class_o_n___buffer-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/d55/class_o_n___user_data.html b/6/d5/d55/class_o_n___user_data.html index 81335c21..adc557e0 100644 --- a/6/d5/d55/class_o_n___user_data.html +++ b/6/d5/d55/class_o_n___user_data.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UserData Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_UserData() [1/2]

    @@ -410,8 +406,7 @@ Additional Inherited Members

    Description: DeleteAfterWrite() is used when opennurbs is writing earlier versions of 3dm archives that used some type of user data that has since become obsolete.

    -

    Parameters: archive - [in] archive that will be written to.
    - If needed, you can inspect the version of 3dm archive this is being saved and other information that you may need to determine the approprite return value. parent_object - [in] If needed, you can inspect the parent object to determine the approprite return value.

    +

    Parameters: archive - [in] archive that will be written to. If needed, you can inspect the version of 3dm archive this is being saved and other information that you may need to determine the approprite return value. parent_object - [in] If needed, you can inspect the parent object to determine the approprite return value.

    Returns: True if the user data should be written the next time the parent object is saved to a 3dm archive and then deleted.

    Remarks: Typically, DeleteAfterWrite() is used in the situation where 1) User data was used to add information to an opennurbs class whose data fields could not be modified because the SDK was fixed at the time. 2) Once the class data fields could be modified, the new data fields were added to the class and the user data from step 1 became obsolete. 3) The class's Write function is called and the value of ON_BinaryArchive::Archive3dmVersion() corresponds to the version of the 3dm archive that was being saved in step 1. The write function fills in and attaches the obsolete user data to the class. When ON_BinaryArchive::WriteObject() writes the obsolete user data to the earlier version file, it then deletes it.

    @@ -853,8 +848,7 @@ Additional Inherited Members
    -

    If m_userdata_copycount is 0, user data is not copied when object is copied. If > 0, user data is copied and m_copycount is incremented when parent object is copied. The user data's operator=() is used to copy.
    -The default ON_UserData::ON_UserData() constructor sets m_userdata_copycount to zero.

    +

    If m_userdata_copycount is 0, user data is not copied when object is copied. If > 0, user data is copied and m_copycount is incremented when parent object is copied. The user data's operator=() is used to copy. The default ON_UserData::ON_UserData() constructor sets m_userdata_copycount to zero.

    @@ -891,9 +885,9 @@ The default diff --git a/6/d5/d64/class_o_n___function_list-members.html b/6/d5/d64/class_o_n___function_list-members.html index fd355158..dc4a73dd 100644 --- a/6/d5/d64/class_o_n___function_list-members.html +++ b/6/d5/d64/class_o_n___function_list-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/d6c/opennurbs__progress__reporter_8h_source.html b/6/d5/d6c/opennurbs__progress__reporter_8h_source.html index 8c502304..6e7c6269 100644 --- a/6/d5/d6c/opennurbs__progress__reporter_8h_source.html +++ b/6/d5/d6c/opennurbs__progress__reporter_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_progress_reporter.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_progress_reporter.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/d77/opennurbs__topology_8h_source.html b/6/d5/d77/opennurbs__topology_8h_source.html index 4bcfad52..cc9c28a5 100644 --- a/6/d5/d77/opennurbs__topology_8h_source.html +++ b/6/d5/d77/opennurbs__topology_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_topology.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_topology.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/d82/opennurbs__subd_8h_source.html b/6/d5/d82/opennurbs__subd_8h_source.html index 69d7f9b3..25ebefa7 100644 --- a/6/d5/d82/opennurbs__subd_8h_source.html +++ b/6/d5/d82/opennurbs__subd_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_subd.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_subd.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_subd.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2014 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 
    18 #if 0
    19 #define ON_SUBD_CENSUS
    20 //////////////////////////////////////////////////////////////////////////
    21 //
    22 // ON_CensusCounter
    23 //
    24 // This tool is used to study memory leaks and other shared ptr issues.
    25 // The classes have no size but effect performance. Use only in
    26 // debugging situations. Never ship a release with ON_SUBD_CENSUS defined.
    27 //
    28 class ON_SUBD_CLASS ON_CensusCounter
    29 {
    30 public:
    31  enum class Class : unsigned int
    32  {
    33  unset = 0,
    34  subd = 1,
    35  subd_impl = 2,
    36  subd_limit_mesh = 3,
    37  subd_limit_mesh_impl = 4,
    38  subd_ref = 5,
    39 
    40  count
    41  };
    42 
    43  static void RegisterBirth(ON_CensusCounter::Class,ON__UINT_PTR);
    44 
    45  static void RegisterDeath(ON_CensusCounter::Class,ON__UINT_PTR);
    46 
    47  static void CensusReport(
    48  class ON_TextLog&
    49  );
    50 
    51  static void Clear();
    52 };
    53 
    54 class ON_SUBD_CLASS ON_SubDCensusCounter
    55 {
    56 public:
    57  ON_SubDCensusCounter() ON_NOEXCEPT;
    58  ~ON_SubDCensusCounter() ON_NOEXCEPT;
    59  ON_SubDCensusCounter(const ON_SubDCensusCounter&) ON_NOEXCEPT;
    60  ON_SubDCensusCounter& operator=(const ON_SubDCensusCounter&) = default;
    61  //ON_SubDCensusCounter( ON_SubDCensusCounter&& ) ON_NOEXCEPT;
    62  //ON_SubDCensusCounter& operator=( ON_SubDCensusCounter&& ) ON_NOEXCEPT;
    63 };
    64 
    65 class ON_SUBD_CLASS ON_SubDRefCensusCounter
    66 {
    67 public:
    68  ON_SubDRefCensusCounter() ON_NOEXCEPT;
    69  ~ON_SubDRefCensusCounter() ON_NOEXCEPT;
    70  ON_SubDRefCensusCounter(const ON_SubDRefCensusCounter&) ON_NOEXCEPT;
    71  ON_SubDRefCensusCounter& operator=(const ON_SubDRefCensusCounter&) = default;
    72  //ON_SubDRefCensusCounter( ON_SubDRefCensusCounter&& ) ON_NOEXCEPT;
    73  //ON_SubDRefCensusCounter& operator=( ON_SubDRefCensusCounter&& ) ON_NOEXCEPT;
    74 };
    75 
    76 
    77 class ON_SUBD_CLASS ON_SubDImpleCensusCounter
    78 {
    79 public:
    80  ON_SubDImpleCensusCounter() ON_NOEXCEPT;
    81  ~ON_SubDImpleCensusCounter() ON_NOEXCEPT;
    82  ON_SubDImpleCensusCounter(const ON_SubDImpleCensusCounter&) ON_NOEXCEPT;
    83  ON_SubDImpleCensusCounter& operator=(const ON_SubDImpleCensusCounter&) = default;
    84  //ON_SubDImplCensusCounter( ON_SubDImplCensusCounter&& ) ON_NOEXCEPT;
    85  //ON_SubDImplCensusCounter& operator=( ON_SubDImplCensusCounter&& ) ON_NOEXCEPT;
    86 };
    87 
    88 class ON_SUBD_CLASS ON_SubDLimitMeshCensusCounter
    89 {
    90 public:
    91  ON_SubDLimitMeshCensusCounter() ON_NOEXCEPT;
    92  ~ON_SubDLimitMeshCensusCounter() ON_NOEXCEPT;
    93  ON_SubDLimitMeshCensusCounter(const ON_SubDLimitMeshCensusCounter&) ON_NOEXCEPT;
    94  ON_SubDLimitMeshCensusCounter& operator=(const ON_SubDLimitMeshCensusCounter&) = default;
    95  //ON_SubDLimitMeshCensusCounter( ON_SubDLimitMeshCensusCounter&& ) ON_NOEXCEPT;
    96  //ON_SubDLimitMeshCensusCounter& operator=( ON_SubDLimitMeshCensusCounter&& ) ON_NOEXCEPT;
    97 };
    98 
    99 
    100 class ON_SUBD_CLASS ON_SubDLimitMeshImplCensusCounter
    101 {
    102 public:
    103  ON_SubDLimitMeshImplCensusCounter() ON_NOEXCEPT;
    104  ~ON_SubDLimitMeshImplCensusCounter() ON_NOEXCEPT;
    105  ON_SubDLimitMeshImplCensusCounter(const ON_SubDLimitMeshImplCensusCounter&) ON_NOEXCEPT;
    106  ON_SubDLimitMeshImplCensusCounter& operator=(const ON_SubDLimitMeshImplCensusCounter&) ON_NOEXCEPT;
    107  ON_SubDLimitMeshImplCensusCounter( ON_SubDLimitMeshImplCensusCounter&& ) ON_NOEXCEPT;
    108  ON_SubDLimitMeshImplCensusCounter& operator=( ON_SubDLimitMeshImplCensusCounter&& ) ON_NOEXCEPT;
    109 };
    110 
    111 #endif
    112 
    113 
    114 ////////////////////////////////////////////////////////////////
    115 //
    116 // Definition of subdivision surface
    117 //
    118 ////////////////////////////////////////////////////////////////
    119 
    120 #if !defined(OPENNURBS_SUBD_INC_)
    121 #define OPENNURBS_SUBD_INC_
    122 
    123 #if defined(OPENNURBS_SUBD_WIP)
    124 
    125 #if 1
    126 // SuD is exported from opennurbs DLL
    127 #define ON_SUBD_CLASS ON_CLASS
    128 #else
    129 // SuD is not exported from opennurbs DLL
    130 #define ON_SUBD_CLASS
    131 #endif
    132 
    133 class ON_SUBD_CLASS ON_SubDVertexPtr
    134 {
    135 public:
    136  // For performance reasons, m_ptr is not initialized and no constructors are declared
    137  // or implemented. If you require initialization, then use x = ON_SubDVertexPtr::Null
    138  // or x = ON_SubDVertexPtr::Create(...).
    139  ON__UINT_PTR m_ptr;
    140 
    141  static const ON_SubDVertexPtr Null;
    142 
    143  bool IsNull() const;
    144 
    145  class ON_SubDVertex* Vertex() const;
    146 
    147  ON__UINT_PTR VertexPtrMark() const;
    148 
    149  ON_ComponentStatus Status() const;
    150 
    151  static
    152  class ON_SubDVertexPtr Create(
    153  const class ON_SubDVertex* vertex
    154  );
    155 
    156  /*
    157  Parameters:
    158  vertex - [in]
    159  mark - [in]
    160  zero or one
    161  */
    162  static
    163  class ON_SubDVertexPtr Create(
    164  const class ON_SubDVertex* vertex,
    165  ON__UINT_PTR vertex_mark
    166  );
    167 
    168  static
    169  class ON_SubDVertexPtr Create(
    170  const class ON_SubDComponentPtr& vertex_component
    171  );
    172 };
    173 
    174 class ON_SUBD_CLASS ON_SubDEdgePtr
    175 {
    176 public:
    177  // For performance reasons, m_ptr is not initialized and no constructors are declared
    178  // or implemented. If you require initialization, then use x = ON_SubDEdgePtr::Null
    179  // or x = ON_SubDEdgePtr::Create(...).
    180  ON__UINT_PTR m_ptr;
    181 
    182  static const ON_SubDEdgePtr Null;
    183 
    184  bool IsNull() const;
    185 
    186  class ON_SubDEdge* Edge() const;
    187 
    188  ON__UINT_PTR EdgeDirection() const;
    189 
    190  ON_ComponentStatus Status() const;
    191 
    192  /*
    193  Returns:
    194  A pointer to the same edge with the direction flipped
    195  */
    196  ON_SubDEdgePtr Reversed() const;
    197 
    198  static ON_SubDEdgePtr Create(
    199  const class ON_SubDEdge* edge,
    200  ON__UINT_PTR direction
    201  );
    202 
    203  static ON_SubDEdgePtr Create(
    204  const class ON_SubDComponentPtr& edge_component
    205  );
    206 };
    207 
    208 class ON_SUBD_CLASS ON_SubDFacePtr
    209 {
    210 public:
    211  // For performance reasons, m_ptr is not initialized and no constructors are declared
    212  // or implemented. If you require initialization, then use x = ON_SubDFacePtr::Null
    213  // or x = ON_SubDFacePtr::Create(...).
    214  ON__UINT_PTR m_ptr;
    215 
    216  static const ON_SubDFacePtr Null;
    217 
    218  bool IsNull() const;
    219 
    220  class ON_SubDFace* Face() const;
    221 
    222  ON__UINT_PTR FaceDirection() const;
    223 
    224  ON_ComponentStatus Status() const;
    225 
    226  static
    227  class ON_SubDFacePtr Create(
    228  const class ON_SubDFace* face,
    229  ON__UINT_PTR direction
    230  );
    231 
    232  static ON_SubDFacePtr Create(
    233  const class ON_SubDComponentPtr& face_component
    234  );
    235 };
    236 
    237 class ON_SUBD_CLASS ON_SubDComponentPtr
    238 {
    239 public:
    240  // For performance reasons, m_ptr is not initialized and no constructors are declared
    241  // or implemented. If you require initialization, then use x = ON_SubDComponentPtr::Null
    242  // or x = ON_SubDComponentPtr::Create(...).
    243  ON__UINT_PTR m_ptr;
    244 
    245  static const ON_SubDComponentPtr Null;
    246 
    247  enum class ComponentPtrType : unsigned char
    248  {
    249  unset = 0,
    250  vertex = 1,
    251  edge = 2,
    252  face = 3
    253  };
    254 
    255  static ON_SubDComponentPtr::ComponentPtrType ComponentPtrTypeFromUnsigned(
    256  unsigned int component_pointer_type_as_unsigned
    257  );
    258 
    259  /*
    260  Description:
    261  ON_SubDComponentPtr::ComponentPtrType::vertex
    262  < ON_SubDComponentPtr::ComponentPtrType::edge
    263  < ON_SubDComponentPtr::ComponentPtrType::face
    264  < ON_SubDComponentPtr::ComponentPtrType::unset
    265  < invalid
    266  */
    267  static int CompareComponentPtrType(
    268  ON_SubDComponentPtr::ComponentPtrType a,
    269  ON_SubDComponentPtr::ComponentPtrType b
    270  );
    271 
    272  static int CompareType(
    273  const ON_SubDComponentPtr* a,
    274  const ON_SubDComponentPtr* b
    275  );
    276 
    277  static int Compare(
    278  const ON_SubDComponentPtr* a,
    279  const ON_SubDComponentPtr* b
    280  );
    281 
    282 
    283  bool IsNull() const;
    284  bool IsNotNull() const;
    285 
    286  ON_SubDComponentPtr::ComponentPtrType ComponentType() const;
    287 
    288  class ON_SubDComponentBase* ComponentBase() const;
    289  class ON_SubDVertex* Vertex() const;
    290  class ON_SubDEdge* Edge() const;
    291  class ON_SubDFace* Face() const;
    292 
    293  ON_SubDVertexPtr VertexPtr() const;
    294  ON_SubDEdgePtr EdgePtr() const;
    295  ON_SubDFacePtr FacePtr() const;
    296 
    297  ON_COMPONENT_INDEX ComponentIndex() const;
    298 
    299  /*
    300  Returns:
    301  0 or 1.
    302  The interpretation of the mark varies depending on the context.
    303  For vertices, this is the vertex mark.
    304  For edges, this is generally an index into ON_SubDEdge.m_vertex[]
    305  or a direction flag with 1 indicating a reversed direction.
    306  For face, this is generally an orientation flag with 1 indicating
    307  a reversed (clockwise) orientation.
    308  */
    309  ON__UINT_PTR ComponentMark() const;
    310 
    311  ON_ComponentStatus Status() const;
    312 
    313  /*
    314  Returns:
    315  1: status changed.
    316  0: status not changed.
    317  */
    318  unsigned int SetStates(
    319  ON_ComponentStatus states_to_set
    320  );
    321 
    322  /*
    323  Returns:
    324  1: status changed.
    325  0: status not changed.
    326  */
    327  unsigned int ClearStates(
    328  ON_ComponentStatus states_to_clear
    329  );
    330 
    331  /*
    332  Description:
    333  Makes "this" an exact copy of status.
    334  Parameters:
    335  status - [in]
    336  Returns:
    337  1: status changed.
    338  0: status not changed.
    339  */
    340  unsigned int SetStatus(
    341  ON_ComponentStatus status
    342  );
    343 
    344  static ON_SubDComponentPtr ClearMark(
    345  ON_SubDComponentPtr component_ptr
    346  );
    347 
    348  static
    349  class ON_SubDComponentPtr Create(
    350  const class ON_SubDVertex* vertex
    351  );
    352 
    353  static
    354  class ON_SubDComponentPtr Create(
    355  const class ON_SubDEdge* edge
    356  );
    357 
    358  static
    359  class ON_SubDComponentPtr Create(
    360  const class ON_SubDFace* face
    361  );
    362 
    363  static
    364  class ON_SubDComponentPtr Create(
    365  const class ON_SubDVertex* vertex,
    366  ON__UINT_PTR vertex_mark
    367  );
    368 
    369  static
    370  class ON_SubDComponentPtr Create(
    371  const class ON_SubDEdge* edge,
    372  ON__UINT_PTR edge_mark
    373  );
    374 
    375  static
    376  class ON_SubDComponentPtr Create(
    377  const class ON_SubDFace* face,
    378  ON__UINT_PTR face_mark
    379  );
    380 
    381  static
    382  class ON_SubDComponentPtr Create(
    383  ON_SubDVertexPtr vertexptr
    384  );
    385 
    386  static
    387  class ON_SubDComponentPtr Create(
    388  ON_SubDEdgePtr edgeptr
    389  );
    390 
    391  static
    392  class ON_SubDComponentPtr Create(
    393  ON_SubDFacePtr faceptr
    394  );
    395 };
    396 
    397 /*
    398 Description:
    399  The ON_SubDComponentLocation enum is used when an ON_SubD component
    400  is referenced and it is important to distinguish between the
    401  component's location in the SubD control net and its location
    402  in the SubD limit surface.
    403 */
    404 enum class ON_SubDComponentLocation : unsigned char
    405 {
    406  Unset = 0,
    407  ControlNet = 1,
    408  LimitSurface = 2
    409 };
    410 
    411 //////////////////////////////////////////////////////////////////////////
    412 //
    413 // ON_SubD
    414 //
    415 class ON_SUBD_CLASS ON_SubD : public ON_Geometry
    416 {
    417  ON_OBJECT_DECLARE(ON_SubD);
    418 
    419 #if defined(ON_SUBD_CENSUS)
    420 private:
    421  ON_SubDCensusCounter m_census_counter;
    422 #endif
    423 
    424 public:
    425  static const ON_SubD Empty;
    426 
    427  enum : unsigned int
    428  {
    429  maximum_subd_level = 128 // uses as a sanity check on input parameters
    430  };
    431 
    432 #pragma region RH_C_SHARED_ENUM [ON_SubD::VertexTag] [Rhino.Geometry.SubD.SubDVertexTag] [nested:byte]
    433  /// <summary>
    434  /// SubD::VertexTag identifies the type of subdivision vertex. Different tags use
    435  /// different subdivision algorithms to determine where the subdivision point and
    436  /// limit point are located. There are toplological constraints that restrict which
    437  /// tags can be assigned.
    438  /// </summary>
    439  enum class VertexTag : unsigned char
    440  {
    441  ///<summary>
    442  /// Not a valid vertex tag and the default value for ON_SubDVertex::m_vertex_tag.
    443  /// This encourages developers to thoughtfully initialize ON_SubDVertex::m_vertex_tag.
    444  ///</summary>
    445  Unset = 0,
    446 
    447  ///<summary>
    448  /// Must be an interior vertex.
    449  /// All edges ending at a smooth vertex must be tagged as ON_SubD::EdgeTag::Smooth.
    450  ///</summary>
    451  Smooth = 1,
    452 
    453  ///<summary>
    454  /// Can be an iterior or a boundary vertex.
    455  /// Exactly two edges ending at a crease vertex must be tagged as ON_SubD::EdgeTag::Crease.
    456  /// All other edges ending at a crease must be tagged as tagON_SubD::EdgeTag::smooth.
    457  ///</summary>
    458  Crease = 2,
    459 
    460  ///<summary>
    461  /// Can be an iterior, boundary or isolated vertex.
    462  /// The location of a corner vertex is fixed.
    463  /// The all subdivision points and the limit point are at the initial vertex location.
    464  /// The edges ending at a corner vertex can be smooth or crease edges.
    465  ///</summary>
    466  Corner = 3,
    467 
    468  ///<summary>
    469  /// Must be an interior vertex.
    470  /// Exactly one edge ending at a dart vertex must be tagged as ON_SubD::EdgeTag::Smooth.
    471  /// All other edges ending at a dart vertex must be tagged as tagON_SubD::EdgeTag::smooth.
    472  ///</summary>
    473  Dart = 4
    474  };
    475 #pragma endregion
    476 
    477  static ON_SubD::VertexTag VertexTagFromUnsigned(
    478  unsigned int vertex_tag_as_unsigned
    479  );
    480 
    481  /*
    482  Parameters:
    483  vertex_tag - [in]
    484  Returns:
    485  True if vertex_tag is Smooth, Crease, Corner, or Dart.
    486  False otherwise.
    487  */
    488  static bool VertexTagIsSet(
    489  ON_SubD::VertexTag vertex_tag
    490  );
    491 
    492 #pragma region RH_C_SHARED_ENUM [ON_SubD::EdgeTag] [Rhino.Geometry.SubD.SubDEdgeTag] [nested:byte]
    493  /// <summary>
    494  /// SubD::EdgeTag identifies the type of subdivision edge. Different tags use
    495  /// different subdivision algorithms to determine where the subdivision point is located.
    496  /// </summary>
    497  enum class EdgeTag : unsigned char
    498  {
    499  ///<summary>
    500  /// Not a valid edge tag and the default value for ON_SubDEdge::m_edge_tag.
    501  /// This encourages developers to thoughtfully initialize ON_SubDEdge::m_edge_tag.
    502  ///</summary>
    503  Unset = 0,
    504 
    505  ///<summary>
    506  /// One or two of the edge's vertices must be tagged as ON_SubD::VertexTag::Smooth.
    507  /// The edge must have exactly two faces.
    508  ///</summary>
    509  Smooth = 1,
    510 
    511  ///<summary>
    512  /// Both of the edge's vertices must be tagged as not ON_SubD::VertexTag::Smooth.
    513  /// The edge can have any number of faces.
    514  ///</summary>
    515  Crease = 2,
    516 
    517  ///<summary>
    518  /// Reserved for version 2 of the ON_SubD project.
    519  /// Currently this tag is not used and is invalid.
    520  ///
    521  /// FUTURE: The edge is a "soft crease" or "semi-sharp".
    522  /// At lease one end vertex must be tagged as ON_SubD::VertexTag::Smooth
    523  /// The edge must have exactly two faces.
    524  /// The value of ON_SubDEdge::m_sharpness controls how
    525  /// soft/hard the edge appears.
    526  /// ON_SubDEdge::m_sharpness = 0 is identical to ON_SubD::EdgeTag::Smooth.
    527  /// ON_SubDEdge::m_sharpness = 1 is identical to ON_SubD::EdgeTag::Crease.
    528  ///</summary>
    529  Sharp = 3,
    530 
    531  ///<summary>
    532  /// This tag appears only on edges that have exactly two neighboring faces
    533  /// and neither end vertex is tagged as ON_SubD::VertexTag::Smooth.
    534  /// The level 1 subdivision point for a level 0 edge tagged as ON_SubD::EdgeTag::X
    535  /// is the standard smooth edge subdivision point.
    536  /// When subdivided, the new subdivision vertex will be tagged
    537  /// as ON_SubD::VertexTag::Smooth and the subdivided edges will
    538  /// be tagged as ON_SubD::EdgeTag::Smooth. Thus, the tag ON_SubD::EdgeTag::X
    539  /// should only appear at level 0.
    540  /// This tag exists because the ON_SubD subdivision
    541  /// algorithm requires any edge with both end vertices
    542  /// tagged as not smooth must be subdivided at its midpoint.
    543  /// Sector iterators treat "X" edges as smooth.
    544  /// Both edge end weights must be set so the smooth
    545  /// subdivided edges will be valid.
    546  ///</summary>
    547  X = 4
    548  };
    549 #pragma endregion
    550 
    551  static ON_SubD::EdgeTag EdgeTagFromUnsigned(
    552  unsigned int edge_tag_as_unsigned
    553  );
    554 
    555 
    556  /*
    557  Parameters:
    558  edge_tag - [in]
    559  Returns:
    560  True if edge_tag is Smooth, Crease, Sharp, or X.
    561  False otherwise.
    562  */
    563  static bool EdgeTagIsSet(
    564  ON_SubD::EdgeTag edge_tag
    565  );
    566 
    567 
    568 #pragma region RH_C_SHARED_ENUM [ON_SubD::FacetType] [Rhino.Geometry.SubD.SubDFacetType] [nested:byte]
    569  /// <summary>
    570  /// SubD::FacetType reports the default facet type for subdivision algorithms.
    571  /// </summary>
    572  enum class FacetType : unsigned char
    573  {
    574  ///<summary> Not a valid facet type. </summary>
    575  Unset = 0,
    576 
    577  ///<summary> Triangle </summary>
    578  Tri = 3,
    579 
    580  ///<summary> Quadrangle </summary>
    581  Quad = 4
    582  };
    583 #pragma endregion
    584 
    585  static ON_SubD::FacetType FacetTypeFromUnsigned(
    586  unsigned int facet_type_as_unsigned
    587  );
    588 
    589  //enum class VertexEdgeOrder : unsigned char
    590  //{
    591  // unset = 0,
    592  // radial, // The ON_SubDVertex edge and face information satisfies:
    593  // // 1) m_face_count = m_edge_count or m_face_count+1 == m_edge_count
    594  // // 2) m_faces[i] is between m_edges[i] and m_edges[(i+1)%m_edge_count]
    595  // // 3) When 0 < i < m_edge_count-1, m_edges[i].m_edge_count = 2
    596  // // and m_edges[i].m_face2[] references m_faces[i-1] and m_faces[i]
    597  // // in an unspecified order.
    598  // notradial // one of the conditions conditions for radial is not satisfied.
    599  //};
    600 
    601  //static ON_SubD::VertexEdgeOrder VertexEdgeOrderFromUnsigned(
    602  // unsigned int vertex_edge_order_as_unsigned
    603  // );
    604 
    605 #pragma region RH_C_SHARED_ENUM [ON_SubD::VertexFacetType] [Rhino.Geometry.SubD.VertexFacetType] [nested:byte]
    606 
    607  ///<summary>Summarizes the number of edges in faces in the whole object.</summary>
    608  enum class VertexFacetType : unsigned char
    609  {
    610  ///<summary>Not a valid vertex face type.</summary>
    611  Unset = 0,
    612 
    613  ///<summary>All faces are triangular.</summary>
    614  Tri = 3,
    615 
    616  ///<summary>All faces are quads.</summary>
    617  Quad = 4,
    618 
    619  ///<summary>Edge count of faces is constant and &gt; 4.</summary>
    620  Ngon = 5,
    621 
    622  ///<summary>Edge count of faces is not constant.</summary>
    623  Mixed = 0xFF
    624  };
    625 #pragma endregion
    626 
    627  static ON_SubD::VertexFacetType VertexFacetTypeFromUnsigned(
    628  unsigned int vertex_facet_type_as_unsigned
    629  );
    630 
    631 #pragma region RH_C_SHARED_ENUM [ON_SubD::SubDType] [Rhino.Geometry.SubD.SubDType] [nested:byte]
    632  /// <summary>
    633  /// Subdivision algorithm.
    634  /// </summary>
    635  enum class SubDType : unsigned char
    636  {
    637  ///<summary>
    638  /// Not a valid subdivision type.
    639  ///</summary>
    640  Unset = 0,
    641 
    642  ///<summary>
    643  /// Built-in Loop-Warren triangle with Bernstein-Levin-Zorin creases and darts.
    644  ///</summary>
    645  TriLoopWarren = 3,
    646 
    647  ///<summary>
    648  /// Built-in Catmull-Clark quad with Bernstein-Levin-Zorin creases and darts.
    649  ///</summary>
    650  QuadCatmullClark = 4,
    651 
    652  ///<summary>
    653  /// Custom triangle face algorithm. (Not built-in. Provided for use by 3rd party developers.)
    654  ///</summary>
    655  CustomTri = 5,
    656 
    657  ///<summary>
    658  /// Custom quad facet algorithm. (Not built-in. Provided for use by 3rd party developers.)
    659  ///</summary>
    660  CustomQuad = 6,
    661 
    662  ///<summary>
    663  /// Custom algorithm. (Not built-in. Provided for use by 3rd party developers.)
    664  ///</summary>
    665  Custom = 7
    666 
    667  // All values must be <= 31; i.e., (((unsigned char)0xE0U) & subd_type)) must be zero.
    668  };
    669 #pragma endregion
    670 
    671  static ON_SubD::SubDType SubDTypeFromUnsigned(
    672  unsigned int subd_type_as_unsigned
    673  );
    674 
    675  static ON_SubD::SubDType DefaultSubDType();
    676 
    677  static unsigned int FacetEdgeCount(
    678  ON_SubD::FacetType facet_type
    679  );
    680 
    681  static unsigned int FacetEdgeCount(
    682  ON_SubD::SubDType subd_type
    683  );
    684 
    685  /*
    686  Parameters:
    687  sit - [in]
    688  vertex sector iterator
    689  component_ring_capacity - [in]
    690  capacity of component_ring[] array
    691  1 + center_vertex.m_edge_count + center_vertex.m_face_count
    692  will be large enough.
    693  component_ring - [out]
    694  A sorted list of ON_SubDComponentPtr values are returned in component_ring[]
    695  component_ring[0] is the central vertex.
    696  component_ring[1] and subsequent components with odd indices are sector edges.
    697  component_ring[2] and subsequent components with even indices are sector faces.
    698  For edge components (i is odd), component_ring[i].ComponentMark() is the index of
    699  the center vertex in ON_SubDEge.m_vertex[].
    700  Returns:
    701  Number of components set in component_ring[].
    702 
    703  0: failure
    704 
    705  >= 4 and even:
    706  component_ring[0] = center vertex
    707  component_ring[1] = starting crease edge
    708  component_ring[2] = starting face
    709  ... zero or more interior smooth edge, face pairs ...
    710  component_ring[component_count-1] = ending crease edge
    711 
    712  >= 5 and odd:
    713  component_ring[0] = vit.CenterVertex()
    714  component_ring[1] = first edge (smooth)
    715  component_ring[2] = first face
    716  ... zero or more smooth edge, face, pairs ...
    717  component_ring[component_count-2] = last edge (smooth)
    718  component_ring[component_count-1] = last face
    719 
    720  Example:
    721  unsinged int component_ring_count = GetVertexComponentRing(vit,component_ring);
    722  unsinged int N = component_ring_count/2; // number of edges in ring
    723  const bool bSectorHasCreaseBoundary = (0 == (component_ring_count % 2));
    724  */
    725  static unsigned int GetSectorComponentRing(
    726  const class ON_SubDSectorIterator& sit,
    727  size_t component_ring_capacity,
    728  ON_SubDComponentPtr* component_ring
    729  );
    730 
    731  /*
    732  Parameters:
    733  sit - [in]
    734  vertex sector iterator
    735  component_ring - [out]
    736  A sorted listof ON_SubDComponentPtr values are returned in component_ring[]
    737 
    738 
    739 
    740  Returns:
    741  Number of components set in component_ring[].
    742 
    743  0: failure
    744 
    745  >= 4 and even:
    746  component_ring[0] = vit.CenterVertex()
    747  component_ring[1] = starting crease edge
    748  component_ring[2] = starting face
    749  ... zero or more interior smooth edge, face pairs ...
    750  component_ring[component_count-1] = ending crease edge
    751 
    752  >= 5 and odd:
    753  component_ring[0] = center vertex
    754  component_ring[1] = first edge (smooth)
    755  component_ring[2] = first face
    756  ... zero or more smooth edge, face, pairs ...
    757  component_ring[component_count-2] = last edge (smooth)
    758  component_ring[component_count-1] = last face
    759 
    760  Example:
    761  unsinged int component_ring_count = GetVertexComponentRing(vit,component_ring);
    762  unsinged int N = component_ring_count/2; // number of edges in ring
    763  const bool bSectorHasCreaseBoundary = (0 == (component_ring_count % 2));
    764  */
    765  static unsigned int GetSectorComponentRing(
    766  const class ON_SubDSectorIterator& sit,
    768  );
    769 
    770  /*
    771  Returns:
    772  Number of edges in an component ring returned by ON_SubD::GetVertexComponentRing();
    773  */
    774  static unsigned int ComponentRingEdgeCount(
    775  size_t component_ring_count
    776  );
    777 
    778  /*
    779  Returns:
    780  Number of faces in an component ring returned by ON_SubD::GetVertexComponentRing();
    781  */
    782  static unsigned int ComponentRingFaceCount(
    783  size_t component_ring_count
    784  );
    785 
    786  static bool ComponentRingIsValid(
    787  size_t component_ring_count,
    788  const ON_SubDComponentPtr* component_ring
    789  );
    790 
    791  /*
    792  Returns:
    793  Number of points in the subdivision ring or 0 if the call fails.
    794  */
    795  static unsigned int GetSectorSubdivsionPointRing(
    796  ON_SubD::SubDType subd_type,
    797  size_t component_ring_count,
    798  const ON_SubDComponentPtr* component_ring,
    799  size_t point_ring_capacity,
    800  size_t point_ring_stride,
    801  double* point_ring
    802  );
    803 
    804  static unsigned int GetSectorSubdivisionPointRing(
    805  ON_SubD::SubDType subd_type,
    806  size_t component_ring_count,
    807  const ON_SubDComponentPtr* component_ring,
    808  ON_SimpleArray<ON_3dPoint>& subd_point_ring
    809  );
    810 
    811  static unsigned int GetSectorPointRing(
    812  ON_SubD::SubDType subd_type,
    813  bool bSubdivideIfNeeded,
    814  size_t component_ring_count,
    815  const ON_SubDComponentPtr* component_ring,
    816  size_t subd_point_ring_capacity,
    817  size_t subd_point_ring_stride,
    818  double* subd_point_ring
    819  );
    820 
    821  static unsigned int GetSectorPointRing(
    822  ON_SubD::SubDType subd_type,
    823  bool bSubdivideIfNeeded,
    824  size_t component_ring_count,
    825  const ON_SubDComponentPtr* component_ring,
    826  ON_SimpleArray<ON_3dPoint>& point_ring
    827  );
    828 
    829  static unsigned int GetSectorPointRing(
    830  ON_SubD::SubDType subd_type,
    831  bool bSubdivideIfNeeded,
    832  const class ON_SubDSectorIterator& sit,
    833  size_t point_ring_capacity,
    834  size_t point_ring_stride,
    835  double* point_ring
    836  );
    837 
    838  static unsigned int GetSectorPointRing(
    839  ON_SubD::SubDType subd_type,
    840  bool bSubdivideIfNeeded,
    841  const class ON_SubDSectorIterator& sit,
    842  ON_SimpleArray<ON_3dPoint>& point_ring
    843  );
    844 
    845  /*
    846  Parameters:
    847  subd_type - [in]
    848  A quad based subdivision algorithm.
    849  bFirstPass - [in]
    850  If bFirstPass is true and the components are in standard form for the vertex
    851  and subdivision type, then locations of the component vertices opposite the
    852  center vertex are returned in the point ring.
    853  bSecondPass - [in]
    854  If bSecondtPass is true and the first pass is disable or does not succeed,
    855  then the component subdivision locations are returned in the point ring.
    856  vertex0 - [in]
    857  If not null, then vertex0->m_edges and vertex0->m_faces must
    858  be radially sorted and span a single sector and component_ring[]
    859  is ignored.
    860  component_ring_count - [in]
    861  If vertex0 is null, then component_ring_count specifies the number
    862  of components in the component_ring[] array.
    863  component_ring[] - [in]
    864  If vertex0 is null, then component_ring[0] is the central vertex,
    865  component_ring[1] and subsequent components with odd indices are
    866  sector edges, component_ring[2] and subsequent components with even
    867  indices are sector faces, all sorted radially.
    868  point_ring_stride - [in]
    869  point_ring - [out]
    870  point locations are returned here.
    871  Returns:
    872  Number of points in the subdivision ring or 0 if the call fails.
    873  The number of points is
    874  1 + ON_SubD::ComponentRingEdgeCount(component_ring_count) + ON_SubD::ComponentRingFaceCount(component_ring_count).
    875  Remarks:
    876  No validation checking is performed. This function will crash
    877  if the input is not valid. Call GetSubdivisionPointRing() if
    878  you want a crash proof call.
    879  */
    880  static unsigned int GetQuadSectorPointRing(
    881  ON_SubD::SubDType subd_type,
    882  bool bFirstPass,
    883  bool bSecondPass,
    884  const class ON_SubDVertex* vertex0,
    885  size_t component_ring_count,
    886  const class ON_SubDComponentPtr* component_ring,
    887  size_t point_ring_stride,
    888  double* point_ring
    889  );
    890 
    891  /*
    892  Parameters:
    893  subd_type - [in]
    894  A tri based subdivision algorithm.
    895  bFirstPass - [in]
    896  If bFirstPass is true and the components are in standard form for the vertex
    897  and subdivision type, then locations of the component vertices opposite the
    898  center vertex are returned in the point ring.
    899  bSecondPass - [in]
    900  If bSecondPass is true and the first pass is disable or does not succeed,
    901  then the component subdivision locations are returned in the point ring.
    902  vertex0 - [in]
    903  If not null, then vertex0->m_edges and vertex0->m_faces must
    904  be radially sorted and span a single sector and component_ring[]
    905  is ignored.
    906  component_ring_count - [in]
    907  If vertex0 is null, then component_ring_count specifies the number
    908  of components in the component_ring[] array.
    909  component_ring[] - [in]
    910  If vertex0 is null, then component_ring[0] is the central vertex,
    911  component_ring[1] and subsequent components with odd indices are
    912  sector edges, component_ring[2] and subsequent components with even
    913  indices are sector faces, all sorted radially.
    914  point_ring_stride - [in]
    915  point_ring - [out]
    916  point locations are returned here.
    917  Returns:
    918  Number of points in the subdivision ring or 0 if the call fails.
    919  The number of points is 1 + ON_SubD::ComponentRingEdgeCount(component_ring_count).
    920  Remarks:
    921  No validation checking is performed. This function will crash
    922  if the input is not valid. Call GetSubdivisionPointRing() if
    923  you want a crash proof call.
    924  */
    925  static unsigned int GetTriSectorPointRing(
    926  ON_SubD::SubDType subd_type,
    927  bool bFirstPass,
    928  bool bSecondPass,
    929  const class ON_SubDVertex* vertex0,
    930  size_t component_ring_count,
    931  const class ON_SubDComponentPtr* component_ring,
    932  size_t point_ring_stride,
    933  double* point_ring
    934  );
    935 
    936  static const class ON_SubDVertex* SubdivideSector(
    937  ON_SubD::SubDType subd_type,
    938  const class ON_SubDVertex* center_vertex,
    939  size_t component_ring_count,
    940  const class ON_SubDComponentPtr* component_ring,
    941  class ON_SubD_FixedSizeHeap& fsh
    942  );
    943 
    944  /*
    945  Returns:
    946  true if sector_edge_count is valid for the vertex type
    947  */
    948  static bool IsValidSectorEdgeCount(
    949  ON_SubD::VertexTag vertex_tag,
    950  unsigned int sector_edge_count
    951  );
    952 
    953  static bool IsValidSectorFaceCount(
    954  ON_SubD::VertexTag vertex_tag,
    955  unsigned int sector_face_count
    956  );
    957 
    958  /*
    959  Returns:
    960  Type of facets the basic subdivision algorithm requires.
    961  ON_SubD::FacetType::Quad if subd_type is ON_SubD::SubDType::TriLoopWarren.
    962  ON_SubD::FacetType::Tri if subd_type is ON_SubD::SubDType::QuadCatmullClark.
    963  ON_SubD::FacetType::Unset otherwise.
    964  Remark:
    965  All built in subdivision algorithm will handle faces with 3 or more edges.
    966  */
    967  static ON_SubD::FacetType FacetTypeFromSubDType(
    968  ON_SubD::SubDType subd_type
    969  );
    970 
    971  static ON_SubD::SubDType SubDTypeFromFacetType(
    972  ON_SubD::FacetType facet_type
    973  );
    974 
    975  static bool PointRingHasFacePoints(
    976  ON_SubD::SubDType subd_type
    977  );
    978 
    979  /*
    980  Returns:
    981  true if facet_type is ON_SubD::FacetType::Tri or ON_SubD::FacetType::Quad.
    982  */
    983  static bool IsQuadOrTriFacetType(
    984  ON_SubD::FacetType facet_type
    985  );
    986 
    987  /*
    988  Returns:
    989  true if subd_type is ON_SubD::SubDType::TriLoopWarren or ON_SubD::SubDType::QuadCatmullClark.
    990  */
    991  static bool IsQuadOrTriSubDType(
    992  ON_SubD::SubDType subd_type
    993  );
    994 
    995  ON_SubD() ON_NOEXCEPT;
    996  virtual ~ON_SubD();
    997 
    998  /*
    999  Description:
    1000  Creates an independent copy of src.
    1001  */
    1002  ON_SubD( const ON_SubD& src );
    1003 
    1004  /*
    1005  Description:
    1006  Creates an independent copy of src.
    1007  */
    1008  ON_SubD& operator=(const ON_SubD& src);
    1009 
    1010 #if defined(ON_HAS_RVALUEREF)
    1011  // rvalue copy constructor
    1012  ON_SubD( ON_SubD&& ) ON_NOEXCEPT;
    1013 
    1014  // The rvalue assignment operator calls ON_Object::operator=(ON_Object&&)
    1015  // which could throw exceptions. See the implementation of
    1016  // ON_Object::operator=(ON_Object&&) for details.
    1017  ON_SubD& operator=( ON_SubD&& );
    1018 #endif
    1019 
    1020  /*
    1021  Description:
    1022  The subdivision information referenced by src_subd will be shared with this
    1023  Remarks:
    1024  ON_Geometry base class information, like ON_UserData, is not copied or shared.
    1025  */
    1026  void ShareContentsFrom(
    1027  ON_SubD& subd
    1028  );
    1029 
    1030  static void SwapContents(
    1031  ON_SubD& a,
    1032  ON_SubD& b
    1033  );
    1034 
    1035  //virtual
    1036  void MemoryRelocate() override;
    1037 
    1038  //virtual
    1039  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    1040 
    1041  //virtual
    1042  void Dump(
    1043  ON_TextLog&
    1044  ) const override;
    1045 
    1046  //virtual
    1047  unsigned int SizeOf() const override;
    1048 
    1049  //virtual
    1050  ON__UINT32 DataCRC(
    1051  ON__UINT32 current_remainder
    1052  ) const override;
    1053 
    1054  //virtual
    1055  bool Write(
    1056  ON_BinaryArchive& archive
    1057  ) const override;
    1058 
    1059  //virtual
    1060  bool Read(
    1061  ON_BinaryArchive& archive
    1062  ) override;
    1063 
    1064  //virtual
    1065  ON::object_type ObjectType() const override;
    1066 
    1067 
    1068  //virtual
    1069  unsigned int ClearComponentStates(
    1070  ON_ComponentStatus states_to_clear
    1071  ) const override;
    1072 
    1073  //virtual
    1074  unsigned int GetComponentsWithSetStates(
    1075  ON_ComponentStatus states_filter,
    1076  bool bAllEqualStates,
    1078  ) const override;
    1079 
    1080  //virtual
    1081  unsigned int SetComponentStates(
    1082  ON_COMPONENT_INDEX component_index,
    1083  ON_ComponentStatus states_to_set
    1084  ) const override;
    1085 
    1086  //virtual
    1087  unsigned int ClearComponentStates(
    1088  ON_COMPONENT_INDEX component_index,
    1089  ON_ComponentStatus states_to_clear
    1090  ) const override;
    1091 
    1092  //virtual
    1093  unsigned int SetComponentStatus(
    1094  ON_COMPONENT_INDEX component_index,
    1095  ON_ComponentStatus status_to_copy
    1096  ) const override;
    1097 
    1098  //virtual
    1100 
    1101  //virtual
    1102  void MarkAggregateComponentStatusAsNotCurrent() const override;
    1103 
    1104  //virtual
    1105  bool DeleteComponents(
    1106  const ON_COMPONENT_INDEX* ci_list,
    1107  size_t ci_count
    1108  ) override;
    1109 
    1110  /*
    1111  Remarks:
    1112  For ON_SubD objects, ClearBoundingBox() and DestroyRuntimeCache()
    1113  are identical.
    1114  */
    1115  //virtual
    1116  void DestroyRuntimeCache(
    1117  bool bDelete = true
    1118  ) override;
    1119 
    1120  //virtual
    1121  int Dimension() const override;
    1122 
    1123  // virtual ON_Geometry GetBBox override
    1124  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1125 
    1126  // virtual ON_Geometry GetTightBoundingBox override
    1127  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    1128 
    1129  /*
    1130  Description:
    1131  Clears all saved information that depends on vertex locations,
    1132  subdivision algorithms, vertex or edge tags, or control net topology.
    1133  If you modify any of the above, then call ClearBoundingBox().
    1134  Remarks:
    1135  For ON_SubD objects, ClearBoundingBox() and DestroyRuntimeCache()
    1136  are identical.
    1137  */
    1138  //virtual
    1139  void ClearBoundingBox() override;
    1140 
    1141  //virtual
    1142  bool Transform(
    1143  const ON_Xform& xform
    1144  ) override;
    1145 
    1146  //virtual
    1147  bool IsDeformable() const override;
    1148 
    1149  //virtual
    1150  bool MakeDeformable() override;
    1151 
    1152  //virtual
    1153  bool SwapCoordinates(
    1154  int i,
    1155  int j
    1156  ) override;
    1157 
    1158 
    1159 
    1160  //virtual
    1161  bool HasBrepForm() const override;
    1162 
    1163  //virtual
    1164  ON_Brep* BrepForm(
    1165  ON_Brep* brep = nullptr
    1166  ) const override;
    1167 
    1168  //virtual
    1169  ON_COMPONENT_INDEX ComponentIndex() const override;
    1170 
    1171  //virtual
    1172  bool EvaluatePoint(
    1173  const class ON_ObjRef& objref,
    1174  ON_3dPoint& P
    1175  ) const override;
    1176 
    1177  /*
    1178  Description:
    1179  Uses the input mesh to define the level zero control polygon.
    1180  Parameters:
    1181  level_zero_mesh - [in]
    1182  from_mesh_parameters - [in]
    1183  To get the smoothest possible result, pass nullptr
    1184  or ON_SubDFromMeshOptions::Smooth. To get a sub-D with interior
    1185  creases use other static ON_SubDFromMeshOptions values or
    1186  create one with custom settings.
    1187  */
    1188  static ON_SubD* CreateFromMesh(
    1189  const class ON_Mesh* level_zero_mesh,
    1190  const class ON_SubDFromMeshOptions* from_mesh_parameters,
    1191  ON_SubD* subd
    1192  );
    1193 
    1194  unsigned int DumpTopology(
    1195  ON_TextLog&
    1196  ) const;
    1197 
    1198  unsigned int DumpTopology(
    1199  ON_2udex vertex_id_range,
    1200  ON_2udex edge_id_range,
    1201  ON_2udex face_id_range,
    1202  ON_TextLog&
    1203  ) const;
    1204 
    1205  /*
    1206  Description:
    1207  Discard all contents of this ON_SubD.
    1208  Remarks:
    1209  More efficient than Destroy() if this ON_SubD will be reused soon.
    1210  */
    1211  void Clear();
    1212 
    1213  /*
    1214  Description:
    1215  Delete all contents release all memory used by this ON_SubD.
    1216  */
    1217  void Destroy();
    1218 
    1219  ON_SubD::SubDType ActiveLevelSubDType() const;
    1220 
    1221  /*
    1222  Returns:
    1223  The number of explicitly computed levels that are currently available.
    1224  A value of 0 indicates this SubD is empty.
    1225  */
    1226  unsigned int LevelCount() const;
    1227 
    1228  /*
    1229  Returns:
    1230  If the SubD is not empty, then the index of the active level is returned. This value will be < LevelCount().
    1231  If the SubD is empty, then ON_UNSET_UINT_INDEX is returned.
    1232  */
    1233  unsigned int ActiveLevelIndex() const;
    1234 
    1235  /*
    1236  Description:
    1237  Remove subdivision levels
    1238  Paramters:
    1239  max_level_count - [in]
    1240  Maximum number of levels to keep.
    1241  */
    1242  void ClearSubdivisionLevels(
    1243  unsigned int max_level_index
    1244  );
    1245 
    1246  bool IsEmpty() const;
    1247 
    1248 
    1249  /*
    1250  Description:
    1251  Get aggregate edge demographics for the subd.
    1252  Returns:
    1253  Bitwise or of ON_ComponentAttributes::EdgeFlags values for every edge in the subd.
    1254  */
    1255  unsigned int EdgeFlags() const;
    1256 
    1257  /////////////////////////////////////////////////////////
    1258  //
    1259  // Component (Vertex, Edge, Face) access
    1260  //
    1261  ON_SubDComponentPtr ComponentPtrFromComponentIndex(
    1262  ON_COMPONENT_INDEX component_index
    1263  ) const;
    1264 
    1265  unsigned int ComponentPtrFromComponentIndex(
    1266  const ON_COMPONENT_INDEX* ci_list,
    1267  size_t ci_count,
    1269  ) const;
    1270 
    1271  unsigned int ComponentPtrFromComponentIndex(
    1272  const ON_COMPONENT_INDEX* ci_list,
    1273  size_t ci_count,
    1274  bool bIncludeVertices,
    1275  bool bIncludeEdges,
    1276  bool bIncludeFaces,
    1278  ) const;
    1279 
    1280  /////////////////////////////////////////////////////////
    1281  //
    1282  // Vertex access
    1283  //
    1284 
    1285  unsigned int VertexCount() const;
    1286 
    1287  const class ON_SubDVertex* FirstVertex() const;
    1288 
    1289  class ON_SubDVertexIterator VertexIterator() const;
    1290 
    1291  class ON_SubDVertexArray VertexArray() const;
    1292 
    1293  /*
    1294  Parameters:
    1295  vertex_id - [in]
    1296  Returns:
    1297  If vertex_id identifies a valid vertex in this ON_SubD, then
    1298  a pointer to that vertex is returned.
    1299  Otherwise, nullptr is returned.
    1300  */
    1301  const class ON_SubDVertex* VertexFromId(
    1302  unsigned int vertex_id
    1303  ) const;
    1304 
    1305  /////////////////////////////////////////////////////////
    1306  //
    1307  // Edge access
    1308  //
    1309 
    1310  unsigned int EdgeCount() const;
    1311 
    1312  const class ON_SubDEdge* FirstEdge() const;
    1313 
    1314  class ON_SubDEdgeIterator EdgeIterator() const;
    1315 
    1316  class ON_SubDEdgeArray EdgeArray() const;
    1317 
    1318  /*
    1319  Parameters:
    1320  edge_id - [in]
    1321  Returns:
    1322  If edge_id identifies a valid edge in this ON_SubD, then
    1323  a pointer to that edge is returned.
    1324  Otherwise, nullptr is returned.
    1325  */
    1326  const class ON_SubDEdge* EdgeFromId(
    1327  unsigned int edge_id
    1328  ) const;
    1329 
    1330  /////////////////////////////////////////////////////////
    1331  //
    1332  // Face access
    1333  //
    1334 
    1335  unsigned int FaceCount() const;
    1336 
    1337  const class ON_SubDFace* FirstFace() const;
    1338 
    1339  class ON_SubDFaceIterator FaceIterator() const;
    1340 
    1341  class ON_SubDFaceArray FaceArray() const;
    1342 
    1343  /*
    1344  Parameters:
    1345  face_id - [in]
    1346  Returns:
    1347  If face_id identifies a valid face in this ON_SubD, then
    1348  a pointer to that face is returned.
    1349  Otherwise, nullptr is returned.
    1350  */
    1351  const class ON_SubDFace* FaceFromId(
    1352  unsigned int face_id
    1353  ) const;
    1354 
    1355  /////////////////////////////////////////////////////////
    1356  //
    1357  // Component (vertex, edge, face) state ( selected, highlighted, ... ) tools
    1358  // NOTE:
    1359  // All component status settings are mutable
    1360  // All are copied.
    1361  // None are saved.
    1362  //
    1363 
    1364  /*
    1365  Parameters:
    1366  states_filter - [in]
    1367  bAllEqualStates - [in]
    1368  If a state is set in states_filter, all active level components
    1369  with the same state set will be included in the
    1370  components_with_set_states[] array.
    1371  If bAllEqualStates is true, then ON_ComponentStatus::AllEqualStates()
    1372  is used to test for inclusion.
    1373  If bAllEqualStates is false, then ON_ComponentStatus::SomeEqualStates()
    1374  is used to test for inclusion.
    1375  components_with_set_states - [out]
    1376  Returns:
    1377  Number of returned components.
    1378  */
    1379  unsigned int GetComponentsWithSetStates(
    1380  ON_ComponentStatus states_filter,
    1381  bool bAllEqualStates,
    1382  ON_SimpleArray< ON_SubDComponentPtr >& components_with_set_states
    1383  ) const;
    1384 
    1385 
    1386  /*
    1387  Description:
    1388  Set states on an individual component.
    1389  Parameters:
    1390  component_ptr - [in]
    1391  The states will be set on this component.
    1392  states_to_set - [in]
    1393  If a state is set in the states_to_set parameter, the same
    1394  state will be set on the component.
    1395  Returns:
    1396  0: no state settings changed on the component.
    1397  1: some state setting changed on the component.
    1398  */
    1399  unsigned int SetComponentStates(
    1400  ON_SubDComponentPtr component_ptr,
    1401  ON_ComponentStatus states_to_set
    1402  ) const;
    1403 
    1404  /*
    1405  Description:
    1406  Clear states on an individual component.
    1407  Parameters:
    1408  component_ptr - [in]
    1409  The states will be cleared on this component.
    1410  states_to_clear - [in]
    1411  If a state is set in the states_to_clear parameter, the same
    1412  state will be cleared on the component.
    1413  Returns:
    1414  0: no state settings changed on the component.
    1415  1: some state setting changed on the component.
    1416  */
    1417  unsigned int ClearComponentStates(
    1418  ON_SubDComponentPtr component_ptr,
    1419  ON_ComponentStatus states_to_clear
    1420  ) const;
    1421 
    1422  /*
    1423  Description:
    1424  Copy status settings to an individual component.
    1425  Parameters:
    1426  component_ptr - [in]
    1427  The states will be copied to this component.
    1428  status_to_copy - [in]
    1429  Returns:
    1430  1: some state settings changed on the component.
    1431  1: some state setting changed on the component.
    1432  */
    1433  unsigned int SetComponentStatus(
    1434  ON_SubDComponentPtr component_ptr,
    1435  ON_ComponentStatus status_to_copy
    1436  ) const;
    1437 
    1438  bool DeleteComponents(
    1439  const ON_SubDComponentPtr* cptr_list,
    1440  size_t cptr_count
    1441  );
    1442 
    1443 
    1444  /////////////////////////////////////////////////////////
    1445  //
    1446  // Editing tools
    1447  //
    1448 
    1449  unsigned int MergeColinearEdges(
    1450  double distance_tolerance,
    1451  double maximum_aspect,
    1452  double sin_angle_tolerance
    1453  );
    1454 
    1455  ON_SubDEdgePtr MergeEdges(
    1456  ON_SubDEdgePtr eptr0,
    1457  ON_SubDEdgePtr eptr1
    1458  );
    1459 
    1460  static bool EdgesCanBeMerged(
    1461  ON_SubDEdgePtr eptr0,
    1462  ON_SubDEdgePtr eptr1
    1463  );
    1464 
    1465  // returns true if all facets are consistently oriented
    1466  bool IsOriented(
    1467  unsigned int level_index
    1468  ) const;
    1469 
    1470  // reverses the orientation of all facets
    1471  bool ReverseOrientation(
    1472  unsigned int level_index
    1473  ) const;
    1474 
    1475  // Attempts to orient all facet to match the first facet.
    1476  bool Orient(
    1477  unsigned int level_index
    1478  ) const;
    1479 
    1480  /*
    1481  Description:
    1482  Interior vertices (smooth and dart) must have at least three faces.
    1483  Concave corner vertices must have at least two faces.
    1484  */
    1485  bool RepairInvalidSectors(
    1486  unsigned int level_index
    1487  );
    1488 
    1489  /*
    1490  Description:
    1491  Split and edge.
    1492  The input edge is modifed to terminate at the input vertex.
    1493  The new edge begins at the input vertex and ends at the final vertex
    1494  of the original input edge.
    1495  edge - [in]
    1496  edge to split.
    1497  vertex_location - [in]
    1498  location of inserted vertex.
    1499  If vertex_location == ON_ON_3dPoint::UnsetPoint,
    1500  then the edge's midpoint is used.
    1501  Returns:
    1502  A pointer to the new edge or nullptr if the input is not valid.
    1503  */
    1504  const class ON_SubDEdge* SplitEdge(
    1505  class ON_SubDEdge* edge,
    1506  ON_3dPoint vertex_location
    1507  );
    1508 
    1509  /*
    1510  Description:
    1511  Split a face into two faces by inserting and edge connecting the
    1512  specified vertices.
    1513  Parameters:
    1514  face - [in]
    1515  A face with at least four edges.
    1516  fvi0 - [in]
    1517  fvi1 - [in]
    1518  Indices of the inserted edge ends.
    1519  Returns:
    1520  A pointer to the inserted edge.
    1521  The inserted edge runs from face->Vertex(fvi0) to face->Vertex(fvi1).
    1522  ON_SubDEdge.Face(0) is the original face and ON_SubDEdge::Face(1) is
    1523  the added face.
    1524  The first edge of the input face remains the first edge of face.
    1525  The inserted edge is the first edge of the added face.
    1526  */
    1527  const class ON_SubDEdge* SplitFace(
    1528  class ON_SubDFace* face,
    1529  unsigned int fvi0,
    1530  unsigned int fvi1
    1531  );
    1532 
    1533  const class ON_SubDVertex* TriangulateFace(
    1534  class ON_SubDFace* face
    1535  );
    1536 
    1537  const class ON_SubDFace* MergeFaces(
    1538  class ON_SubDEdge* edge
    1539  );
    1540 
    1541  /*
    1542  Description:
    1543  Updates vertex tag, edge tag, and edge coefficient values
    1544  on the active level.
    1545 
    1546  After completing custom editing operations that modify the
    1547  topology of the SubD control net or changing values of
    1548  vertex or edge tags, the tag and sector coefficients
    1549  information on nearby components in the edited areas
    1550  need to be updated.
    1551 
    1552  Parameters:
    1553  bUnsetValuesOnly - [in]
    1554  If true, the update is restricted to vertices tagged as
    1555  ON_SubD::VertexTag::Unset and edges tagged as ON_SubD::EdgeTag::Unset.
    1556 
    1557  Returns:
    1558  Number of vertices and edges that were changed during the update.
    1559  */
    1560  unsigned int UpdateAllTagsAndSectorCoefficients(
    1561  bool bUnsetValuesOnly
    1562  );
    1563 
    1564  /*
    1565  Description:
    1566  This tool if for expert users writing advanced editing tools.
    1567  After completing custom editing operations that modify the
    1568  topology of the SubD control net or changing values of
    1569  vertex or edge tags, the tag and sector coefficients
    1570  information on nearby components in the edited areas
    1571  need to be updated.
    1572  Parameters:
    1573  bUnsetTagsOnly - [in]
    1574  If bUnsetTagsOnly is true, then only unset tags and
    1575  ill be updated.
    1576  If bUnsetTagsOnly is false, then all tags and
    1577  will be checked and updated as needed.
    1578  Returns:
    1579  Number of vertices that changed during the update.
    1580  Remarks:
    1581  It is easiest to call UpdateTagsAndSectorCoefficients().
    1582  */
    1583  unsigned int UpdateVertexTags(
    1584  bool bUnsetVertexTagsOnly
    1585  );
    1586 
    1587  /*
    1588  Description:
    1589  This tool if for expert users writing advanced editing tools.
    1590  After completing custom editing operations that modify the
    1591  topology of the SubD control net or changing values of
    1592  vertex or edge tags, the tag and sector coefficients
    1593  information on nearby components in the edited areas
    1594  need to be updated.
    1595  Parameters:
    1596  bUnsetValuesOnly - [in]
    1597  If bUnsetValuesOnly is true, then only unset tags and
    1598  sector weights will be updated.
    1599  If bUnsetValuesOnly is false, then all tags and
    1600  sector weights will be checked and updated as needed.
    1601  Returns:
    1602  Number of edges that had a tag value changed or sector
    1603  coefficient set to ON_SubDSectorType::UnsetSectorWeight.
    1604  Remarks:
    1605  It is easiest to call UpdateTagsAndSectorCoefficients().
    1606  */
    1607  unsigned int UpdateEdgeTags(
    1608  bool bUnsetEdgeTagsOnly
    1609  );
    1610 
    1611  /*
    1612  Description:
    1613  This tool if for expert users writing advanced editing tools.
    1614  After completing custom editing operations that modify the
    1615  topology of the SubD control net or changing values of
    1616  vertex or edge tags, the tag and sector coefficients
    1617  information on nearby components in the edited areas
    1618  need to be updated.
    1619  Parameters:
    1620  bUnsetValuesOnly - [in]
    1621  If bUnsetValuesOnly is true, then only unset tags and
    1622  sector weights will be updated.
    1623  If bUnsetValuesOnly is false, then all tags and
    1624  sector weights will be checked and updated as needed.
    1625  Returns:
    1626  Number of edges that had a tag value changed or sector
    1627  coefficient set to ON_SubDSectorType::UnsetSectorWeight.
    1628  Remarks:
    1629  It is easiest to call UpdateTagsAndSectorCoefficients().
    1630  */
    1631  unsigned int UpdateEdgeSectorCoefficients(
    1632  bool bUnsetSectorCoefficientsOnly
    1633  );
    1634 
    1635  /*
    1636  Descripiton:
    1637  Clears the ON_ComponentState
    1638  */
    1639  unsigned int ClearComponentMarks(
    1640  bool bClearVertexMarks,
    1641  bool bClearEdgeMarks,
    1642  bool bClearFaceMarks,
    1644  ) const;
    1645 
    1646  unsigned int SetComponentMarks(
    1647  bool bClearBeforeSet,
    1648  const ON_SimpleArray< const class ON_SubDComponentBase* >& marked_component_list
    1649  ) const;
    1650 
    1651  unsigned int GetMarkedComponents(
    1652  bool bIncludeVertices,
    1653  bool bIncludeEdges,
    1654  bool bIncludeFaces,
    1656  ) const;
    1657 
    1658 
    1659  /*
    1660  Description:
    1661  Transforms the SubD components in ci_list[].
    1662  Parameters:
    1663  xform - [in]
    1664  ci_list - [in]
    1665  ci_count - [in]
    1666  Returns:
    1667  Number of vertex locations that changed.
    1668  */
    1669  unsigned int TransformComponents(
    1670  const ON_Xform& xform,
    1671  const ON_COMPONENT_INDEX* ci_list,
    1672  size_t ci_count
    1673  );
    1674 
    1675  unsigned int TransformComponents(
    1676  const ON_Xform& xform,
    1677  const ON_SubDComponentPtr* cptr_list,
    1678  size_t cptr_count
    1679  );
    1680 
    1681  unsigned int ExtrudeComponents(
    1682  const ON_Xform& xform,
    1683  const ON_COMPONENT_INDEX* ci_list,
    1684  size_t ci_count,
    1685  bool bPermitNonManifoldEdgeCreation,
    1686  ON_SubD::EdgeTag original_edge_tag,
    1687  ON_SubD::EdgeTag moved_edge_tag
    1688  );
    1689 
    1690  unsigned int ExtrudeComponents(
    1691  const ON_Xform& xform,
    1692  const ON_SubDComponentPtr* cptr_list,
    1693  size_t cptr_count,
    1694  bool bPermitNonManifoldEdgeCreation,
    1695  ON_SubD::EdgeTag original_edge_tag,
    1696  ON_SubD::EdgeTag moved_edge_tag
    1697  );
    1698 
    1699  /////*
    1700  ////Description:
    1701  //// Apply the built-in triangle subdivision subdivision algorithm globally.
    1702  ////Returns:
    1703  //// New level.
    1704  ////*/
    1705  ////unsigned int TriSubdivision();
    1706 
    1707  ////unsigned int GetSector(
    1708  //// const class ON_SubDFace* face,
    1709  //// ON__UINT_PTR face_vertex_index,
    1710  //// class ON_SubDVertex& sector
    1711  //// ) const;
    1712 
    1713  ////unsigned int GetSector(
    1714  //// const class ON_SubDVertex* vertex,
    1715  //// const ON_SubDFace* face,
    1716  //// class ON_SubDVertex& sector
    1717  //// ) const;
    1718 
    1719  ////unsigned int GetSector(
    1720  //// const ON_SubDVertex* vertex,
    1721  //// ON_SubDFacePtr face_ptr,
    1722  //// class ON_SubDVertex& sector
    1723  //// ) const;
    1724 
    1725  ////unsigned int GetSector(
    1726  //// const class ON_SubDVertex* vertex,
    1727  //// const class ON_SubDEdge* smooth_edge,
    1728  //// ON_SubDVertex& sector
    1729  //// ) const;
    1730 
    1731  ////unsigned int GetSector(
    1732  //// const ON_SubDEdge* smooth_edge,
    1733  //// ON__UINT_PTR smooth_edge_end_index,
    1734  //// ON_SubDVertex& sector
    1735  //// ) const;
    1736 
    1737  ////unsigned int GetSector(
    1738  //// ON_SubDEdgePtr smooth_edge_ptr,
    1739  //// class ON_SubDVertex& sector
    1740  //// ) const;
    1741 
    1742  /*
    1743  Description:
    1744  Apply the built-in subdivision algorithm and save the results
    1745  in this ON_SubD.
    1746  Parameters:
    1747  subd_type - [in]
    1748  unset will use the current subdivision type.
    1749  level_index - [in]
    1750  Level where subdivision starts
    1751  count - [in] > 0
    1752  Number of times to subdivide.
    1753  Returns:
    1754  Number of subdivision steps that succeeded.
    1755  (= count when everything works, < count when input is not valid)
    1756  */
    1757  bool Subdivide(
    1758  ON_SubD::SubDType subd_type,
    1759  unsigned int level_index,
    1760  unsigned int count
    1761  );
    1762 
    1763  /*
    1764  Returns:
    1765  Active level subdivison type.
    1766  */
    1767  bool SetSubDType(
    1768  ON_SubD::SubDType subd_type
    1769  );
    1770 
    1771  class ON_SubDVertex* AddVertex(
    1772  ON_SubD::VertexTag vertex_tag,
    1773  const double* P
    1774  );
    1775 
    1776  /*
    1777  Parameters:
    1778  edge_face_count - [in]
    1779  Number of faces the edge will eventually have.
    1780  Pass 0 if the value is not known.
    1781  v0 - [in]
    1782  starting vertex
    1783  v1 - [in]
    1784  ending vertex
    1785  Returns:
    1786  If edge_face_count > 0x7FFFU, then ON_SubD::EdgeTag::Unset is returned.
    1787 
    1788  If edge_face_count is 1 or >= 3, then ON_SubD::EdgeTag::Crease is returned.
    1789 
    1790  If both vertex tags are ON_SubD::VertexTag::Smooth, then ON_SubD::EdgeTag::Smooth is returned.
    1791 
    1792  If edge_face_count is 1 and both vertex tags are ON_SubD::VertexTag::Crease or ON_SubD::VertexTag::Corner,
    1793  then ON_SubD::EdgeTag::Crease is returned.
    1794 
    1795  If edge_face_count is 2 and both vertex tags are set and both are not ON_SubD::VertexTag::Smooth,
    1796  then ON_SubD::EdgeTag::X is returned.
    1797 
    1798  Otherwise, ON_SubD::EdgeTag::Unset is returned.
    1799  */
    1800  static ON_SubD::EdgeTag EdgeTagFromContext(
    1801  unsigned int edge_face_count,
    1802  const ON_SubD::VertexTag v0_tag,
    1803  const ON_SubD::VertexTag v1_tag
    1804  );
    1805 
    1806  static ON_SubD::EdgeTag EdgeTagFromContext(
    1807  unsigned int edge_face_count,
    1808  const ON_SubDVertex* v0,
    1809  const ON_SubDVertex* v1
    1810  );
    1811 
    1812  /*
    1813  Description:
    1814  Add an edge to the subd.
    1815  Parameters:
    1816  edge_tag - [in]
    1817  ON_SubD::EdgeTag::Unset
    1818  Edge tag is not known at this time.
    1819  ON_SubD::EdgeTag::Smooth
    1820  Smooth edge. If both vertices are tagged as not smooth, the
    1821  tag on the returned edge will be ON_SubD::EdgeTag::X. This
    1822  tag is changed to ON_SubD::EdgeTag::Smooth on the first
    1823  subdivision step.
    1824  ON_SubD::EdgeTag::Crease.
    1825  Crease edge. Both vertices must be tagged as not smooth.
    1826  v0 - [in]
    1827  v1 - [in]
    1828  The edge begins at v0 and ends at v1.
    1829  The edge will be on the same level as the vertices.
    1830  Returns:
    1831  Pointer to the allocated edge.
    1832  Remarks:
    1833  ON_SubD::EdgeTagFromContext() can be used to determine edge
    1834  tag values in simple situations.
    1835  */
    1836  class ON_SubDEdge* AddEdge(
    1837  ON_SubD::EdgeTag edge_tag,
    1838  class ON_SubDVertex* v0,
    1839  class ON_SubDVertex* v1
    1840  );
    1841 
    1842  /*
    1843  Description:
    1844  Expert use tool to add an edge with precomputed sector coefficients.
    1845  Parameters:
    1846  edge_tag - [in]
    1847  This expert user function does not automatically set the edge tag.
    1848  v0 - [in]
    1849  v0_sector_coefficient - [in]
    1850  v1 - [in]
    1851  v1_sector_coefficient - [in]
    1852  The edge begins at v0 and ends at v1.
    1853  The edge will be on the same level as the vertices.
    1854  The edges sector weights are set
    1855  */
    1856  class ON_SubDEdge* AddEdgeWithSectorCoefficients(
    1857  ON_SubD::EdgeTag edge_tag,
    1858  class ON_SubDVertex* v0,
    1859  double v0_sector_coefficient,
    1860  class ON_SubDVertex* v1,
    1861  double v1_sector_coefficient
    1862  );
    1863 
    1864  class ON_SubDFace* AddFace(
    1865  unsigned int edge_count,
    1866  const class ON_SubDEdgePtr* edge
    1867  );
    1868 
    1869  /*
    1870  Description:
    1871  Expert user tool to insert an edge in the face's edge array.
    1872  Parameters:
    1873  face - [in]
    1874  edge - [in]
    1875  edge_direction -[in]
    1876  i - [in]
    1877  index where the edge should be inserted.
    1878  Returns:
    1879  true if successful.
    1880  Remarks:
    1881  This tool is used during construction or editing of a SubD and the
    1882  connection is added even if the result is an invalid face or edge.
    1883  It is up to the expert user to make enough changes to create a valid SubD.
    1884  */
    1885  bool AddFaceEdgeConnection(
    1886  ON_SubDFace* face,
    1887  unsigned int i,
    1888  ON_SubDEdge* edge,
    1889  ON__UINT_PTR edge_direction
    1890  );
    1891 
    1892  /*
    1893  Description:
    1894  Expert user tool to insert an edge in the face's edge array.
    1895  Parameters:
    1896  face - [in]
    1897  eptr - [in]
    1898  direction must be set correctly
    1899  i - [in]
    1900  index where the edge should be inserted.
    1901  Returns:
    1902  true if successful.
    1903  Remarks:
    1904  This tool is used during construction or editing of a SubD and the
    1905  connection is added even if the result is an invalid face or edge.
    1906  It is up to the expert user to make enough changes to create a valid SubD.
    1907  */
    1908  bool AddFaceEdgeConnection(
    1909  ON_SubDFace* face,
    1910  unsigned int i,
    1911  ON_SubDEdgePtr eptr
    1912  );
    1913 
    1914  /*
    1915  Description:
    1916  Expert user tool to insert an edge in the face's edge array.
    1917  Parameters:
    1918  face - [in]
    1919  edge - [in]
    1920  edge to remove
    1921  Returns:
    1922  true if successful.
    1923  Remarks:
    1924  This tool is used during construction or editing of a SubD and the
    1925  connection is removed even if the result is an invalid face or edge.
    1926  It is up to the expert user to make enough changes to create a valid SubD.
    1927  */
    1928  bool RemoveFaceEdgeConnection(
    1929  ON_SubDFace* face,
    1930  ON_SubDEdge* edge
    1931  );
    1932 
    1933  /*
    1934  Description:
    1935  Expert user tool to insert an edge in the face's edge array.
    1936  Parameters:
    1937  face - [in]
    1938  i - [in]
    1939  index where the edge should be removed.
    1940  removed_edge - [out]
    1941  removed edge
    1942  Remarks:
    1943  This tool is used during construction or editing of a SubD and the
    1944  connection is removed even if the result is an invalid face or edge.
    1945  It is up to the expert user to make enough changes to create a valid SubD.
    1946  */
    1947  bool RemoveFaceEdgeConnection(
    1948  ON_SubDFace* face,
    1949  unsigned int i
    1950  );
    1951 
    1952  /*
    1953  Description:
    1954  Expert user tool to insert an edge in the face's edge array.
    1955  Parameters:
    1956  face - [in]
    1957  i - [in]
    1958  index where the edge should be removed.
    1959  removed_edge - [out]
    1960  removed edge
    1961  Remarks:
    1962  This tool is used during construction or editing of a SubD and the
    1963  connection is removed even if the result is an invalid face or edge.
    1964  It is up to the expert user to make enough changes to create a valid SubD.
    1965  */
    1966  bool RemoveFaceEdgeConnection(
    1967  ON_SubDFace* face,
    1968  unsigned int i,
    1969  ON_SubDEdgePtr& removed_edge
    1970  );
    1971 
    1972  bool GrowVertexEdgeArray(
    1973  ON_SubDVertex* v,
    1974  size_t capacity
    1975  );
    1976  bool GrowVertexFaceArray(
    1977  ON_SubDVertex* v,
    1978  size_t capacity
    1979  );
    1980  bool GrowEdgeFaceArray(
    1981  ON_SubDEdge* e,
    1982  size_t capacity
    1983  );
    1984  bool GrowFaceEdgeArray(
    1985  ON_SubDFace* f,
    1986  size_t capacity
    1987  );
    1988 
    1989  /*
    1990  Description:
    1991  Get the limit surface mesh for this subD.
    1992  Parameters:
    1993  minimum_display_density - [in]
    1994  Returns:
    1995  A mesh of the subdivision limit surface.
    1996  Remarks:
    1997  The mesh is a reference counted mesh managed by this ON_SubD.
    1998  */
    1999  class ON_SubDLimitMesh LimitSurfaceMesh() const;
    2000 
    2001  ON_SubDLimitMesh UpdateLimitSurfaceMesh(
    2002  unsigned int minimum_display_density
    2003  ) const;
    2004 
    2005  void ClearLimitSurfaceMesh() const;
    2006 
    2007  void ClearEvaluationCache() const;
    2008 
    2009  /*
    2010  Description:
    2011  Get an ON_Mesh of the subdivision limit surface
    2012  Parameters:
    2013  display_parameters - [in]
    2014  mesh - [in]
    2015  If not null, the returned mesh will be stored on
    2016  the input class.
    2017  Returns:
    2018  A mesh of the subdivision limit surface.
    2019  */
    2020  class ON_Mesh* GetLimitSurfaceMesh(
    2021  const class ON_SubDDisplayParameters& display_parameters,
    2022  class ON_Mesh* mesh
    2023  ) const;
    2024 
    2025 
    2026  /*
    2027  Description:
    2028  Get a mesh of the subdivision control net.
    2029  Parameters:
    2030  level_index - [in] (>=0)
    2031  mesh - [in]
    2032  If not null, the returned mesh will be stored on
    2033  the input class.
    2034  Returns:
    2035  The subdivision level as a mesh.
    2036  */
    2037  class ON_Mesh* GetControlNetMesh(
    2038  class ON_Mesh* mesh
    2039  ) const;
    2040 
    2041 
    2042  /*
    2043  Description:
    2044  Get the limit surface mesh as a set of fragments.
    2045  Parameters:
    2046  display_parameters - [in]
    2047 
    2048  fragment_callback_context - [in]
    2049  first parameter for the FragmentCallback function
    2050 
    2051  fragment_callback_function - [in]
    2052  A function pointer with prototype:
    2053 
    2054  bool fragment_callback_function(
    2055  void *fragment_callback_context,
    2056  const class ON_SubDLimitMeshFragment* fragment
    2057  );
    2058 
    2059  For each fragment that is produced, fragment_callback_function() is called.
    2060  You must copy the retuned fragment if you want to keep it for future use.
    2061  If fragment_callback_function returns false, the calculation is canceled.
    2062  Returns:
    2063  Number of fragments produced.
    2064  */
    2065  unsigned int GetLimitSurfaceMeshInFragments(
    2066  const class ON_SubDDisplayParameters& display_parameters,
    2067  ON__UINT_PTR fragment_callback_context,
    2068  bool(*fragment_callback_function)(ON__UINT_PTR , const class ON_SubDLimitMeshFragment*)
    2069  ) const;
    2070 
    2071  /*
    2072  Returns:
    2073  The number of limit surface mesh fragments (ON_SubDLimitMeshFragment) that
    2074  GetLimitSurfaceMeshFragments() will produce.
    2075  */
    2076  unsigned int LimitSurfaceMeshFragmentCount() const;
    2077 
    2078 
    2079  /*
    2080  Description:
    2081  Get the limit surface as a set of bicubic patch fragments.
    2082  Parameters:
    2083  display_parameters - [in]
    2084 
    2085  fragment_callback_context - [in]
    2086  first parameter for the FragmentCallback function
    2087 
    2088  fragment_callback_function - [in]
    2089  A function pointer with prototype:
    2090 
    2091  bool fragment_callback_function(
    2092  void *fragment_callback_context,
    2093  const class ON_SubDLimitPatchFragment* fragment
    2094  );
    2095 
    2096  For each fragment that is produced, fragment_callback_function() is called.
    2097  You must copy the retuned fragment if you want to keep it for future use.
    2098  If fragment_callback_function returns false, the calculation is canceled.
    2099  Returns:
    2100  Number of fragments produced.
    2101  */
    2102  unsigned int GetLimitSurfaceInPatches(
    2103  const class ON_SubDDisplayParameters& display_parameters,
    2104  ON__UINT_PTR fragment_callback_context,
    2105  bool(*fragment_callback_function)(ON__UINT_PTR , const class ON_SubDLimitPatchFragment*)
    2106  ) const;
    2107 
    2108  /*
    2109  Description:
    2110  Get the SubD limit surface as a list of bicubic NURBS patches.
    2111  Parameters:
    2112  display_parameters - [in]
    2113  bClampPatchKnots - [in]
    2114  true to clamp knots
    2115  sUserStringPatchKey - [in]
    2116  If non empty, a user string with this key will be added that
    2117  contains a description of which portion of which SubD face generated
    2118  the patch.
    2119  patches - [out]
    2120  The bicubic NURBS patches are appended to this array.
    2121  Returns:
    2122  Number of patches appended to patches[]
    2123  */
    2124  unsigned int GetLimitSurfacePatches(
    2125  const class ON_SubDDisplayParameters& display_parameters,
    2126  bool bClampPatchKnots,
    2127  const wchar_t* sUserStringPatchKey,
    2129  ) const;
    2130 
    2131 public:
    2132  /*
    2133  Description:
    2134  Pretend this function and ON_SubDimple do not exist.
    2135  Returns:
    2136  Something that you are pretending does not exist.
    2137  Remarks:
    2138  It is intentional that the definition of ON_SubDimple class is not
    2139  available in the opennurbs library interface (not in a header file).
    2140  The size and design of ON_SubDimple will change constantly.
    2141  If you choose to hack and whack so you can dereference an
    2142  ON_SubDimple* pointer, then your code will crash unpredictably.
    2143  */
    2144  const class ON_SubDimple* SubDimple() const;
    2145  const class ON_SubDLevel& ActiveLevel() const;
    2146  unsigned int SubDimpleUseCount() const;
    2147 
    2148  void ShareDimple(const ON_SubD&);
    2149  void SwapDimple(ON_SubD&);
    2150 
    2151  void ShareDimple(const class ON_SubDLimitMeshImpl&);
    2152  void SwapDimple(class ON_SubDLimitMeshImpl& );
    2153 
    2154 private:
    2155  class ON_SubDimple* SubDimple(bool bCreateIfNeeded);
    2156  class ON_SubDLevel const * ActiveLevelConstPointer() const;
    2157  class ON_SubDLevel* ActiveLevelPointer();
    2158 
    2159  void CopyHelper(const ON_SubD&);
    2160 
    2161 private:
    2162  friend class ON_SubDRef;
    2163 #pragma ON_PRAGMA_WARNING_PUSH
    2164 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    2165  // C4251: ... needs to have dll-interface to be used by clients of class ...
    2166  // m_subdimple_sp is private and all code that manages m_subdimple_sp is explicitly implemented in the DLL.
    2167 private:
    2168  std::shared_ptr<class ON_SubDimple> m_subdimple_sp;
    2169 #pragma ON_PRAGMA_WARNING_POP
    2170 
    2171 public:
    2172  // The ON_SubD code increments ON_SubD::ErrorCount everytime something
    2173  // unexpected happens. This is useful for debugging.
    2174  static unsigned int ErrorCount;
    2175 };
    2176 
    2177 
    2178 //////////////////////////////////////////////////////////////////////////
    2179 //
    2180 // ON_SubDRef
    2181 //
    2182 class ON_SUBD_CLASS ON_SubDRef
    2183 {
    2184 #if defined(ON_SUBD_CENSUS)
    2185 private:
    2186  ON_SubDRefCensusCounter m_census_counter;
    2187 #endif
    2188 
    2189 public:
    2190  static const ON_SubDRef Empty;
    2191 
    2192  ON_SubDRef() ON_NOEXCEPT;
    2193  ~ON_SubDRef();
    2194  ON_SubDRef(const ON_SubDRef& src) ON_NOEXCEPT;
    2195  ON_SubDRef& operator=(const ON_SubDRef& src);
    2196 
    2197 #if defined(ON_HAS_RVALUEREF)
    2198  // rvalue copy constructor
    2199  ON_SubDRef( ON_SubDRef&& ) ON_NOEXCEPT;
    2200  // rvalue assignment operator
    2201  ON_SubDRef& operator=( ON_SubDRef&& );
    2202 #endif
    2203 
    2204  const class ON_SubD& SubD() const;
    2205 
    2206  /*
    2207  Returns:
    2208  Number of references to the ON_SubD, including the one by this ON_SubDRef.
    2209  */
    2210  unsigned int ReferenceCount() const;
    2211 
    2212  /*
    2213  Description:
    2214  Allocates a new ON_SubD and has this ON_SubDRef reference it.
    2215  */
    2216  class ON_SubD& NewSubD();
    2217 
    2218 
    2219  /*
    2220  Description:
    2221  Allocates a new ON_SubD and has this ON_SubDRef reference it.
    2222  */
    2223  class ON_SubD& CopySubD(
    2224  const ON_SubDRef& src
    2225  );
    2226  class ON_SubD& CopySubD(
    2227  const ON_SubD& src
    2228  );
    2229 
    2230  class ON_SubD& UniqueSubD();
    2231 
    2232  /*
    2233  Description:
    2234  Remove this reference to the managed ON_SubD.
    2235  If this is the last reference, then the managed ON_SubD is deleted.
    2236  */
    2237  void Clear();
    2238 
    2239 public:
    2240  class ON_SubDVertexIterator VertexIterator() const;
    2241  class ON_SubDEdgeIterator EdgeIterator() const;
    2242  class ON_SubDFaceIterator FaceIterator() const;
    2243 
    2244  /*
    2245  Description:
    2246  Expert user function to have this ON_SubDRef manage the lifetime of subd.
    2247  Parameters:
    2248  subd - [in/out]
    2249  subd must point to an ON_SubD that was constructed on the heap using
    2250  an operator new call with a public ON_SubD constructor.
    2251  Returns:
    2252  a pointer to the managed subd or nullptr subd in not valid.
    2253  Example:
    2254  ON_SubD* subd = new ON_SubD(...);
    2255  ON_SubDRef subr;
    2256  ON_SubD* managed_subd = subdr.SetSubD(subd);
    2257  // subd = nullptr
    2258  // managed_subd = pointer you can use
    2259  */
    2260  class ON_SubD* SetSubDForExperts(
    2261  class ON_SubD*& subd
    2262  );
    2263 
    2264  /*
    2265  Description:
    2266  Expert user function to have this ON_SubDRef reference the
    2267  contents of an existing ON_SubD.
    2268  Do not use if user data on the referenced subd needs to be accessed.
    2269  Parameters:
    2270  subd - [in]
    2271  Any subd on the heap or the stack.
    2272  Returns:
    2273  true if successful.
    2274  */
    2275  static ON_SubDRef CreateReferenceForExperts(
    2276  const ON_SubD& subd
    2277  );
    2278 
    2279 private:
    2280  /*
    2281  Description:
    2282  Expert user function to have this ON_SubDRef reference the
    2283  contents of an existing ON_SubD.
    2284  Do not use if user data on the referenced subd needs to be accessed.
    2285  Parameters:
    2286  subd - [in]
    2287  Any subd on the heap or the stack.
    2288  */
    2289  ON_SubDRef(
    2290  const class ON_SubD& subd
    2291  );
    2292 
    2293 private:
    2294 #pragma ON_PRAGMA_WARNING_PUSH
    2295 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    2296  // C4251: ... needs to have dll-interface to be used by clients of class ...
    2297  // m_subd_sp is private and all code that manages m_subd_sp is explicitly implemented in the DLL.
    2298 private:
    2299  std::shared_ptr<class ON_SubD> m_subd_sp;
    2300 #pragma ON_PRAGMA_WARNING_POP
    2301 };
    2302 
    2303 
    2304 //////////////////////////////////////////////////////////////////////////
    2305 //
    2306 // ON_SubDSectorType
    2307 //
    2308 class ON_SUBD_CLASS ON_SubDSectorType
    2309 {
    2310 public:
    2311  ON_SubDSectorType() = default;
    2312  ON_SubDSectorType(const ON_SubDSectorType&) = default;
    2313  ON_SubDSectorType& operator=(const ON_SubDSectorType&) = default;
    2314 
    2315  static const ON_SubDSectorType Empty;
    2316 
    2317  bool IsValid() const;
    2318 
    2319  unsigned int SectorTypeHash() const;
    2320 
    2321  static int Compare(const ON_SubDSectorType*, const ON_SubDSectorType*);
    2322 
    2323 
    2324  /////////////////////////////////////////////////////////////////////////////////////
    2325  //
    2326  // Sector Weights
    2327  //
    2328  /////////////////////////////////////////////////////////////////////////////////////
    2329  //
    2330  // In the comment below,
    2331  // F = number of faces in the sector,
    2332  // E = number of edges in the sector.
    2333  //
    2334  // There are five valid sector configurations of edges and faces. In all
    2335  // configurations, the edges have one end at the center vertex and the
    2336  // faces have one corner at the center vertex.
    2337  //
    2338  // SMOOTH
    2339  // 1) The center vertex is smooth.
    2340  // 2) F >= 2
    2341  // 3) E = F
    2342  // 4) Every edge is smooth.
    2343  // 5) Every edge is an edge of two different faces in the sector.
    2344  //
    2345  // DART
    2346  // 1) The center vertex is a dart.
    2347  // 2) F >= 2
    2348  // 3) E = F
    2349  // 4) One edge is a crease.
    2350  // 5) The crease edge is an edge of two geometrically adjacent sector faces.
    2351  //
    2352  // DART* (The same as "DART", but the crease edge has been duplicated.)
    2353  // 1) The center vertex is a dart.
    2354  // 2) F >= 2
    2355  // 3) E = F+1
    2356  // 4) Two edges are creases that have the same end locations.
    2357  // 5) Each crease edge is an edge of a single face in the sector,
    2358  // these faces are different and are geometrically adjacent.
    2359  //
    2360  // BOUNDED
    2361  // 1) The center vertex is a crease or corner vertex.
    2362  // 2) F >= 2
    2363  // 3) E = F+1
    2364  // 4) Two edges are crease edges that have different vertices at their ends.
    2365  // 5) Each crease edge is an edge of a single face in the sector,
    2366  // these faces are different and not geometrically adjacent.
    2367  //
    2368  // BOUNDED*
    2369  // 1) The center vertex is a crease or corner vertex.
    2370  // 2) F = 1
    2371  // 3) E = 2
    2372  // 4) The edges are crease edges that have different vertices at their ends.
    2373  // 5) The edges a edges of the face.
    2374  //
    2375  /////////////////////////////////////////////////////////////////////////////////////
    2376  //
    2377  // The sector weight is used when subdividing smooth edges in sectors
    2378  // with a DART, DART* or BOUNDED configuration. In these cases the
    2379  // sector weight is a value strictly between 0.0 and 1.0 that depends on
    2380  // 1) the center vertex tag (crease, corner or dart),
    2381  // 2) the value of F,
    2382  // 3) and when the center vertex is a corner, the angle between
    2383  // the boundary edges.
    2384  //
    2385  // The sector weight is ignored when dividing smooth edges in SMOOTH sectors.
    2386  // The sector weight is ignored when subdividing crease edges.
    2387  //
    2388  // For a smooth edge in a sector with a DART, DART* or BOUNDED configuration,
    2389  // with w = sector weight, C = location of the center vertex
    2390  // and P = location of the smooth vertex at the other end
    2391  // of the smooth edge, the point
    2392  //
    2393  // Q = 3/4 * (w*C + (1-w)*P)
    2394  //
    2395  // is the contribution of C and P to the edge's subdivision point.
    2396  //
    2397  // When a smooth edge has smooth vertices at both ends located
    2398  // at A and B, the contribution of A and B to the edge's subdivision
    2399  // point is
    2400  //
    2401  // Q = 3/8 * (A + B) = 3/4 * (1/2*A + 1/2*B)
    2402  //
    2403  // A crease edge's subdivision point is alwasy the edge's midpoint.
    2404  /*
    2405  Description:
    2406  Calculates sector weight value for the sector type
    2407  identified by this ON_SubDSectorType.
    2408  Returns:
    2409  w: 0.0 <= w < 1.0
    2410  w = sector theta value.
    2411  ON_SubDSectorType::ErrorSectorWeight
    2412  This ON_SubDSectorType is not valid and the calculation failed.
    2413  */
    2414  double SectorWeight() const;
    2415 
    2416 
    2417  ON_SubD::SubDType SubDType() const;
    2418 
    2419  ON_SubD::FacetType FacetType() const;
    2420 
    2421  unsigned int FacetEdgeCount() const;
    2422 
    2423  ON_SubD::VertexTag VertexTag() const;
    2424 
    2425 
    2426  unsigned int EdgeCount() const;
    2427 
    2428  unsigned int FaceCount() const;
    2429 
    2430  /*
    2431  Returns:
    2432  Number of points in the point ring.
    2433  For quad subds, this is 1 + FaceCount() + EdgeCount().
    2434  For tri subds, this is 1 + EdgeCount().
    2435  */
    2436  unsigned int PointRingCount() const;
    2437 
    2438  /*
    2439  Returns:
    2440  1 + FaceCount() + EdgeCount()
    2441  */
    2442  unsigned int ComponentRingCount() const;
    2443 
    2444  /*
    2445  Returns:
    2446  If the sector vertex tag is ON_SubD::VertexTag::Corner,
    2447  the angle between the corner crease boundary edges is
    2448  returned.
    2449  Otherwise, ON_SubDSectorType::ErrorCornerSectorAngle is returned.
    2450  */
    2451  double CornerSectorAngleRadians() const;
    2452 
    2453  /*
    2454  Returns:
    2455  a value >= 0 and <= ON_SubDSectorType::MaximumAngleIndex
    2456  */
    2457  unsigned int CornerSectorAngleIndex() const;
    2458 
    2459  /*
    2460  Description:
    2461  An angle index value of ON_SubDSectorType::MaximumAngleIndex indicates
    2462  the angle is 2pi radians.
    2463  */
    2464  static const unsigned int MaximumAngleIndex; // = 72
    2465 
    2466  /*
    2467  Parameters:
    2468  angle_radians - [in] (0.0 <= angle_radians <= 2*ON_PI
    2469  The angle between the bounding crease edges
    2470  Returns:
    2471  angle_index: >= 0 and <= ON_SubDSectorType::MaximumCornerSectorIndex
    2472  | angle_radians - angle_index/M * 2pi | <= 1/2 * 1/M * 2pi,
    2473  where M = ON_SubDSectorType::MaximumAngleIndex
    2474  ON_UNSET_UINT_INDEX
    2475  angle_radians is not valid and the calculation failed.
    2476  */
    2477  static unsigned int AngleIndexFromAngleRadians(
    2478  double angle_radians
    2479  );
    2480 
    2481  /*
    2482  Convert and angle index into radians
    2483  Parameters:
    2484  angle_index - [in]
    2485  0 to ON_SubDSectorType::MaximumAngleIndex.
    2486  Returns:
    2487  If angle_index is valid, the corresponding angle in radians is returned.
    2488  = angle_index / ON_SubDSectorType::MaximumAngleIndex * 2 * ON_PI
    2489  (double division performed)
    2490  Otherwise ON_UNSET_VALUE is returned.
    2491  */
    2492  static double AngleRadiansFromAngleIndex(
    2493  unsigned int angle_index
    2494  );
    2495 
    2496  /*
    2497  Returns:
    2498  True if this is a smooth interior vertex sector
    2499  */
    2500  bool IsSmoothSector() const;
    2501 
    2502 
    2503  /*
    2504  Returns:
    2505  True if this is a dart interior vertex sector
    2506  */
    2507  bool IsDartSector() const;
    2508 
    2509 
    2510  /*
    2511  Returns:
    2512  True if this is a crease vertex sector
    2513  */
    2514  bool IsCreaseSector() const;
    2515 
    2516  /*
    2517  Returns:
    2518  True if this is a corner vertex sector
    2519  */
    2520  bool IsCornerSector() const;
    2521 
    2522  /*
    2523  Returns:
    2524  True if this is a convex corner vertex sector (sector angle <= pi)
    2525  */
    2526  bool IsConvexCornerSector() const;
    2527 
    2528  /*
    2529  Returns:
    2530  True if this is a concave corner vertex sector (sector angle > pi)
    2531  */
    2532  bool IsConcaveCornerSector() const;
    2533 
    2534  /*
    2535  Parameters:
    2536  sector_boundary_edge0_ptr - [in]
    2537  sector_boundary_edge1_ptr - [in]
    2538  Crease edges that bound the sector containing the smooth edge.
    2539  The edge direction must identify the corner vertex.
    2540  Returns:
    2541  tagged end angle for a smooth edge that
    2542  1) ends at a vertex tagged on ON_SubD::VertexTag::Corner
    2543  2) has two adjacent faces.
    2544  3) lies in a sector bounded by 2 distinct crease edges.
    2545  */
    2546  static double CornerSectorAngleRadiansFromEdges(
    2547  ON_SubDEdgePtr sector_boundary_edge0_ptr,
    2548  ON_SubDEdgePtr sector_boundary_edge1_ptr
    2549  );
    2550 
    2551  static bool IsValidCornerSectorAngleRadians(
    2552  double corner_sector_angle_radians
    2553  );
    2554 
    2555  static double ClampCornerSectorAngleRadians(
    2556  double corner_sector_angle_radians
    2557  );
    2558 
    2559  /*
    2560  Returns:
    2561  Number of subdivision points in a sector ring
    2562  facet_type vertex_tag ring count
    2563  tri smooth N+1
    2564  tri crease N+2
    2565  quad smooth 2N+1
    2566  quad crease 2N+2
    2567  (2 * valence + 1) for quad subds
    2568  (valence + 1) for tri subds
    2569  */
    2570  static unsigned int SectorPointRingCountFromEdgeCount(
    2571  ON_SubD::SubDType subd_type,
    2572  ON_SubD::VertexTag vertex_tag,
    2573  unsigned int sector_edge_count
    2574  );
    2575 
    2576  static unsigned int SectorPointRingCountFromFaceCount(
    2577  ON_SubD::SubDType subd_type,
    2578  ON_SubD::VertexTag vertex_tag,
    2579  unsigned int sector_face_count
    2580  );
    2581 
    2582  static unsigned int SectorFaceCountFromEdgeCount(
    2583  ON_SubD::VertexTag vertex_tag,
    2584  unsigned int sector_edge_count
    2585  );
    2586 
    2587  static unsigned int SectorEdgeCountFromFaceCount(
    2588  ON_SubD::VertexTag vertex_tag,
    2589  unsigned int sector_face_count
    2590  );
    2591 
    2592  static unsigned int MinimumSectorEdgeCount(
    2593  ON_SubD::VertexTag vertex_tag
    2594  );
    2595 
    2596  static unsigned int MinimumSectorFaceCount(
    2597  ON_SubD::VertexTag vertex_tag
    2598  );
    2599 
    2600 public:
    2601  /*
    2602  Returns:
    2603  ON_SubDSectorType::IgnoredSectorWeight
    2604  */
    2605  static double SmoothSectorWeight();
    2606 
    2607  /*
    2608  Parameters:
    2609  face_type - [in]
    2610  sector_face_count - [in]
    2611  number of faces in the smooth sector.
    2612  Returns:
    2613  0:
    2614  failed to caclulate weight
    2615  ON_SubDSectorType::UnsetSectorWeight:
    2616  subd_type was set ON_SubD::SubDType::Unset
    2617  and was required to calculate the weight.
    2618  This typically happens when a SubD control net is being
    2619  created and a facet type is not specified.
    2620  The weights will be calculated at the first subdivision.
    2621  0 < w < 1:
    2622  1/2 + 1/3*cos(tagged end angle) for quadrangle facets
    2623  1/3 + 1/3*cos(tagged end angle) for triangle facets
    2624  Remarks:
    2625  This is a useful tool when calling AddEdge while a subdivision
    2626  level is being constructed.
    2627  */
    2628  static double CreaseSectorWeight(
    2629  ON_SubD::SubDType subd_type,
    2630  unsigned int sector_face_count
    2631  );
    2632 
    2633  static double DartSectorWeight(
    2634  ON_SubD::SubDType subd_type,
    2635  unsigned int sector_face_count
    2636  );
    2637 
    2638  static double CornerSectorWeight(
    2639  ON_SubD::SubDType subd_type,
    2640  unsigned int sector_face_count,
    2641  double corner_sector_angle_radians
    2642  );
    2643 
    2644  // This value is is used to set sector angles when the
    2645  // actual value is not needed. This occurs at both ends
    2646  // of a creased edge and when the end of a smooth edge
    2647  // is a smooth vertex.
    2648  static const double IgnoredCornerSectorAngle; // = 0.0;
    2649 
    2650  // This value is used to set sector weights that could not be
    2651  // correctly set because something in the calculation failed.
    2652  // It is typically used when an invalid component in SubD object
    2653  // was needed to calculate the weight.
    2654  static const double UnsetCornerSectorAngle; // = -8881.0;
    2655 
    2656  // This value is indicate a corner sector angle calculation failed.
    2657  static const double ErrorCornerSectorAngle; // = -9991.0;
    2658 
    2659 
    2660  // This value is used for smooth sector thetas
    2661  static const double SmoothSectorTheta; // = 0.5*ON_PI
    2662 
    2663  // This value is used to indicate a sector theta needs to be set
    2664  static const double UnsetSectorTheta; // = -8882.0;
    2665 
    2666  // This value is used to indicate a sector theta calculation failed.
    2667  static const double ErrorSectorTheta; // = -9992.0;
    2668 
    2669 
    2670  // This value is is used to set sector weights when the
    2671  // actual value is not needed. This occurs at both ends
    2672  // of a creased edge and when the end of a smooth edge
    2673  // is a smooth vertex.
    2674  static const double IgnoredSectorWeight; // = 0.0;
    2675 
    2676  // This value is used to mark sector weights that need to be
    2677  // set in the future when more information is available.
    2678  // It is typically used when creating a subD control net
    2679  // and the facet type is not known. Any value < 0.0 and not
    2680  // equal to ON_UNSET_VALUE would work. The fact that the actual
    2681  // value is -999.0 has no other significance.
    2682  static const double UnsetSectorWeight; // = -8883.0;
    2683 
    2684  // This value is indicate a sector weight calculation failed.
    2685  static const double ErrorSectorWeight; // = -9993.0;
    2686 
    2687  static bool IsValidSectorWeightValue(
    2688  double weight_value,
    2689  bool bAllowUnsetTaggedEndWeight
    2690  );
    2691 
    2692  /*
    2693  Returns:
    2694  ON_SubDSectorType::ErrorSectorWeight and calls debug breakpoint
    2695  */
    2696  static double SectorWeightCalculationError();
    2697 
    2698 
    2699  /*
    2700  Description:
    2701  Create a ON_SubDSectorType from a ON_SubDSectorIterator.
    2702  Parameters:
    2703  subd_type - [in]
    2704  vertex_tag - [in]
    2705  sector_face_count - [in]
    2706  Number of faces in the sector.
    2707  corner_sector_angle_radians - [in]
    2708  If vertex_tag is ON_SubD::VertexTag::Corner, this
    2709  parameter is the angle between the crease edges
    2710  that bound the corner.
    2711  If vertex_tag is not ON_SubD::VertexTag::Corner,
    2712  this parameter is ignored.
    2713  Returns:
    2714  An ON_SubDSectorType for the case the input parameters
    2715  identify.
    2716  */
    2717  static ON_SubDSectorType Create(
    2718  ON_SubD::SubDType subd_type,
    2719  ON_SubD::VertexTag vertex_tag,
    2720  unsigned int sector_face_count,
    2721  double corner_sector_angle_radians
    2722  );
    2723 
    2724 
    2725  /*
    2726  Description:
    2727  Create a ON_SubDSectorType from a ON_SubDSectorIterator.
    2728  Parameters:
    2729  subd_type - [in]
    2730  sit - [in]
    2731  Returns:
    2732  An ON_SubDSectorType for the sector identified by sit.
    2733  */
    2734  static ON_SubDSectorType Create(
    2735  ON_SubD::SubDType subd_type,
    2736  const ON_SubDSectorIterator& sit
    2737  );
    2738 
    2739  /*
    2740  Description:
    2741  Create a ON_SubDSectorType for the sector containing the face.
    2742  Parameters:
    2743  subd_type - [in]
    2744  face - [in]
    2745  face_vertex_index - [in]
    2746  face->Vertex(face_vertex_index) will be the sector's
    2747  center vertex.
    2748  Returns:
    2749  An ON_SubDSectorType for the sector containing the face.
    2750  */
    2751  static ON_SubDSectorType Create(
    2752  ON_SubD::SubDType subd_type,
    2753  const class ON_SubDFace* face,
    2754  unsigned int face_vertex_index
    2755  );
    2756 
    2757  static ON_SubDSectorType Create(
    2758  ON_SubD::SubDType subd_type,
    2759  const class ON_SubDFace* face,
    2760  const class ON_SubDVertex* vertex
    2761  );
    2762 
    2763  /*
    2764  Description:
    2765  Create a ON_SubDSectorType for the sector containing the edge.
    2766  Parameters:
    2767  subd_type - [in]
    2768  edge - [in]
    2769  edge_vertex_index - [in]
    2770  edge->Vertex(edge_vertex_index) will be the sector's
    2771  center vertex.
    2772  Returns:
    2773  An ON_SubDSectorType for the sector containing the edge.
    2774  */
    2775  static ON_SubDSectorType Create(
    2776  ON_SubD::SubDType subd_type,
    2777  const class ON_SubDEdge* edge,
    2778  unsigned int edge_vertex_index
    2779  );
    2780 
    2781  /*
    2782  Description:
    2783  Create a smooth ON_SubDSectorType.
    2784  Parameters:
    2785  subd_type - [in]
    2786  sector_face_count - [in]
    2787  Number of faces in the sector.
    2788  Returns:
    2789  An ON_SubDSectorType for the smooth sector case specified
    2790  by the input parameters.
    2791  */
    2792  static ON_SubDSectorType CreateSmoothSectorType(
    2793  ON_SubD::SubDType subd_type,
    2794  unsigned int sector_face_count
    2795  );
    2796 
    2797  /*
    2798  Description:
    2799  Create a crease ON_SubDSectorType.
    2800  Parameters:
    2801  subd_type - [in]
    2802  sector_face_count - [in]
    2803  Number of faces in the sector.
    2804  Returns:
    2805  An ON_SubDSectorType for the crease sector case specified
    2806  by the input parameters.
    2807  */
    2808  static ON_SubDSectorType CreateCreaseSectorType(
    2809  ON_SubD::SubDType subd_type,
    2810  unsigned int sector_face_count
    2811  );
    2812 
    2813  /*
    2814  Description:
    2815  Create a dart ON_SubDSectorType.
    2816  Parameters:
    2817  subd_type - [in]
    2818  sector_face_count - [in]
    2819  Number of faces in the sector.
    2820  Returns:
    2821  An ON_SubDSectorType for the dart sector case specified
    2822  by the input parameters.
    2823  */
    2824  static ON_SubDSectorType CreateDartSectorType(
    2825  ON_SubD::SubDType subd_type,
    2826  unsigned int sector_face_count
    2827  );
    2828 
    2829  /*
    2830  Description:
    2831  Create a corner ON_SubDSectorType.
    2832  Parameters:
    2833  subd_type - [in]
    2834  sector_face_count - [in]
    2835  Number of faces in the sector.
    2836  corner_sector_angle_radians - [in]
    2837  The angle between the crease edges that bound the corner.
    2838  Returns:
    2839  An ON_SubDSectorType for the corner sector case specified
    2840  by the input parameters.
    2841  */
    2842  static ON_SubDSectorType CreateCornerSectorType(
    2843  ON_SubD::SubDType subd_type,
    2844  unsigned int sector_face_count,
    2845  double sector_corner_angle_radians
    2846  );
    2847 
    2848  static int Compare(
    2849  const ON_SubDSectorType& a,
    2850  const ON_SubDSectorType& b
    2851  );
    2852 
    2853 
    2854  /*
    2855  Description:
    2856  Get the subdivision matrix for the default subdivison algorithms
    2857  used by ON_SubD.
    2858 
    2859  The matrix coefficents are ordered so that the matrix acts on
    2860  the left of the points returned by ON_SubDSectorIterator::GetVertexRing().
    2861 
    2862  For an interior vertex (smooth or dart), the coefficents are ordered
    2863  so that one iteration of subdivision is given by:
    2864  ON_SubD::SubDType::TriLoopWarren case:
    2865  S*Transpose(V, E[0], E[1], ..., E[N-1])
    2866  ON_SubD::SubDType::QuadCatmullClark case:
    2867  S*Transpose(V, E[0], F[0], E[1], F[1], ..., E[N-1], F[N-1]).
    2868  For a dart vertex, E[0] is the point at the end of the creased edge.
    2869 
    2870 
    2871  For a boundary vertex (crease or corner), the coefficents are ordered
    2872  so that one iteration of subdivision is given by:
    2873  ON_SubD::SubDType::TriLoopWarren case:
    2874  S*Transpose(V, E[0], E[1], ..., E[N-1]).
    2875  ON_SubD::SubDType::QuadCatmullClark case:
    2876  S*Transpose(V, E[0], F[0], E[1], F[1], ..., F[N-2], E[N-1]).
    2877 
    2878  N = edge valence = number of edges in the sector.
    2879  E[i] = end of i-th edge radiating from V.
    2880  In the ON_SubD::SubDType::QuadCatmullClark case, F[i] = point on the quad
    2881  that is opposite V.
    2882  The edges and faces are ordered radially so that the face for F[i]
    2883  lies between the edges for E[i] and E[(i+1)%N].
    2884 
    2885  Parameters:
    2886  matrix_capacity - [in]
    2887  S[] can store any RxR matrix with R <= matrix_capacity.
    2888  S - [out]
    2889  subdivision matrix
    2890  Matrix coefficent (i,j) = S[i][j]
    2891  0 <= i < R, 0 <= j < R, R = ON_SubDSectorType.PointRingCount()
    2892 
    2893  Returns:
    2894  R > 0:
    2895  R = PointRingCount() and S is the RxR subdivision matrix for the sector type.
    2896  0: Invalid input
    2897  */
    2898  unsigned int GetSubdivisionMatrix(
    2899  size_t matrix_capacity,
    2900  double** S
    2901  ) const;
    2902 
    2903  /*
    2904  Parameters:
    2905  S_capacity - [in]
    2906  Number of elements in S[] array
    2907  S - [out]
    2908  subdivision matrix.
    2909  Matrix coefficent (i,j) = S[i*R + j],
    2910  0 <= i < R, 0 <= j < R, R = ON_SubDSectorType.PointRingCount()
    2911  Returns:
    2912  0: Invalid input.
    2913  >0: Number of rows and columns in S.
    2914  This number is always ON_SubDSectorType.PointRingCount().
    2915  */
    2916  unsigned int GetSubdivisionMatrix(
    2917  size_t S_capacity,
    2918  double* S
    2919  ) const;
    2920 
    2921  /*
    2922  Description:
    2923  All the subdivision matrices for the ON_SubD built-in
    2924  subdivision algorithms have eigenvalues (1, lambda1, lambda2, e4, ..., eR),
    2925  where 1 > lambda1 >= lambda2 > |e4| >= ... >= |eR| > 0.
    2926 
    2927  The subdominant eigenvalue is lambda1 and,
    2928  with one exception, lambda1 = lambda2.
    2929  The exception is described in the description of
    2930  ON_SubDSectorType::SubdominantEigenvalueMulitiplicity().
    2931 
    2932  Returns:
    2933  > 0.0:
    2934  The subdominant eigenvalue for the subdivision matrix.
    2935 
    2936  ON_UNSET_VALUE:
    2937  This ON_SubDSectorType is not valid.
    2938  */
    2939  double SubdominantEigenvalue() const;
    2940 
    2941  /*
    2942  Returns:
    2943  0:
    2944  The sector type is not set.
    2945 
    2946  2:
    2947  The subdominant eigenvalue has algebraic and geometric multiplicty = 2.
    2948  This is the most common case.
    2949 
    2950  1:
    2951  The subdominant eigenvalue has algebraic and geometric multiplicty = 1.
    2952  This occures in Catmull-Clark subdivision at a crease vertex with
    2953  two crease edges and a single face. The subdivision matrix for this
    2954  case is
    2955  S is a 4 x 4 matrix with rows =
    2956  (3/4, 1/8, 0, 1/8),
    2957  (1/2, 1/2, 0, 0),
    2958  (1/4, 1/4, 1/4, 1/4),
    2959  (1/2, 0, 0, 1/2).
    2960  S has 4 real eigenvalues = (1, 1/2, 1/4, 1/4), all wtih
    2961  geometric multiplicity = 1.
    2962  The three eigenvectors are
    2963  (1, 1, 1, 1), (0, -1, 0, 1), (0, 0, 1, 0).
    2964  */
    2965  unsigned int SubdominantEigenvalueMulitiplicity() const;
    2966 
    2967  /*
    2968  Description:
    2969  With one exception, which is described below,
    2970  all the subdivision matrices for the ON_SubD built-in
    2971  subdivision algorithms have eigenvalues (1, lambda, lambda, e4, ..., eR),
    2972  where lambda is real, 1 > lambda > |e4| >= ... >= |eR| > 0, and the
    2973  geometric dimension of the lambda eigenspace is 2 (there are two
    2974  linearly independent lambda eigenvectors).
    2975 
    2976  The subdominant eigenvalue is lamda. This function returns an
    2977  orthogonal basis, (E1, E2), for the subdominant eigenspace.
    2978 
    2979  An eigenvector for the dominant eigen value 1 has is (1,1,...,1).
    2980  The domainant eignevector is orthogonal to the subdominant eigenspace.
    2981 
    2982  Put another way,
    2983  0 = E1[0] + ... + E1[R-1]
    2984  0 = E2[0] + ... + E2[R-1]
    2985  0 = E1[0]*E2[0] + ... + E1[R-1]*E2[R-1]
    2986 
    2987  Exceptional case:
    2988  The Catmull-Clark subdivision matrix for a crease vertex with
    2989  two crease edges and a single face is a special case.
    2990  In this exceptional, this function returns
    2991  lambda = 1/2, E1 = {0,-1,0,-1} and E2 = {1, -2, -5, -2}.
    2992  For more information about the exceptional case, see the description of
    2993  ON_SubDSectorType::SubdominantEigenvalueMulitiplicity().
    2994 
    2995  Parameters:
    2996  E1_capacity - [in]
    2997  Capacity of the E1[] array.
    2998  E1 - [out]
    2999  E2_capacity - [in]
    3000  Capacity of the E2[] array.
    3001  E2 - [out]
    3002  When E1_capacity > 0 and E2_capacity > 0, two orthoganal eigenvectors
    3003  spanning the subdivision matrix subdominant eigenspace are returned
    3004  in E1[] and E2[].
    3005  If one of E1_capacity or E2_capacity is > 0, then both must be > 0.
    3006 
    3007  Returns:
    3008  ON_UNSET_VALUE: Invalid input.
    3009  e > 0.0 and e < 1.0:
    3010  subdominant eigenvalue.
    3011  */
    3012  double GetSubdominantEigenvectors(
    3013  size_t E1_capacity,
    3014  double* E1,
    3015  size_t E2_capacity,
    3016  double* E2
    3017  ) const;
    3018 
    3019  /*
    3020  Parameters:
    3021  LPev_capacity - [in]
    3022  Capacity of the LPev[] array.
    3023  LPev - [out]
    3024  When LPev_capacity > 0, then the limit surface point evaluation coefficients are
    3025  returned in LPev[]. Otherwise LPev is ignored.
    3026  LT0ev_capacity - [in]
    3027  Capacity of the LPev[] array.
    3028  LT0ev - [out]
    3029  LT1ev_capacity - [in]
    3030  Capacity of the LPev[] array.
    3031  LT1ev - [out]
    3032  When LT0ev_capacity > 0 and LT1ev_capacity > 0, then the limit surface
    3033  tangent coefficients are returned in LT0ev[] and LT1ev[]. Otherwise,
    3034  LT0ev[] and LT1ev[] are ignored.
    3035  If one of LT0ev_capacity or LT1ev_capacity is > 0, then both must be > 0.
    3036  Returns:
    3037  0: Invalid input.
    3038  >0: Number of evaluation coefficients in the L*ev[] arrays.
    3039  This number is always ON_SubDSectorType.PointRingCount().
    3040  */
    3041  unsigned int GetLimitSurfaceEvaluationCoefficients(
    3042  size_t LPev_capacity,
    3043  double* LPev,
    3044  size_t LT0ev_capacity,
    3045  double* LT0ev,
    3046  size_t LT1ev_capacity,
    3047  double* LT1ev
    3048  ) const;
    3049 
    3050  // LimitSurfaceNormalSign() is a debugging tool - slow and not useful in general
    3051  double LimitSurfaceNormalSign() const;
    3052 
    3053  bool LimitEvaluationCoefficientsAvailable() const;
    3054 
    3055  /*
    3056  Parameters:
    3057  eigenvalues_capacity - [in]
    3058  Capacity of the eigenvalues[] array.
    3059  Must be 0 or >= PointRingCount()
    3060  eigenvalues - [out]
    3061  If 0 = eigenvalues_capacity, eigenvalues must be nullptr.
    3062  If eigenvalues_capacity > 0, is specifies the capactiy
    3063  of the eigenvalues[] array.
    3064  Returns:
    3065  R > 0:
    3066  A complete set of eigenvalues is available for this sector type.
    3067  The eigenvalues are (1, lambda, lambda, e3, ..., eR), where
    3068  1 > lambda > e3 >= ... >= eR > 0.
    3069  0:
    3070  Invalid input or the eigenvalues for this sector typoe are not available.
    3071  */
    3072  unsigned int GetAllEigenvalues(
    3073  size_t eigenvalues_capacity,
    3074  double* eigenvalues
    3075  );
    3076 
    3077  /*
    3078  Description:
    3079  The subdivision matrix for all cases is known.
    3080  A complete set of eigenvalues are available for some cases.
    3081  Parameters:
    3082  facet_type - [in]
    3083  vertex_tag - [in]
    3084  sector_edge_count - [in]
    3085  The input parameters identify the subdivision case.
    3086  Returns:
    3087  R > 0: Eigenvalues are known. There subdivison matrix is R x R.
    3088  0: Eigenvalues for this case are not known.
    3089  */
    3090  static unsigned int AllEigenvaluesAvailableKnown(
    3091  ON_SubD::SubDType subd_type,
    3092  ON_SubD::VertexTag vertex_tag,
    3093  unsigned int sector_edge_count
    3094  );
    3095 
    3096  /*
    3097  Description:
    3098  Create a partial subdivison sector around vertex.
    3099  The resulting ON_SubD has an outer ring with smooth edges and vertices,
    3100  which is not valid as a stand-alone subd. This is typically used for
    3101  testing.
    3102  Parameters:
    3103  radius - [in]
    3104  The center vertex is located at (0,0,0),
    3105  If radius > 0.0, then the end of the first edge is at (radius,0,0),
    3106  subsequent edges are in a radial array and quad face points, if any,
    3107  are 2*radius from the origin.
    3108  sector_angle_radians - [in]
    3109  If radius > 0,
    3110  this->VertexTag() is ON_SubD::VertexTag::Crease,
    3111  crease_sector_angle_radians > 0.0 and
    3112  crease_sector_angle_radians < 2.0*ON_PI,
    3113  then this will be the angle between the crease boundary edges.
    3114  In all other cases, crease_sector_angle_radians is ignored.
    3115  subd - [in]
    3116  If subd is not null, the vertex ring is put in this
    3117  subd.
    3118  Returns:
    3119  a pointer to the vertex ring
    3120  nullptr is returned if the input is not valid.
    3121  */
    3122  ON_SubD* SectorRingSubD(
    3123  double radius,
    3124  double sector_angle_radians,
    3125  ON_SubD* subd
    3126  ) const;
    3127 
    3128 private:
    3129  ON_SubD::SubDType m_subd_type = ON_SubD::SubDType::Unset;
    3130  ON_SubD::FacetType m_facet_type = ON_SubD::FacetType::Unset;
    3131  ON_SubD::VertexTag m_vertex_tag = ON_SubD::VertexTag::Unset;
    3132  unsigned char m_reserved1 = 0;
    3133  unsigned int m_hash = 0; // SetHash() sets this field, SectorTypeHash() returns its value.
    3134  unsigned int m_corner_sector_angle_index = 0; // >= 0 and <= ON_SubDSectorType::MaximumAngleIndex
    3135  unsigned int m_sector_face_count = 0;
    3136  double m_sector_weight = 0.0;
    3137  double m_sector_theta = 0.0;
    3138  double m_corner_sector_angle_radians = 0.0;
    3139 
    3140 private:
    3141  void SetHash();
    3142 
    3143  /*
    3144  Description:
    3145  Calculates sector theta value for the sector type
    3146  identified by this ON_SubDSectorType.
    3147  Returns:
    3148  theta: 0.0 <= theta <= ON_PI
    3149  The sector theta value.
    3150  ON_SubDSectorType::ErrorSectorTheta
    3151  This ON_SubDSectorType is not valid and the calculation failed.
    3152  */
    3153  double SectorTheta() const;
    3154 
    3155  /*
    3156  Parameters:
    3157  sector_face_count - [in] >= 1
    3158  Number of faces in the crease sector.
    3159  Returns:
    3160  theta: 0.0 < theta <= ON_PI
    3161  sector theta value for a crease sector with sector_face_count faces.
    3162  ON_SubDSectorType::ErrorSectorTheta
    3163  sector_face_count is not valid and the calculation failed.
    3164  */
    3165  static double CreaseSectorTheta(
    3166  unsigned int sector_face_count
    3167  );
    3168 
    3169  /*
    3170  Parameters:
    3171  sector_face_count - [in] >= 2
    3172  Number of faces in the dart sector.
    3173  Returns:
    3174  theta: 0.0 < theta <= ON_PI
    3175  sector theta value for a dart sector with sector_face_count faces.
    3176  ON_SubDSectorType::ErrorSectorTheta
    3177  sector_face_count is not valid and the calculation failed.
    3178  */
    3179  static double DartSectorTheta(
    3180  unsigned int sector_face_count
    3181  );
    3182 
    3183  /*
    3184  Parameters:
    3185  sector_face_count - [in] >= 2
    3186  Number of faces in the dart sector.
    3187  corner_sector_angle_radians - [in] (0.0 <= corner_sector_angle_radians <= 2*ON_PI
    3188  The angle between the bounding crease edges
    3189  Returns:
    3190  theta: 0.0 < theta <= ON_PI/2
    3191  sector theta value for the corner sector.
    3192  ON_SubDSectorType::ErrorSectorTheta
    3193  sector_face_count or corner_sector_angle_radians were not valid
    3194  and the calculation failed.
    3195  */
    3196  static double CornerSectorThetaFromCornerAngle(
    3197  unsigned int sector_face_count,
    3198  double corner_sector_angle_radians
    3199  );
    3200 
    3201  /*
    3202  Parameters:
    3203  subd_type - [in]
    3204  sector_theta - [in]
    3205  value from one of the sector theta functions.
    3206  ON_SubDEdge::SectorTheta()
    3207  ON_SubDEdge::SmoothSectorTheta()
    3208  ON_SubDEdge::CreaseSectorTheta()
    3209  ON_SubDEdge::CornerSectorTheta()
    3210  ON_SubDEdge::DartSectorTheta()
    3211  Returns:
    3212  0:
    3213  failed to caclulate weight
    3214  ON_UNSET_VALUE:
    3215  subd_type was set ON_SubD::SubDType::Unset
    3216  and the tagged end weight cannot be calculated until
    3217  the facet type is known. This typically happens
    3218  when a SubD control net is being created and
    3219  a facet type is not specified. The weights will
    3220  be calculated at the first subdivision.
    3221  0 < w < 1:
    3222  If ON_SubD::SubDType::QuadCatmullClark == subd_type,
    3223  then the returned value is
    3224  1/2 + 1/3*cos(sector_angle_radians). (1/6 <= w <= 5/6)
    3225  If ON_SubD::SubDType::TriLoopWarren == subd_type,
    3226  then the returned value is
    3227  1/3 + 1/3*cos(sector_angle_radians). (0 < w <= 2/3)
    3228  Remarks:
    3229  This is a useful tool when calling AddEdge while a subdivision
    3230  level is being constructed.
    3231  */
    3232  static double SectorWeightFromTheta(
    3233  ON_SubD::SubDType subd_type,
    3234  double sector_theta
    3235  );
    3236 };
    3237 
    3238 //////////////////////////////////////////////////////////////////////////
    3239 //
    3240 // ON_SubDLimitMeshFragment
    3241 //
    3242 // Meshes of ON_SubD limit surface are calculated in fragments.
    3243 //
    3244 class ON_SUBD_CLASS ON_SubDLimitMeshFragmentGrid
    3245 {
    3246 public:
    3247  // No construction for performance reasons.
    3248  // If you require initialization, use = ON_SubDLimitMeshFragmentGrid::Empty
    3249  //
    3250  //ON_SubDLimitMeshFragmentGrid() = default;
    3251  //~ON_SubDLimitMeshFragmentGrid() = default;
    3252  //ON_SubDLimitMeshFragmentGrid(const ON_SubDLimitMeshFragmentGrid&) = default;
    3253  //ON_SubDLimitMeshFragmentGrid& operator=(const ON_SubDLimitMeshFragmentGrid&) = default;
    3254  static const ON_SubDLimitMeshFragmentGrid Empty;
    3255 
    3256  /*
    3257  Description:
    3258  Get mesh facet quads that index into a grid of points.
    3259  Parameters:
    3260  side_segment_count - [in]
    3261  number quads in each row and column of the quad grid.
    3262  side_segment_count >= 1
    3263  side_segment_count <= ON_SubDLimitMesh::MaximumSideSegmentCount
    3264  side_segment_count must be a power of 2
    3265 
    3266  level_of_detail - [in]
    3267  0: quad count = maximum quad count = (side_count x side_count)
    3268  1: quad count = 1/4 maximum quad count
    3269  1: quad count = 1/16 maximum quad count
    3270  ...
    3271  If 4^level_of_detail > maximum quad count, then a single quad is returned.
    3272  */
    3273  static ON_SubDLimitMeshFragmentGrid Quads(
    3274  unsigned int side_segment_count,
    3275  unsigned int level_of_detail
    3276  );
    3277 
    3278  static ON_SubDLimitMeshFragmentGrid Tris(
    3279  unsigned int side_segment_count,
    3280  unsigned int level_of_detail
    3281  );
    3282 
    3283  static ON_SubDLimitMeshFragmentGrid Facets(
    3284  ON_SubD::FacetType facet_type,
    3285  unsigned int side_segment_count,
    3286  unsigned int level_of_detail
    3287  );
    3288 
    3289  /*
    3290  Description:
    3291  Get mesh facet quads that index into a grid of points.
    3292  Parameters:
    3293  side_segment_count - [in]
    3294  number quads in each row and column of the quad grid
    3295  with the highest level of detail (level_of_detail = 0)
    3296  side_count must be a power of 2
    3297  level_of_detail - [in]
    3298  Desired level of detail of the returned grid
    3299  0: highest (side_count x side_count) quads
    3300  1: 1/4 density (side_count x side_count)/4 quads
    3301  2: 1/16 density (side_count x side_count)/16 quads
    3302  ...
    3303  side_count-2: 4 quads
    3304  side_count-1: 1 quad
    3305  >= side_count: 1 quad
    3306  Returns:
    3307  Number of quads in the grid.
    3308  */
    3309  static unsigned int SetQuads(
    3310  unsigned int side_segment_count,
    3311  unsigned int level_of_detail,
    3312  size_t quad_capacity,
    3313  size_t quad_stride,
    3314  unsigned int* quads,
    3315  size_t side_capacity,
    3316  size_t side_stride,
    3317  unsigned int* sides
    3318  );
    3319 
    3320 
    3321  unsigned int SideSegmentCount() const;
    3322 
    3323  /*
    3324  Description:
    3325  The GridId() is persistent and unique based on the contents of the
    3326  grid. It is intended to be used in render applications that store
    3327  copies of ON_SubDLimitMeshFragmentGrid settings in things like
    3328  vertex object buffers and want a reliable way to index into them.
    3329  The Empty grid has id = 0;
    3330  Returns:
    3331  0:
    3332  when the grid is empty
    3333  32*n + 2*lod + t:
    3334  t = 0 for quads and 1 for tris,
    3335  (0 <= n <= 8) m_F_count = 2^(2n),
    3336  (0 <= lod <= 8) m_F_level_of_detail = lod
    3337  Remarks:
    3338  m_F_count is always
    3339  */
    3340  unsigned int GridId() const;
    3341 
    3342  /*
    3343  Returns:
    3344  3 for tris, 4 for quads, 0 for unset.
    3345  */
    3346  unsigned int GridFacetSideCount() const;
    3347 
    3348  bool GetGridParameters(
    3349  unsigned int grid_point_index,
    3350  double grid_parameters[2]
    3351  ) const;
    3352 
    3353 
    3354 private:
    3355  unsigned char m_reserved;
    3356 
    3357 public:
    3358 
    3359  ON_SubD::FacetType m_F_type;
    3360  unsigned char m_side_segment_count; // = 2^n for non-empty grids (0 <= n <= 8)
    3361  unsigned short m_F_count; // = m_side_count*m_side_count
    3362  unsigned short m_F_level_of_detail; // 0 = highest, > 0 = reduced
    3363  unsigned short m_F_stride;
    3364  const unsigned int* m_F;
    3365  const unsigned int* m_S; // [4*m_side_segment_count + 1] indices that form the polyline boundary.
    3366  const ON_SubDLimitMeshFragmentGrid* m_prev_level_of_detail; // nullptr or the previous level with more facets.
    3367  const ON_SubDLimitMeshFragmentGrid* m_next_level_of_detail; // nullptr or the next level with fewer facets.
    3368 };
    3369 
    3370 class ON_SUBD_CLASS ON_SubDLimitMeshFragment
    3371 {
    3372 public:
    3373  // No construction for performance reasons.
    3374  // If you require initialization, use = ON_SubDLimitMeshFragment::Empty
    3375  //
    3376  //ON_SubDLimitMeshFragment() = default;
    3377  //~ON_SubDLimitMeshFragment() = default;
    3378  //ON_SubDLimitMeshFragment(const ON_SubDLimitMeshFragment&) = default;
    3379  //ON_SubDLimitMeshFragment& operator=(const ON_SubDLimitMeshFragment&) = default;
    3380 
    3381  // Every field of ON_SubDLimitMeshFragment::Empty is zero.
    3382  static const ON_SubDLimitMeshFragment Empty;
    3383 
    3384  static const unsigned int MaximumSideSegmentCount;
    3385 
    3386  /*
    3387  Returns:
    3388  side_segment_count = 2^display_density
    3389  */
    3390  static unsigned int SideSegmentCountFromDisplayDensity(
    3391  unsigned int display_density
    3392  );
    3393 
    3394  /*
    3395  Returns:
    3396  base 2 log of side_segment_count.
    3397  Remarks:
    3398  side_segment_count = 2^display_density
    3399  */
    3400  static unsigned int DisplayDensityFromSideSegmentCount(
    3401  unsigned int side_segment_count
    3402  );
    3403 
    3404  /*
    3405  Parameters:
    3406  facet_type - [in]
    3407  ON_SubD::FacetType::Quad or ON_SubD::FacetType::Tri
    3408 
    3409  display_density - [in]
    3410  >= 0
    3411  Returns:
    3412  total number of points in the limit mesh fragment.
    3413  Remarks:
    3414  The number of points is the same for quad or tri subdivision limit
    3415  mesh fragments, even though one is a rectanglular collection of
    3416  quads and the other is a trianglular collection of triangles.
    3417  */
    3418  static unsigned int PointCountFromDisplayDensity(
    3419  ON_SubD::FacetType facet_type,
    3420  unsigned int display_density
    3421  );
    3422 
    3423  /*
    3424  Parameters:
    3425  display_density - [in]
    3426  >= 0
    3427  Returns:
    3428  total number of faces in the limit mesh fragment.
    3429  */
    3430  static unsigned int FaceCountFromDisplayDensity(
    3431  unsigned int display_density
    3432  );
    3433 
    3434  /*
    3435  Returns:
    3436  true if side_segment_count is valid.
    3437  Otherwise 0 is returned.
    3438  */
    3439  static bool SideSegmentCountIsValid(
    3440  unsigned int side_segment_count
    3441  );
    3442 
    3443  /*
    3444  Returns:
    3445  If side_segment_count is valide, then (side_segment_count+1) is returned.
    3446  Otherwise 0 is returned.
    3447  */
    3448  static unsigned int SidePointCountFromSideCount(
    3449  unsigned int side_segment_count
    3450  );
    3451 
    3452  /*
    3453  Returns:
    3454  If side_segment_count is valide, then (side_segment_count+1)^2 is returned.
    3455  Otherwise 0 is returned.
    3456  */
    3457  static unsigned int QuadGridPointCountFromSideCount(
    3458  unsigned int side_segment_count
    3459  );
    3460 
    3461  /*
    3462  Returns:
    3463  If side_segment_count is valide, then side_segment_count^2 is returned.
    3464  Otherwise 0 is returned.
    3465  */
    3466  static unsigned int QuadGridQuadCountFromSideCount(
    3467  unsigned int side_segment_count
    3468  );
    3469 
    3470 public:
    3471  const class ON_SubDFace* m_face;
    3472 
    3473  // m_face_vertex_index[] stores the information needed for the Vertex()
    3474  // and Edge() functions to work.
    3475  //
    3476  // If m_face is nullptr, then m_face_vertex_index[] has no meaning.
    3477  // If m_face is not nullptr and a corner of the grid is on a face
    3478  // vertex, then the corresponding m_face_vertex_index[] value
    3479  // will be <= ON_SubDFace::MaximumEdgeCount and m_face->Vertex(m_face_vertex_index[])
    3480  // is the vertex. Otherwise, the corresponding m_face_vertex_index[] value
    3481  // will be > ON_SubDFace::MaximumEdgeCount. For partial fragments,
    3482  // only some m_face_vertex_index[] identify vertices and the grid extends
    3483  // halfway along the neighboring face edges are
    3484  unsigned short m_face_vertex_index[4];
    3485 
    3486  /*
    3487  Parameters:
    3488  grid_side_index - [in]
    3489  0 to 3 for quad grids.
    3490  0 to 2 for tri grids
    3491  Returns:
    3492  The subd edge that is on the identified side of the grid.
    3493  */
    3494  const class ON_SubDEdgePtr EdgePtr(
    3495  unsigned int grid_side_index
    3496  ) const;
    3497  const class ON_SubDEdge* Edge(
    3498  unsigned int grid_side_index
    3499  ) const;
    3500 
    3501  const class ON_SubDVertexPtr VertexPtr(
    3502  unsigned int grid_corner_index
    3503  ) const;
    3504  const class ON_SubDVertex* Vertex(
    3505  unsigned int grid_corner_index
    3506  ) const;
    3507 
    3508  ON_3dPoint CornerPoint(
    3509  unsigned int grid_corner_index
    3510  ) const;
    3511 
    3512  /*
    3513  Returns:
    3514  Status of the face.
    3515  */
    3516  ON_ComponentStatus Status() const;
    3517 
    3518  /*
    3519  Returns:
    3520  True if this fragment covers a subset of a face.
    3521  */
    3522  bool IsSubFragment() const;
    3523 
    3524  /*
    3525  Returns:
    3526  True if this fragment covers an entier subd face.
    3527  */
    3528  bool IsCompleteFragment() const;
    3529 
    3530  bool Transform(
    3531  const ON_Xform& xform
    3532  );
    3533 
    3534  unsigned short m_face_fragment_count; // Number of fragments that will be delivered for this face.
    3535  unsigned short m_face_fragment_index; // First fragment has index = 0. Last fragment has index = m_face_fragment_count-1.
    3536 
    3537  // For quad based subdivision algorithms, the mesh fragment
    3538  // is a tesselation of a rectangular shaped surface,
    3539  // there are m_side_count quad edges along each side of the tesselation,
    3540  // there are a total of m_side_count X m_side_count quads, and
    3541  // m_P_count = (m_side_count+1)*(m_side_count+1).
    3542  //
    3543  // For trangle based subdivision algorithms, the mesh fragment
    3544  // is a tesselation of a triangular shaped surface,
    3545  // there are m_side_count triangle edges along each side of the tesselation,
    3546  // there are a total of m_side_count X m_side_count triangles, and
    3547  // m_P_count = (m_side_count+1)*(m_side_count+2)/2.
    3548  //
    3549 
    3550  // Number of points
    3551  unsigned short m_P_count;
    3552  unsigned short m_P_capacity;
    3553 
    3554  // points
    3555  size_t m_P_stride;
    3556  // The memory m_P references is managed by some other class or function.
    3557  // Never modify the values in m_P.
    3558  double* m_P;
    3559 
    3560  // surface normals parallel to m_P[] array
    3561  size_t m_N_stride;
    3562  // If m_N is not nullptr, then it can accomodate up to m_P_capacity normals.
    3563  // The memory m_N references is managed by some other class or function.
    3564  // Never modify the values in m_N.
    3565  double* m_N;
    3566 
    3567  // quads or tris
    3568  ON_SubDLimitMeshFragmentGrid m_grid; //
    3569 
    3570  ON_BoundingBox m_bbox;
    3571 
    3572  ON_SubDLimitMeshFragment* m_next_fragment;
    3573  ON_SubDLimitMeshFragment* m_prev_fragment;
    3574 };
    3575 
    3576 class ON_SUBD_CLASS ON_SubDManagedLimitMeshFragment : public ON_SubDLimitMeshFragment
    3577 {
    3578 public:
    3579  ON_SubDManagedLimitMeshFragment() ON_NOEXCEPT;
    3580  ~ON_SubDManagedLimitMeshFragment() ON_NOEXCEPT;
    3581  ON_SubDManagedLimitMeshFragment(const ON_SubDManagedLimitMeshFragment&) ON_NOEXCEPT;
    3582  ON_SubDManagedLimitMeshFragment& operator=(const ON_SubDManagedLimitMeshFragment&) ON_NOEXCEPT;
    3583 
    3584  static ON_SubDManagedLimitMeshFragment Create(const ON_SubDLimitMeshFragment& src) ON_NOEXCEPT;
    3585 
    3586 #if defined(ON_HAS_RVALUEREF)
    3587  // rvalue copy constructor
    3588  ON_SubDManagedLimitMeshFragment( ON_SubDManagedLimitMeshFragment&& ) ON_NOEXCEPT;
    3589 
    3590  // rvalue assignment operator
    3591  ON_SubDManagedLimitMeshFragment& operator=( ON_SubDManagedLimitMeshFragment&& ) ON_NOEXCEPT;
    3592 #endif
    3593 
    3594  void Clear() ON_NOEXCEPT;
    3595 
    3596  void Destroy() ON_NOEXCEPT;
    3597 
    3598  bool ReserveCapacity(
    3599  ON_SubD::FacetType facet_type,
    3600  unsigned int mesh_density
    3601  ) ON_NOEXCEPT;
    3602 
    3603 private:
    3604  void CopyHelper(const ON_SubDLimitMeshFragment& src);
    3605  size_t m_storage_capacity = 0;
    3606  double* m_storage = nullptr;
    3607 };
    3608 
    3609 //////////////////////////////////////////////////////////////////////////
    3610 //
    3611 // ON_SubDDisplayParameters
    3612 //
    3613 // A collection of parameters that are passed to functions that
    3614 // calculate a various representations of the limit surface.
    3615 //
    3616 class ON_SUBD_CLASS ON_SubDDisplayParameters
    3617 {
    3618 public:
    3619  static const ON_SubDDisplayParameters Empty;
    3620 
    3621  // Parameters for the default limit surface display mesh.
    3622  static const ON_SubDDisplayParameters DefaultDisplayMeshParameters;
    3623 
    3624  /*
    3625  Description:
    3626  In most applications, the caller sets the mesh_density
    3627  and leaves the other parameters set to the default
    3628  values.
    3629  */
    3630  static ON_SubDDisplayParameters CreateFromDisplayDensity(
    3631  unsigned int display_density
    3632  );
    3633 
    3634  ON_SubDDisplayParameters() = default;
    3635  ~ON_SubDDisplayParameters() = default;
    3636  ON_SubDDisplayParameters(const ON_SubDDisplayParameters&) = default;
    3637  ON_SubDDisplayParameters& operator=(const ON_SubDDisplayParameters&) = default;
    3638 
    3639  unsigned int m_display_density = 0;
    3640 
    3641  bool m_bUseMultipleThreads = false;
    3642  ON_Terminator* m_terminator = nullptr;
    3643  // optional progress reporting
    3644  ON_ProgressReporter* m_progress_reporter = nullptr;
    3645  ON_Interval m_progress_reporter_interval = ON_Interval::ZeroToOne;
    3646 };
    3647 
    3648 //////////////////////////////////////////////////////////////////////////
    3649 //
    3650 // ON_SubDLimitMesh
    3651 //
    3652 class ON_SUBD_CLASS ON_SubDLimitMesh
    3653 {
    3654 #if defined(ON_SUBD_CENSUS)
    3655 private:
    3656  ON_SubDLimitMeshCensusCounter m_census_counter;
    3657 #endif
    3658 
    3659 public:
    3660  static const ON_SubDLimitMesh Empty;
    3661 
    3662  /*
    3663  Returns:
    3664  A runtime number that changes if the limit mesh content changes.
    3665  0: Empty limit mesh
    3666  Remarks:
    3667  This is a runtime number. It is not saved in archives and begins
    3668  at 1 with each new runtime instance of the opennurbs library.
    3669  */
    3670  unsigned int ContentSerialNumber() const;
    3671 
    3672  enum : unsigned int
    3673  {
    3674  DefaultDisplayDensity = 4, // default limit mesh density 16x16 quads per SubD quad 16 = 2^4
    3675  MaximumDisplayDensity = 8 // 8 (256x256 quads per SubD quad 256 = 2^8)
    3676  //MaximumLevelOfDetail = 0, // 0 = most facets per fragment
    3677  //MinimumLevelOfDetail = 8 // 8 = fewest facets per fragment
    3678  };
    3679 
    3680  static ON_SubDLimitMesh* Create(
    3681  const ON_SubD& subd,
    3682  const class ON_SubDDisplayParameters& limit_mesh_parameters,
    3683  ON_SubDLimitMesh* destination_mesh
    3684  );
    3685 
    3686  /*
    3687  Description:
    3688  This version is for expert users who want to take
    3689  responsibility for managing the subd and limit mesh
    3690  */
    3691  static ON_SubDLimitMesh* Create(
    3692  ON_SubDFaceIterator fit,
    3693  const class ON_SubDDisplayParameters& limit_mesh_parameters,
    3694  ON_SubDLimitMesh* destination_mesh
    3695  );
    3696 
    3697  ON_SubDLimitMesh() = default;
    3698  ~ON_SubDLimitMesh() = default;
    3699  ON_SubDLimitMesh(const ON_SubDLimitMesh&) = default;
    3700  ON_SubDLimitMesh& operator=(const ON_SubDLimitMesh&) = default;
    3701 
    3702 
    3703 #if defined(ON_HAS_RVALUEREF)
    3704  // rvalue copy constructor
    3705  ON_SubDLimitMesh( ON_SubDLimitMesh&& ) ON_NOEXCEPT;
    3706  // rvalue assignment operator
    3707  ON_SubDLimitMesh& operator=( ON_SubDLimitMesh&& );
    3708 #endif
    3709 
    3710  ON_SubDLimitMesh Copy() const;
    3711 
    3712  ON_SubDLimitMesh& CopyFrom(
    3713  const ON_SubDLimitMesh& src
    3714  );
    3715 
    3716  static void Swap(
    3717  ON_SubDLimitMesh& a,
    3718  ON_SubDLimitMesh& b
    3719  );
    3720 
    3721  bool Transform(
    3722  const ON_Xform& xform
    3723  );
    3724 
    3725  unsigned int DisplayDensity() const;
    3726  ON_SubDDisplayParameters DisplayParameters() const;
    3727  unsigned int FragmentCount() const;
    3728  const ON_SubDLimitMeshFragment* FirstFragment() const; // linked list of mesh fragments
    3729 
    3730  /*
    3731  Description:
    3732  If the subd referenced by m_subd_ref changes, then call
    3733  Update to update the limit mesh.
    3734  */
    3735  bool Update(
    3736  bool bShareUpdate
    3737  );
    3738 
    3739  /*
    3740  Description:
    3741  The ON__INT_PTRs in the tree are const ON_SubDLimitMeshFragment* pointers.
    3742  */
    3743  const ON_RTree& FragmentTree() const;
    3744 
    3745  /*
    3746  Description:
    3747  Clears everything.
    3748  */
    3749  void Clear();
    3750 
    3751  /*
    3752  Description:
    3753  If the tree is not needed and memory resources are tight, then call ClearTree()
    3754  to remove the RTree.
    3755  */
    3756  void ClearTree();
    3757 
    3758  bool IsEmpty() const;
    3759 
    3760  ON_SubD::FacetType GridType() const;
    3761 
    3762  ON_BoundingBox BoundingBox() const;
    3763 
    3764  bool GetTightBoundingBox(
    3765  ON_BoundingBox& bbox,
    3766  bool bGrowBox,
    3767  const ON_Xform* xform
    3768  ) const;
    3769 
    3770  ON_SubDRef SubDRef() const;
    3771  ON_SubD SubD() const;
    3772 
    3773 public:
    3774  /*
    3775  Description:
    3776  Pretend this function and ON_SubDLimitMeshImpl do not exist.
    3777  Returns:
    3778  Something that you are pretending does not exist.
    3779  Remarks:
    3780  It is intentional that the definition of ON_SubDLimitMeshImpl class is not
    3781  available in the opennurbs library interface (not in a header file).
    3782  The size and design of ON_SubDLimitMeshImpl will change constantly.
    3783  If you choose to hack and whack so you can dereference an
    3784  ON_SubDLimitMeshImpl* pointer, then your code will crash unpredictably.
    3785  */
    3786  class ON_SubDLimitMeshImpl* SubLimple() const;
    3787  unsigned int SubLimpleUseCount() const;
    3788 
    3789 private:
    3790 #pragma ON_PRAGMA_WARNING_PUSH
    3791 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    3792  friend class ON_SubDLimitMeshImpl;
    3793  // C4251: ... needs to have dll-interface to be used by clients of class ...
    3794  // m_impl_sp is private and all code that manages m_impl_sp is explicitly implemented in the DLL.
    3795 private:
    3796  std::shared_ptr< class ON_SubDLimitMeshImpl > m_impl_sp;
    3797 #pragma ON_PRAGMA_WARNING_POP
    3798 
    3799 };
    3800 
    3801 
    3802 
    3803 class ON_SUBD_CLASS ON_SubDLimitPatchFragment
    3804 {
    3805 public:
    3806  // No construction for performance reasons.
    3807  // If you require initialization, use = ON_SubDLimitMeshFragment::Empty
    3808  //
    3809  //ON_SubDLimitMeshFragment() = default;
    3810  //~ON_SubDLimitMeshFragment() = default;
    3811  //ON_SubDLimitMeshFragment(const ON_SubDLimitMeshFragment&) = default;
    3812  //ON_SubDLimitMeshFragment& operator=(const ON_SubDLimitMeshFragment&) = default;
    3813 
    3814  // Every field of ON_SubDLimitPatchFragment::Empty is zero.
    3815  static const ON_SubDLimitPatchFragment Empty;
    3816 
    3817  // Every m_patch_cv[][][] value is ON_UNSET_VALUE.
    3818  // Every other field of ON_SubDLimitPatchFragment::Unset is zero.
    3819  static const ON_SubDLimitPatchFragment Unset;
    3820 
    3821  // Every m_patch_cv[][][] value is ON_DBL_QNAN.
    3822  // Every other field of ON_SubDLimitPatchFragment::Unset is zero.
    3823  static const ON_SubDLimitPatchFragment Nan;
    3824 
    3825 #pragma region RH_C_SHARED_ENUM [SubD::PatchType] [Rhino.Geometry.SubD.PatchType] [internal:nested:byte]
    3826  enum class PatchType : unsigned char
    3827  {
    3828  ///<summary>Not a valid patch type.</summary>
    3829  Unset = 0,
    3830 
    3831  ///<summary>Entire subdivision face is an exact bicubic patch.</summary>
    3832  Bicubic = 1,
    3833 
    3834  ///<summary>A quadrant of the subdivision face is an exact bicubic patch.</summary>
    3835  BicubicQuadrant = 2,
    3836 
    3837  ///<summary>Entire subdivision face is approximately a bicubic patch.</summary>
    3838  ApproximateBicubic = 3,
    3839 
    3840  ///<summary>A quadrant of the subdivision face is approximately a bicubic patch.</summary>
    3841  ApproximateBicubicQuadrant = 4,
    3842 
    3843  ///<summary>A patch cannot be calculated at the current subdivision level.</summary>
    3844  None = 5
    3845  };
    3846 #pragma endregion
    3847 
    3848 public:
    3849  double m_patch_cv[5][5][3];
    3850  const double* m_patch_knots[2]; // nullptr or 7 uniform cubic knots. Never modify these values.
    3851 
    3852  const class ON_SubDFace* m_level0_face;
    3853 
    3854 
    3855  // m_patch_state[] reports what information is returned in m_patch_cv[] and m_patch_knots[].
    3856  // m_patch_state[0] report the state for the cubic patch:
    3857  // CV[0][0] = m_patch_cv[0][0], knot[0] = m_patch_knots[0], knot[1] = m_patch_knots[1]
    3858  // m_patch_state[1] report the state for the cubic patch:
    3859  // CV[0][0] = m_patch_cv[1][0], knot[0] = m_patch_knots[0]+1, knot[1] = m_patch_knots[1]
    3860  // m_patch_state[2] report the state for the cubic patch:
    3861  // CV[0][0] = m_patch_cv[1][1], knot[0] = m_patch_knots[0]+1, knot[1] = m_patch_knots[1]+1
    3862  // m_patch_state[3] report the state for the cubic patch:
    3863  // CV[0][0] = m_patch_cv[0][1], knot[0] = m_patch_knots[0], knot[1] = m_patch_knots[1]+1
    3864  ON_SubDLimitPatchFragment::PatchType m_patch_type[4];
    3865 
    3866  unsigned short m_patch_level;
    3867 
    3868  // When the subdivision method is quad based and m_face is a quad, there is one region.
    3869  // When the subdivision method is quad based and m_face is not a quad, there are m_face->m_edge_count regions.
    3870  unsigned short m_level0_face_region_count; // Number of regions in m_face.
    3871  unsigned short m_level0_face_region_index; // First region has index = 0. Last region has index = m_face_region_count-1.
    3872 
    3873  unsigned short m_face_subdivision_count;
    3874  unsigned short m_face_region_index[10]; // vertex index for subdivision
    3875 
    3876 public:
    3877  ON_SubDLimitPatchFragment* m_next_fragment;
    3878  ON_SubDLimitPatchFragment* m_prev_fragment;
    3879 };
    3880 
    3881 
    3882 class ON_SUBD_CLASS ON_SubDSectorLimitPoint
    3883 {
    3884 public:
    3885  // For performance reasons, the default the data members are
    3886  // not initialized by the default constructor
    3887  // Use = ON_SubDSectorLimitPoint::Unset when initialization is required
    3888  static const ON_SubDSectorLimitPoint Unset; // all doubles are ON_UNSET_VALUE, all pointer are nullptr
    3889  static const ON_SubDSectorLimitPoint Nan; // all doubles are ON_DBL_QNAN, all pointer are nullptr
    3890  static const ON_SubDSectorLimitPoint Zero; // all doubles are 0.0, all pointer are nullptr
    3891 
    3892  /*
    3893  Returns:
    3894  true if m_limitP[0] is a nan (like ON_DBL_QNAN).
    3895  false otherwise.
    3896  */
    3897  bool IsUnset() const;
    3898 
    3899  /*
    3900  Returns:
    3901  true if m_limitP[0] is ON_UNSET_VALUE.
    3902  false otherwise.
    3903  */
    3904  bool IsNan() const;
    3905 
    3906  /*
    3907  Returns:
    3908  true if all coordinates are zero.
    3909  false otherwise.
    3910  */
    3911  bool IsZero() const;
    3912 
    3913  /*
    3914  Returns:
    3915  true if all coordinates are valid doubles and the tangents and normal have at least
    3916  one nonzero coordinate.
    3917  false otherwise.
    3918  */
    3919  bool IsSet() const;
    3920 
    3921  bool Transform(
    3922  const ON_Xform& xform
    3923  );
    3924 
    3925  // limit surface point, tangents and normal
    3926  double m_limitP[3]; // point
    3927  double m_limitT1[3]; // first unit tangent
    3928  double m_limitT2[3]; // second unit tangent
    3929  double m_limitN[3]; // unit normal (same direction as m_limitT1 x m_limitT2)
    3930 
    3931  // When an ON_SubDVertex has a single sector, these pointers are both null.
    3932  // When an ON_SubDVertex has a multiple sectors,
    3933  // m_sector_face is the "first" face in the sector and
    3934  // m_next_sector_limit_point is used to create a linked list.
    3935  // (The "first" face in a sector is the one ON_SubDSectorIterator.IncrementToCrease(-1) returns.)
    3936  const class ON_SubDSectorLimitPoint* m_next_sector_limit_point; // nullptr for vertices with one sector
    3937  const class ON_SubDFace* m_sector_face; // nullptr for vertices with one sector
    3938 };
    3939 
    3940 
    3941 
    3942 ////////////////////////////////////////////////////////////////////////////
    3943 //
    3944 // ON_SubDComponentBase
    3945 //
    3946 class ON_SUBD_CLASS ON_SubDComponentBase
    3947 {
    3948 public:
    3949  static const ON_SubDComponentBase Unset;
    3950 
    3951  ///*
    3952  //Returns:
    3953  // True if component is not nullptr, component->m_id > 0 and component->m_archive_id != ON_UNSET_UINT_INDEX.
    3954  //*/
    3955  //static bool IsActive(
    3956  // const ON_SubDComponentBase* component
    3957  // );
    3958 
    3959 public:
    3960  ON_SubDComponentBase() = default;
    3961  ~ON_SubDComponentBase() = default;
    3962  ON_SubDComponentBase(const ON_SubDComponentBase&) = default;
    3963  ON_SubDComponentBase& operator=(const ON_SubDComponentBase&) = default;
    3964 
    3965 public:
    3966  // The audience for this comment is anybody who wants to change the data
    3967  // fields in ON_SubDComponentBase. Everyone else should ignore this comment.
    3968  // ON_SubD components come from ON_FixedSizePool and ON_SubD code
    3969  // uses ON_FixedSizePool.ReturnElement. The first sizeof(void*) bytes
    3970  // must be a data field that is not referenced in returned elements.
    3971  // Since a returned element cannot have a "next level vertex",
    3972  // m_subd_point1 is a good data member to put first.
    3973 
    3974  // m_subd_point1 points to the next level's vertex when this component
    3975  // has been subdivided using an algorithm like Catmull-Clark or Loop-Warren.
    3976  const class ON_SubDVertex* m_subd_point1 = nullptr;
    3977 
    3978 public:
    3979  // The audience for this comment is anybody who wants to change the data
    3980  // fields in ON_SubDComponentBase. Everyone else should ignore this comment.
    3981  // It is critical that the offset of m_id in ON_SubDComponentBase be >= sizeof(void*).
    3982  // ON_SubD components come from ON_FixedSizePool and ON_SubD code
    3983  // use ON_FixedSizePool.ElementFromId and ON_FixedSizePool.ReturnElement.
    3984  // Once assigned, m_id is never changed and that allows ON_SubD component
    3985  // indices to work.
    3986 
    3987  // Id assigned to this component. Never modify this value. It is assigned
    3988  // by allocators and used to find the component from an ON_COMPONENT_INDEX.
    3989  unsigned int m_id = 0;
    3990 
    3991 private:
    3992  // The m_archive_id must be immediately after the m_id field.
    3993  mutable unsigned int m_archive_id = 0;
    3994 
    3995 public:
    3996  unsigned short m_level = 0;
    3997 
    3998 public:
    4000 
    4001 public:
    4002 
    4003  //////////////////////////////////////////////////////////////
    4004  //
    4005  // Saved subdivision point
    4006  //
    4007  /*
    4008  Description:
    4009  Set the saved subdivision point.
    4010  Parameters:
    4011  subdivision_point_type - [in]
    4012  Specifies subdivision algorithm.
    4013  Use ON_SubD::SubDType::Unset to clear the cache.
    4014  subdivision_point - [in]
    4015  includes displacement if it exists
    4016  Returns:
    4017  true if successful
    4018  */
    4019  bool SetSavedSubdivisionPoint(
    4020  ON_SubD::SubDType subd_type,
    4021  const double subdivision_point[3]
    4022  ) const;
    4023 
    4024  bool GetSavedSubdivisionPoint(
    4025  ON_SubD::SubDType subd_type,
    4026  double subdivision_point[3]
    4027  ) const;
    4028 
    4029  ON_SubD::SubDType SavedSubdivisionPointType() const;
    4030 
    4031  /*
    4032  Description:
    4033  Clears saved subdivision information for this component.
    4034  */
    4035  void ClearSavedSubdivisionPoint() const;
    4036 
    4037  //////////////////////////////////////////////////////////////
    4038  //
    4039  // displacement applied to subdivision point
    4040  //
    4041  bool SetDisplacement(
    4042  ON_SubD::SubDType subd_type,
    4043  const double displacement[3]
    4044  );
    4045 
    4046  bool GetDisplacement(
    4047  ON_SubD::SubDType subd_type,
    4048  double displacement[3]
    4049  ) const;
    4050 
    4051  ON_SubD::SubDType DisplacementType() const;
    4052 
    4053  void ClearDisplacement() const;
    4054 
    4055 protected:
    4056  // GetSubdivisionPoint( bUseSavedSubdivisionPoint=true ) can change the value of m_saved_points_flags
    4057  // m_saved_points_flags & 0x1F = ON_SubD::SubDType value
    4058  // m_saved_points_flags & 0x40 != 0 if m_cache_subd_P is set.
    4059  // m_saved_points_flags & 0x80 != 0 if m_displacementV is set.
    4060  // GetLimitPoint( bUseSavedLimitPoint=true ) can change the value of m_saved_points_flags
    4061  // m_saved_points_flags & 0x20 != 0 if ON_subDVertex.m_limit* values are set.
    4062  mutable unsigned char m_saved_points_flags = 0U;
    4063 
    4064 public:
    4065 
    4066  // All the faces with the same nonzero value of m_group_id are in the same "group".
    4067  // SDK interface on ON_SubD will be added after we get a better idea of how this
    4068  // feature will be used.
    4069  unsigned int m_group_id = 0U;
    4070 
    4071 protected:
    4072  // GetSubdivisionPoint( bUseSavedSubdivisionPoint=true ) can change the value of m_cache_subd_P
    4073  mutable double m_saved_subd_point1[3]; // saved subdivision point
    4074 
    4075 protected:
    4076  // optional displacement applied to standard subdivision point.
    4077  double m_displacement_V[3];
    4078 
    4079 public:
    4080  /*
    4081  Description:
    4082  Pretend ArchiveId() and SetArchiveId() do not exist.
    4083  Returns:
    4084  The ArchiveId is a value set and used by ON_BinaryArchive Read() and Write()
    4085  functions and copy constructors and operator=().
    4086  A public interface is supplied because it is not practical to use friends.
    4087  Remarks:
    4088  A value of ON_UNSET_UINT_INDEX indicates the component is not in use.
    4089  */
    4090  unsigned int ArchiveId() const
    4091  {
    4092  return m_archive_id;
    4093  }
    4094 
    4095  void SetArchiveId(
    4096  unsigned int archive_id
    4097  ) const
    4098  {
    4099  // m_archive_id is mutable
    4100  if ( ON_UNSET_UINT_INDEX != archive_id )
    4101  m_archive_id = archive_id;
    4102  }
    4103 
    4104 protected:
    4105  void CopyBaseFrom(
    4106  const ON_SubDComponentBase* src
    4107  );
    4108 };
    4109 
    4110 ////////////////////////////////////////////////////////////////////////////
    4111 //
    4112 // ON_SubDVertex
    4113 //
    4114 class ON_SUBD_CLASS ON_SubDVertex : public ON_SubDComponentBase
    4115 {
    4116 public:
    4117  static const ON_SubDVertex Empty;
    4118 
    4119  bool Write (
    4120  class ON_BinaryArchive& archive
    4121  ) const;
    4122 
    4123  static bool Read (
    4124  class ON_BinaryArchive& archive,
    4125  class ON_SubD& subd,
    4126  class ON_SubDVertex*& vertex
    4127  );
    4128 
    4129  /*
    4130  Description:
    4131  Apply a tranxfomration matrix to vertex geometry information.
    4132  Parameters:
    4133  bTransformationSavedSubdivisionPoint - [in]
    4134  If the transformation is being applied to every vertex, edge and
    4135  face in every level of a subdivision object, and the transformation
    4136  is an isometry (rotation, translation, ...), a uniform scale, or a
    4137  composition of these types, then set
    4138  bTransformationSavedSubdivisionPoint = true to apply the
    4139  transformation to saved subdivision and saved limit point information.
    4140  In all other cases, set bTransformationSavedSubdivisionPoint = false
    4141  and any saved subdivision points or saved limit points will be
    4142  deleted. When in doubt, pass false.
    4143 
    4144  xform - [in]
    4145  */
    4146  bool Transform(
    4147  bool bTransformationSavedSubdivisionPoint,
    4148  const class ON_Xform& xform
    4149  );
    4150 
    4151  bool SetLocation(
    4152  ON_3dPoint location,
    4153  bool bClearNeighborhoodCache
    4154  );
    4155 
    4156 
    4157  ON_BoundingBox ControlNetBoundingBox() const;
    4158  ON_BoundingBox LimitSurfaceBoundingBox(
    4159  const ON_SubD& subd
    4160  ) const;
    4161 
    4162 public:
    4163  ON_COMPONENT_INDEX ComponentIndex() const;
    4164  ON_SubDComponentPtr ComponentPtr() const;
    4165 
    4166 public:
    4167  const class ON_SubDVertex* m_prev_vertex = nullptr; // linked list of vertices on this level
    4168  const class ON_SubDVertex* m_next_vertex = nullptr; // linked list of vertices on this level
    4169 
    4170 public:
    4171  ON_SubD::VertexTag m_vertex_tag = ON_SubD::VertexTag::Unset;
    4172 
    4173 
    4174 private:
    4175  //ON_SubD::VertexEdgeOrder m_vertex_edge_order = ON_SubD::VertexEdgeOrder::unset;
    4176  unsigned char m_reserved1 = 0;
    4177  unsigned short m_reserved2 = 0;
    4178  unsigned int m_reserved3 = 0;
    4179 
    4180 public:
    4181  unsigned short m_edge_count = 0;
    4182  unsigned short m_face_count = 0;
    4183 
    4184  unsigned short m_edge_capacity = 0;
    4185  unsigned short m_face_capacity = 0;
    4186 
    4187 public:
    4188  // Array of m_edge_count edges.
    4189  // m_edge[i].EdgeDirection() indicates which edge end is located at this vertex
    4190  // If m_edge_capacity > 0, m_edge_capacity is the number of elements that
    4191  // may be used in m_edges[].
    4192  class ON_SubDEdgePtr* m_edges = nullptr;
    4193 
    4194  // Array of m_face_count faces.
    4195  // If m_face_capacity > 0, m_face_capacity is the number of elements that
    4196  // may be used in m_faces[].
    4197  const class ON_SubDFace** m_faces = nullptr;
    4198 
    4199 public:
    4200  double m_P[3]; // vertex location
    4201 
    4202 private:
    4203  // Cached limit point and limit normal
    4204  // GetLimitPoint( bUseSavedLimitPoint=true ) can change the value of m_limitP_type
    4205  // If the limit point is set and vertex has a single sector, then
    4206  // m_limit_point.m_sector_face = nullptr and m_limit_point.m_next_sector_limit_point = nullptr.
    4207  // If the limit point is set and vertex has a multiple sectors, then
    4208  // m_limit_point.m_sector_face = first face in the sector.
    4209  // If multiple limit points are set, then are in a linked list
    4210  // traversed using the ON_SubDSectorLimitPointm_next_sector_limit_point.
    4211  // The second and any additional limit points are managed by a fixed size pool.
    4212  // Calling ClearLimitPoint() will return these to the pool.
    4213  mutable ON_SubDSectorLimitPoint m_limit_point = ON_SubDSectorLimitPoint::Unset;
    4214 
    4215 public:
    4216  static const unsigned int MaximumEdgeCount;
    4217  static const unsigned int MaximumFaceCount;
    4218 
    4219  static int CompareUnorderedEdges(
    4220  const ON_SubDVertex* a,
    4221  const ON_SubDVertex* b
    4222  );
    4223 
    4224  static int CompareUnorderedFaces(
    4225  const ON_SubDVertex* a,
    4226  const ON_SubDVertex* b
    4227  );
    4228 
    4229  static int CompareUnorderedEdgesAndFaces(
    4230  const ON_SubDVertex* a,
    4231  const ON_SubDVertex* b
    4232  );
    4233 
    4234  ///*
    4235  //Description:
    4236  // Sort the m_edges[] and m_faces[] arrays so radial groups are together.
    4237  // After the sorting is completed, m_vertex_edge_order is set to recored
    4238  // the current sorting state and its value is returned.
    4239  // The sorting is done unconditionally.
    4240  //*/
    4241  //ON_SubD::VertexEdgeOrder SortEdges();
    4242 
    4243  unsigned int EdgeCount(
    4244  ON_SubD::EdgeTag edge_tag
    4245  ) const;
    4246 
    4247  unsigned int EdgeCount() const;
    4248 
    4249  const class ON_SubDEdge* Edge(
    4250  unsigned int i
    4251  ) const;
    4252 
    4253  const ON_SubDEdgePtr EdgePtr(
    4254  unsigned int i
    4255  ) const;
    4256 
    4257  ON__UINT_PTR EdgeDirection(
    4258  unsigned int i
    4259  ) const;
    4260 
    4261  unsigned int EdgeArrayIndex(
    4262  const ON_SubDEdge* edge
    4263  ) const;
    4264 
    4265  unsigned int FaceCount() const;
    4266 
    4267  const class ON_SubDFace* Face(
    4268  unsigned int i
    4269  ) const;
    4270 
    4271  unsigned int FaceArrayIndex(
    4272  const ON_SubDFace* face
    4273  ) const;
    4274 
    4275  ON_SubD::FacetType FirstFaceFacetType() const;
    4276 
    4277  /*
    4278  Returns
    4279  true if m_vertex_tag is ON_SubD::VertexTag::Crease, ON_SubD::VertexTag::Corner or ON_SubD::VertexTag::Dart.
    4280  */
    4281  bool IsTagged() const;
    4282 
    4283  ///*
    4284  //Parameters:
    4285  // subd_type - [in]
    4286  // Specifies subdivision algorithm
    4287  // vertex_tag_filter - [in]
    4288  // If vertex_tag is not ON_SubD::VertexTag::Unset and vertex_tag != m_vertex_tag,
    4289  // then false is returned. This parameter can be used when a smooth or crease
    4290  // vertex is explicity required.
    4291  // bTestFaces - [in]
    4292  // If true, and the edge and face count tests succeed, then the faces in the
    4293  // vertex m_faces[] array are tested to insure they are
    4294  // quads (ccquad subdivisiontype) or tris (lwtri subdivisiontype).
    4295  //Returns:
    4296  // If m_vertex_tag is ON_SubD::Vertex::Tag::smooth,
    4297  // and the number of edges = number of faces,
    4298  // and there are 4 (ccquad subdivisiontype) or 6 (lwtri subdivisiontype) edges,
    4299  // and bTestFaces is false or the faces pass the face test,
    4300  // then true is returned.
    4301  //
    4302  // If m_vertex_tag is ON_SubD::Vertex::Tag::crease,
    4303  // and the number of edges = 1 + number of faces,
    4304  // and there are 3 (ccquad subdivisiontype) or 4 (lwtri subdivisiontype) edges,
    4305  // and bTestFaces is false or the faces pass the face test,
    4306  // then true is returned.
    4307 
    4308  // In all other cases, false is returned.
    4309  //*/
    4310  //bool IsOrdinary(
    4311  // ON_SubD::SubDType subd_type,
    4312  // ON_SubD::VertexTag vertex_tag_filter,
    4313  // bool bTestFaces
    4314  // ) const;
    4315 
    4316 
    4317  /*
    4318  Returns:
    4319  True if m_vertex_tag is ON_SubD::VertexTag::Smooth.
    4320  */
    4321  bool IsSmooth() const;
    4322 
    4323  /*
    4324  Returns:
    4325  True if m_vertex_tag is ON_SubD::VertexTag::Crease.
    4326  */
    4327  bool IsCrease() const;
    4328 
    4329  /*
    4330  Returns:
    4331  True if m_vertex_tag is ON_SubD::VertexTag::Corner.
    4332  */
    4333  bool IsCorner() const;
    4334 
    4335  /*
    4336  Returns:
    4337  True if m_vertex_tag is ON_SubD::VertexTag::Dart.
    4338  */
    4339  bool IsDart() const;
    4340 
    4341  /*
    4342  Returns:
    4343  True if m_vertex_tag is ON_SubD::VertexTag::Smooth or ON_SubD::VertexTag::Crease.
    4344  */
    4345  bool IsSmoothOrCrease() const;
    4346 
    4347  /*
    4348  Returns:
    4349  True if m_vertex_tag is ON_SubD::VertexTag::Crease or ON_SubD::VertexTag::Corner.
    4350  */
    4351  bool IsCreaseOrCorner() const;
    4352 
    4353  /*
    4354  Returns:
    4355  True if m_vertex_tag is ON_SubD::VertexTag::Crease or ON_SubD::VertexTag::Corner or ON_SubD::VertexTag::Dart.
    4356  */
    4357  bool IsCreaseOrCornerOrDart() const;
    4358 
    4359  /*
    4360  Returns:
    4361  True if m_vertex_tag is ON_SubD::VertexTag::Smooth or ON_SubD::VertexTag::Dart.
    4362  */
    4363  bool IsSmoothOrDart() const;
    4364 
    4365  /*
    4366  Description:
    4367  A "standard" vertex is one where the standard subdivsion matrix for that vertex
    4368  can be used to calculate the subdivision point.
    4369  This function is desinged to be useful for testing and debugging code when
    4370  a certain situation is expected to exist. It is not used for evaluation
    4371  because it is too slow.
    4372 
    4373  Returns:
    4374  True if the subdivison point of the vertex can be calulated using the standard
    4375  subdivion matrix for the vertex type and face count.
    4376 
    4377  Remarks:
    4378  If the vertex is tagged and has multiple sectors, like an interior
    4379  crease or corner vertex, then this function will return false.
    4380  In this situation, it is possible that the vertex, as the center of a
    4381  sector, is standard.
    4382  */
    4383  bool IsStandard(
    4384  ON_SubD::SubDType subd_type
    4385  ) const;
    4386 
    4387  /*
    4388  Parameters:
    4389  subdivision_point_type - [in]
    4390  Selects subdivision algorithm. Must be either
    4391  ON_SubD::SubDType::TriLoopWarren or ON_SubD::SubDType::QuadCatmullClark.
    4392  bUseSavedSubdivisionPoint - [in]
    4393  If there is a saved subdivision point and bUseSavedSubdivisionPoint
    4394  is true, then the saved value is returned.
    4395  subdivision_point - [out]
    4396  Returns:
    4397  true if successful
    4398  */
    4399  bool GetSubdivisionPoint(
    4400  ON_SubD::SubDType subdivision_point_type,
    4401  bool bUseSavedSubdivisionPoint,
    4402  double subdivision_point[3]
    4403  ) const;
    4404 
    4405  /*
    4406  Parameters:
    4407  facet_type - [in]
    4408  Selects subdivision algorithm.
    4409  bUseSavedLimitPoint - [in]
    4410  If there is a saved limit point and normal and bUseSavedLimitPoint
    4411  is true, then the saved value is used.
    4412  limit_point - [out]
    4413  Returns:
    4414  true if successful
    4415  */
    4416  bool GetLimitPoint(
    4417  ON_SubD::SubDType subd_type,
    4418  const ON_SubDFace* sector_face,
    4419  bool bUseSavedLimitPoint,
    4420  class ON_SubDSectorLimitPoint& limit_point
    4421  ) const;
    4422 
    4423  /*
    4424  Description:
    4425  Save limit point and limit normal for future use.
    4426  Parameters:
    4427  subd_type - [in]
    4428  limit_point - [in]
    4429  limit_normal - [in]
    4430  Returns:
    4431  true if successful
    4432  */
    4433  bool SetSavedLimitPoint(
    4434  ON_SubD::SubDType subd_type,
    4435  const ON_SubDSectorLimitPoint limit_point
    4436  ) const;
    4437 
    4438  void ClearSavedLimitPoints() const;
    4439 
    4440  /*
    4441  Returns:
    4442  ON_SubD::SubDType::TriLoopWarren
    4443  The vertex limit point and normal are saved for Loop trianglular subdivision.
    4444  ON_SubD::SubDType::QuadCatmullClark
    4445  The vertex limit point and normal are saved for Catmull-Clark quad subdivision.
    4446  ON_SubD::SubDType::Unset
    4447  The vertex limit point and normal are not saved.
    4448  */
    4449  ON_SubD::SubDType SavedLimitPointType() const;
    4450 
    4451  /*
    4452  Description:
    4453  Report what type of facet or facets use this vertex.
    4454  */
    4455  ON_SubD::VertexFacetType VertexFacetTypes() const;
    4456 
    4457 
    4458  /*
    4459  Description:
    4460  Call this function if the vertex is modified and it will clear any
    4461  cached subdivision information that needs to be recalculated.
    4462  */
    4463  void VertexModifiedNofification() const;
    4464 
    4465 private:
    4466  static bool GetQuadPoint(
    4467  const class ON_SubDVertex* vertex, // smooth or dart
    4468  bool bUseSavedSubdivisionPoint,
    4469  double vertex_point[3]
    4470  );
    4471 
    4472  static bool GetTriPoint(
    4473  const class ON_SubDVertex* vertex, // smooth or dart
    4474  bool bUseSavedSubdivisionPoint,
    4475  double vertex_point[3]
    4476  );
    4477 
    4478  static unsigned int GetFacePointSum(
    4479  const ON_SubDFace* face,
    4480  const ON_SubDVertex* vertex,
    4481  double* facePsum // sum of points that are not immediately adjacent to vertex
    4482  );
    4483 
    4484 
    4485  /*
    4486  Description:
    4487  Used for smooth and dart vertices when there are faces
    4488  that use the vertex have different numbers of sides.
    4489  This typically happen when a quad subd control net is
    4490  being subdivided for the first time.
    4491  Parameters:
    4492  vertex - [in]
    4493  vertex_point - [out]
    4494  Returns:
    4495  true if successful
    4496  */
    4497  static bool GetGeneralQuadSubdivisionPoint(
    4498  const class ON_SubDVertex* vertex,
    4499  bool bUseSavedSubdivisionPoint,
    4500  double vertex_point[3]
    4501  );
    4502 
    4503 private:
    4504  friend class ON_SubDArchiveIdMap;
    4505  void CopyFrom(
    4506  const ON_SubDVertex* src,
    4507  bool bCopyEdgeArray,
    4508  bool bCopyFaceArray,
    4509  bool bCopyLimitPointList
    4510  );
    4511 };
    4512 
    4513 //////////////////////////////////////////////////////////////////////////
    4514 //
    4515 // ON_SubDEdge
    4516 //
    4517 class ON_SUBD_CLASS ON_SubDEdge : public ON_SubDComponentBase
    4518 {
    4519 public:
    4520  static const ON_SubDEdge Empty;
    4521 
    4522  bool Write (
    4523  class ON_BinaryArchive& archive
    4524  ) const;
    4525 
    4526  static bool Read (
    4527  class ON_BinaryArchive& archive,
    4528  class ON_SubD& subd,
    4529  class ON_SubDEdge*& edge
    4530  );
    4531 
    4532  /*
    4533  Description:
    4534  Apply a tranxfomration matrix to vertex geometry information.
    4535 
    4536  Parameters:
    4537  bTransformationSavedSubdivisionPoint - [in]
    4538  If the transformation is being applied to every vertex, edge and
    4539  face in every level of a subdivision object, and the transformation
    4540  is an isometry (rotation, translation, ...), a uniform scale, or a
    4541  composition of these types, then set
    4542  bTransformationSavedSubdivisionPoint = true to apply the
    4543  transformation to saved subdivision and saved limit point information.
    4544  In all other cases, set bTransformationSavedSubdivisionPoint = false
    4545  and any saved subdivision points or saved limit points will be
    4546  deleted. When in doubt, pass false.
    4547 
    4548  xform - [in]
    4549  */
    4550  bool Transform(
    4551  bool bTransformationSavedSubdivisionPoint,
    4552  const class ON_Xform& xform
    4553  );
    4554 
    4555  ON_BoundingBox ControlNetBoundingBox() const;
    4556  ON_BoundingBox LimitSurfaceBoundingBox(
    4557  const ON_SubD& subd
    4558  ) const;
    4559 
    4560 
    4561  /*
    4562  Description:
    4563  Call this function if the edge is modified and it will clear any
    4564  cached subdivision information that needs to be recalculated.
    4565  */
    4566  void EdgeModifiedNofification() const;
    4567 
    4568 
    4569 public:
    4570  ON_COMPONENT_INDEX ComponentIndex() const;
    4571  ON_SubDComponentPtr ComponentPtr() const;
    4572 
    4573 public:
    4574  const class ON_SubDEdge* m_prev_edge = nullptr; // linked list of edges on this level
    4575  const class ON_SubDEdge* m_next_edge = nullptr; // linked list of edges on this level
    4576 
    4577 public:
    4578  // When checking the edge tag, it is important to consider what
    4579  // should happen in the ON_SubD::EdgeTag::X case. It is strongly
    4580  // suggested that you use the member functions ON_SubDEdge::IsSmooth()
    4581  // and ON_SubDEdge::IsCrease() instead of comparing m_edge_tag to
    4582  // ON_SubD::EdgeTag values.
    4583  ON_SubD::EdgeTag m_edge_tag = ON_SubD::EdgeTag::Unset;
    4584 
    4585 private:
    4586  unsigned char m_reserved1 = 0;
    4587  unsigned short m_reserved2 = 0;
    4588 
    4589 public:
    4590  // Array of m_face_count faces.
    4591  //
    4592  // The first two are in m_face2[0] and m_face2[1].
    4593  // When m_face_count > 3, the third and additional faces
    4594  // are in m_facex[0], ..., m_facex[m_face_count-3];
    4595  //
    4596  // The value of ON_SubDFacePtr.FaceDirection() is 0 if the
    4597  // edge's natural orientation from m_vertex[0] to m_vertex[1]
    4598  // agrees with the face's boundary orientation.
    4599  //
    4600  // The value of ON_SubDFacePtr.FaceDirection() is 1 if the
    4601  // edge's natural orientation from m_vertex[0] to m_vertex[1]
    4602  // is opposited the face's boundary orientation.
    4603  static const unsigned int MaximumFaceCount;
    4604  unsigned short m_face_count = 0;
    4605  unsigned short m_facex_capacity = 0;
    4606  ON_SubDFacePtr m_face2[2];
    4607  ON_SubDFacePtr* m_facex = nullptr;
    4608 
    4609  // m_vertex[0] = vertex at the start of the edge.
    4610  // m_vertex[1] = vertex at the end of the edge.
    4611  const class ON_SubDVertex* m_vertex[2];
    4612 
    4613  // If the value of vertex->m_vertex_tag is not ON_SubD::VertexTag::Smooth,
    4614  // then that vertex is "tagged".
    4615  //
    4616  // If the value of m_edge_tag is ON_SubD::EdgeTag::Crease,
    4617  // then m_sector_coefficient[] should be {0,0}.
    4618  // In any case m_sector_coefficient[] values are ignored and the
    4619  // midpoint of the edge is the location of the edge.s subdivision point.
    4620  // The edge's subdivision vertex will be tagged as ON_SubD::VertexTag::Crease
    4621  // and both subdivision edges will be tagged as ON_SubD::EdgeTag::Crease.
    4622  //
    4623  // If the value of m_edge_tag is ON_SubD::EdgeTag::Smooth
    4624  // and neither end vertex is tagged, then m_sector_coefficient[] should be {0,0}.
    4625  // In any case m_sector_coefficient[] values are ignored on smooth edges
    4626  // with smooth vertices at both ends.
    4627  // The edge's subdivision vertex will be tagged as ON_SubD::VertexTag::Smooth
    4628  // and both subdivision edges will be tagged as ON_SubD::EdgeTag::Smooth.
    4629  //
    4630  // If the value of m_edge_tag is ON_SubD::EdgeTag::Smooth and
    4631  // exactly one end vertex is tagged, then the m_sector_coefficient[]
    4632  // value for the tagged end is calculated by ON_SubDSectorType::SectorWeight().
    4633  // tagged_weight*tagged_vertex + (1.0 - tagged_weight)*untagged_vertex
    4634  // is used when combining the edge ends.
    4635  // The edge's subdivision vertex will be tagged as ON_SubD::VertexTag::Smooth
    4636  // and both subdivision edges will be tagged as ON_SubD::EdgeTag::Smooth.
    4637  //
    4638  // If the value of m_edge_tag is ON_SubD::EdgeTag::X, then the edge
    4639  // must have exactly two neighboring faces,
    4640  // both vertices must be tagged and the m_sector_coefficient[]
    4641  // values are calculated by ON_SubDSectorType::SectorWeight().
    4642  // When the edge is subdivided, the midpoint of the edge is the
    4643  // location of the edge.s subdivision point.
    4644  // The edge's subdivision vertex will be tagged as ON_SubD::VertexTag::Smooth
    4645  // and both subdivision edges will be tagged as ON_SubD::EdgeTag::Smooth.
    4646  //
    4647  // If the value of m_edge_tag is ON_SubD::EdgeTag::Smooth
    4648  // and both end vertices are tagged, that is a severe error
    4649  // condition and the edge is subdivided at its midpoint.
    4650  //
    4651  // If the value of m_edge_tag is ON_SubD::EdgeTag::X
    4652  // and both end vertices are not tagged, that is a severe error
    4653  // condition and the edge is subdivided at its midpoint.
    4654  double m_sector_coefficient[2];
    4655 
    4656  // If m_edge_tag is not ON_SubD::EdgeTag::Sharp, then m_sharpness is ignored.
    4657  // If m_edge_tag is ON_SubD::EdgeTag::Sharp, then m_sharpness controls how hard/soft
    4658  // the edge appears.
    4659  // The behavior of a "sharp" edge with m_sharpness = 1 is identical to a crease edge.
    4660  // A "sharp" edge with m_sharpness = 0 is identical to a smooth edge.
    4661  // For this reason, m_sharpness must be > 0 and < 1.
    4662  double m_sharpness = 0.0;
    4663 
    4664 public:
    4665  unsigned int FaceCount() const;
    4666 
    4667  ON_SubDFacePtr FacePtr(
    4668  unsigned int i
    4669  ) const;
    4670 
    4671  ON_SubDFacePtr FacePtr(
    4672  const class ON_SubDFace* f
    4673  ) const;
    4674 
    4675  const class ON_SubDFace* Face(
    4676  unsigned int i
    4677  ) const;
    4678 
    4679  ON__UINT_PTR FaceDirection(
    4680  unsigned int i
    4681  ) const;
    4682 
    4683  unsigned int FaceArrayIndex(
    4684  const class ON_SubDFace* f
    4685  ) const;
    4686 
    4687  /*
    4688  Description:
    4689  Expert user tool to remove a face from the edges's face array.
    4690  Remarks:
    4691  Does not modify the face. If the edge is referenced in the face's edge array,
    4692  then the edge must be removed from the face's edge array.
    4693  */
    4694  bool RemoveFaceFromArray(
    4695  const ON_SubDFace* f
    4696  );
    4697 
    4698  /*
    4699  Description:
    4700  Expert user tool to remove a face from the edges's face array.
    4701  Remarks:
    4702  Does not modify the face. If the edge is referenced in the face's edge array,
    4703  then the edge must be removed from the face's edge array.
    4704  */
    4705  bool RemoveFaceFromArray(
    4706  unsigned int i,
    4707  ON_SubDFacePtr& removed_face
    4708  );
    4709 
    4710  /*
    4711  Description:
    4712  Expert user tool to add a face from the edges's face array.
    4713  Remarks:
    4714  Does not modify the face. If the edge is not referenced in the face's edge array,
    4715  then the edge must be inserted in the correct location in the faces array.
    4716  If you are creating a non-manifold SubD, you must first reserve m_facex[]
    4717  capacity by calling ON_SubD::GrowEdgeFaceArray().
    4718  */
    4719  bool AddFaceToArray(
    4720  ON_SubDFacePtr face_ptr
    4721  );
    4722 
    4723  const class ON_SubDVertex* Vertex(
    4724  unsigned int i
    4725  ) const;
    4726 
    4727  /*
    4728  Description:
    4729  Return the vertex at the other end of the edge.
    4730  Parameters:
    4731  vertex - [in]
    4732  A vertex referenced in the edge's m_vertex[] array.
    4733  Returns:
    4734  If vertex is not nullptr and exactly one of m_vertex[] is equal to vertex,
    4735  then the other m_vertex[] pointer is returned.
    4736  In any other case, nullptr is returned.
    4737  */
    4738  const ON_SubDVertex* OtherEndVertex(
    4739  const ON_SubDVertex* vertex
    4740  ) const;
    4741 
    4742  /*
    4743  Description:
    4744  Return the neighboring face.
    4745  Parameters:
    4746  face - [in]
    4747  A face referenced in the edge's m_face2[] array.
    4748  bStopAtCrease - [in]
    4749  If true and if m_edge_tag = ON_SubD::EdgeTag::Crease,
    4750  then nullptr is returned.
    4751  Returns:
    4752  If the m_face_count = 2,
    4753  m_edge_tag is smooth or x or passes the crease tag test,
    4754  one of m_face2[0,1] points a face, then
    4755  the neighboring face is returned.
    4756  In any other case, nullptr is returned.
    4757  */
    4758  const ON_SubDFace* NeighborFace(
    4759  const ON_SubDFace* face,
    4760  bool bStopAtCrease
    4761  ) const;
    4762 
    4763  /*
    4764  Description:
    4765  Return the neighboring face.
    4766  Parameters:
    4767  face - [in]
    4768  A face referenced in the edge's m_face2[] array.
    4769  bStopAtCrease - [in]
    4770  If true and if m_edge_tag = ON_SubD::EdgeTag::Crease,
    4771  then nullptr is returned.
    4772  Returns:
    4773  If the m_face_count = 2,
    4774  m_edge_tag is smooth or x or passes the crease tag test,
    4775  one of m_face2[0,1] points a face, then
    4776  the neighboring face is returned.
    4777  In any other case, ON_SubDFacePtr::Null is returned.
    4778  */
    4779  const ON_SubDFacePtr NeighborFacePtr(
    4780  const ON_SubDFace* face,
    4781  bool bStopAtCrease
    4782  ) const;
    4783 
    4784 
    4785 
    4786  /*
    4787  Returns:
    4788  True if m_edge_tag is ON_SubD::EdgeTag::Smooth.
    4789  bEdgeTagXresult if m_edge_tag is ON_SubD::EdgeTag::X.
    4790  False in all other cases.
    4791  */
    4792  bool IsSmooth(
    4793  bool bEdgeTagXresult
    4794  ) const;
    4795 
    4796  /*
    4797  Returns:
    4798  True if m_edge_tag is ON_SubD::EdgeTag::Crease.
    4799  bEdgeTagXresult if m_edge_tag is ON_SubD::EdgeTag::X.
    4800  False in all other cases.
    4801  */
    4802  bool IsCrease(
    4803  bool bEdgeTagXresult
    4804  ) const;
    4805 
    4806  /*
    4807  Returns:
    4808  0: end vertices are not tagged as darts
    4809  1: one end vertex is tagged as a dart.
    4810  2: both end vertices are tagged as a darts.
    4811  */
    4812  unsigned int DartCount() const;
    4813 
    4814  /*
    4815  Returns:
    4816  bitwise or of applicable ON_ComponentAttributes::EdgeFlags values.
    4817  */
    4818  unsigned int EdgeFlags() const;
    4819 
    4820  /*
    4821  Parameters:
    4822  subdivision_point_type - [in]
    4823  Selects subdivision algorithm. Must be either
    4824  ON_SubD::SubDType::TriLoopWarren or ON_SubD::SubDType::QuadCatmullClark.
    4825  bUseSavedSubdivisionPoint - [in]
    4826  If there is a saved subdivision point and bUseSavedSubdivisionPoint
    4827  is true, then the saved value is returned.
    4828  subdivision_point - [out]
    4829  Returns:
    4830  true if successful
    4831  */
    4832  bool GetSubdivisionPoint(
    4833  ON_SubD::SubDType subdivision_point_type,
    4834  bool bUseSavedSubdivisionPoint,
    4835  double subdivision_point[3]
    4836  ) const;
    4837 
    4838  /*
    4839  Parameters:
    4840  edge_vertex_index - [in]
    4841  0 or 1
    4842  edge_ptr0 - [out]
    4843  edge_ptr1 - [out]
    4844  Crease edges that bound the sector containing this edge.
    4845  The direction value of the edge pointer identifies the end
    4846  of the sector boundary edge this->at m_vertex[edge_vertex_index].
    4847  Returns:
    4848  Number of faces in the sector.
    4849  */
    4850  unsigned int GetSectorBoundaryEdges(
    4851  unsigned int edge_vertex_index,
    4852  ON_SubDEdgePtr* edge_ptr0,
    4853  ON_SubDEdgePtr* edge_ptr1
    4854  ) const;
    4855 
    4856  /*
    4857  Returns:
    4858  0: m_vertex[0] is tagged and m_vertex[1] is not tagged.
    4859  1: m_vertex[0] is tagged and m_vertex[1] is not tagged.
    4860  2: m_vertex[0] and m_vertex[1] are both tagged.
    4861  3: neither m_vertex[0] nor m_vertex[1] is tagged.
    4862  */
    4863  unsigned int TaggedEndIndex() const;
    4864 
    4865 private:
    4866  static unsigned int GetFacePointSum(
    4867  const ON_SubDFace* face,
    4868  const ON_SubDEdge* edge,
    4869  double* facePsum // sum of face vertex points not on the edge
    4870  );
    4871 
    4872 private:
    4873  friend class ON_SubDArchiveIdMap;
    4874  void CopyFrom(
    4875  const ON_SubDEdge* src,
    4876  bool bReverseEdge,
    4877  bool bCopyVertexArray,
    4878  bool bCopyFaceArray
    4879  );
    4880 };
    4881 
    4882 //////////////////////////////////////////////////////////////////////////
    4883 //
    4884 // ON_SubDFace
    4885 //
    4886 class ON_SUBD_CLASS ON_SubDFace : public ON_SubDComponentBase
    4887 {
    4888 public:
    4889  static const ON_SubDFace Empty;
    4890 
    4891  bool Write (
    4892  class ON_BinaryArchive& archive
    4893  ) const;
    4894 
    4895  static bool Read (
    4896  class ON_BinaryArchive& archive,
    4897  class ON_SubD& subd,
    4898  class ON_SubDFace*& face
    4899  );
    4900 
    4901  /*
    4902  Description:
    4903  Apply a tranxfomration matrix to vertex geometry information.
    4904 
    4905  Parameters:
    4906  bTransformationSavedSubdivisionPoint - [in]
    4907  If the transformation is being applied to every vertex, edge and
    4908  face in every level of a subdivision object, and the transformation
    4909  is an isometry (rotation, translation, ...), a uniform scale, or a
    4910  composition of these types, then set
    4911  bTransformationSavedSubdivisionPoint = true to apply the
    4912  transformation to saved subdivision and saved limit point information.
    4913  In all other cases, set bTransformationSavedSubdivisionPoint = false
    4914  and any saved subdivision points or saved limit points will be
    4915  deleted. When in doubt, pass false.
    4916 
    4917  xform - [in]
    4918  */
    4919  bool Transform(
    4920  bool bTransformationSavedSubdivisionPoint,
    4921  const class ON_Xform& xform
    4922  );
    4923 
    4924  ON_BoundingBox ControlNetBoundingBox() const;
    4925  ON_BoundingBox LimitSurfaceBoundingBox(
    4926  const ON_SubD& subd
    4927  ) const;
    4928 
    4929 
    4930  ON_COMPONENT_INDEX ComponentIndex() const;
    4931  ON_SubDComponentPtr ComponentPtr() const;
    4932 
    4933  /*
    4934  Description:
    4935  Call this function if the face is modified and it will clear any
    4936  cached subdivision information that needs to be recalculated.
    4937  */
    4938  void FaceModifiedNofification() const;
    4939 
    4940 
    4941 public:
    4942  const class ON_SubDFace* m_prev_face = nullptr; // linked list of faces on this level
    4943  const class ON_SubDFace* m_next_face = nullptr; // linked list of faces on this level
    4944 
    4945 public:
    4946  unsigned int m_zero_face_id = 0; // id of level zero face
    4947  unsigned int m_parent_face_id = 0; // id of previous level face
    4948 
    4949 private:
    4950  unsigned int m_reserved = 0; // id of previous level face
    4951 
    4952 public:
    4953  // Array of m_edge_count edges that form the boundary of the face.
    4954  // The edges are in ordered to form a continuous loop.
    4955  //
    4956  // The first four are in m_edge4[0], ..., m_edge4[3].
    4957  // When m_edge_count > 4, the fifth and additional edges
    4958  // are in m_edgex[0], ..., m_edgex[m_edge_count-5];
    4959  //
    4960  // The value of ON_SubDEdgePtr.EdgeDirection() is 0 if the
    4961  // edge's natural orientation from m_vertex[0] to m_vertex[1]
    4962  // agrees with the face's boundary orientation.
    4963  //
    4964  // The value of ON_SubDEdgePtr.EdgeDirection() is 1 if the
    4965  // edge's natural orientation from m_vertex[0] to m_vertex[1]
    4966  // is opposited the face's boundary orientation.
    4967  static const unsigned int MaximumEdgeCount;
    4968  unsigned short m_edge_count = 0;
    4969  unsigned short m_edgex_capacity = 0;
    4970 
    4971  ON_SubDEdgePtr m_edge4[4];
    4972  ON_SubDEdgePtr* m_edgex = nullptr;
    4973 
    4974 public:
    4975  unsigned int EdgeCount() const;
    4976 
    4977  ON_SubDEdgePtr EdgePtr(
    4978  unsigned int i
    4979  ) const;
    4980 
    4981  ON_SubDEdgePtr EdgePtr(
    4982  const class ON_SubDEdge* e
    4983  ) const;
    4984 
    4985  const class ON_SubDVertex* Vertex(
    4986  unsigned int i
    4987  ) const;
    4988 
    4989  unsigned int VertexIndex(
    4990  const ON_SubDVertex* vertex
    4991  ) const;
    4992 
    4993  const class ON_SubDEdge* Edge(
    4994  unsigned int i
    4995  ) const;
    4996 
    4997  ON__UINT_PTR EdgeDirection(
    4998  unsigned int i
    4999  ) const;
    5000 
    5001  unsigned int EdgeArrayIndex(
    5002  const ON_SubDEdge* e
    5003  ) const;
    5004 
    5005  /*
    5006  Description:
    5007  Expert user tool to remove an edge from the face's edge array.
    5008  Remarks:
    5009  Does not modify the edge. If the face is referenced in the edge's face array,
    5010  then the face must be removed from the edge's face array.
    5011  */
    5012  bool RemoveEdgeFromArray(
    5013  const ON_SubDEdge* e
    5014  );
    5015 
    5016  /*
    5017  Description:
    5018  Expert user tool to remove an edge from the face's edge array.
    5019  Remarks:
    5020  Does not modify the edge. If the face is referenced in the edge's face array,
    5021  then the face must be removed from the edge's face array.
    5022  */
    5023  bool RemoveEdgeFromArray(
    5024  unsigned int i,
    5025  ON_SubDEdgePtr& removed_edge
    5026  );
    5027 
    5028  /*
    5029  Description:
    5030  Expert user tool to replace one edge with another in the face's edge array.
    5031  Parameters:
    5032  edge_to_remove - [in]
    5033  edge_to_insert - [in]
    5034  The inserted edge is assigned the same boundary orientation as the
    5035  removed edge.
    5036  Remarks:
    5037  Does not modify the edge. The corresponding reference to this face must
    5038  be removed from the first edge and added to the second edge.
    5039  */
    5040  bool ReplaceEdgeInArray(
    5041  unsigned int fei0,
    5042  ON_SubDEdge* edge_to_remove,
    5043  ON_SubDEdge* edge_to_insert
    5044  );
    5045 
    5046  /*
    5047  Description:
    5048  Expert user tool to replace one edge with another in the face's edge array.
    5049  Parameters:
    5050  edge_to_remove - [in]
    5051  edge_to_insert - [in]
    5052  The inserted edge is assigned the same boundary orientation specified
    5053  in edgeptr_to_insert.
    5054  Remarks:
    5055  Does not modify the edge. The corresponding reference to this face must
    5056  be removed from the first edge and added to the second edge.
    5057  */
    5058  bool ReplaceEdgeInArray(
    5059  unsigned int fei0,
    5060  ON_SubDEdge* edge_to_remove,
    5061  ON_SubDEdgePtr edgeptr_to_insert
    5062  );
    5063 
    5064  const ON_SubDEdge* PrevEdge(
    5065  const ON_SubDEdge* edge
    5066  ) const;
    5067 
    5068  const ON_SubDEdge* NextEdge(
    5069  const ON_SubDEdge* edge
    5070  ) const;
    5071 
    5072  unsigned int PrevEdgeArrayIndex(
    5073  unsigned int edge_array_index
    5074  ) const;
    5075 
    5076  unsigned int NextEdgeArrayIndex(
    5077  unsigned int edge_array_index
    5078  ) const;
    5079 
    5080  /*
    5081  Description:
    5082  If the face is a quad, get the opposite corner vertex.
    5083  Parameters:
    5084  vertex - [in]
    5085  a vertex on this face.
    5086  Returns:
    5087  If the face is a quad and vertex is a vertex of the face, then
    5088  the vertex on the opposite corner is returned.
    5089  Otherwise, nullptr is returned.
    5090  */
    5091  const ON_SubDVertex* QuadOppositeVertex(
    5092  const ON_SubDVertex* vertex
    5093  ) const;
    5094 
    5095  /*
    5096  Description:
    5097  If the face is a quad, get the opposite side edge.
    5098  Parameters:
    5099  edge - [in]
    5100  an edge on this face.
    5101  Returns:
    5102  If the face is a quad and edge is an edge of the face, then
    5103  the edge on the opposite side is returned.
    5104  Otherwise, nullptr is returned.
    5105  */
    5106  const ON_SubDEdge* QuadOppositeEdge(
    5107  const ON_SubDEdge* edge
    5108  ) const;
    5109 
    5110  ///*
    5111  //Parameters:
    5112  // subd_type - [in]
    5113  // bTestFaces - [in]
    5114  // If true, then false is returned if any neighboring face is not
    5115  // a quad (ccquad subdivision type) or tri (lwtri subdivsion type).
    5116  //*/
    5117  //bool IsOrdinary(
    5118  // ON_SubD::SubDType subd_type,
    5119  // bool bTestFaces
    5120  // ) const;
    5121 
    5122  /*
    5123  Parameters:
    5124  subdivision_point_type - [in]
    5125  Selects subdivision algorithm. Must be either
    5126  ON_SubD::SubDType::TriLoopWarren or ON_SubD::SubDType::QuadCatmullClark.
    5127  bUseSavedSubdivisionPoint - [in]
    5128  If there is a saved subdivision point and bUseSavedSubdivisionPoint
    5129  is true, then the saved value is returned.
    5130  subdivision_point - [out]
    5131  The average of the face vertex locations.
    5132  Returns:
    5133  true if successful
    5134  */
    5135  bool GetSubdivisionPoint(
    5136  ON_SubD::SubDType subdivision_point_type,
    5137  bool bUseSavedSubdivisionPoint,
    5138  double subdivision_point[3]
    5139  ) const;
    5140 
    5141  /*
    5142  Description:
    5143  Reverse the order and orientation of the edges that form
    5144  the boundary of this face.
    5145  */
    5146  bool ReverseEdgeList();
    5147 
    5148  /*
    5149  Description:
    5150  Get the bicubic b-spline control points for the limit surface.
    5151  The corresponding knots are uniform.
    5152  Parameters:
    5153  vertex - [in]
    5154  limit_surface_cv_stride0 - [int]
    5155  limit_surface_cv_stride1 - [out]
    5156  limit_surface_cv - [out]
    5157  control points for a cubic spline surface
    5158  CV[i][j][k] = limit_surface_cv[i*limit_bspline_cv_stride0 + j*limit_bspline_cv_stride1 + k]
    5159  0 <= i < 4, 0 <= j < 4, 0 <= k < 3
    5160  Returns:
    5161  true if successful
    5162  false if the limit surface for this face is not a cubic surface
    5163  Remarks:
    5164  The knots for the bicubic b-spline surface are uniform.
    5165  */
    5166  bool GetQuadLimitSurface(
    5167  size_t limit_surface_cv_stride0,
    5168  size_t limit_surface_cv_stride1,
    5169  double* limit_surface_cv
    5170  ) const;
    5171 
    5172  bool GetQuadLimitSurface(
    5173  class ON_NurbsSurface& limit_surface
    5174  ) const;
    5175 
    5176  bool GetQuadLimitSurface(
    5177  class ON_BezierSurface& limit_surface
    5178  ) const;
    5179 
    5180 private:
    5181  friend class ON_SubDArchiveIdMap;
    5182  void CopyFrom(
    5183  const ON_SubDFace* src,
    5184  bool bCopyEdgeArray
    5185  );
    5186 };
    5187 
    5188 //////////////////////////////////////////////////////////////////////////
    5189 //
    5190 // ON_SubDVertexArray
    5191 //
    5192 class ON_SUBD_CLASS ON_SubDVertexArray
    5193 {
    5194 public:
    5195  ON_SubDVertexArray(
    5196  const ON_SubD& subd
    5197  );
    5198  ON_SubDVertexArray() = default;
    5199  ON_SubDVertexArray(const ON_SubDVertexArray&) = default;
    5200  ON_SubDVertexArray& operator=(const ON_SubDVertexArray&) = default;
    5201 
    5202 #if defined(ON_HAS_RVALUEREF)
    5203  // rvalue copy constructor
    5204  ON_SubDVertexArray(ON_SubDVertexArray&&) ON_NOEXCEPT;
    5205 
    5206  // rvalue copy operator-=
    5207  ON_SubDVertexArray& operator=(ON_SubDVertexArray&&);
    5208 #endif
    5209 
    5210  const ON_SubD& SubD() const
    5211  {
    5212  return m_subd;
    5213  }
    5214 
    5215  unsigned int VertexCount() const
    5216  {
    5217  return m_vertex_count;
    5218  }
    5219 
    5220  const class ON_SubDVertex* operator[](unsigned int i) const
    5221  {
    5222  return (i < m_vertex_count) ? m_a[i] : nullptr;
    5223  }
    5224 
    5225 private:
    5226  ON_SubD m_subd;
    5227  const class ON_SubDVertex*const* m_a = nullptr;
    5228  unsigned int m_vertex_count = 0;
    5229 
    5230 #pragma ON_PRAGMA_WARNING_PUSH
    5231 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    5232  // C4251: ... needs to have dll-interface to be used by clients of class ...
    5233  // m_sp is private and all code that manages m_sp is explicitly implemented in the DLL.
    5234 private:
    5235  std::shared_ptr< const class ON_SubDVertex* > m_sp;
    5236 #pragma ON_PRAGMA_WARNING_POP
    5237 };
    5238 
    5239 //////////////////////////////////////////////////////////////////////////
    5240 //
    5241 // ON_SubDEdgeArray
    5242 //
    5243 class ON_SUBD_CLASS ON_SubDEdgeArray
    5244 {
    5245 public:
    5246  ON_SubDEdgeArray(
    5247  const ON_SubD& subd
    5248  );
    5249  ON_SubDEdgeArray() = default;
    5250  ON_SubDEdgeArray(const ON_SubDEdgeArray&) = default;
    5251  ON_SubDEdgeArray& operator=(const ON_SubDEdgeArray&) = default;
    5252 
    5253 #if defined(ON_HAS_RVALUEREF)
    5254  // rvalue copy constructor
    5255  ON_SubDEdgeArray(ON_SubDEdgeArray&&) ON_NOEXCEPT;
    5256 
    5257  // rvalue copy operator-=
    5258  ON_SubDEdgeArray& operator=(ON_SubDEdgeArray&&);
    5259 #endif
    5260 
    5261  const ON_SubD& SubD() const
    5262  {
    5263  return m_subd;
    5264  }
    5265 
    5266  unsigned int EdgeCount() const
    5267  {
    5268  return m_edge_count;
    5269  }
    5270 
    5271  const class ON_SubDEdge* operator[](unsigned int i) const
    5272  {
    5273  return (i < m_edge_count) ? m_a[i] : nullptr;
    5274  }
    5275 
    5276 private:
    5277  ON_SubD m_subd;
    5278  const class ON_SubDEdge*const* m_a = nullptr;
    5279  unsigned int m_edge_count = 0;
    5280 
    5281 #pragma ON_PRAGMA_WARNING_PUSH
    5282 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    5283  // C4251: ... needs to have dll-interface to be used by clients of class ...
    5284  // m_sp is private and all code that manages m_sp is explicitly implemented in the DLL.
    5285 private:
    5286  std::shared_ptr< const class ON_SubDEdge* > m_sp;
    5287 #pragma ON_PRAGMA_WARNING_POP
    5288 };
    5289 
    5290 //////////////////////////////////////////////////////////////////////////
    5291 //
    5292 // ON_SubDFaceArray
    5293 //
    5294 class ON_SUBD_CLASS ON_SubDFaceArray
    5295 {
    5296 public:
    5297  ON_SubDFaceArray(
    5298  const ON_SubD& subd
    5299  );
    5300  ON_SubDFaceArray() = default;
    5301  ON_SubDFaceArray(const ON_SubDFaceArray&) = default;
    5302  ON_SubDFaceArray& operator=(const ON_SubDFaceArray&) = default;
    5303 
    5304 #if defined(ON_HAS_RVALUEREF)
    5305  // rvalue copy constructor
    5306  ON_SubDFaceArray(ON_SubDFaceArray&&) ON_NOEXCEPT;
    5307 
    5308  // rvalue copy operator-=
    5309  ON_SubDFaceArray& operator=(ON_SubDFaceArray&&);
    5310 #endif
    5311 
    5312  const ON_SubD& SubD() const
    5313  {
    5314  return m_subd;
    5315  }
    5316 
    5317  unsigned int FaceCount() const
    5318  {
    5319  return m_face_count;
    5320  }
    5321 
    5322  const class ON_SubDFace* operator[](unsigned int i) const
    5323  {
    5324  return (i < m_face_count) ? m_a[i] : nullptr;
    5325  }
    5326 
    5327 private:
    5328  ON_SubD m_subd;
    5329  const class ON_SubDFace*const* m_a = nullptr;
    5330  unsigned int m_face_count = 0;
    5331 
    5332 #pragma ON_PRAGMA_WARNING_PUSH
    5333 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    5334  // C4251: ... needs to have dll-interface to be used by clients of class ...
    5335  // m_sp is private and all code that manages m_sp is explicitly implemented in the DLL.
    5336 private:
    5337  std::shared_ptr< const class ON_SubDFace* > m_sp;
    5338 #pragma ON_PRAGMA_WARNING_POP
    5339 };
    5340 
    5341 //////////////////////////////////////////////////////////////////////////
    5342 //
    5343 // ON_SubDVertexIterator
    5344 //
    5345 class ON_SUBD_CLASS ON_SubDVertexIterator
    5346 {
    5347 public:
    5348  // The ON_SubD member function
    5349  // ON_SubDVertexIterator ON_SubD::VertexIterator(subd_level_index)
    5350  // is the best way to get a vertex iterator.
    5351  ON_SubDVertexIterator(
    5352  const class ON_SubD& subd
    5353  );
    5354  ON_SubDVertexIterator(
    5355  const class ON_SubDRef& subd_ref
    5356  );
    5357 
    5358  // Construct and interator that iterates over a single vertex.
    5359  ON_SubDVertexIterator(
    5360  const class ON_SubD& subd,
    5361  const class ON_SubDVertex& vertex
    5362  );
    5363 
    5364  // Construct and interator that iterates over a single vertex.
    5365  ON_SubDVertexIterator(
    5366  const class ON_SubDRef& subd_ref,
    5367  const class ON_SubDVertex& vertex
    5368  );
    5369 
    5370  // Construct and interator that iterates over the vertices of an edge.
    5371  ON_SubDVertexIterator(
    5372  const class ON_SubD& subd,
    5373  const class ON_SubDEdge& edge
    5374  );
    5375 
    5376  // Construct and interator that iterates over the vertices of an edge.
    5377  ON_SubDVertexIterator(
    5378  const class ON_SubDRef& subd_ref,
    5379  const class ON_SubDEdge& edge
    5380  );
    5381 
    5382  // Construct and interator that iterates over the vertices of a face.
    5383  ON_SubDVertexIterator(
    5384  const class ON_SubD& subd,
    5385  const class ON_SubDFace& face
    5386  );
    5387 
    5388  // Construct and interator that iterates over the vertices of a face.
    5389  ON_SubDVertexIterator(
    5390  const class ON_SubDRef& subd_ref,
    5391  const class ON_SubDFace& face
    5392  );
    5393 
    5394  ON_SubDVertexIterator() = default;
    5395  ON_SubDVertexIterator(const ON_SubDVertexIterator&) = default;
    5396  ON_SubDVertexIterator& operator=(const ON_SubDVertexIterator&) = default;
    5397 
    5398 #if defined(ON_HAS_RVALUEREF)
    5399  // rvalue copy constructor
    5400  ON_SubDVertexIterator( ON_SubDVertexIterator&& ) ON_NOEXCEPT;
    5401  // rvalue assignment operator
    5402  ON_SubDVertexIterator& operator=( ON_SubDVertexIterator&& );
    5403 #endif
    5404 
    5405  /*
    5406  Returns:
    5407  The subD object for this iterator.
    5408  */
    5409  const class ON_SubD& SubD() const
    5410  {
    5411  return m_subd_ref.SubD();
    5412  }
    5413 
    5414  const class ON_SubDRef& SubDRef() const
    5415  {
    5416  return m_subd_ref;
    5417  }
    5418 
    5419  /*
    5420  Description:
    5421  Increment the iterator.
    5422  Returns:
    5423  Current vertex.
    5424  Remarks:
    5425  operator++ and NextVertex() behave differently.
    5426  */
    5427  const class ON_SubDVertex* operator++()
    5428  {
    5429  const class ON_SubDVertex* v = m_v_current;
    5430  NextVertex();
    5431  return v;
    5432  }
    5433 
    5434  /*
    5435  Return:
    5436  Number of vertices this iterator will iterate through.
    5437  */
    5438  unsigned int VertexCount() const
    5439  {
    5440  return m_vertex_count;
    5441  }
    5442 
    5443  /*
    5444  Return:
    5445  Interator index of the current vertex.
    5446  */
    5447  unsigned int CurrentVertexIndex() const
    5448  {
    5449  return m_vertex_index;
    5450  }
    5451 
    5452  /*
    5453  Description:
    5454  Set the iterator to the beginning of the vertex list.
    5455  Returns:
    5456  First vertex in the list.
    5457  */
    5458  const class ON_SubDVertex* FirstVertex()
    5459  {
    5460  m_vertex_index = 0;
    5461  return (m_v_current = m_v_first);
    5462  }
    5463 
    5464  /*
    5465  Description:
    5466  Increment the iterator.
    5467  Returns:
    5468  Next vertex.
    5469  Remarks:
    5470  operator++ and NextVertex() behave differently.
    5471  */
    5472  const class ON_SubDVertex* NextVertex()
    5473  {
    5474  m_vertex_index++;
    5475  if (m_vertex_index < m_vertex_count)
    5476  {
    5477  if (0 == m_component_ptr.m_ptr)
    5478  {
    5479  if (nullptr != m_v_current)
    5480  m_v_current = m_v_current->m_next_vertex;
    5481  }
    5482  else
    5483  {
    5484  const ON_SubDEdge* edge = m_component_ptr.Edge();
    5485  if (nullptr != edge)
    5486  {
    5487  m_v_current = edge->Vertex(m_vertex_index);
    5488  }
    5489  else
    5490  {
    5491  const ON_SubDFace* face = m_component_ptr.Face();
    5492  if (nullptr != face)
    5493  m_v_current = face->Vertex(m_vertex_index);
    5494  else
    5495  m_v_current = nullptr;
    5496  }
    5497  }
    5498  }
    5499  else
    5500  {
    5501  m_vertex_index = m_vertex_count;
    5502  m_v_current = nullptr;
    5503  }
    5504  return m_v_current;
    5505  }
    5506 
    5507  /*
    5508  Returns:
    5509  Current vertex;
    5510  */
    5511  const class ON_SubDVertex* CurrentVertex() const
    5512  {
    5513  return m_v_current;
    5514  }
    5515 
    5516  /*
    5517  Description:
    5518  Set the iterator to the end of the vertex list.
    5519  Returns:
    5520  Last vertex in the list.
    5521  */
    5522  const class ON_SubDVertex* LastVertex()
    5523  {
    5524  m_vertex_index = (m_vertex_count > 0) ? (m_vertex_count - 1) : 0;
    5525  return (m_v_current = m_v_last);
    5526  }
    5527 
    5528 private:
    5529  void Internal_Init(
    5530  const ON_SubDRef& subd_ref,
    5531  unsigned int vertex_count,
    5532  const ON_SubDVertex* first,
    5533  const ON_SubDVertex* last,
    5534  ON_SubDComponentPtr component_ptr
    5535  );
    5536  ON_SubDRef m_subd_ref;
    5537  const ON_SubDVertex* m_v_first = nullptr;
    5538  const ON_SubDVertex* m_v_last = nullptr;
    5539  const ON_SubDVertex* m_v_current = nullptr;
    5540  unsigned int m_vertex_index = 0;
    5541  unsigned int m_vertex_count = 0;
    5542  ON_SubDComponentPtr m_component_ptr = ON_SubDComponentPtr::Null;
    5543 };
    5544 
    5545 //////////////////////////////////////////////////////////////////////////
    5546 //
    5547 // ON_SubDEdgeIterator
    5548 //
    5549 class ON_SUBD_CLASS ON_SubDEdgeIterator
    5550 {
    5551 public:
    5552  // The ON_SubD member function
    5553  // ON_SubDEdgeIterator ON_SubD::EdgeIterator()
    5554  // is the best way to get an edge iterator from an ON_SubD.
    5555  ON_SubDEdgeIterator(
    5556  const class ON_SubD& subd
    5557  );
    5558 
    5559  // The ON_SubDRef member function
    5560  // ON_SubDEdgeIterator ON_SubDRef::EdgeIterator()
    5561  // is the best way to get an edge iterator from an ON_SubDRef.
    5562  ON_SubDEdgeIterator(
    5563  const class ON_SubDRef& subd_ref
    5564  );
    5565 
    5566  // Construct and interator that iterates over a single edge.
    5567  ON_SubDEdgeIterator(
    5568  const class ON_SubD& subd,
    5569  const class ON_SubDEdge& edge
    5570  );
    5571 
    5572  // Construct and interator that iterates over a single edge.
    5573  ON_SubDEdgeIterator(
    5574  const class ON_SubDRef& subd_ref,
    5575  const class ON_SubDEdge& edge
    5576  );
    5577 
    5578  // Construct and interator that iterates over the edges of a vertex.
    5579  ON_SubDEdgeIterator(
    5580  const class ON_SubD& subd,
    5581  const class ON_SubDVertex& vertex
    5582  );
    5583 
    5584  // Construct and interator that iterates over the edges of a vertex.
    5585  ON_SubDEdgeIterator(
    5586  const class ON_SubDRef& subd_ref,
    5587  const class ON_SubDVertex& vertex
    5588  );
    5589 
    5590  // Construct and interator that iterates over the edges of a face.
    5591  ON_SubDEdgeIterator(
    5592  const class ON_SubD& subd,
    5593  const class ON_SubDFace& face
    5594  );
    5595 
    5596  // Construct and interator that iterates over the edges of a face.
    5597  ON_SubDEdgeIterator(
    5598  const class ON_SubDRef& subd_ref,
    5599  const class ON_SubDFace& face
    5600  );
    5601 
    5602  ON_SubDEdgeIterator() = default;
    5603  ON_SubDEdgeIterator(const ON_SubDEdgeIterator&) = default;
    5604  ON_SubDEdgeIterator& operator=(const ON_SubDEdgeIterator&) = default;
    5605 
    5606 #if defined(ON_HAS_RVALUEREF)
    5607  // rvalue copy constructor
    5608  ON_SubDEdgeIterator( ON_SubDEdgeIterator&& ) ON_NOEXCEPT;
    5609  // rvalue assignment operator
    5610  ON_SubDEdgeIterator& operator=( ON_SubDEdgeIterator&& );
    5611 #endif
    5612 
    5613  /*
    5614  Returns:
    5615  The subD object for this iterator.
    5616  */
    5617  const class ON_SubD& SubD() const
    5618  {
    5619  return m_subd_ref.SubD();
    5620  }
    5621 
    5622  const class ON_SubDRef& SubDRef() const
    5623  {
    5624  return m_subd_ref;
    5625  }
    5626 
    5627  /*
    5628  Description:
    5629  Increment the iterator.
    5630  Returns:
    5631  Current edge.
    5632  Remarks:
    5633  operator++ and NextEdge() behave differently.
    5634  */
    5635  const class ON_SubDEdge* operator++()
    5636  {
    5637  const class ON_SubDEdge* e = m_e_current;
    5638  NextEdge();
    5639  return e;
    5640  }
    5641 
    5642  /*
    5643  Return:
    5644  Number of edges this iterator will iterate through.
    5645  */
    5646  unsigned int EdgeCount() const
    5647  {
    5648  return m_edge_count;
    5649  }
    5650 
    5651  /*
    5652  Return:
    5653  Interator index of the current edge.
    5654  */
    5655  unsigned int CurrentEdgeIndex() const
    5656  {
    5657  return m_edge_index;
    5658  }
    5659 
    5660  /*
    5661  Description:
    5662  Set the iterator to the beginning of the edge list.
    5663  Returns:
    5664  First edge in the list.
    5665  */
    5666  const class ON_SubDEdge* FirstEdge()
    5667  {
    5668  m_edge_index = 0;
    5669  return m_e_current = m_e_first;
    5670  }
    5671 
    5672  /*
    5673  Description:
    5674  Increment the iterator.
    5675  Returns:
    5676  Next edge.
    5677  Remarks:
    5678  operator++ and NextEdge() behave differently.
    5679  */
    5680  const class ON_SubDEdge* NextEdge()
    5681  {
    5682  m_edge_index++;
    5683  if (m_edge_index < m_edge_count)
    5684  {
    5685  if (0 == m_component_ptr.m_ptr)
    5686  {
    5687  if (nullptr != m_e_current)
    5688  m_e_current = m_e_current->m_next_edge;
    5689  }
    5690  else
    5691  {
    5692  const ON_SubDVertex* vertex = m_component_ptr.Vertex();
    5693  if (nullptr != vertex)
    5694  {
    5695  m_e_current = vertex->Edge(m_edge_index);
    5696  }
    5697  else
    5698  {
    5699  const ON_SubDFace* face = m_component_ptr.Face();
    5700  if (nullptr != face)
    5701  m_e_current = face->Edge(m_edge_index);
    5702  else
    5703  m_e_current = nullptr;
    5704  }
    5705  }
    5706  }
    5707  else
    5708  {
    5709  m_edge_index = m_edge_count;
    5710  m_e_current = nullptr;
    5711  }
    5712  return m_e_current;
    5713  }
    5714 
    5715  /*
    5716  Returns:
    5717  Current edge;
    5718  */
    5719  const class ON_SubDEdge* CurrentEdge() const
    5720  {
    5721  return m_e_current;
    5722  }
    5723 
    5724  /*
    5725  Description:
    5726  Set the iterator to the end of the edge list.
    5727  Returns:
    5728  Last edge in the list.
    5729  */
    5730  const class ON_SubDEdge* LastEdge()
    5731  {
    5732  m_edge_index = (m_edge_count > 0) ? (m_edge_count - 1) : 0;
    5733  return m_e_current = m_e_last;
    5734  }
    5735 
    5736 private:
    5737  void Internal_Init(
    5738  const ON_SubDRef& subd_ref,
    5739  unsigned int edge_count,
    5740  const ON_SubDEdge* first,
    5741  const ON_SubDEdge* last,
    5742  ON_SubDComponentPtr component_ptr
    5743  );
    5744  ON_SubDRef m_subd_ref;
    5745  const ON_SubDEdge* m_e_first = nullptr;
    5746  const ON_SubDEdge* m_e_last = nullptr;
    5747  const ON_SubDEdge* m_e_current = nullptr;
    5748  unsigned int m_edge_index = 0;
    5749  unsigned int m_edge_count = 0;
    5750  ON_SubDComponentPtr m_component_ptr = ON_SubDComponentPtr::Null;
    5751 };
    5752 
    5753 //////////////////////////////////////////////////////////////////////////
    5754 //
    5755 // ON_SubDFaceIterator
    5756 //
    5757 class ON_SUBD_CLASS ON_SubDFaceIterator
    5758 {
    5759 public:
    5760  // The ON_SubD member function
    5761  // ON_SubDFaceIterator ON_SubD::FaceIterator()
    5762  // is the best way to get a face iterator from an ON_SubD.
    5763  ON_SubDFaceIterator(
    5764  const class ON_SubD& subd
    5765  );
    5766 
    5767  // The ON_SubDRef member function
    5768  // ON_SubDFaceIterator ON_SubDRef::FaceIterator()
    5769  // is the best way to get a face iterator from an ON_SubDRef.
    5770  ON_SubDFaceIterator(
    5771  const class ON_SubDRef& subd_ref
    5772  );
    5773 
    5774  // Construct and interator that iterates over the single face.
    5775  ON_SubDFaceIterator(
    5776  const class ON_SubD& subd,
    5777  const class ON_SubDFace& face
    5778  );
    5779 
    5780  // Construct and interator that iterates over the single face.
    5781  ON_SubDFaceIterator(
    5782  const class ON_SubDRef& subd_ref,
    5783  const class ON_SubDFace& face
    5784  );
    5785 
    5786  // Construct and interator that iterates over the faces of a vertex.
    5787  ON_SubDFaceIterator(
    5788  const class ON_SubD& subd,
    5789  const class ON_SubDVertex& vertex
    5790  );
    5791 
    5792  // Construct and interator that iterates over the faces of a vertex.
    5793  ON_SubDFaceIterator(
    5794  const class ON_SubDRef& subd_ref,
    5795  const class ON_SubDVertex& vertex
    5796  );
    5797 
    5798  // Construct and interator that iterates over the faces of an edge.
    5799  ON_SubDFaceIterator(
    5800  const class ON_SubD& subd,
    5801  const class ON_SubDEdge& edge
    5802  );
    5803 
    5804  // Construct and interator that iterates over the faces of an edge.
    5805  ON_SubDFaceIterator(
    5806  const class ON_SubDRef& subd_ref,
    5807  const class ON_SubDEdge& edge
    5808  );
    5809 
    5810  ON_SubDFaceIterator() = default;
    5811  ON_SubDFaceIterator(const ON_SubDFaceIterator&) = default;
    5812  ON_SubDFaceIterator& operator=(const ON_SubDFaceIterator&) = default;
    5813 
    5814 #if defined(ON_HAS_RVALUEREF)
    5815  // rvalue copy constructor
    5816  ON_SubDFaceIterator( ON_SubDFaceIterator&& ) ON_NOEXCEPT;
    5817  // rvalue assignment operator
    5818  ON_SubDFaceIterator& operator=( ON_SubDFaceIterator&& );
    5819 #endif
    5820 
    5821  /*
    5822  Returns:
    5823  The subD object for this iterator.
    5824  */
    5825  const class ON_SubD& SubD() const
    5826  {
    5827  return m_subd_ref.SubD();
    5828  }
    5829 
    5830  const class ON_SubDRef& SubDRef() const
    5831  {
    5832  return m_subd_ref;
    5833  }
    5834 
    5835  /*
    5836  Description:
    5837  Returns the current face and increment the iterator.
    5838  Returns:
    5839  Current face.
    5840  Remarks:
    5841  operator++ and NextFace() behave differently.
    5842  */
    5843  const class ON_SubDFace* operator++()
    5844  {
    5845  const class ON_SubDFace* f = m_face_current;
    5846  NextFace();
    5847  return f;
    5848  }
    5849 
    5850  /*
    5851  Return:
    5852  Number of faces this iterator will iterate through.
    5853  */
    5854  unsigned int FaceCount() const
    5855  {
    5856  return m_face_count;
    5857  }
    5858 
    5859  /*
    5860  Return:
    5861  Interator index of the current face.
    5862  */
    5863  unsigned int CurrentFaceIndex() const
    5864  {
    5865  return m_face_index;
    5866  }
    5867 
    5868 
    5869  /*
    5870  Description:
    5871  Set the iterator to the beginning of the face list.
    5872  Returns:
    5873  First face in the list.
    5874  */
    5875  const class ON_SubDFace* FirstFace()
    5876  {
    5877  m_face_index = 0;
    5878  return (m_face_current = m_face_first);
    5879  }
    5880 
    5881  /*
    5882  Description:
    5883  Returns the next face and incrments the iterator.
    5884  Returns:
    5885  Next face.
    5886  Remarks:
    5887  operator++ and NextFace() behave differently.
    5888  */
    5889  const class ON_SubDFace* NextFace()
    5890  {
    5891  m_face_index++;
    5892  if (m_face_index < m_face_count)
    5893  {
    5894  if (0 == m_component_ptr.m_ptr)
    5895  {
    5896  if (nullptr != m_face_current)
    5897  m_face_current = m_face_current->m_next_face;
    5898  }
    5899  else
    5900  {
    5901  const ON_SubDVertex* vertex = m_component_ptr.Vertex();
    5902  if (nullptr != vertex)
    5903  {
    5904  m_face_current = vertex->Face(m_face_index);
    5905  }
    5906  else
    5907  {
    5908  const ON_SubDEdge* edge = m_component_ptr.Edge();
    5909  if (nullptr != edge)
    5910  m_face_current = edge->Face(m_face_index);
    5911  else
    5912  m_face_current = nullptr;
    5913  }
    5914  }
    5915  }
    5916  else
    5917  {
    5918  m_face_index = m_face_count;
    5919  m_face_current = nullptr;
    5920  }
    5921  return m_face_current;
    5922  }
    5923 
    5924  /*
    5925  Returns:
    5926  Current face;
    5927  */
    5928  const class ON_SubDFace* CurrentFace() const
    5929  {
    5930  return m_face_current;
    5931  }
    5932 
    5933  /*
    5934  Description:
    5935  Set the iterator to the end of the face list.
    5936  Returns:
    5937  Last face in the list.
    5938  */
    5939  const class ON_SubDFace* LastFace()
    5940  {
    5941  m_face_index = (m_face_count > 0) ? (m_face_count - 1) : 0;
    5942  return (m_face_current = m_face_last);
    5943  }
    5944 
    5945  unsigned int LimitSurfaceMeshFragmentCount(
    5946  ON_SubD::FacetType facet_type
    5947  ) const;
    5948 
    5949 private:
    5950  void Internal_Init(
    5951  const ON_SubDRef& subd_ref,
    5952  unsigned int face_count,
    5953  const ON_SubDFace* first,
    5954  const ON_SubDFace* last,
    5955  ON_SubDComponentPtr component_ptr
    5956  );
    5957  ON_SubDRef m_subd_ref;
    5958  const ON_SubDFace* m_face_first = nullptr;
    5959  const ON_SubDFace* m_face_last = nullptr;
    5960  const ON_SubDFace* m_face_current = nullptr;
    5961  unsigned int m_face_index = 0;
    5962  unsigned int m_face_count = 0;
    5963  ON_SubDComponentPtr m_component_ptr = ON_SubDComponentPtr::Null;
    5964 };
    5965 
    5966 //////////////////////////////////////////////////////////////////////////
    5967 //
    5968 // ON_SubDComponentIterator
    5969 //
    5970 class ON_SUBD_CLASS ON_SubDComponentIterator
    5971 {
    5972 public:
    5973  static const ON_SubDComponentIterator Empty;
    5974 
    5975  // The ON_SubD member function
    5976  // ON_SubDComponentIterator ON_SubD::ComponentIterator(subd_level_index)
    5977  // is the best way to get a component iterator for a subd level.
    5978  ON_SubDComponentIterator(
    5979  const class ON_SubD& subd
    5980  );
    5981  ON_SubDComponentIterator(
    5982  const class ON_SubDRef& subd_ref
    5983  );
    5984 
    5985  ON_SubDComponentIterator() = default;
    5986  ON_SubDComponentIterator(const ON_SubDComponentIterator&) = default;
    5987  ON_SubDComponentIterator& operator=(const ON_SubDComponentIterator&) = default;
    5988 
    5989 #if defined(ON_HAS_RVALUEREF)
    5990  // rvalue copy constructor
    5991  ON_SubDComponentIterator( ON_SubDComponentIterator&& ) ON_NOEXCEPT;
    5992  // rvalue assignment operator
    5993  ON_SubDComponentIterator& operator=( ON_SubDComponentIterator&& );
    5994 #endif
    5995 
    5996  /*
    5997  Returns:
    5998  The subD object for this iterator.
    5999  */
    6000  const class ON_SubD& SubD() const
    6001  {
    6002  return m_subd_ref.SubD();
    6003  }
    6004 
    6005  const class ON_SubDRef& SubDRef() const
    6006  {
    6007  return m_subd_ref;
    6008  }
    6009 
    6010  /*
    6011  Returns:
    6012  The subD level for this iterator.
    6013  */
    6014  unsigned int SubDLevel() const
    6015  {
    6016  return m_subd_level;
    6017  }
    6018 
    6019  /*
    6020  Description:
    6021  Returns the current component and increment the iterator.
    6022  Returns:
    6023  Current component.
    6024  Remarks:
    6025  operator++ and NextComponent() behave differently.
    6026  */
    6027  const class ON_SubDComponentPtr operator++()
    6028  {
    6029  const class ON_SubDComponentPtr cptr = m_cptr_current;
    6030  NextComponent();
    6031  return cptr;
    6032  }
    6033 
    6034  /*
    6035  Description:
    6036  Set the iterator to the beginning of the component list.
    6037  Returns:
    6038  First component in the list.
    6039  */
    6040  const class ON_SubDComponentPtr FirstComponent();
    6041 
    6042  /*
    6043  Description:
    6044  Returns the next component and incrments the iterator.
    6045  Returns:
    6046  Next component.
    6047  Remarks:
    6048  operator++ and NextComponent() behave differently.
    6049  */
    6050  const class ON_SubDComponentPtr NextComponent();
    6051 
    6052  /*
    6053  Returns:
    6054  Current component;
    6055  */
    6056  const class ON_SubDComponentPtr CurrentComponent() const
    6057  {
    6058  return m_cptr_current;
    6059  }
    6060 
    6061  /*
    6062  Description:
    6063  Set the iterator to the end of the component list.
    6064  Returns:
    6065  Last component in the list.
    6066  */
    6067  const class ON_SubDComponentPtr LastComponent();
    6068 
    6069 private:
    6070  ON_SubDRef m_subd_ref;
    6071  unsigned int m_subd_level = 0;
    6072  const ON_SubDVertex* m_vertex_first = nullptr;
    6073  const ON_SubDVertex* m_vertex_last = nullptr;
    6074  const ON_SubDEdge* m_edge_first = nullptr;
    6075  const ON_SubDEdge* m_edge_last = nullptr;
    6076  const ON_SubDFace* m_face_first = nullptr;
    6077  const ON_SubDFace* m_face_last = nullptr;
    6078  ON_SubDComponentPtr m_cptr_current = ON_SubDComponentPtr::Null;
    6079 };
    6080 
    6081 //////////////////////////////////////////////////////////////////////////
    6082 //
    6083 // ON_SubDSectorIterator
    6084 //
    6085 
    6086 class ON_SUBD_CLASS ON_SubDSectorIterator
    6087 {
    6088 public:
    6089  static const ON_SubDSectorIterator Empty;
    6090 
    6091  ON_SubDSectorIterator() = default;
    6092  ~ON_SubDSectorIterator() = default;
    6093  ON_SubDSectorIterator(const ON_SubDSectorIterator&) = default;
    6094  ON_SubDSectorIterator& operator=(const ON_SubDSectorIterator&) = default;
    6095 
    6096  /*
    6097  Parameters:
    6098  center_vertex - [in]
    6099  The vertex on initial_face that will be iterated around.
    6100  center_vertex->Face(0) is used to select the sector.
    6101  Returns:
    6102  If input is valid, a pointer to the center vertex is returned.
    6103  Otherwise, nullptr is returned.
    6104  */
    6105  const ON_SubDVertex* Initialize(
    6106  const ON_SubDVertex* center_vertex
    6107  );
    6108 
    6109  /*
    6110  Parameters:
    6111  initial_face - [in]
    6112  iterator_orientation - [in]
    6113  0: (more common)
    6114  "next" means counter-clockwise with respect to the orientation of initial_face
    6115  1: (less common)
    6116  "next" means clockwise with respect to the orientation of initial_face
    6117  center_vertex - [in]
    6118  The vertex on initial_face that will be iterated around.
    6119  Returns:
    6120  If input is valid, a pointer to the center vertex is returned.
    6121  Otherwise, nullptr is returned.
    6122  */
    6123  const ON_SubDVertex* Initialize(
    6124  const ON_SubDFace* initial_face,
    6125  ON__UINT_PTR iterator_orientation,
    6126  const ON_SubDVertex* center_vertex
    6127  );
    6128 
    6129  /*
    6130  Parameters:
    6131  initial_face - [in]
    6132  iterator_orientation - [in]
    6133  0: (more common)
    6134  "next" means counter-clockwise with respect to the orientation of initial_face
    6135  1: (less common)
    6136  "next" means clockwise with respect to the orientation of initial_face
    6137  face_vertex_index - [in]
    6138  initial_face->Vertex(face_vertex_index) is the center vertex
    6139  that will be iterated around.
    6140  Returns:
    6141  If input is valid, a pointer to the center vertex is returned.
    6142  Otherwise, nullptr is returned.
    6143  */
    6144  const ON_SubDVertex* Initialize(
    6145  const ON_SubDFace* initial_face,
    6146  ON__UINT_PTR iterator_orientation,
    6147  unsigned int face_vertex_index
    6148  );
    6149 
    6150  bool InitializeToCurrentFace();
    6151 
    6152  void Initialize();
    6153 
    6154  /*
    6155  Description:
    6156  The current ring index reports the total increment from the
    6157  start to the current state. It can be positive or negative.
    6158  */
    6159  int CurrentRingIndex() const;
    6160 
    6161  const ON_SubDVertex* CenterVertex() const;
    6162 
    6163  const ON_SubDFace* InitialFace() const;
    6164 
    6165  unsigned int InitialFaceCenterVertexIndex() const;
    6166 
    6167  const ON_SubDFace* CurrentFace() const;
    6168 
    6169  unsigned int CurrentFaceDirection() const;
    6170 
    6171  ON_SubDFacePtr CurrentFacePtr() const;
    6172 
    6173  unsigned int CurrentFaceCenterVertexIndex() const;
    6174 
    6175 
    6176  /*
    6177  Parameters:
    6178  face_side_index - [in]
    6179  0: Return the edge entering the center vertex.
    6180  1: Return the edge leaving the center vertex.
    6181  Returns:
    6182  The requested edge.
    6183  */
    6184  ON_SubDEdgePtr CurrentEdgePtr(
    6185  unsigned int face_side_index
    6186  ) const;
    6187 
    6188  /*
    6189  Description:
    6190 
    6191  CurrentEdge(1)
    6192  |
    6193  |
    6194  NextFace() | CurrentFace()
    6195  |
    6196  |
    6197  *------------- CurrentEdge(0)
    6198  PrevFace()
    6199 
    6200  The asterisk (*) marks the center vertex.
    6201  The diagram is With respect to the initial iterator orientation.
    6202 
    6203  Parameters:
    6204  face_side_index - [in]
    6205  CurrentEdge(0) = edge on the clockwise (PrevFace) side of the current face
    6206  CurrentEdge(1) = edge on the counterclockwise (NextFace) side of the current face
    6207  The directions "counterclockwise" and "clockwise" are with respect to the
    6208  initial iterator orientation.
    6209  Returns:
    6210  The requested edge or nullptr if the iterator is not initialized,
    6211  has terminated, or is not valid.
    6212  */
    6213  const ON_SubDEdge* CurrentEdge(
    6214  unsigned int face_side_index
    6215  ) const;
    6216 
    6217  ON__UINT_PTR CurrentEdgeDirection(
    6218  unsigned int face_side_index
    6219  ) const;
    6220 
    6221  /*
    6222  Returns:
    6223  The vertex on CurrentEdge(face_side_index) that is opposite
    6224  the central vertex.
    6225  */
    6226  const ON_SubDVertex* CurrentEdgeRingVertex(
    6227  unsigned int face_side_index
    6228  ) const;
    6229 
    6230  /*
    6231  Description:
    6232  Advance the "current" face to the "next" face in the ring
    6233  by "hopping across" CurrentEdge(1).
    6234 
    6235  If the current face is not reversed (1 == CurrentFaceDirection),
    6236  then this rotation is counter-clockwise with respect to
    6237  the current face's orientation.
    6238 
    6239  If the current face is reversed (1 == CurrentFaceDirection),
    6240  then this rotation is clockwise with respect to
    6241  the current face's orientation.
    6242  Parameters:
    6243  bStopAtCrease - [in]
    6244  If true and CurrentEdge(1) is tagged ON_SubD:EdgeTag::crease,
    6245  iteration terminates.
    6246  Returns:
    6247  When the input CurrentEdge(1) has exactly two faces and
    6248  is not tagged as a crease or bStopAtCrease is false, the
    6249  face on the other side of CurrentEdge(1) becomes the new
    6250  current face and a pointer to this face is returned.
    6251  Remarks:
    6252  Identical to calling IncrementFace(+1,bStopAtCrease);
    6253  */
    6254  const ON_SubDFace* NextFace(
    6255  bool bStopAtCrease
    6256  );
    6257 
    6258  /*
    6259  Description:
    6260  Advance the "current" face to the "previous" face in the ring
    6261  by "hopping across" CurrentEdge(0).
    6262 
    6263  If the current face is not reversed (0 == CurrentFaceDirection),
    6264  then this rotation is clockwise with respect to
    6265  the current face's orientation.
    6266 
    6267  If the current face is reversed (1 == CurrentFaceDirection),
    6268  then this rotation is counter-clockwise with respect to
    6269  the current face's orientation.
    6270  Parameters:
    6271  bStopAtCrease - [in]
    6272  If true and CurrentEdge(0) is tagged ON_SubD:EdgeTag::crease,
    6273  iteration terminates.
    6274  Returns:
    6275  When the input CurrentEdge(0) has exactly two faces and
    6276  is not tagged as a crease or bStopAtCrease is false, the
    6277  face on the other side of CurrentEdge(0) becomes the new
    6278  current face and a pointer to this face is returned.
    6279  In all other cases, nullptr is returned
    6280  Remarks:
    6281  Identical to calling IncrementFace(-1,bStopAtCrease);
    6282  */
    6283  const ON_SubDFace* PrevFace(
    6284  bool bStopAtCrease
    6285  );
    6286 
    6287  /*
    6288  Description:
    6289  Advance the "current" face by "hopping across" the edge
    6290  CurrentEdge((increment_direction>0) ? 1 : 0).
    6291 
    6292  If the current face is not reversed (0 == CurrentFaceDirection),
    6293  then increment_direction>0 rotates counter-clockwise with respect to
    6294  the current face's orientation.
    6295 
    6296  If the current face is reversed (1 == CurrentFaceDirection),
    6297  then increment_direction>0 rotates clockwise with respect to
    6298  the current face's orientation.
    6299  Parameters:
    6300  increment_direction - [in]
    6301  > 0 advance the "current" face to next face
    6302  <= 0 advance the "current" face to previous face
    6303  bStopAtCrease - [in]
    6304  If true and the input value of CurrentEdge((increment_direction>0) ? 1 : 0)
    6305  is tagged as ON_SubD:EdgeTag::crease, iteration terminates.
    6306  When iteration terminates at a crease,
    6307  CurrentFace() becomes nullptr
    6308  CurrentEdge((increment_direction>0) ? 1 : 0) becomes nullptr
    6309  CurrentEdge((increment_direction>0) ? 0 : 1) points at the crease
    6310  and nullptr returned.
    6311  Returns:
    6312  nullptr if iteration terminates.
    6313  */
    6314  const ON_SubDFace* IncrementFace(
    6315  int increment_direction,
    6316  bool bStopAtCrease
    6317  );
    6318 
    6319  /*
    6320  Description:
    6321  Increment the iterator until it reaches a face with
    6322  a crease
    6323  Parameters:
    6324  increment_direction - [in]
    6325  > 0 advance next until CurrentEdge(1) is a crease.
    6326  <= 0 advance previous until CurrentEdge(0) is a crease.
    6327  Returns:
    6328  nullptr - the sector has no creases.
    6329  not nullptr - incremented to a crease
    6330  */
    6331  const ON_SubDFace* IncrementToCrease(
    6332  int increment_direction
    6333  );
    6334 
    6335  /*
    6336  Description:
    6337  Reset iterator to initial face.
    6338  */
    6339  const ON_SubDFace* FirstFace();
    6340 
    6341  bool IsValid() const;
    6342 
    6343 private:
    6344  const ON_SubDVertex* m_center_vertex = nullptr;
    6345  const ON_SubDFace* m_initial_face = nullptr;
    6346  const ON_SubDFace* m_current_face = nullptr;
    6347 
    6348  // m_current_eptr[0].Edge() = "prev" side edge
    6349  // m_current_eptr[1].Edge() = "next" side edge
    6350  // When m_current_eptr[i].Edge() is not null,
    6351  // center vertex = m_current_eptr[i].Edge()->m_vertex[m_current_eptr[i].Direction()]
    6352  ON_SubDEdgePtr m_current_eptr[2]; // default = { ON_SubDEdgePtr::Null, ON_SubDEdgePtr::Null };
    6353 
    6354  unsigned int m_initial_fvi = 0;
    6355  unsigned int m_current_fvi = 0;
    6356  unsigned int m_current_fei[2]; // default = { 0, 0 }; // "prev" and "next"
    6357 
    6358  // m_initial_face_dir
    6359  // 0: "next" means clockwise with respect to the initial face's orientation.
    6360  // 1: "next" means counter-clockwise with respect to the initial face's orientation.
    6361  unsigned int m_initial_face_dir = 0;
    6362 
    6363  // m_current_face_dir
    6364  // 0: "next" means clockwise with respect to the initial face's orientation.
    6365  // 1: "next" means counter-clockwise with respect to the initial face's orientation.
    6366  // When the subd faces around the center vertex are consistently oriented,
    6367  // m_current_face_dir is always equal to m_initial_face_dir.
    6368  unsigned int m_current_face_dir = 0;
    6369 
    6370  int m_current_ring_index = 0;
    6371 };
    6372 
    6373 
    6374 //////////////////////////////////////////////////////////////////////////
    6375 //
    6376 // ON_SubDFaceEdgeIterator
    6377 //
    6378 class ON_SUBD_CLASS ON_SubDFaceEdgeIterator
    6379 {
    6380 public:
    6381  ON_SubDFaceEdgeIterator();
    6382 
    6383  /*
    6384  Description:
    6385  Construct an iterator for going around the edges on a face.
    6386  Parameters:
    6387  face - [in]
    6388  first_edge - [in]
    6389  starting edge for the iterator or nullptr to start at face->Edge(0).
    6390  */
    6391  ON_SubDFaceEdgeIterator(
    6392  const ON_SubDFace* face
    6393  );
    6394 
    6395  ON_SubDFaceEdgeIterator(
    6396  const ON_SubDFace* face,
    6397  const ON_SubDEdge* first_edge
    6398  );
    6399 
    6400 
    6401  /*
    6402  Description:
    6403  Initialize an iterator for going around the edges on a face.
    6404  Parameters:
    6405  face - [in]
    6406  first_edge - [in]
    6407  starting edge for the iterator or nullptr to start at face->Edge(0).
    6408  */
    6409  unsigned int Initialize(
    6410  const ON_SubDFace* face
    6411  );
    6412 
    6413  unsigned int Initialize(
    6414  const ON_SubDFace* face,
    6415  const ON_SubDEdge* first_edge
    6416  );
    6417 
    6418  unsigned int EdgeCount() const;
    6419 
    6420  /*
    6421  Returns:
    6422  Resets the iterator and returns the first edge.
    6423  */
    6424  const ON_SubDEdge* FirstEdge();
    6425 
    6426  /*
    6427  Description:
    6428  Increments the iterator and returns the edge.
    6429  */
    6430  const ON_SubDEdge* NextEdge();
    6431 
    6432  /*
    6433  Description:
    6434  Decrements the iterator and returns the edge.
    6435  */
    6436  const ON_SubDEdge* PrevEdge();
    6437 
    6438  /*
    6439  Returns:
    6440  Current edge.
    6441  */
    6442  const ON_SubDEdge* CurrentEdge() const;
    6443 
    6444  unsigned int FirstEdgeIndex() const;
    6445 
    6446  unsigned int CurrentEdgeIndex() const;
    6447 
    6448 private:
    6449  const ON_SubDFace* m_face;
    6450  unsigned int m_edge_count;
    6451  unsigned int m_edge_index0;
    6452  unsigned int m_edge_index;
    6453 };
    6454 
    6455 //////////////////////////////////////////////////////////////////////////
    6456 //
    6457 // ON_SubDFromMeshOptions
    6458 //
    6459 class ON_SUBD_CLASS ON_SubDFromMeshOptions
    6460 {
    6461 public:
    6462 
    6463  // Default construction is identical to ON_SubDFromMeshOptions::Smooth.
    6464  ON_SubDFromMeshOptions() = default;
    6465  ~ON_SubDFromMeshOptions() = default;
    6466  ON_SubDFromMeshOptions(const ON_SubDFromMeshOptions&) = default;
    6467  ON_SubDFromMeshOptions& operator=(const ON_SubDFromMeshOptions&) = default;
    6468 
    6469  ///////////////////////////////////////////////////////////////////////////////////////
    6470  //
    6471  // Crease options
    6472  //
    6473 
    6474  // No interior creases and no corners.
    6475  static const ON_SubDFromMeshOptions Smooth;
    6476 
    6477  // Create an interior sub-D crease along coincident input mesh edges
    6478  // where the vertex normal directions at one end differ by at
    6479  // least 30 degrees.
    6480  static const ON_SubDFromMeshOptions InteriorCreaseAtMeshCrease;
    6481 
    6482  // Create an interior sub-D crease along all coincident input mesh edges.
    6483  static const ON_SubDFromMeshOptions InteriorCreaseAtMeshEdge;
    6484 
    6485  ///////////////////////////////////////////////////////////////////////////////////////
    6486  //
    6487  // Custom interior crease options
    6488  //
    6489 #pragma region RH_C_SHARED_ENUM [SubD::InteriorCreaseOption] [Rhino.Geometry.SubD.InteriorCreaseOption] [nested:byte]
    6490  ///<summary>
    6491  ///Defines how interior creases are treated.
    6492  ///</summary>
    6493  enum class InteriorCreaseOption : unsigned char
    6494  {
    6495  ///<summary>The interior creases option is not defined.</summary>
    6496  Unset = 0,
    6497 
    6498  ///<summary>No interior creases.</summary>
    6499  None = 1,
    6500 
    6501  ///<summary>An interior subd crease will appear along coincident
    6502  ///mesh edges where the angle between coindident vertex
    6503  ///normals &gt;= MinimumCreaseAngleRadians().</summary>
    6504  AtMeshCrease = 2,
    6505 
    6506  ///<summary>An interior subd crease will appear all coincident mesh edges.
    6507  ///Input mesh vertex normals are ignored.</summary>
    6508  AtMeshEdge = 3
    6509  };
    6510 #pragma endregion
    6511 
    6512  static ON_SubDFromMeshOptions::InteriorCreaseOption InteriorCreaseOptionFromUnsigned(
    6513  unsigned int interior_crease_option_as_unsigned
    6514  );
    6515 
    6516  /*
    6517  Parameters:
    6518  interior_crease_option - [in]
    6519  */
    6520  void SetInteriorCreaseOption(
    6521  ON_SubDFromMeshOptions::InteriorCreaseOption interior_crease_option
    6522  );
    6523 
    6524  /*
    6525  Returns:
    6526  The interior crease option.
    6527  */
    6528  ON_SubDFromMeshOptions::InteriorCreaseOption InteriorCreaseTest() const;
    6529 
    6530 
    6531  /*
    6532  Description:
    6533  When the interior crease option is
    6534  ON_SubDFromMeshOptions::InteriorCreaseOption::AtMeshCreases,
    6535  the value of MinimumCreaseAngleRadians() determines which
    6536  coincident input mesh edges generate sub-D creases.
    6537 
    6538  If the input mesh has vertex normals, and the angle between
    6539  vertex normals is > MinimumCreaseAngleRadians() at an end
    6540  of a coincident input mesh edge, the the correspondeing sub-D
    6541  edge will be a crease.
    6542 
    6543  Parameters:
    6544  minimum_crease_angle_radians - [in]
    6545  >= 0.0 and < ON_PI
    6546  */
    6547  void SetMinimumCreaseAngleRadians(
    6548  double minimum_crease_angle_radians
    6549  );
    6550 
    6551  /*
    6552  Description:
    6553  When the interior crease option is
    6554  ON_SubDFromMeshOptions::InteriorCreaseOption::AtMeshCreases,
    6555  the value of MinimumCreaseAngleRadians() determines which
    6556  coincident input mesh edges generate sub-D creases.
    6557 
    6558  If the input mesh has vertex normals, and the angle between
    6559  vertex normals is > MinimumCreaseAngleRadians() at an end
    6560  of a coincident input mesh edge, the the correspondeing sub-D
    6561  edge will be a crease.
    6562  Returns:
    6563  Current value of
    6564  */
    6565  double MinimumCreaseAngleRadians() const;
    6566 
    6567  /*
    6568  Description:
    6569  Copy all interior crease option settings from source_options to this.
    6570  Parameters:
    6571  source_options - [in]
    6572  Returns:
    6573  The currently selected interior crease option.
    6574  */
    6575  ON_SubDFromMeshOptions::InteriorCreaseOption CopyInteriorCreaseTest(
    6576  ON_SubDFromMeshOptions source_options
    6577  );
    6578 
    6579 
    6580  ///////////////////////////////////////////////////////////////////////////////////////
    6581  //
    6582  // Convex corner options
    6583  //
    6584 
    6585  // Look for convex corners at sub-D vertices with 2 edges
    6586  // that have an included angle <= 90 degrees.
    6587  static const ON_SubDFromMeshOptions ConvexCornerAtMeshCorner;
    6588 
    6589  ///////////////////////////////////////////////////////////////////////////////////////
    6590  //
    6591  // Custom convex corner options
    6592  //
    6593 #pragma region RH_C_SHARED_ENUM [SubD::ConvexCornerOption] [Rhino.Geometry.SubD.ConvexCornerOption] [nested:byte]
    6594  ///<summary>
    6595  ///Defines how convex corners are treated.
    6596  ///</summary>
    6597  enum class ConvexCornerOption : unsigned char
    6598  {
    6599  ///<summary>The option is not set.</summary>
    6600  Unset = 0,
    6601 
    6602  ///<summary>No convex coners.</summary>
    6603  None = 1,
    6604 
    6605  ///<summary>A convext subd corner will appear at input mesh/ boundary vertices
    6606  /// where the corner angle &lt;= MaximumConvexCornerAngleRadians() and
    6607  /// the number of edges the end at the vertex is &lt;= MaximumConvexCornerEdgeCount().
    6608  ///</summary>
    6609  AtMeshCorner = 2
    6610  };
    6611 #pragma endregion
    6612 
    6613  static ON_SubDFromMeshOptions::ConvexCornerOption ConvexCornerOptionFromUnsigned(
    6614  unsigned int convex_corner_option_as_unsigned
    6615  );
    6616 
    6617  /*
    6618  Parameters:
    6619  convex_corner_option - [in]
    6620  */
    6621  void SetConvexCornerOption(
    6622  ON_SubDFromMeshOptions::ConvexCornerOption convex_corner_option
    6623  );
    6624 
    6625  /*
    6626  Returns:
    6627  The currently selected convex corner option.
    6628  */
    6629  ON_SubDFromMeshOptions::ConvexCornerOption ConvexCornerTest() const;
    6630 
    6631  /*
    6632  Description:
    6633  If ConvexCornerTest() ConvexCornerOption::at_mesh_corner, then an
    6634  input mesh boundary vertex becomes a sub-D corner when the number of
    6635  edges that end at the vertex is <= MaximumConvexCornerEdgeCount() edges
    6636  and the corner angle is <= MaximumConvexCornerAngleRadians().
    6637  Parameters:
    6638  maximum_convex_corner_edge_count - [in]
    6639  */
    6640  void SetMaximumConvexCornerEdgeCount(
    6641  unsigned int maximum_convex_corner_edge_count
    6642  );
    6643 
    6644  /*
    6645  Description:
    6646  If ConvexCornerTest() ConvexCornerOption::at_mesh_corner, then an
    6647  input mesh boundary vertex becomes a sub-D corner when the number of
    6648  edges that end at the vertex is <= MaximumConvexCornerEdgeCount() edges
    6649  and the corner angle is <= MaximumConvexCornerAngleRadians().
    6650  Returns:
    6651  The maximum number of edges at a convex corner vertex.
    6652  */
    6653  unsigned int MaximumConvexCornerEdgeCount() const;
    6654 
    6655  /*
    6656  Description:
    6657  If ConvexCornerTest() ConvexCornerOption::at_mesh_corner, then an
    6658  input mesh boundary vertex becomes a sub-D corner when the number of
    6659  edges that end at the vertex is <= MaximumConvexCornerEdgeCount() edges
    6660  and the corner angle is <= MaximumConvexCornerAngleRadians().
    6661  Parameters:
    6662  maximum_convex_corner_angle_radians - [in]
    6663  > 0.0 and < ON_PI
    6664  */
    6665  void SetMaximumConvexCornerAngleRadians(
    6666  double maximum_convex_corner_angle_radians
    6667  );
    6668 
    6669  /*
    6670  Description:
    6671  If ConvexCornerTest() ConvexCornerOption::at_mesh_corner, then an
    6672  input mesh boundary vertex becomes a sub-D corner when the number of
    6673  edges that end at the vertex is <= MaximumConvexCornerEdgeCount() edges
    6674  and the corner angle is <= MaximumConvexCornerAngleRadians().
    6675  Returns:
    6676  The maximum corner angle.
    6677  */
    6678  double MaximumConvexCornerAngleRadians() const;
    6679 
    6680  /*
    6681  Description:
    6682  Copy all convex corner option settings from source_options to this.
    6683  Parameters:
    6684  source_options - [in]
    6685  Returns:
    6686  The currently selected convex corner option.
    6687  */
    6688  ON_SubDFromMeshOptions::ConvexCornerOption CopyConvexCornerTest(
    6689  ON_SubDFromMeshOptions source_parameters
    6690  );
    6691 
    6692 
    6693  ///////////////////////////////////////////////////////////////////////////////////////
    6694  //
    6695  // Sub-D type option
    6696  //
    6697  ON_SubD::SubDType SubDType() const;
    6698 
    6699  void SetSubDType(
    6700  ON_SubD::SubDType subd_type
    6701  );
    6702 
    6703 private:
    6704  ON_SubD::SubDType m_subd_type = ON_SubD::SubDType::Unset;
    6705  unsigned char m_reserved1 = 0;
    6706  unsigned short m_reserved2 = 0;
    6707 
    6708  ON_SubDFromMeshOptions::InteriorCreaseOption m_interior_crease_option = ON_SubDFromMeshOptions::InteriorCreaseOption::None;
    6709  ON_SubDFromMeshOptions::ConvexCornerOption m_convex_corner_option = ON_SubDFromMeshOptions::ConvexCornerOption::None;
    6710  unsigned short m_maximum_convex_corner_edge_count = 2U;
    6711 
    6712  double m_minimum_crease_angle_radians = ON_PI/6.0; // 30 degrees in radians
    6713  double m_maximum_convex_corner_angle_radians = 0.501*ON_PI; // 90 degrees (+ a smidge) in radians
    6714 };
    6715 
    6716 //////////////////////////////////////////////////////////////////////////
    6717 //
    6718 // ON_SubDComponentRef
    6719 //
    6720 // Used when an ON_SubD vertex, edge or face needs to be sent around as
    6721 // a piece of ON_Geometry.
    6722 //
    6723 class ON_SUBD_CLASS ON_SubDComponentRef : public ON_Geometry
    6724 {
    6725  ON_OBJECT_DECLARE(ON_SubDComponentRef);
    6726 public:
    6727  static const ON_SubDComponentRef Empty;
    6728 
    6729  ON_SubDComponentRef() = default;
    6730  ~ON_SubDComponentRef() = default;
    6731  ON_SubDComponentRef(const ON_SubDComponentRef&) ON_NOEXCEPT;
    6732  ON_SubDComponentRef& operator=(const ON_SubDComponentRef&);
    6733 
    6734 #if defined(ON_HAS_RVALUEREF)
    6735  // rvalue copy constructor
    6736  ON_SubDComponentRef( ON_SubDComponentRef&& ) ON_NOEXCEPT;
    6737 
    6738  // The rvalue assignment operator calls ON_Object::operator=(ON_Object&&)
    6739  // which could throw exceptions. See the implementation of
    6740  // ON_Object::operator=(ON_Object&&) for details.
    6741  ON_SubDComponentRef& operator=( ON_SubDComponentRef&& );
    6742 #endif
    6743 
    6744  /*
    6745  Parameters:
    6746  subd_ref - [in]
    6747  component_index - [in]
    6748  bLimitSurface - [in]
    6749  true - the reference is to the limit surface location
    6750  false - the reference is to the control net location
    6751  */
    6752  static ON_SubDComponentRef Create(
    6753  const ON_SubDRef& subd_ref,
    6754  ON_COMPONENT_INDEX component_index,
    6755  ON_SubDComponentLocation component_location
    6756  );
    6757 
    6758  static ON_SubDComponentRef Create(
    6759  const ON_SubDRef& subd_ref,
    6760  ON_SubDComponentPtr component_ptr,
    6761  ON_SubDComponentLocation component_location
    6762  );
    6763 
    6764  static ON_SubDComponentRef Create(
    6765  const ON_SubDRef& subd_ref,
    6766  const class ON_SubDVertex* vertex,
    6767  ON_SubDComponentLocation component_location
    6768  );
    6769 
    6770  static ON_SubDComponentRef Create(
    6771  const ON_SubDRef& subd_ref,
    6772  const class ON_SubDEdge* edge,
    6773  ON_SubDComponentLocation component_location
    6774  );
    6775 
    6776  static ON_SubDComponentRef Create(
    6777  const ON_SubDRef& subd_ref,
    6778  const class ON_SubDFace* face,
    6779  ON_SubDComponentLocation component_location
    6780  );
    6781 
    6782  void Clear();
    6783 
    6784  ON_SubDRef SubDRef() const;
    6785 
    6786  const class ON_SubD& SubD() const;
    6787 
    6788  ON_COMPONENT_INDEX ComponentIndex() const override;
    6789 
    6790  ON_SubDComponentPtr ComponentPtr() const;
    6791 
    6792  ON_SubDComponentLocation ComponentLocation() const;
    6793 
    6794  const class ON_SubDVertex* Vertex() const;
    6795 
    6796  const class ON_SubDEdge* Edge() const;
    6797 
    6798  const class ON_SubDFace* Face() const;
    6799 
    6800 private:
    6801  ON_SubDRef m_subd_ref;
    6802  ON_SubDComponentPtr m_component_ptr = ON_SubDComponentPtr::Null;
    6803  ON_COMPONENT_INDEX m_component_index = ON_COMPONENT_INDEX::UnsetComponentIndex;
    6804  ON_SubDComponentLocation m_component_location = ON_SubDComponentLocation::Unset;
    6805 
    6806 public:
    6807  // overrides of virtual ON_Object functions
    6808  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    6809  void Dump( ON_TextLog& ) const override;
    6810  unsigned int SizeOf() const override;
    6811  ON::object_type ObjectType() const override;
    6812 
    6813  // overrides of virtual ON_Geometry functions
    6814  int Dimension() const override;
    6815 
    6816  // virtual ON_Geometry GetBBox override
    6817  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    6818 };
    6819 
    6820 //////////////////////////////////////////////////////////////////////////
    6821 //
    6822 // ON_SubDComponentPoint
    6823 //
    6824 // Used in selection tests to return a point and parameters on a component.
    6825 //
    6826 class ON_SUBD_CLASS ON_SubDComponentPoint
    6827 {
    6828 public:
    6829  static const ON_SubDComponentPoint Unset;
    6830 
    6831  ON_SubDComponentPoint() = default;
    6832  ~ON_SubDComponentPoint() = default;
    6833  ON_SubDComponentPoint(const ON_SubDComponentPoint&) = default;
    6834  ON_SubDComponentPoint& operator=(const ON_SubDComponentPoint&) = default;
    6835 
    6836  /*
    6837  Description:
    6838  Compares the m_component_ptr values. This function is useful for sorting
    6839  arrays of ON_SubDComponentPoint values remove duplicates.
    6840  */
    6841  static int CompareComponentPtr(
    6842  const ON_SubDComponentPoint* a,
    6843  const ON_SubDComponentPoint* b
    6844  );
    6845 
    6846  // m_component_ptr will be face, edge or vertex
    6847  ON_SubDComponentPtr m_component_ptr = ON_SubDComponentPtr::Null;
    6848 
    6849  //// If the point is on a a face that does not have the ordinary number of
    6850  //// edges for the subdivision type, then m_face_corner_index identifies the
    6851  //// subfragment corner.
    6852  //unsigned int m_face_corner_index = ON_UNSET_UINT_INDEX;
    6853 
    6854  //// If m_level_index is ON_UNSET_UINT_INDEX, the point is on the limit surface.
    6855  //// Otherwise the point is on the control net at the specified level.
    6856  //unsigned int m_level_index = ON_UNSET_UINT_INDEX;
    6857 
    6858  ON_PickPoint m_pick_point = ON_PickPoint::Unset;
    6859 };
    6860 
    6861 //////////////////////////////////////////////////////////////////////////
    6862 //
    6863 // ON_SubDMatrix
    6864 //
    6865 class ON_SUBD_CLASS ON_SubDMatrix
    6866 {
    6867 public:
    6868  ON_SubDMatrix() = default;
    6869 
    6870  static const ON_SubDMatrix Empty;
    6871 
    6872  /*
    6873  Description:
    6874  Precise evaluation of cos(a) and cos(a) where a = i/n pi.
    6875  These values are required for high qualitiy limit surface evaluation.
    6876  Parameters:
    6877  j - [in]
    6878  n - [in]
    6879  cos_theta - [out]
    6880  cos(j/n pi)
    6881  sin_theta - [out]
    6882  sin(j/n pi)
    6883  */
    6884  static bool EvaluateCosAndSin(
    6885  unsigned int j,
    6886  unsigned int n,
    6887  double* cos_theta,
    6888  double* sin_theta
    6889  );
    6890 
    6891  bool IsValid() const;
    6892 
    6893  bool IsValidPointRing(
    6894  size_t point_ring_count,
    6895  size_t point_ring_stride,
    6896  const double* point_ring
    6897  ) const;
    6898 
    6899  bool EvaluateSubdivisionPoint(
    6900  unsigned int component_index,
    6901  size_t point_ring_count,
    6902  size_t point_ring_stride,
    6903  const double* point_ring,
    6904  double subd_point[3]
    6905  ) const;
    6906 
    6907  bool EvaluateLimitPoint(
    6908  size_t point_ring_count,
    6909  size_t point_ring_stride,
    6910  const double* point_ring,
    6911  double limit_point[3],
    6912  double limit_tangent1[3],
    6913  double limit_tangent2[3],
    6914  double limit_normal[3]
    6915  ) const;
    6916 
    6917  bool EvaluateLimitPoint(
    6918  size_t point_ring_count,
    6919  size_t point_ring_stride,
    6920  const double* point_ring,
    6921  class ON_SubDSectorLimitPoint& limit_point
    6922  ) const;
    6923 
    6924  /*
    6925  Description:
    6926  Get the subdivision matrix information for the case specified
    6927  by the input parameters. This information is retrieved from
    6928  a cache. In some cases, it will be calculated the first time
    6929  it is needed.
    6930  Parameters:
    6931  facet_type - [in]
    6932  vertex_tag - [in]
    6933  valence - [in]
    6934  The input parameters identify the subdivision case.
    6935  Remarks:
    6936  Every member function of ON_SubDMatrix, including this one
    6937  is thread safe.
    6938  */
    6939  static const ON_SubDMatrix& FromCache(
    6940  ON_SubDSectorType sector_type
    6941  );
    6942 
    6943  ON_SubDSectorType m_sector_type;
    6944 
    6945  unsigned int m_R = 0; // the matrix m_S is m_R x m_R (m_R = m_sector_type.PointRingCount())
    6946 
    6947  // The term "standard vertex ring points" is used below.
    6948  //
    6949  // If "C" is an interior vertex (m_vertex_tag is smooth or dart),
    6950  // (E[0], ...., E[N-1]) is a radially sorted list of its edges,
    6951  // (F[0], ..., F[N-1]) is a radially sorted list of its faces,
    6952  // and (P[0], ..., P[N-1]) is a list of the edge vertices opposite C,
    6953  // E0type = smooth for a smooth vertex and crease for a dart vertex,
    6954  // then C is "standard" if E[0] has type E0type, every other
    6955  // edge E[i] is smooth, every outer vertex/ P[i] is smooth, and every
    6956  // face F[i] has the stadard facet type (tri or quad) for the subdivision
    6957  // algorithm.
    6958  //
    6959  // If If "C" is a boundary vertex (m_vertex_tag is crease or corner), the conditions
    6960  // listed above are satisified except
    6961  // E[0] and E[N-1] are tagged as crease edges,
    6962  // P[0] and P[N-1] are tagged as crease vertices (NOT corners),
    6963  // and there are N-2 faces,
    6964  // then "C" is a standard boundary vertex.
    6965  //
    6966  // If the facet type is triangle and C is a standard interior or boundary vertex,
    6967  // then the "standard vertex ring" is the list of N+1 points
    6968  // (C, P[0], ...., P[N-1]).
    6969  //
    6970  // If the facet type is quad, and C is a standard interior vertex,
    6971  // then the "standard vertex ring" is the list of 2*N+1 points
    6972  // (C, P[0], Q[0], ...., P[N-1], Q[N-1]), where Q[I] is the average of the
    6973  // four corners of the quad F[i].
    6974  //
    6975  // If the facet type is quad, and C is a standard boundary vertex,
    6976  // then the "standard vertex ring" is the list of 2*N points
    6977  // (C, P[0], Q[0], ...., P[N-1]).
    6978 
    6979  // m_S = R x R subdivision matrix
    6980  // If (vertexR[0], ..., vertexR[R-1]) is a list of standard vertex ring points,
    6981  // then then the location of the subdivided ring points
    6982  // (vertexR1[0], ..., vertexR1[R-1]) can be calculated from m_S.
    6983  // vertexR1[i] = m_S[i][0]*vertexR[0] + ... + m_S[i][R-1]*vertexR[R-1]
    6984  const double* const* m_S = nullptr;
    6985 
    6986  // m_LP[] = limit point evaluation vector.
    6987  // The array m_LP[] has m_R elements.
    6988  // If (vertexR[0], ..., vertexR[R-1]) is a list of standard vertex ring points,
    6989  // then Limit point = m_LP[0]*vertexR[0] + ... + m_LP[R-1]*vertexR[R-1].
    6990  // m_LP is the eigenvector of Transpose(m_S) with eigenvalue = 1.
    6991  // Length(m_LP) = 1.
    6992  const double* m_LP = nullptr;
    6993 
    6994  // m_L1 and m_L2 = tangent space evaluation vectors.
    6995  // The arrays m_L1[] and m_L2[] have m_R elements.
    6996  // If (vertexR[0], ..., vertexR[R-1]) is a list of standard vertex ring points,
    6997  // then the two vectors
    6998  // V1 = m_L1[0]*vertexR[0] + ... + m_L1[R-1]*vertexR[R-1].
    6999  // V2 = m_L2[0]*vertexR[0] + ... + m_L2[R-1]*vertexR[R-1].
    7000  // span the tangent plane and
    7001  // N = V1 x V2 is perpindicular to the limit tangent plane.
    7002  // In general and almost always in practice, V1 and V2 are not unit vectors
    7003  // and it is best to noramalize V1 and V2 before taking the cross product.
    7004  // m_L1 and m_L2 are subdominant eigenvectors of Transpose(m_S).
    7005  // When the subdominant eigenvalue has geometric multiplicity 2,
    7006  // m_L1 and m_L2 span the same space as m_E1 and m_E2.
    7007  // The values stored in m_L1 and m_L2 are chosen to provide accurate
    7008  // evaluation. In come common cases m_L1 and m_L2 are equal to m_E1 and m_E2,
    7009  // but not in all cases.
    7010  const double* m_L1 = nullptr;
    7011  const double* m_L2 = nullptr;
    7012 
    7013  /*
    7014  Description:
    7015  Set the values in this ON_SubDMatrix so the information
    7016  can be used to evaluate the case identified by the input
    7017  parameters.
    7018  Parameters:
    7019  facet_type - [in]
    7020  vertex_tag - [in]
    7021  sector_edge_count - [in]
    7022  The input parameters identify the subdivision case.
    7023  Returns:
    7024  R > 0: Success. The matrix is R x R.
    7025  0: Failure.
    7026  */
    7027  unsigned int SetFromSectorType(
    7028  ON_SubDSectorType sector_type
    7029  );
    7030 
    7031  /*
    7032  Returns:
    7033  ON_UNSET_VALUE - serious error
    7034  >= 0:
    7035  Maximum value of numbers that should be zero in and ideal world.
    7036  When the matrices, eigenvalues and eigenvectors are correctly calculated,
    7037  this returned value is in the range from 1e-16 to 5e-13 as valence goes
    7038  from 3 to 100.
    7039  For valences < 100, if a value larger than 1.0e-12 occurs, there is a bug in the code.
    7040  */
    7041  double TestMatrix() const;
    7042 
    7043  /*
    7044  Description:
    7045  Run evaluation tests on this subdivision case.
    7046  Returns:
    7047  >= 0.0: Test passed. Maximum deviation found in any test is returned.
    7048  ON_UNSET_VALUE: Test failed.
    7049  */
    7050  double TestEvaluation() const;
    7051 
    7052  /*
    7053  Description:
    7054  Run evaluation tests on a range of subdivision cases.
    7055  Parameters:
    7056  sector_type - [in]
    7057  If ON_SubDSectorType::Empty, then all supported sector types types are tested.
    7058  minimum_sector_face_count - [in]
    7059  If 0, then testing begins at ON_SubDSectorType::MinimumSectorFaceCount(vertex_tag)
    7060  when testing vertex_tag types
    7061  maximum_sector_face_count - [in]
    7062  If 0, then testing stops at ON_SubD::maximum_evaluation_valence.
    7063  text_log - [out]
    7064  If not nullptr, then a brief written report is printed for each test case.
    7065  Returns:
    7066  >= 0.0: Test passed. Maximum deviation found in any test is returned.
    7067  ON_UNSET_VALUE: Test failed.
    7068  */
    7069  static double TestEvaluation(
    7070  ON_SubDSectorType sector_type,
    7071  unsigned int minimum_sector_face_count,
    7072  unsigned int maximum_sector_face_count,
    7073  ON_TextLog* text_log
    7074  );
    7075 
    7076  double TestComponentRing(
    7077  size_t component_ring_count,
    7078  const ON_SubDComponentPtr* component_ring
    7079  ) const;
    7080 
    7081  /*
    7082  Description:
    7083  Test cached subdivision matrix on sector identified by sit.
    7084  Parameters:
    7085  subd_type - [in]
    7086  subd_recursion_count - [in]
    7087  number of times to subdivide
    7088  sit - [in]
    7089  vertex to subdivide
    7090  component_ring - [out]
    7091  subd_points - [out]
    7092  limit_point - [out]
    7093  limit_tangent0 - [out]
    7094  limit_tangent1 - [out]
    7095  limit_normal - [out]
    7096  */
    7097  static double TestEvaluation(
    7098  ON_SubD::SubDType subd_type,
    7099  const unsigned int subd_recursion_count,
    7100  ON_SubDSectorIterator sit,
    7101  ON_SimpleArray<ON_SubDComponentPtr>& component_ring,
    7102  ON_SimpleArray< ON_3dPoint >& subd_points,
    7103  class ON_SubDSectorLimitPoint& limit_point
    7104  );
    7105 
    7106 private:
    7107  unsigned int m__max_R = 0;
    7108  ON_Matrix m__S; // m_S matrix memory
    7109  ON_SimpleArray<double> m__buffer; // m_LP, m_L1, m_L2, m_E1, m_E2 memory
    7110 };
    7111 
    7112 //////////////////////////////////////////////////////////////////////////
    7113 //
    7114 // ON_SubD_FixedSizeHeap
    7115 //
    7116 
    7117 class ON_SUBD_CLASS ON_SubD_FixedSizeHeap
    7118 {
    7119 private:
    7120  static unsigned int m__sn_factory;
    7121 
    7122 public:
    7123  // The serial number is used for debugging purposes.
    7124  const unsigned int m_sn = ++m__sn_factory;
    7125 
    7126 public:
    7127  ON_SubD_FixedSizeHeap() = default;
    7128  ~ON_SubD_FixedSizeHeap();
    7129 
    7130  /*
    7131  Description:
    7132  Reserve enough room to accomodate a face
    7133  with one extraordinary vertex.
    7134  Parameters:
    7135  subd_type - [in]
    7136  extraordinary_valence - [in]
    7137  */
    7138  bool ReserveSubDWorkspace(
    7139  ON_SubD::SubDType subd_type,
    7140  unsigned int extraordinary_valence
    7141  );
    7142 
    7143  bool ReserveSubDWorkspace(
    7144  size_t vertex_capacity,
    7145  size_t edge_capacity,
    7146  size_t face_capacity,
    7147  size_t array_capacity
    7148  );
    7149 
    7150  /*
    7151  Description:
    7152  Reset this ON_SubD_FixedSizeHeap so it can be used again.
    7153  */
    7154  void Reset();
    7155 
    7156  /*
    7157  Description:
    7158  Deallocate all reserved heap.
    7159  */
    7160  void Destroy();
    7161 
    7162  bool InUse() const;
    7163 
    7164  ON_SubDVertex* AllocateVertex(
    7165  const double vertexP[3],
    7166  unsigned int edge_capacity,
    7167  unsigned int face_capacity
    7168  );
    7169 
    7170  ON_SubDVertex* AllocateVertex(
    7171  const ON_SubDVertex* vertex0,
    7172  ON_SubD::SubDType subd_type,
    7173  bool bUseSavedSubdivisionPoint,
    7174  unsigned int edge_capacity,
    7175  unsigned int face_capacity
    7176  );
    7177 
    7178  ON_SubDVertex* AllocateVertex(
    7179  const ON_SubDEdge* edge0,
    7180  ON_SubD::SubDType subd_type,
    7181  bool bUseSavedSubdivisionPoint,
    7182  unsigned int edge_capacity,
    7183  unsigned int face_capacity
    7184  );
    7185 
    7186  ON_SubDVertex* AllocateVertex(
    7187  const ON_SubDFace* face0,
    7188  ON_SubD::SubDType subd_type,
    7189  bool bUseSavedSubdivisionPoint,
    7190  unsigned int edge_capacity,
    7191  unsigned int face_capacity
    7192  );
    7193 
    7194  /*
    7195  Parameters:
    7196  v0 - [in]
    7197  v0_sector_weight - [in]
    7198  If v0 null or ON_SubD::VertexTag::Smooth == v0->m_vertex_tag, and v1 is null or tagged,
    7199  then m_sector_weight[0] is set to v0_sector_weight.
    7200  In all other cases the value of v0_sector_weight is ignored and m_sector_weight[0]
    7201  is set to ON_SubDSectorType::IgnoredSectorWeight.
    7202  v1 - [in]
    7203  v1_sector_weight - [in]
    7204  If v1 null or ON_SubD::VertexTag::Smooth == v1->m_vertex_tag, and v0 is null or tagged,
    7205  then m_sector_weight[1] is set to v1_sector_weight.
    7206  In all other cases the value of v1_sector_weight is ignored and m_sector_weight[1]
    7207  is set to ON_SubDSectorType::IgnoredSectorWeight.
    7208  Returns:
    7209  An edge.
    7210  The vertex parameter information is used to set the ON_SubDEdge.m_vertex[]
    7211  and ON_SubDEdge.m_sector_weight[] values.
    7212  If v0 and v1 are not null and both are tagged, then ON_SubDEdge.m_edge_tag is
    7213  set to ON_SubD::EdgeTag::Crease.
    7214  In all other cases, ON_SubDEdge.m_edge_tag is set to ON_SubD::EdgeTag::Smooth.
    7215  If v0 or v1 is not null, then ON_SubDEdge.m_level is set to the
    7216  maximum of v0->m_level or v1->m_level.
    7217  */
    7218  ON_SubDEdge* AllocateEdge(
    7219  ON_SubDVertex* v0,
    7220  double v0_sector_weight,
    7221  ON_SubDVertex* v1,
    7222  double v1_sector_weight
    7223  );
    7224 
    7225  /*
    7226  Returns:
    7227  A face with all field values zero (same values as ON_SubDEdge::Face), except ON_SubDFace.m_id.
    7228  */
    7229  ON_SubDFace* AllocateFace(
    7230  unsigned int zero_face_id,
    7231  unsigned int parent_face_id
    7232  );
    7233 
    7234  ON_SubDFace* AllocateQuad(
    7235  unsigned int zero_face_id,
    7236  unsigned int parent_face_id,
    7237  const ON_SubDEdgePtr eptrs[4]
    7238  );
    7239 
    7240  ON_SubDFace* AllocateTri(
    7241  unsigned int zero_face_id,
    7242  unsigned int parent_face_id,
    7243  const ON_SubDEdgePtr eptrs[3]
    7244  );
    7245 
    7246  /*
    7247  Parameters:
    7248  capacity - [in]
    7249  desired array size
    7250  bZeroMemory - [in]
    7251  If true, all array element values are zero.
    7252  If false, array element values are undefined.
    7253  Returns:
    7254  An array of capacity ON__UINT_PTR pointers.
    7255  */
    7256  ON__UINT_PTR* AllocatePtrArray(
    7257  unsigned int capacity,
    7258  bool bZeroMemory
    7259  );
    7260 
    7261  /*
    7262  Description:
    7263  Return the most recent array obtained from AllocatePtrArray().
    7264  so it can be reused.
    7265  Returns:
    7266  True:
    7267  Success.
    7268  False:
    7269  Failure. The array was not the most recent array obtained
    7270  from AllocatePtrArray().
    7271  */
    7272  bool ReturnPtrArray(
    7273  unsigned int capacity,
    7274  void* p
    7275  );
    7276 
    7277 private:
    7278  //unsigned int m_max_valence = 0;
    7279 
    7280  ON_SubDVertex* m_v = nullptr;
    7281  unsigned int m_v_capacity = 0;
    7282  unsigned int m_v_index = 0;
    7283 
    7284  ON_SubDEdge* m_e = nullptr;
    7285  unsigned int m_e_capacity = 0;
    7286  unsigned int m_e_index = 0;
    7287 
    7288  ON_SubDFace* m_f = nullptr;
    7289  unsigned int m_f_capacity = 0;
    7290  unsigned int m_f_index = 0;
    7291 
    7292  ON__UINT_PTR* m_p = nullptr;
    7293  unsigned int m_p_capacity = 0;
    7294  unsigned int m_p_index = 0;
    7295 
    7296 private:
    7297  // copies not supported
    7298  ON_SubD_FixedSizeHeap(const ON_SubD_FixedSizeHeap&) = delete;
    7299  ON_SubD_FixedSizeHeap& operator=(const ON_SubD_FixedSizeHeap&) = delete;
    7300 };
    7301 
    7302 #if defined(ON_COMPILING_OPENNURBS)
    7303 /*
    7304 The ON_SubDAsUserData class is used to attach a subd to it proxy mesh
    7305 when writing V6 files in commerical rhino.
    7306 */
    7307 class ON_SubDMeshProxyUserData : public ON_UserData
    7308 {
    7309 public:
    7310  /*
    7311  Returns:
    7312  A pointer to a mesh that now manages subd.
    7313  */
    7314  static ON_Mesh* MeshProxyFromSubD(
    7315  const ON_SubD* subd
    7316  );
    7317 
    7318  /*
    7319  Returns:
    7320  A pointer to a subd and deletes mesh.
    7321  */
    7322  static ON_SubD* SubDFromMeshProxy(
    7323  const ON_Mesh* mesh
    7324  );
    7325 
    7326  /*
    7327  Returns:
    7328  A pointer to a subd and deletes mesh.
    7329  */
    7330  static bool IsSubDMeshProxy(
    7331  const ON_Mesh* mesh
    7332  );
    7333 
    7334  static const ON_SubDDisplayParameters MeshProxyDisplayParameters();
    7335 
    7336 private:
    7337  ON_OBJECT_DECLARE(ON_SubDMeshProxyUserData);
    7338 
    7339 public:
    7340  ON_SubDMeshProxyUserData();
    7341  ~ON_SubDMeshProxyUserData();
    7342  ON_SubDMeshProxyUserData(const ON_SubDMeshProxyUserData&);
    7343  ON_SubDMeshProxyUserData& operator=(const ON_SubDMeshProxyUserData&);
    7344 
    7345 private:
    7346  // ON_Object overrides
    7347  bool Write(ON_BinaryArchive& archive) const override;
    7348  bool Read(ON_BinaryArchive& archive) override;
    7349  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    7350 
    7351  bool ParentMeshValid() const;
    7352 
    7353 private:
    7354  // ON_UserData overrides
    7355  bool GetDescription(ON_wString& description) override;
    7356  bool WriteToArchive(
    7357  const class ON_BinaryArchive& archive,
    7358  const class ON_Object* parent_object
    7359  ) const override;
    7360 
    7361 private:
    7362  // The subd
    7363  mutable ON_SubD* m_subd = nullptr;
    7364 
    7365 private:
    7366  // information used to see if the parent mesh has been modified.
    7367  mutable unsigned int m_mesh_face_count = 0;
    7368  mutable unsigned int m_mesh_vertex_count = 0;
    7369  mutable ON_SHA1_Hash m_mesh_face_array_sha1 = ON_SHA1_Hash::EmptyContentHash;
    7370  mutable ON_SHA1_Hash m_mesh_vertex_array_sha1 = ON_SHA1_Hash::EmptyContentHash;
    7371 
    7372 private:
    7373  void Internal_CopyFrom(const ON_SubDMeshProxyUserData& src);
    7374  void Internal_Destroy();
    7375  static const bool Internal_MeshHasFaces(const ON_Mesh* mesh);
    7376  static const ON_SHA1_Hash Internal_FaceSHA1(const ON_Mesh* mesh);
    7377  static const ON_SHA1_Hash Internal_VertexSHA1(const ON_Mesh* mesh);
    7378 };
    7379 #endif
    7380 
    7381 #endif
    7382 
    7383 #endif
    virtual bool Transform(const ON_Xform &xform)
    -
    virtual void MemoryRelocate()
    -
    Definition: opennurbs_progress_reporter.h:25
    -
    virtual unsigned int SetComponentStatus(ON_COMPONENT_INDEX component_index, ON_ComponentStatus status_to_copy) const
    -
    virtual int Dimension() const
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2014 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 
    18 #if 0
    19 #define ON_SUBD_CENSUS
    20 //////////////////////////////////////////////////////////////////////////
    21 //
    22 // ON_CensusCounter
    23 //
    24 // This tool is used to study memory leaks and other shared ptr issues.
    25 // The classes have no size but effect performance. Use only in
    26 // debugging situations. Never ship a release with ON_SUBD_CENSUS defined.
    27 //
    28 class ON_SUBD_CLASS ON_CensusCounter
    29 {
    30 public:
    31  enum class Class : unsigned int
    32  {
    33  unset = 0,
    34  subd = 1,
    35  subd_impl = 2,
    36  subd_limit_mesh = 3,
    37  subd_limit_mesh_impl = 4,
    38  subd_ref = 5,
    39 
    40  count
    41  };
    42 
    43  static void RegisterBirth(ON_CensusCounter::Class,ON__UINT_PTR);
    44 
    45  static void RegisterDeath(ON_CensusCounter::Class,ON__UINT_PTR);
    46 
    47  static void CensusReport(
    48  class ON_TextLog&
    49  );
    50 
    51  static void Clear();
    52 };
    53 
    54 class ON_SUBD_CLASS ON_SubDCensusCounter
    55 {
    56 public:
    57  ON_SubDCensusCounter() ON_NOEXCEPT;
    58  ~ON_SubDCensusCounter() ON_NOEXCEPT;
    59  ON_SubDCensusCounter(const ON_SubDCensusCounter&) ON_NOEXCEPT;
    60  ON_SubDCensusCounter& operator=(const ON_SubDCensusCounter&) = default;
    61  //ON_SubDCensusCounter( ON_SubDCensusCounter&& ) ON_NOEXCEPT;
    62  //ON_SubDCensusCounter& operator=( ON_SubDCensusCounter&& ) ON_NOEXCEPT;
    63 };
    64 
    65 class ON_SUBD_CLASS ON_SubDRefCensusCounter
    66 {
    67 public:
    68  ON_SubDRefCensusCounter() ON_NOEXCEPT;
    69  ~ON_SubDRefCensusCounter() ON_NOEXCEPT;
    70  ON_SubDRefCensusCounter(const ON_SubDRefCensusCounter&) ON_NOEXCEPT;
    71  ON_SubDRefCensusCounter& operator=(const ON_SubDRefCensusCounter&) = default;
    72  //ON_SubDRefCensusCounter( ON_SubDRefCensusCounter&& ) ON_NOEXCEPT;
    73  //ON_SubDRefCensusCounter& operator=( ON_SubDRefCensusCounter&& ) ON_NOEXCEPT;
    74 };
    75 
    76 
    77 class ON_SUBD_CLASS ON_SubDImpleCensusCounter
    78 {
    79 public:
    80  ON_SubDImpleCensusCounter() ON_NOEXCEPT;
    81  ~ON_SubDImpleCensusCounter() ON_NOEXCEPT;
    82  ON_SubDImpleCensusCounter(const ON_SubDImpleCensusCounter&) ON_NOEXCEPT;
    83  ON_SubDImpleCensusCounter& operator=(const ON_SubDImpleCensusCounter&) = default;
    84  //ON_SubDImplCensusCounter( ON_SubDImplCensusCounter&& ) ON_NOEXCEPT;
    85  //ON_SubDImplCensusCounter& operator=( ON_SubDImplCensusCounter&& ) ON_NOEXCEPT;
    86 };
    87 
    88 class ON_SUBD_CLASS ON_SubDLimitMeshCensusCounter
    89 {
    90 public:
    91  ON_SubDLimitMeshCensusCounter() ON_NOEXCEPT;
    92  ~ON_SubDLimitMeshCensusCounter() ON_NOEXCEPT;
    93  ON_SubDLimitMeshCensusCounter(const ON_SubDLimitMeshCensusCounter&) ON_NOEXCEPT;
    94  ON_SubDLimitMeshCensusCounter& operator=(const ON_SubDLimitMeshCensusCounter&) = default;
    95  //ON_SubDLimitMeshCensusCounter( ON_SubDLimitMeshCensusCounter&& ) ON_NOEXCEPT;
    96  //ON_SubDLimitMeshCensusCounter& operator=( ON_SubDLimitMeshCensusCounter&& ) ON_NOEXCEPT;
    97 };
    98 
    99 
    100 class ON_SUBD_CLASS ON_SubDLimitMeshImplCensusCounter
    101 {
    102 public:
    103  ON_SubDLimitMeshImplCensusCounter() ON_NOEXCEPT;
    104  ~ON_SubDLimitMeshImplCensusCounter() ON_NOEXCEPT;
    105  ON_SubDLimitMeshImplCensusCounter(const ON_SubDLimitMeshImplCensusCounter&) ON_NOEXCEPT;
    106  ON_SubDLimitMeshImplCensusCounter& operator=(const ON_SubDLimitMeshImplCensusCounter&) ON_NOEXCEPT;
    107  ON_SubDLimitMeshImplCensusCounter( ON_SubDLimitMeshImplCensusCounter&& ) ON_NOEXCEPT;
    108  ON_SubDLimitMeshImplCensusCounter& operator=( ON_SubDLimitMeshImplCensusCounter&& ) ON_NOEXCEPT;
    109 };
    110 
    111 #endif
    112 
    113 
    114 ////////////////////////////////////////////////////////////////
    115 //
    116 // Definition of subdivision surface
    117 //
    118 ////////////////////////////////////////////////////////////////
    119 
    120 #if !defined(OPENNURBS_SUBD_INC_)
    121 #define OPENNURBS_SUBD_INC_
    122 
    123 #if defined(OPENNURBS_SUBD_WIP)
    124 
    125 #if 1
    126 // SuD is exported from opennurbs DLL
    127 #define ON_SUBD_CLASS ON_CLASS
    128 #else
    129 // SuD is not exported from opennurbs DLL
    130 #define ON_SUBD_CLASS
    131 #endif
    132 
    133 class ON_SUBD_CLASS ON_SubDVertexPtr
    134 {
    135 public:
    136  // For performance reasons, m_ptr is not initialized and no constructors are declared
    137  // or implemented. If you require initialization, then use x = ON_SubDVertexPtr::Null
    138  // or x = ON_SubDVertexPtr::Create(...).
    139  ON__UINT_PTR m_ptr;
    140 
    141  static const ON_SubDVertexPtr Null;
    142 
    143  bool IsNull() const;
    144 
    145  class ON_SubDVertex* Vertex() const;
    146 
    147  ON__UINT_PTR VertexPtrMark() const;
    148 
    149  ON_ComponentStatus Status() const;
    150 
    151  static
    152  class ON_SubDVertexPtr Create(
    153  const class ON_SubDVertex* vertex
    154  );
    155 
    156  /*
    157  Parameters:
    158  vertex - [in]
    159  mark - [in]
    160  zero or one
    161  */
    162  static
    163  class ON_SubDVertexPtr Create(
    164  const class ON_SubDVertex* vertex,
    165  ON__UINT_PTR vertex_mark
    166  );
    167 
    168  static
    169  class ON_SubDVertexPtr Create(
    170  const class ON_SubDComponentPtr& vertex_component
    171  );
    172 };
    173 
    174 class ON_SUBD_CLASS ON_SubDEdgePtr
    175 {
    176 public:
    177  // For performance reasons, m_ptr is not initialized and no constructors are declared
    178  // or implemented. If you require initialization, then use x = ON_SubDEdgePtr::Null
    179  // or x = ON_SubDEdgePtr::Create(...).
    180  ON__UINT_PTR m_ptr;
    181 
    182  static const ON_SubDEdgePtr Null;
    183 
    184  bool IsNull() const;
    185 
    186  class ON_SubDEdge* Edge() const;
    187 
    188  ON__UINT_PTR EdgeDirection() const;
    189 
    190  ON_ComponentStatus Status() const;
    191 
    192  /*
    193  Returns:
    194  A pointer to the same edge with the direction flipped
    195  */
    196  ON_SubDEdgePtr Reversed() const;
    197 
    198  static ON_SubDEdgePtr Create(
    199  const class ON_SubDEdge* edge,
    200  ON__UINT_PTR direction
    201  );
    202 
    203  static ON_SubDEdgePtr Create(
    204  const class ON_SubDComponentPtr& edge_component
    205  );
    206 };
    207 
    208 class ON_SUBD_CLASS ON_SubDFacePtr
    209 {
    210 public:
    211  // For performance reasons, m_ptr is not initialized and no constructors are declared
    212  // or implemented. If you require initialization, then use x = ON_SubDFacePtr::Null
    213  // or x = ON_SubDFacePtr::Create(...).
    214  ON__UINT_PTR m_ptr;
    215 
    216  static const ON_SubDFacePtr Null;
    217 
    218  bool IsNull() const;
    219 
    220  class ON_SubDFace* Face() const;
    221 
    222  ON__UINT_PTR FaceDirection() const;
    223 
    224  ON_ComponentStatus Status() const;
    225 
    226  static
    227  class ON_SubDFacePtr Create(
    228  const class ON_SubDFace* face,
    229  ON__UINT_PTR direction
    230  );
    231 
    232  static ON_SubDFacePtr Create(
    233  const class ON_SubDComponentPtr& face_component
    234  );
    235 };
    236 
    237 class ON_SUBD_CLASS ON_SubDComponentPtr
    238 {
    239 public:
    240  // For performance reasons, m_ptr is not initialized and no constructors are declared
    241  // or implemented. If you require initialization, then use x = ON_SubDComponentPtr::Null
    242  // or x = ON_SubDComponentPtr::Create(...).
    243  ON__UINT_PTR m_ptr;
    244 
    245  static const ON_SubDComponentPtr Null;
    246 
    247  enum class ComponentPtrType : unsigned char
    248  {
    249  unset = 0,
    250  vertex = 1,
    251  edge = 2,
    252  face = 3
    253  };
    254 
    255  static ON_SubDComponentPtr::ComponentPtrType ComponentPtrTypeFromUnsigned(
    256  unsigned int component_pointer_type_as_unsigned
    257  );
    258 
    259  /*
    260  Description:
    261  ON_SubDComponentPtr::ComponentPtrType::vertex
    262  < ON_SubDComponentPtr::ComponentPtrType::edge
    263  < ON_SubDComponentPtr::ComponentPtrType::face
    264  < ON_SubDComponentPtr::ComponentPtrType::unset
    265  < invalid
    266  */
    267  static int CompareComponentPtrType(
    268  ON_SubDComponentPtr::ComponentPtrType a,
    269  ON_SubDComponentPtr::ComponentPtrType b
    270  );
    271 
    272  static int CompareType(
    273  const ON_SubDComponentPtr* a,
    274  const ON_SubDComponentPtr* b
    275  );
    276 
    277  static int Compare(
    278  const ON_SubDComponentPtr* a,
    279  const ON_SubDComponentPtr* b
    280  );
    281 
    282 
    283  bool IsNull() const;
    284  bool IsNotNull() const;
    285 
    286  ON_SubDComponentPtr::ComponentPtrType ComponentType() const;
    287 
    288  class ON_SubDComponentBase* ComponentBase() const;
    289  class ON_SubDVertex* Vertex() const;
    290  class ON_SubDEdge* Edge() const;
    291  class ON_SubDFace* Face() const;
    292 
    293  ON_SubDVertexPtr VertexPtr() const;
    294  ON_SubDEdgePtr EdgePtr() const;
    295  ON_SubDFacePtr FacePtr() const;
    296 
    297  ON_COMPONENT_INDEX ComponentIndex() const;
    298 
    299  /*
    300  Returns:
    301  0 or 1.
    302  The interpretation of the mark varies depending on the context.
    303  For vertices, this is the vertex mark.
    304  For edges, this is generally an index into ON_SubDEdge.m_vertex[]
    305  or a direction flag with 1 indicating a reversed direction.
    306  For face, this is generally an orientation flag with 1 indicating
    307  a reversed (clockwise) orientation.
    308  */
    309  ON__UINT_PTR ComponentMark() const;
    310 
    311  ON_ComponentStatus Status() const;
    312 
    313  /*
    314  Returns:
    315  1: status changed.
    316  0: status not changed.
    317  */
    318  unsigned int SetStates(
    319  ON_ComponentStatus states_to_set
    320  );
    321 
    322  /*
    323  Returns:
    324  1: status changed.
    325  0: status not changed.
    326  */
    327  unsigned int ClearStates(
    328  ON_ComponentStatus states_to_clear
    329  );
    330 
    331  /*
    332  Description:
    333  Makes "this" an exact copy of status.
    334  Parameters:
    335  status - [in]
    336  Returns:
    337  1: status changed.
    338  0: status not changed.
    339  */
    340  unsigned int SetStatus(
    341  ON_ComponentStatus status
    342  );
    343 
    344  static ON_SubDComponentPtr ClearMark(
    345  ON_SubDComponentPtr component_ptr
    346  );
    347 
    348  static
    349  class ON_SubDComponentPtr Create(
    350  const class ON_SubDVertex* vertex
    351  );
    352 
    353  static
    354  class ON_SubDComponentPtr Create(
    355  const class ON_SubDEdge* edge
    356  );
    357 
    358  static
    359  class ON_SubDComponentPtr Create(
    360  const class ON_SubDFace* face
    361  );
    362 
    363  static
    364  class ON_SubDComponentPtr Create(
    365  const class ON_SubDVertex* vertex,
    366  ON__UINT_PTR vertex_mark
    367  );
    368 
    369  static
    370  class ON_SubDComponentPtr Create(
    371  const class ON_SubDEdge* edge,
    372  ON__UINT_PTR edge_mark
    373  );
    374 
    375  static
    376  class ON_SubDComponentPtr Create(
    377  const class ON_SubDFace* face,
    378  ON__UINT_PTR face_mark
    379  );
    380 
    381  static
    382  class ON_SubDComponentPtr Create(
    383  ON_SubDVertexPtr vertexptr
    384  );
    385 
    386  static
    387  class ON_SubDComponentPtr Create(
    388  ON_SubDEdgePtr edgeptr
    389  );
    390 
    391  static
    392  class ON_SubDComponentPtr Create(
    393  ON_SubDFacePtr faceptr
    394  );
    395 };
    396 
    397 /*
    398 Description:
    399  The ON_SubDComponentLocation enum is used when an ON_SubD component
    400  is referenced and it is important to distinguish between the
    401  component's location in the SubD control net and its location
    402  in the SubD limit surface.
    403 */
    404 enum class ON_SubDComponentLocation : unsigned char
    405 {
    406  Unset = 0,
    407  ControlNet = 1,
    408  LimitSurface = 2
    409 };
    410 
    411 //////////////////////////////////////////////////////////////////////////
    412 //
    413 // ON_SubD
    414 //
    415 class ON_SUBD_CLASS ON_SubD : public ON_Geometry
    416 {
    417  ON_OBJECT_DECLARE(ON_SubD);
    418 
    419 #if defined(ON_SUBD_CENSUS)
    420 private:
    421  ON_SubDCensusCounter m_census_counter;
    422 #endif
    423 
    424 public:
    425  static const ON_SubD Empty;
    426 
    427  enum : unsigned int
    428  {
    429  maximum_subd_level = 128 // uses as a sanity check on input parameters
    430  };
    431 
    432 #pragma region RH_C_SHARED_ENUM [ON_SubD::VertexTag] [Rhino.Geometry.SubD.SubDVertexTag] [nested:byte]
    433  /// <summary>
    434  /// SubD::VertexTag identifies the type of subdivision vertex. Different tags use
    435  /// different subdivision algorithms to determine where the subdivision point and
    436  /// limit point are located. There are toplological constraints that restrict which
    437  /// tags can be assigned.
    438  /// </summary>
    439  enum class VertexTag : unsigned char
    440  {
    441  ///<summary>
    442  /// Not a valid vertex tag and the default value for ON_SubDVertex::m_vertex_tag.
    443  /// This encourages developers to thoughtfully initialize ON_SubDVertex::m_vertex_tag.
    444  ///</summary>
    445  Unset = 0,
    446 
    447  ///<summary>
    448  /// Must be an interior vertex.
    449  /// All edges ending at a smooth vertex must be tagged as ON_SubD::EdgeTag::Smooth.
    450  ///</summary>
    451  Smooth = 1,
    452 
    453  ///<summary>
    454  /// Can be an iterior or a boundary vertex.
    455  /// Exactly two edges ending at a crease vertex must be tagged as ON_SubD::EdgeTag::Crease.
    456  /// All other edges ending at a crease must be tagged as tagON_SubD::EdgeTag::smooth.
    457  ///</summary>
    458  Crease = 2,
    459 
    460  ///<summary>
    461  /// Can be an iterior, boundary or isolated vertex.
    462  /// The location of a corner vertex is fixed.
    463  /// The all subdivision points and the limit point are at the initial vertex location.
    464  /// The edges ending at a corner vertex can be smooth or crease edges.
    465  ///</summary>
    466  Corner = 3,
    467 
    468  ///<summary>
    469  /// Must be an interior vertex.
    470  /// Exactly one edge ending at a dart vertex must be tagged as ON_SubD::EdgeTag::Smooth.
    471  /// All other edges ending at a dart vertex must be tagged as tagON_SubD::EdgeTag::smooth.
    472  ///</summary>
    473  Dart = 4
    474  };
    475 #pragma endregion
    476 
    477  static ON_SubD::VertexTag VertexTagFromUnsigned(
    478  unsigned int vertex_tag_as_unsigned
    479  );
    480 
    481  /*
    482  Parameters:
    483  vertex_tag - [in]
    484  Returns:
    485  True if vertex_tag is Smooth, Crease, Corner, or Dart.
    486  False otherwise.
    487  */
    488  static bool VertexTagIsSet(
    489  ON_SubD::VertexTag vertex_tag
    490  );
    491 
    492 #pragma region RH_C_SHARED_ENUM [ON_SubD::EdgeTag] [Rhino.Geometry.SubD.SubDEdgeTag] [nested:byte]
    493  /// <summary>
    494  /// SubD::EdgeTag identifies the type of subdivision edge. Different tags use
    495  /// different subdivision algorithms to determine where the subdivision point is located.
    496  /// </summary>
    497  enum class EdgeTag : unsigned char
    498  {
    499  ///<summary>
    500  /// Not a valid edge tag and the default value for ON_SubDEdge::m_edge_tag.
    501  /// This encourages developers to thoughtfully initialize ON_SubDEdge::m_edge_tag.
    502  ///</summary>
    503  Unset = 0,
    504 
    505  ///<summary>
    506  /// One or two of the edge's vertices must be tagged as ON_SubD::VertexTag::Smooth.
    507  /// The edge must have exactly two faces.
    508  ///</summary>
    509  Smooth = 1,
    510 
    511  ///<summary>
    512  /// Both of the edge's vertices must be tagged as not ON_SubD::VertexTag::Smooth.
    513  /// The edge can have any number of faces.
    514  ///</summary>
    515  Crease = 2,
    516 
    517  ///<summary>
    518  /// Reserved for version 2 of the ON_SubD project.
    519  /// Currently this tag is not used and is invalid.
    520  ///
    521  /// FUTURE: The edge is a "soft crease" or "semi-sharp".
    522  /// At lease one end vertex must be tagged as ON_SubD::VertexTag::Smooth
    523  /// The edge must have exactly two faces.
    524  /// The value of ON_SubDEdge::m_sharpness controls how
    525  /// soft/hard the edge appears.
    526  /// ON_SubDEdge::m_sharpness = 0 is identical to ON_SubD::EdgeTag::Smooth.
    527  /// ON_SubDEdge::m_sharpness = 1 is identical to ON_SubD::EdgeTag::Crease.
    528  ///</summary>
    529  Sharp = 3,
    530 
    531  ///<summary>
    532  /// This tag appears only on edges that have exactly two neighboring faces
    533  /// and neither end vertex is tagged as ON_SubD::VertexTag::Smooth.
    534  /// The level 1 subdivision point for a level 0 edge tagged as ON_SubD::EdgeTag::X
    535  /// is the standard smooth edge subdivision point.
    536  /// When subdivided, the new subdivision vertex will be tagged
    537  /// as ON_SubD::VertexTag::Smooth and the subdivided edges will
    538  /// be tagged as ON_SubD::EdgeTag::Smooth. Thus, the tag ON_SubD::EdgeTag::X
    539  /// should only appear at level 0.
    540  /// This tag exists because the ON_SubD subdivision
    541  /// algorithm requires any edge with both end vertices
    542  /// tagged as not smooth must be subdivided at its midpoint.
    543  /// Sector iterators treat "X" edges as smooth.
    544  /// Both edge end weights must be set so the smooth
    545  /// subdivided edges will be valid.
    546  ///</summary>
    547  X = 4
    548  };
    549 #pragma endregion
    550 
    551  static ON_SubD::EdgeTag EdgeTagFromUnsigned(
    552  unsigned int edge_tag_as_unsigned
    553  );
    554 
    555 
    556  /*
    557  Parameters:
    558  edge_tag - [in]
    559  Returns:
    560  True if edge_tag is Smooth, Crease, Sharp, or X.
    561  False otherwise.
    562  */
    563  static bool EdgeTagIsSet(
    564  ON_SubD::EdgeTag edge_tag
    565  );
    566 
    567 
    568 #pragma region RH_C_SHARED_ENUM [ON_SubD::FacetType] [Rhino.Geometry.SubD.SubDFacetType] [nested:byte]
    569  /// <summary>
    570  /// SubD::FacetType reports the default facet type for subdivision algorithms.
    571  /// </summary>
    572  enum class FacetType : unsigned char
    573  {
    574  ///<summary> Not a valid facet type. </summary>
    575  Unset = 0,
    576 
    577  ///<summary> Triangle </summary>
    578  Tri = 3,
    579 
    580  ///<summary> Quadrangle </summary>
    581  Quad = 4
    582  };
    583 #pragma endregion
    584 
    585  static ON_SubD::FacetType FacetTypeFromUnsigned(
    586  unsigned int facet_type_as_unsigned
    587  );
    588 
    589  //enum class VertexEdgeOrder : unsigned char
    590  //{
    591  // unset = 0,
    592  // radial, // The ON_SubDVertex edge and face information satisfies:
    593  // // 1) m_face_count = m_edge_count or m_face_count+1 == m_edge_count
    594  // // 2) m_faces[i] is between m_edges[i] and m_edges[(i+1)%m_edge_count]
    595  // // 3) When 0 < i < m_edge_count-1, m_edges[i].m_edge_count = 2
    596  // // and m_edges[i].m_face2[] references m_faces[i-1] and m_faces[i]
    597  // // in an unspecified order.
    598  // notradial // one of the conditions conditions for radial is not satisfied.
    599  //};
    600 
    601  //static ON_SubD::VertexEdgeOrder VertexEdgeOrderFromUnsigned(
    602  // unsigned int vertex_edge_order_as_unsigned
    603  // );
    604 
    605 #pragma region RH_C_SHARED_ENUM [ON_SubD::VertexFacetType] [Rhino.Geometry.SubD.VertexFacetType] [nested:byte]
    606 
    607  ///<summary>Summarizes the number of edges in faces in the whole object.</summary>
    608  enum class VertexFacetType : unsigned char
    609  {
    610  ///<summary>Not a valid vertex face type.</summary>
    611  Unset = 0,
    612 
    613  ///<summary>All faces are triangular.</summary>
    614  Tri = 3,
    615 
    616  ///<summary>All faces are quads.</summary>
    617  Quad = 4,
    618 
    619  ///<summary>Edge count of faces is constant and &gt; 4.</summary>
    620  Ngon = 5,
    621 
    622  ///<summary>Edge count of faces is not constant.</summary>
    623  Mixed = 0xFF
    624  };
    625 #pragma endregion
    626 
    627  static ON_SubD::VertexFacetType VertexFacetTypeFromUnsigned(
    628  unsigned int vertex_facet_type_as_unsigned
    629  );
    630 
    631 #pragma region RH_C_SHARED_ENUM [ON_SubD::SubDType] [Rhino.Geometry.SubD.SubDType] [nested:byte]
    632  /// <summary>
    633  /// Subdivision algorithm.
    634  /// </summary>
    635  enum class SubDType : unsigned char
    636  {
    637  ///<summary>
    638  /// Not a valid subdivision type.
    639  ///</summary>
    640  Unset = 0,
    641 
    642  ///<summary>
    643  /// Built-in Loop-Warren triangle with Bernstein-Levin-Zorin creases and darts.
    644  ///</summary>
    645  TriLoopWarren = 3,
    646 
    647  ///<summary>
    648  /// Built-in Catmull-Clark quad with Bernstein-Levin-Zorin creases and darts.
    649  ///</summary>
    650  QuadCatmullClark = 4,
    651 
    652  ///<summary>
    653  /// Custom triangle face algorithm. (Not built-in. Provided for use by 3rd party developers.)
    654  ///</summary>
    655  CustomTri = 5,
    656 
    657  ///<summary>
    658  /// Custom quad facet algorithm. (Not built-in. Provided for use by 3rd party developers.)
    659  ///</summary>
    660  CustomQuad = 6,
    661 
    662  ///<summary>
    663  /// Custom algorithm. (Not built-in. Provided for use by 3rd party developers.)
    664  ///</summary>
    665  Custom = 7
    666 
    667  // All values must be <= 31; i.e., (((unsigned char)0xE0U) & subd_type)) must be zero.
    668  };
    669 #pragma endregion
    670 
    671  static ON_SubD::SubDType SubDTypeFromUnsigned(
    672  unsigned int subd_type_as_unsigned
    673  );
    674 
    675  static ON_SubD::SubDType DefaultSubDType();
    676 
    677  static unsigned int FacetEdgeCount(
    678  ON_SubD::FacetType facet_type
    679  );
    680 
    681  static unsigned int FacetEdgeCount(
    682  ON_SubD::SubDType subd_type
    683  );
    684 
    685  /*
    686  Parameters:
    687  sit - [in]
    688  vertex sector iterator
    689  component_ring_capacity - [in]
    690  capacity of component_ring[] array
    691  1 + center_vertex.m_edge_count + center_vertex.m_face_count
    692  will be large enough.
    693  component_ring - [out]
    694  A sorted list of ON_SubDComponentPtr values are returned in component_ring[]
    695  component_ring[0] is the central vertex.
    696  component_ring[1] and subsequent components with odd indices are sector edges.
    697  component_ring[2] and subsequent components with even indices are sector faces.
    698  For edge components (i is odd), component_ring[i].ComponentMark() is the index of
    699  the center vertex in ON_SubDEge.m_vertex[].
    700  Returns:
    701  Number of components set in component_ring[].
    702 
    703  0: failure
    704 
    705  >= 4 and even:
    706  component_ring[0] = center vertex
    707  component_ring[1] = starting crease edge
    708  component_ring[2] = starting face
    709  ... zero or more interior smooth edge, face pairs ...
    710  component_ring[component_count-1] = ending crease edge
    711 
    712  >= 5 and odd:
    713  component_ring[0] = vit.CenterVertex()
    714  component_ring[1] = first edge (smooth)
    715  component_ring[2] = first face
    716  ... zero or more smooth edge, face, pairs ...
    717  component_ring[component_count-2] = last edge (smooth)
    718  component_ring[component_count-1] = last face
    719 
    720  Example:
    721  unsinged int component_ring_count = GetVertexComponentRing(vit,component_ring);
    722  unsinged int N = component_ring_count/2; // number of edges in ring
    723  const bool bSectorHasCreaseBoundary = (0 == (component_ring_count % 2));
    724  */
    725  static unsigned int GetSectorComponentRing(
    726  const class ON_SubDSectorIterator& sit,
    727  size_t component_ring_capacity,
    728  ON_SubDComponentPtr* component_ring
    729  );
    730 
    731  /*
    732  Parameters:
    733  sit - [in]
    734  vertex sector iterator
    735  component_ring - [out]
    736  A sorted listof ON_SubDComponentPtr values are returned in component_ring[]
    737 
    738 
    739 
    740  Returns:
    741  Number of components set in component_ring[].
    742 
    743  0: failure
    744 
    745  >= 4 and even:
    746  component_ring[0] = vit.CenterVertex()
    747  component_ring[1] = starting crease edge
    748  component_ring[2] = starting face
    749  ... zero or more interior smooth edge, face pairs ...
    750  component_ring[component_count-1] = ending crease edge
    751 
    752  >= 5 and odd:
    753  component_ring[0] = center vertex
    754  component_ring[1] = first edge (smooth)
    755  component_ring[2] = first face
    756  ... zero or more smooth edge, face, pairs ...
    757  component_ring[component_count-2] = last edge (smooth)
    758  component_ring[component_count-1] = last face
    759 
    760  Example:
    761  unsinged int component_ring_count = GetVertexComponentRing(vit,component_ring);
    762  unsinged int N = component_ring_count/2; // number of edges in ring
    763  const bool bSectorHasCreaseBoundary = (0 == (component_ring_count % 2));
    764  */
    765  static unsigned int GetSectorComponentRing(
    766  const class ON_SubDSectorIterator& sit,
    768  );
    769 
    770  /*
    771  Returns:
    772  Number of edges in an component ring returned by ON_SubD::GetVertexComponentRing();
    773  */
    774  static unsigned int ComponentRingEdgeCount(
    775  size_t component_ring_count
    776  );
    777 
    778  /*
    779  Returns:
    780  Number of faces in an component ring returned by ON_SubD::GetVertexComponentRing();
    781  */
    782  static unsigned int ComponentRingFaceCount(
    783  size_t component_ring_count
    784  );
    785 
    786  static bool ComponentRingIsValid(
    787  size_t component_ring_count,
    788  const ON_SubDComponentPtr* component_ring
    789  );
    790 
    791  /*
    792  Returns:
    793  Number of points in the subdivision ring or 0 if the call fails.
    794  */
    795  static unsigned int GetSectorSubdivsionPointRing(
    796  ON_SubD::SubDType subd_type,
    797  size_t component_ring_count,
    798  const ON_SubDComponentPtr* component_ring,
    799  size_t point_ring_capacity,
    800  size_t point_ring_stride,
    801  double* point_ring
    802  );
    803 
    804  static unsigned int GetSectorSubdivisionPointRing(
    805  ON_SubD::SubDType subd_type,
    806  size_t component_ring_count,
    807  const ON_SubDComponentPtr* component_ring,
    808  ON_SimpleArray<ON_3dPoint>& subd_point_ring
    809  );
    810 
    811  static unsigned int GetSectorPointRing(
    812  ON_SubD::SubDType subd_type,
    813  bool bSubdivideIfNeeded,
    814  size_t component_ring_count,
    815  const ON_SubDComponentPtr* component_ring,
    816  size_t subd_point_ring_capacity,
    817  size_t subd_point_ring_stride,
    818  double* subd_point_ring
    819  );
    820 
    821  static unsigned int GetSectorPointRing(
    822  ON_SubD::SubDType subd_type,
    823  bool bSubdivideIfNeeded,
    824  size_t component_ring_count,
    825  const ON_SubDComponentPtr* component_ring,
    826  ON_SimpleArray<ON_3dPoint>& point_ring
    827  );
    828 
    829  static unsigned int GetSectorPointRing(
    830  ON_SubD::SubDType subd_type,
    831  bool bSubdivideIfNeeded,
    832  const class ON_SubDSectorIterator& sit,
    833  size_t point_ring_capacity,
    834  size_t point_ring_stride,
    835  double* point_ring
    836  );
    837 
    838  static unsigned int GetSectorPointRing(
    839  ON_SubD::SubDType subd_type,
    840  bool bSubdivideIfNeeded,
    841  const class ON_SubDSectorIterator& sit,
    842  ON_SimpleArray<ON_3dPoint>& point_ring
    843  );
    844 
    845  /*
    846  Parameters:
    847  subd_type - [in]
    848  A quad based subdivision algorithm.
    849  bFirstPass - [in]
    850  If bFirstPass is true and the components are in standard form for the vertex
    851  and subdivision type, then locations of the component vertices opposite the
    852  center vertex are returned in the point ring.
    853  bSecondPass - [in]
    854  If bSecondtPass is true and the first pass is disable or does not succeed,
    855  then the component subdivision locations are returned in the point ring.
    856  vertex0 - [in]
    857  If not null, then vertex0->m_edges and vertex0->m_faces must
    858  be radially sorted and span a single sector and component_ring[]
    859  is ignored.
    860  component_ring_count - [in]
    861  If vertex0 is null, then component_ring_count specifies the number
    862  of components in the component_ring[] array.
    863  component_ring[] - [in]
    864  If vertex0 is null, then component_ring[0] is the central vertex,
    865  component_ring[1] and subsequent components with odd indices are
    866  sector edges, component_ring[2] and subsequent components with even
    867  indices are sector faces, all sorted radially.
    868  point_ring_stride - [in]
    869  point_ring - [out]
    870  point locations are returned here.
    871  Returns:
    872  Number of points in the subdivision ring or 0 if the call fails.
    873  The number of points is
    874  1 + ON_SubD::ComponentRingEdgeCount(component_ring_count) + ON_SubD::ComponentRingFaceCount(component_ring_count).
    875  Remarks:
    876  No validation checking is performed. This function will crash
    877  if the input is not valid. Call GetSubdivisionPointRing() if
    878  you want a crash proof call.
    879  */
    880  static unsigned int GetQuadSectorPointRing(
    881  ON_SubD::SubDType subd_type,
    882  bool bFirstPass,
    883  bool bSecondPass,
    884  const class ON_SubDVertex* vertex0,
    885  size_t component_ring_count,
    886  const class ON_SubDComponentPtr* component_ring,
    887  size_t point_ring_stride,
    888  double* point_ring
    889  );
    890 
    891  /*
    892  Parameters:
    893  subd_type - [in]
    894  A tri based subdivision algorithm.
    895  bFirstPass - [in]
    896  If bFirstPass is true and the components are in standard form for the vertex
    897  and subdivision type, then locations of the component vertices opposite the
    898  center vertex are returned in the point ring.
    899  bSecondPass - [in]
    900  If bSecondPass is true and the first pass is disable or does not succeed,
    901  then the component subdivision locations are returned in the point ring.
    902  vertex0 - [in]
    903  If not null, then vertex0->m_edges and vertex0->m_faces must
    904  be radially sorted and span a single sector and component_ring[]
    905  is ignored.
    906  component_ring_count - [in]
    907  If vertex0 is null, then component_ring_count specifies the number
    908  of components in the component_ring[] array.
    909  component_ring[] - [in]
    910  If vertex0 is null, then component_ring[0] is the central vertex,
    911  component_ring[1] and subsequent components with odd indices are
    912  sector edges, component_ring[2] and subsequent components with even
    913  indices are sector faces, all sorted radially.
    914  point_ring_stride - [in]
    915  point_ring - [out]
    916  point locations are returned here.
    917  Returns:
    918  Number of points in the subdivision ring or 0 if the call fails.
    919  The number of points is 1 + ON_SubD::ComponentRingEdgeCount(component_ring_count).
    920  Remarks:
    921  No validation checking is performed. This function will crash
    922  if the input is not valid. Call GetSubdivisionPointRing() if
    923  you want a crash proof call.
    924  */
    925  static unsigned int GetTriSectorPointRing(
    926  ON_SubD::SubDType subd_type,
    927  bool bFirstPass,
    928  bool bSecondPass,
    929  const class ON_SubDVertex* vertex0,
    930  size_t component_ring_count,
    931  const class ON_SubDComponentPtr* component_ring,
    932  size_t point_ring_stride,
    933  double* point_ring
    934  );
    935 
    936  static const class ON_SubDVertex* SubdivideSector(
    937  ON_SubD::SubDType subd_type,
    938  const class ON_SubDVertex* center_vertex,
    939  size_t component_ring_count,
    940  const class ON_SubDComponentPtr* component_ring,
    941  class ON_SubD_FixedSizeHeap& fsh
    942  );
    943 
    944  /*
    945  Returns:
    946  true if sector_edge_count is valid for the vertex type
    947  */
    948  static bool IsValidSectorEdgeCount(
    949  ON_SubD::VertexTag vertex_tag,
    950  unsigned int sector_edge_count
    951  );
    952 
    953  static bool IsValidSectorFaceCount(
    954  ON_SubD::VertexTag vertex_tag,
    955  unsigned int sector_face_count
    956  );
    957 
    958  /*
    959  Returns:
    960  Type of facets the basic subdivision algorithm requires.
    961  ON_SubD::FacetType::Quad if subd_type is ON_SubD::SubDType::TriLoopWarren.
    962  ON_SubD::FacetType::Tri if subd_type is ON_SubD::SubDType::QuadCatmullClark.
    963  ON_SubD::FacetType::Unset otherwise.
    964  Remark:
    965  All built in subdivision algorithm will handle faces with 3 or more edges.
    966  */
    967  static ON_SubD::FacetType FacetTypeFromSubDType(
    968  ON_SubD::SubDType subd_type
    969  );
    970 
    971  static ON_SubD::SubDType SubDTypeFromFacetType(
    972  ON_SubD::FacetType facet_type
    973  );
    974 
    975  static bool PointRingHasFacePoints(
    976  ON_SubD::SubDType subd_type
    977  );
    978 
    979  /*
    980  Returns:
    981  true if facet_type is ON_SubD::FacetType::Tri or ON_SubD::FacetType::Quad.
    982  */
    983  static bool IsQuadOrTriFacetType(
    984  ON_SubD::FacetType facet_type
    985  );
    986 
    987  /*
    988  Returns:
    989  true if subd_type is ON_SubD::SubDType::TriLoopWarren or ON_SubD::SubDType::QuadCatmullClark.
    990  */
    991  static bool IsQuadOrTriSubDType(
    992  ON_SubD::SubDType subd_type
    993  );
    994 
    995  ON_SubD() ON_NOEXCEPT;
    996  virtual ~ON_SubD();
    997 
    998  /*
    999  Description:
    1000  Creates an independent copy of src.
    1001  */
    1002  ON_SubD( const ON_SubD& src );
    1003 
    1004  /*
    1005  Description:
    1006  Creates an independent copy of src.
    1007  */
    1008  ON_SubD& operator=(const ON_SubD& src);
    1009 
    1010 #if defined(ON_HAS_RVALUEREF)
    1011  // rvalue copy constructor
    1012  ON_SubD( ON_SubD&& ) ON_NOEXCEPT;
    1013 
    1014  // The rvalue assignment operator calls ON_Object::operator=(ON_Object&&)
    1015  // which could throw exceptions. See the implementation of
    1016  // ON_Object::operator=(ON_Object&&) for details.
    1017  ON_SubD& operator=( ON_SubD&& );
    1018 #endif
    1019 
    1020  /*
    1021  Description:
    1022  The subdivision information referenced by src_subd will be shared with this
    1023  Remarks:
    1024  ON_Geometry base class information, like ON_UserData, is not copied or shared.
    1025  */
    1026  void ShareContentsFrom(
    1027  ON_SubD& subd
    1028  );
    1029 
    1030  static void SwapContents(
    1031  ON_SubD& a,
    1032  ON_SubD& b
    1033  );
    1034 
    1035  //virtual
    1036  void MemoryRelocate() override;
    1037 
    1038  //virtual
    1039  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    1040 
    1041  //virtual
    1042  void Dump(
    1043  ON_TextLog&
    1044  ) const override;
    1045 
    1046  //virtual
    1047  unsigned int SizeOf() const override;
    1048 
    1049  //virtual
    1050  ON__UINT32 DataCRC(
    1051  ON__UINT32 current_remainder
    1052  ) const override;
    1053 
    1054  //virtual
    1055  bool Write(
    1056  ON_BinaryArchive& archive
    1057  ) const override;
    1058 
    1059  //virtual
    1060  bool Read(
    1061  ON_BinaryArchive& archive
    1062  ) override;
    1063 
    1064  //virtual
    1065  ON::object_type ObjectType() const override;
    1066 
    1067 
    1068  //virtual
    1069  unsigned int ClearComponentStates(
    1070  ON_ComponentStatus states_to_clear
    1071  ) const override;
    1072 
    1073  //virtual
    1074  unsigned int GetComponentsWithSetStates(
    1075  ON_ComponentStatus states_filter,
    1076  bool bAllEqualStates,
    1078  ) const override;
    1079 
    1080  //virtual
    1081  unsigned int SetComponentStates(
    1082  ON_COMPONENT_INDEX component_index,
    1083  ON_ComponentStatus states_to_set
    1084  ) const override;
    1085 
    1086  //virtual
    1087  unsigned int ClearComponentStates(
    1088  ON_COMPONENT_INDEX component_index,
    1089  ON_ComponentStatus states_to_clear
    1090  ) const override;
    1091 
    1092  //virtual
    1093  unsigned int SetComponentStatus(
    1094  ON_COMPONENT_INDEX component_index,
    1095  ON_ComponentStatus status_to_copy
    1096  ) const override;
    1097 
    1098  //virtual
    1099  ON_AggregateComponentStatus AggregateComponentStatus() const override;
    1100 
    1101  //virtual
    1102  void MarkAggregateComponentStatusAsNotCurrent() const override;
    1103 
    1104  //virtual
    1105  bool DeleteComponents(
    1106  const ON_COMPONENT_INDEX* ci_list,
    1107  size_t ci_count
    1108  ) override;
    1109 
    1110  /*
    1111  Remarks:
    1112  For ON_SubD objects, ClearBoundingBox() and DestroyRuntimeCache()
    1113  are identical.
    1114  */
    1115  //virtual
    1116  void DestroyRuntimeCache(
    1117  bool bDelete = true
    1118  ) override;
    1119 
    1120  //virtual
    1121  int Dimension() const override;
    1122 
    1123  // virtual ON_Geometry GetBBox override
    1124  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1125 
    1126  // virtual ON_Geometry GetTightBoundingBox override
    1127  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    1128 
    1129  /*
    1130  Description:
    1131  Clears all saved information that depends on vertex locations,
    1132  subdivision algorithms, vertex or edge tags, or control net topology.
    1133  If you modify any of the above, then call ClearBoundingBox().
    1134  Remarks:
    1135  For ON_SubD objects, ClearBoundingBox() and DestroyRuntimeCache()
    1136  are identical.
    1137  */
    1138  //virtual
    1139  void ClearBoundingBox() override;
    1140 
    1141  //virtual
    1142  bool Transform(
    1143  const ON_Xform& xform
    1144  ) override;
    1145 
    1146  //virtual
    1147  bool IsDeformable() const override;
    1148 
    1149  //virtual
    1150  bool MakeDeformable() override;
    1151 
    1152  //virtual
    1153  bool SwapCoordinates(
    1154  int i,
    1155  int j
    1156  ) override;
    1157 
    1158 
    1159 
    1160  //virtual
    1161  bool HasBrepForm() const override;
    1162 
    1163  //virtual
    1164  ON_Brep* BrepForm(
    1165  ON_Brep* brep = nullptr
    1166  ) const override;
    1167 
    1168  //virtual
    1169  ON_COMPONENT_INDEX ComponentIndex() const override;
    1170 
    1171  //virtual
    1172  bool EvaluatePoint(
    1173  const class ON_ObjRef& objref,
    1174  ON_3dPoint& P
    1175  ) const override;
    1176 
    1177  /*
    1178  Description:
    1179  Uses the input mesh to define the level zero control polygon.
    1180  Parameters:
    1181  level_zero_mesh - [in]
    1182  from_mesh_parameters - [in]
    1183  To get the smoothest possible result, pass nullptr
    1184  or ON_SubDFromMeshOptions::Smooth. To get a sub-D with interior
    1185  creases use other static ON_SubDFromMeshOptions values or
    1186  create one with custom settings.
    1187  */
    1188  static ON_SubD* CreateFromMesh(
    1189  const class ON_Mesh* level_zero_mesh,
    1190  const class ON_SubDFromMeshOptions* from_mesh_parameters,
    1191  ON_SubD* subd
    1192  );
    1193 
    1194  unsigned int DumpTopology(
    1195  ON_TextLog&
    1196  ) const;
    1197 
    1198  unsigned int DumpTopology(
    1199  ON_2udex vertex_id_range,
    1200  ON_2udex edge_id_range,
    1201  ON_2udex face_id_range,
    1202  ON_TextLog&
    1203  ) const;
    1204 
    1205  /*
    1206  Description:
    1207  Discard all contents of this ON_SubD.
    1208  Remarks:
    1209  More efficient than Destroy() if this ON_SubD will be reused soon.
    1210  */
    1211  void Clear();
    1212 
    1213  /*
    1214  Description:
    1215  Delete all contents release all memory used by this ON_SubD.
    1216  */
    1217  void Destroy();
    1218 
    1219  ON_SubD::SubDType ActiveLevelSubDType() const;
    1220 
    1221  /*
    1222  Returns:
    1223  The number of explicitly computed levels that are currently available.
    1224  A value of 0 indicates this SubD is empty.
    1225  */
    1226  unsigned int LevelCount() const;
    1227 
    1228  /*
    1229  Returns:
    1230  If the SubD is not empty, then the index of the active level is returned. This value will be < LevelCount().
    1231  If the SubD is empty, then ON_UNSET_UINT_INDEX is returned.
    1232  */
    1233  unsigned int ActiveLevelIndex() const;
    1234 
    1235  /*
    1236  Description:
    1237  Remove subdivision levels
    1238  Paramters:
    1239  max_level_count - [in]
    1240  Maximum number of levels to keep.
    1241  */
    1242  void ClearSubdivisionLevels(
    1243  unsigned int max_level_index
    1244  );
    1245 
    1246  bool IsEmpty() const;
    1247 
    1248 
    1249  /*
    1250  Description:
    1251  Get aggregate edge demographics for the subd.
    1252  Returns:
    1253  Bitwise or of ON_ComponentAttributes::EdgeFlags values for every edge in the subd.
    1254  */
    1255  unsigned int EdgeFlags() const;
    1256 
    1257  /////////////////////////////////////////////////////////
    1258  //
    1259  // Component (Vertex, Edge, Face) access
    1260  //
    1261  ON_SubDComponentPtr ComponentPtrFromComponentIndex(
    1262  ON_COMPONENT_INDEX component_index
    1263  ) const;
    1264 
    1265  unsigned int ComponentPtrFromComponentIndex(
    1266  const ON_COMPONENT_INDEX* ci_list,
    1267  size_t ci_count,
    1269  ) const;
    1270 
    1271  unsigned int ComponentPtrFromComponentIndex(
    1272  const ON_COMPONENT_INDEX* ci_list,
    1273  size_t ci_count,
    1274  bool bIncludeVertices,
    1275  bool bIncludeEdges,
    1276  bool bIncludeFaces,
    1278  ) const;
    1279 
    1280  /////////////////////////////////////////////////////////
    1281  //
    1282  // Vertex access
    1283  //
    1284 
    1285  unsigned int VertexCount() const;
    1286 
    1287  const class ON_SubDVertex* FirstVertex() const;
    1288 
    1289  class ON_SubDVertexIterator VertexIterator() const;
    1290 
    1291  class ON_SubDVertexArray VertexArray() const;
    1292 
    1293  /*
    1294  Parameters:
    1295  vertex_id - [in]
    1296  Returns:
    1297  If vertex_id identifies a valid vertex in this ON_SubD, then
    1298  a pointer to that vertex is returned.
    1299  Otherwise, nullptr is returned.
    1300  */
    1301  const class ON_SubDVertex* VertexFromId(
    1302  unsigned int vertex_id
    1303  ) const;
    1304 
    1305  /////////////////////////////////////////////////////////
    1306  //
    1307  // Edge access
    1308  //
    1309 
    1310  unsigned int EdgeCount() const;
    1311 
    1312  const class ON_SubDEdge* FirstEdge() const;
    1313 
    1314  class ON_SubDEdgeIterator EdgeIterator() const;
    1315 
    1316  class ON_SubDEdgeArray EdgeArray() const;
    1317 
    1318  /*
    1319  Parameters:
    1320  edge_id - [in]
    1321  Returns:
    1322  If edge_id identifies a valid edge in this ON_SubD, then
    1323  a pointer to that edge is returned.
    1324  Otherwise, nullptr is returned.
    1325  */
    1326  const class ON_SubDEdge* EdgeFromId(
    1327  unsigned int edge_id
    1328  ) const;
    1329 
    1330  /////////////////////////////////////////////////////////
    1331  //
    1332  // Face access
    1333  //
    1334 
    1335  unsigned int FaceCount() const;
    1336 
    1337  const class ON_SubDFace* FirstFace() const;
    1338 
    1339  class ON_SubDFaceIterator FaceIterator() const;
    1340 
    1341  class ON_SubDFaceArray FaceArray() const;
    1342 
    1343  /*
    1344  Parameters:
    1345  face_id - [in]
    1346  Returns:
    1347  If face_id identifies a valid face in this ON_SubD, then
    1348  a pointer to that face is returned.
    1349  Otherwise, nullptr is returned.
    1350  */
    1351  const class ON_SubDFace* FaceFromId(
    1352  unsigned int face_id
    1353  ) const;
    1354 
    1355  /////////////////////////////////////////////////////////
    1356  //
    1357  // Component (vertex, edge, face) state ( selected, highlighted, ... ) tools
    1358  // NOTE:
    1359  // All component status settings are mutable
    1360  // All are copied.
    1361  // None are saved.
    1362  //
    1363 
    1364  /*
    1365  Parameters:
    1366  states_filter - [in]
    1367  bAllEqualStates - [in]
    1368  If a state is set in states_filter, all active level components
    1369  with the same state set will be included in the
    1370  components_with_set_states[] array.
    1371  If bAllEqualStates is true, then ON_ComponentStatus::AllEqualStates()
    1372  is used to test for inclusion.
    1373  If bAllEqualStates is false, then ON_ComponentStatus::SomeEqualStates()
    1374  is used to test for inclusion.
    1375  components_with_set_states - [out]
    1376  Returns:
    1377  Number of returned components.
    1378  */
    1379  unsigned int GetComponentsWithSetStates(
    1380  ON_ComponentStatus states_filter,
    1381  bool bAllEqualStates,
    1382  ON_SimpleArray< ON_SubDComponentPtr >& components_with_set_states
    1383  ) const;
    1384 
    1385 
    1386  /*
    1387  Description:
    1388  Set states on an individual component.
    1389  Parameters:
    1390  component_ptr - [in]
    1391  The states will be set on this component.
    1392  states_to_set - [in]
    1393  If a state is set in the states_to_set parameter, the same
    1394  state will be set on the component.
    1395  Returns:
    1396  0: no state settings changed on the component.
    1397  1: some state setting changed on the component.
    1398  */
    1399  unsigned int SetComponentStates(
    1400  ON_SubDComponentPtr component_ptr,
    1401  ON_ComponentStatus states_to_set
    1402  ) const;
    1403 
    1404  /*
    1405  Description:
    1406  Clear states on an individual component.
    1407  Parameters:
    1408  component_ptr - [in]
    1409  The states will be cleared on this component.
    1410  states_to_clear - [in]
    1411  If a state is set in the states_to_clear parameter, the same
    1412  state will be cleared on the component.
    1413  Returns:
    1414  0: no state settings changed on the component.
    1415  1: some state setting changed on the component.
    1416  */
    1417  unsigned int ClearComponentStates(
    1418  ON_SubDComponentPtr component_ptr,
    1419  ON_ComponentStatus states_to_clear
    1420  ) const;
    1421 
    1422  /*
    1423  Description:
    1424  Copy status settings to an individual component.
    1425  Parameters:
    1426  component_ptr - [in]
    1427  The states will be copied to this component.
    1428  status_to_copy - [in]
    1429  Returns:
    1430  1: some state settings changed on the component.
    1431  1: some state setting changed on the component.
    1432  */
    1433  unsigned int SetComponentStatus(
    1434  ON_SubDComponentPtr component_ptr,
    1435  ON_ComponentStatus status_to_copy
    1436  ) const;
    1437 
    1438  bool DeleteComponents(
    1439  const ON_SubDComponentPtr* cptr_list,
    1440  size_t cptr_count
    1441  );
    1442 
    1443 
    1444  /////////////////////////////////////////////////////////
    1445  //
    1446  // Editing tools
    1447  //
    1448 
    1449  unsigned int MergeColinearEdges(
    1450  double distance_tolerance,
    1451  double maximum_aspect,
    1452  double sin_angle_tolerance
    1453  );
    1454 
    1455  ON_SubDEdgePtr MergeEdges(
    1456  ON_SubDEdgePtr eptr0,
    1457  ON_SubDEdgePtr eptr1
    1458  );
    1459 
    1460  static bool EdgesCanBeMerged(
    1461  ON_SubDEdgePtr eptr0,
    1462  ON_SubDEdgePtr eptr1
    1463  );
    1464 
    1465  // returns true if all facets are consistently oriented
    1466  bool IsOriented(
    1467  unsigned int level_index
    1468  ) const;
    1469 
    1470  // reverses the orientation of all facets
    1471  bool ReverseOrientation(
    1472  unsigned int level_index
    1473  ) const;
    1474 
    1475  // Attempts to orient all facet to match the first facet.
    1476  bool Orient(
    1477  unsigned int level_index
    1478  ) const;
    1479 
    1480  /*
    1481  Description:
    1482  Interior vertices (smooth and dart) must have at least three faces.
    1483  Concave corner vertices must have at least two faces.
    1484  */
    1485  bool RepairInvalidSectors(
    1486  unsigned int level_index
    1487  );
    1488 
    1489  /*
    1490  Description:
    1491  Split and edge.
    1492  The input edge is modifed to terminate at the input vertex.
    1493  The new edge begins at the input vertex and ends at the final vertex
    1494  of the original input edge.
    1495  edge - [in]
    1496  edge to split.
    1497  vertex_location - [in]
    1498  location of inserted vertex.
    1499  If vertex_location == ON_ON_3dPoint::UnsetPoint,
    1500  then the edge's midpoint is used.
    1501  Returns:
    1502  A pointer to the new edge or nullptr if the input is not valid.
    1503  */
    1504  const class ON_SubDEdge* SplitEdge(
    1505  class ON_SubDEdge* edge,
    1506  ON_3dPoint vertex_location
    1507  );
    1508 
    1509  /*
    1510  Description:
    1511  Split a face into two faces by inserting and edge connecting the
    1512  specified vertices.
    1513  Parameters:
    1514  face - [in]
    1515  A face with at least four edges.
    1516  fvi0 - [in]
    1517  fvi1 - [in]
    1518  Indices of the inserted edge ends.
    1519  Returns:
    1520  A pointer to the inserted edge.
    1521  The inserted edge runs from face->Vertex(fvi0) to face->Vertex(fvi1).
    1522  ON_SubDEdge.Face(0) is the original face and ON_SubDEdge::Face(1) is
    1523  the added face.
    1524  The first edge of the input face remains the first edge of face.
    1525  The inserted edge is the first edge of the added face.
    1526  */
    1527  const class ON_SubDEdge* SplitFace(
    1528  class ON_SubDFace* face,
    1529  unsigned int fvi0,
    1530  unsigned int fvi1
    1531  );
    1532 
    1533  const class ON_SubDVertex* TriangulateFace(
    1534  class ON_SubDFace* face
    1535  );
    1536 
    1537  const class ON_SubDFace* MergeFaces(
    1538  class ON_SubDEdge* edge
    1539  );
    1540 
    1541  /*
    1542  Description:
    1543  Updates vertex tag, edge tag, and edge coefficient values
    1544  on the active level.
    1545 
    1546  After completing custom editing operations that modify the
    1547  topology of the SubD control net or changing values of
    1548  vertex or edge tags, the tag and sector coefficients
    1549  information on nearby components in the edited areas
    1550  need to be updated.
    1551 
    1552  Parameters:
    1553  bUnsetValuesOnly - [in]
    1554  If true, the update is restricted to vertices tagged as
    1555  ON_SubD::VertexTag::Unset and edges tagged as ON_SubD::EdgeTag::Unset.
    1556 
    1557  Returns:
    1558  Number of vertices and edges that were changed during the update.
    1559  */
    1560  unsigned int UpdateAllTagsAndSectorCoefficients(
    1561  bool bUnsetValuesOnly
    1562  );
    1563 
    1564  /*
    1565  Description:
    1566  This tool if for expert users writing advanced editing tools.
    1567  After completing custom editing operations that modify the
    1568  topology of the SubD control net or changing values of
    1569  vertex or edge tags, the tag and sector coefficients
    1570  information on nearby components in the edited areas
    1571  need to be updated.
    1572  Parameters:
    1573  bUnsetTagsOnly - [in]
    1574  If bUnsetTagsOnly is true, then only unset tags and
    1575  ill be updated.
    1576  If bUnsetTagsOnly is false, then all tags and
    1577  will be checked and updated as needed.
    1578  Returns:
    1579  Number of vertices that changed during the update.
    1580  Remarks:
    1581  It is easiest to call UpdateTagsAndSectorCoefficients().
    1582  */
    1583  unsigned int UpdateVertexTags(
    1584  bool bUnsetVertexTagsOnly
    1585  );
    1586 
    1587  /*
    1588  Description:
    1589  This tool if for expert users writing advanced editing tools.
    1590  After completing custom editing operations that modify the
    1591  topology of the SubD control net or changing values of
    1592  vertex or edge tags, the tag and sector coefficients
    1593  information on nearby components in the edited areas
    1594  need to be updated.
    1595  Parameters:
    1596  bUnsetValuesOnly - [in]
    1597  If bUnsetValuesOnly is true, then only unset tags and
    1598  sector weights will be updated.
    1599  If bUnsetValuesOnly is false, then all tags and
    1600  sector weights will be checked and updated as needed.
    1601  Returns:
    1602  Number of edges that had a tag value changed or sector
    1603  coefficient set to ON_SubDSectorType::UnsetSectorWeight.
    1604  Remarks:
    1605  It is easiest to call UpdateTagsAndSectorCoefficients().
    1606  */
    1607  unsigned int UpdateEdgeTags(
    1608  bool bUnsetEdgeTagsOnly
    1609  );
    1610 
    1611  /*
    1612  Description:
    1613  This tool if for expert users writing advanced editing tools.
    1614  After completing custom editing operations that modify the
    1615  topology of the SubD control net or changing values of
    1616  vertex or edge tags, the tag and sector coefficients
    1617  information on nearby components in the edited areas
    1618  need to be updated.
    1619  Parameters:
    1620  bUnsetValuesOnly - [in]
    1621  If bUnsetValuesOnly is true, then only unset tags and
    1622  sector weights will be updated.
    1623  If bUnsetValuesOnly is false, then all tags and
    1624  sector weights will be checked and updated as needed.
    1625  Returns:
    1626  Number of edges that had a tag value changed or sector
    1627  coefficient set to ON_SubDSectorType::UnsetSectorWeight.
    1628  Remarks:
    1629  It is easiest to call UpdateTagsAndSectorCoefficients().
    1630  */
    1631  unsigned int UpdateEdgeSectorCoefficients(
    1632  bool bUnsetSectorCoefficientsOnly
    1633  );
    1634 
    1635  /*
    1636  Descripiton:
    1637  Clears the ON_ComponentState
    1638  */
    1639  unsigned int ClearComponentMarks(
    1640  bool bClearVertexMarks,
    1641  bool bClearEdgeMarks,
    1642  bool bClearFaceMarks,
    1644  ) const;
    1645 
    1646  unsigned int SetComponentMarks(
    1647  bool bClearBeforeSet,
    1648  const ON_SimpleArray< const class ON_SubDComponentBase* >& marked_component_list
    1649  ) const;
    1650 
    1651  unsigned int GetMarkedComponents(
    1652  bool bIncludeVertices,
    1653  bool bIncludeEdges,
    1654  bool bIncludeFaces,
    1656  ) const;
    1657 
    1658 
    1659  /*
    1660  Description:
    1661  Transforms the SubD components in ci_list[].
    1662  Parameters:
    1663  xform - [in]
    1664  ci_list - [in]
    1665  ci_count - [in]
    1666  Returns:
    1667  Number of vertex locations that changed.
    1668  */
    1669  unsigned int TransformComponents(
    1670  const ON_Xform& xform,
    1671  const ON_COMPONENT_INDEX* ci_list,
    1672  size_t ci_count
    1673  );
    1674 
    1675  unsigned int TransformComponents(
    1676  const ON_Xform& xform,
    1677  const ON_SubDComponentPtr* cptr_list,
    1678  size_t cptr_count
    1679  );
    1680 
    1681  unsigned int ExtrudeComponents(
    1682  const ON_Xform& xform,
    1683  const ON_COMPONENT_INDEX* ci_list,
    1684  size_t ci_count,
    1685  bool bPermitNonManifoldEdgeCreation,
    1686  ON_SubD::EdgeTag original_edge_tag,
    1687  ON_SubD::EdgeTag moved_edge_tag
    1688  );
    1689 
    1690  unsigned int ExtrudeComponents(
    1691  const ON_Xform& xform,
    1692  const ON_SubDComponentPtr* cptr_list,
    1693  size_t cptr_count,
    1694  bool bPermitNonManifoldEdgeCreation,
    1695  ON_SubD::EdgeTag original_edge_tag,
    1696  ON_SubD::EdgeTag moved_edge_tag
    1697  );
    1698 
    1699  /////*
    1700  ////Description:
    1701  //// Apply the built-in triangle subdivision subdivision algorithm globally.
    1702  ////Returns:
    1703  //// New level.
    1704  ////*/
    1705  ////unsigned int TriSubdivision();
    1706 
    1707  ////unsigned int GetSector(
    1708  //// const class ON_SubDFace* face,
    1709  //// ON__UINT_PTR face_vertex_index,
    1710  //// class ON_SubDVertex& sector
    1711  //// ) const;
    1712 
    1713  ////unsigned int GetSector(
    1714  //// const class ON_SubDVertex* vertex,
    1715  //// const ON_SubDFace* face,
    1716  //// class ON_SubDVertex& sector
    1717  //// ) const;
    1718 
    1719  ////unsigned int GetSector(
    1720  //// const ON_SubDVertex* vertex,
    1721  //// ON_SubDFacePtr face_ptr,
    1722  //// class ON_SubDVertex& sector
    1723  //// ) const;
    1724 
    1725  ////unsigned int GetSector(
    1726  //// const class ON_SubDVertex* vertex,
    1727  //// const class ON_SubDEdge* smooth_edge,
    1728  //// ON_SubDVertex& sector
    1729  //// ) const;
    1730 
    1731  ////unsigned int GetSector(
    1732  //// const ON_SubDEdge* smooth_edge,
    1733  //// ON__UINT_PTR smooth_edge_end_index,
    1734  //// ON_SubDVertex& sector
    1735  //// ) const;
    1736 
    1737  ////unsigned int GetSector(
    1738  //// ON_SubDEdgePtr smooth_edge_ptr,
    1739  //// class ON_SubDVertex& sector
    1740  //// ) const;
    1741 
    1742  /*
    1743  Description:
    1744  Apply the built-in subdivision algorithm and save the results
    1745  in this ON_SubD.
    1746  Parameters:
    1747  subd_type - [in]
    1748  unset will use the current subdivision type.
    1749  level_index - [in]
    1750  Level where subdivision starts
    1751  count - [in] > 0
    1752  Number of times to subdivide.
    1753  Returns:
    1754  Number of subdivision steps that succeeded.
    1755  (= count when everything works, < count when input is not valid)
    1756  */
    1757  bool Subdivide(
    1758  ON_SubD::SubDType subd_type,
    1759  unsigned int level_index,
    1760  unsigned int count
    1761  );
    1762 
    1763  /*
    1764  Returns:
    1765  Active level subdivison type.
    1766  */
    1767  bool SetSubDType(
    1768  ON_SubD::SubDType subd_type
    1769  );
    1770 
    1771  class ON_SubDVertex* AddVertex(
    1772  ON_SubD::VertexTag vertex_tag,
    1773  const double* P
    1774  );
    1775 
    1776  /*
    1777  Parameters:
    1778  edge_face_count - [in]
    1779  Number of faces the edge will eventually have.
    1780  Pass 0 if the value is not known.
    1781  v0 - [in]
    1782  starting vertex
    1783  v1 - [in]
    1784  ending vertex
    1785  Returns:
    1786  If edge_face_count > 0x7FFFU, then ON_SubD::EdgeTag::Unset is returned.
    1787 
    1788  If edge_face_count is 1 or >= 3, then ON_SubD::EdgeTag::Crease is returned.
    1789 
    1790  If both vertex tags are ON_SubD::VertexTag::Smooth, then ON_SubD::EdgeTag::Smooth is returned.
    1791 
    1792  If edge_face_count is 1 and both vertex tags are ON_SubD::VertexTag::Crease or ON_SubD::VertexTag::Corner,
    1793  then ON_SubD::EdgeTag::Crease is returned.
    1794 
    1795  If edge_face_count is 2 and both vertex tags are set and both are not ON_SubD::VertexTag::Smooth,
    1796  then ON_SubD::EdgeTag::X is returned.
    1797 
    1798  Otherwise, ON_SubD::EdgeTag::Unset is returned.
    1799  */
    1800  static ON_SubD::EdgeTag EdgeTagFromContext(
    1801  unsigned int edge_face_count,
    1802  const ON_SubD::VertexTag v0_tag,
    1803  const ON_SubD::VertexTag v1_tag
    1804  );
    1805 
    1806  static ON_SubD::EdgeTag EdgeTagFromContext(
    1807  unsigned int edge_face_count,
    1808  const ON_SubDVertex* v0,
    1809  const ON_SubDVertex* v1
    1810  );
    1811 
    1812  /*
    1813  Description:
    1814  Add an edge to the subd.
    1815  Parameters:
    1816  edge_tag - [in]
    1817  ON_SubD::EdgeTag::Unset
    1818  Edge tag is not known at this time.
    1819  ON_SubD::EdgeTag::Smooth
    1820  Smooth edge. If both vertices are tagged as not smooth, the
    1821  tag on the returned edge will be ON_SubD::EdgeTag::X. This
    1822  tag is changed to ON_SubD::EdgeTag::Smooth on the first
    1823  subdivision step.
    1824  ON_SubD::EdgeTag::Crease.
    1825  Crease edge. Both vertices must be tagged as not smooth.
    1826  v0 - [in]
    1827  v1 - [in]
    1828  The edge begins at v0 and ends at v1.
    1829  The edge will be on the same level as the vertices.
    1830  Returns:
    1831  Pointer to the allocated edge.
    1832  Remarks:
    1833  ON_SubD::EdgeTagFromContext() can be used to determine edge
    1834  tag values in simple situations.
    1835  */
    1836  class ON_SubDEdge* AddEdge(
    1837  ON_SubD::EdgeTag edge_tag,
    1838  class ON_SubDVertex* v0,
    1839  class ON_SubDVertex* v1
    1840  );
    1841 
    1842  /*
    1843  Description:
    1844  Expert use tool to add an edge with precomputed sector coefficients.
    1845  Parameters:
    1846  edge_tag - [in]
    1847  This expert user function does not automatically set the edge tag.
    1848  v0 - [in]
    1849  v0_sector_coefficient - [in]
    1850  v1 - [in]
    1851  v1_sector_coefficient - [in]
    1852  The edge begins at v0 and ends at v1.
    1853  The edge will be on the same level as the vertices.
    1854  The edges sector weights are set
    1855  */
    1856  class ON_SubDEdge* AddEdgeWithSectorCoefficients(
    1857  ON_SubD::EdgeTag edge_tag,
    1858  class ON_SubDVertex* v0,
    1859  double v0_sector_coefficient,
    1860  class ON_SubDVertex* v1,
    1861  double v1_sector_coefficient
    1862  );
    1863 
    1864  class ON_SubDFace* AddFace(
    1865  unsigned int edge_count,
    1866  const class ON_SubDEdgePtr* edge
    1867  );
    1868 
    1869  /*
    1870  Description:
    1871  Expert user tool to insert an edge in the face's edge array.
    1872  Parameters:
    1873  face - [in]
    1874  edge - [in]
    1875  edge_direction -[in]
    1876  i - [in]
    1877  index where the edge should be inserted.
    1878  Returns:
    1879  true if successful.
    1880  Remarks:
    1881  This tool is used during construction or editing of a SubD and the
    1882  connection is added even if the result is an invalid face or edge.
    1883  It is up to the expert user to make enough changes to create a valid SubD.
    1884  */
    1885  bool AddFaceEdgeConnection(
    1886  ON_SubDFace* face,
    1887  unsigned int i,
    1888  ON_SubDEdge* edge,
    1889  ON__UINT_PTR edge_direction
    1890  );
    1891 
    1892  /*
    1893  Description:
    1894  Expert user tool to insert an edge in the face's edge array.
    1895  Parameters:
    1896  face - [in]
    1897  eptr - [in]
    1898  direction must be set correctly
    1899  i - [in]
    1900  index where the edge should be inserted.
    1901  Returns:
    1902  true if successful.
    1903  Remarks:
    1904  This tool is used during construction or editing of a SubD and the
    1905  connection is added even if the result is an invalid face or edge.
    1906  It is up to the expert user to make enough changes to create a valid SubD.
    1907  */
    1908  bool AddFaceEdgeConnection(
    1909  ON_SubDFace* face,
    1910  unsigned int i,
    1911  ON_SubDEdgePtr eptr
    1912  );
    1913 
    1914  /*
    1915  Description:
    1916  Expert user tool to insert an edge in the face's edge array.
    1917  Parameters:
    1918  face - [in]
    1919  edge - [in]
    1920  edge to remove
    1921  Returns:
    1922  true if successful.
    1923  Remarks:
    1924  This tool is used during construction or editing of a SubD and the
    1925  connection is removed even if the result is an invalid face or edge.
    1926  It is up to the expert user to make enough changes to create a valid SubD.
    1927  */
    1928  bool RemoveFaceEdgeConnection(
    1929  ON_SubDFace* face,
    1930  ON_SubDEdge* edge
    1931  );
    1932 
    1933  /*
    1934  Description:
    1935  Expert user tool to insert an edge in the face's edge array.
    1936  Parameters:
    1937  face - [in]
    1938  i - [in]
    1939  index where the edge should be removed.
    1940  removed_edge - [out]
    1941  removed edge
    1942  Remarks:
    1943  This tool is used during construction or editing of a SubD and the
    1944  connection is removed even if the result is an invalid face or edge.
    1945  It is up to the expert user to make enough changes to create a valid SubD.
    1946  */
    1947  bool RemoveFaceEdgeConnection(
    1948  ON_SubDFace* face,
    1949  unsigned int i
    1950  );
    1951 
    1952  /*
    1953  Description:
    1954  Expert user tool to insert an edge in the face's edge array.
    1955  Parameters:
    1956  face - [in]
    1957  i - [in]
    1958  index where the edge should be removed.
    1959  removed_edge - [out]
    1960  removed edge
    1961  Remarks:
    1962  This tool is used during construction or editing of a SubD and the
    1963  connection is removed even if the result is an invalid face or edge.
    1964  It is up to the expert user to make enough changes to create a valid SubD.
    1965  */
    1966  bool RemoveFaceEdgeConnection(
    1967  ON_SubDFace* face,
    1968  unsigned int i,
    1969  ON_SubDEdgePtr& removed_edge
    1970  );
    1971 
    1972  bool GrowVertexEdgeArray(
    1973  ON_SubDVertex* v,
    1974  size_t capacity
    1975  );
    1976  bool GrowVertexFaceArray(
    1977  ON_SubDVertex* v,
    1978  size_t capacity
    1979  );
    1980  bool GrowEdgeFaceArray(
    1981  ON_SubDEdge* e,
    1982  size_t capacity
    1983  );
    1984  bool GrowFaceEdgeArray(
    1985  ON_SubDFace* f,
    1986  size_t capacity
    1987  );
    1988 
    1989  /*
    1990  Description:
    1991  Get the limit surface mesh for this subD.
    1992  Parameters:
    1993  minimum_display_density - [in]
    1994  Returns:
    1995  A mesh of the subdivision limit surface.
    1996  Remarks:
    1997  The mesh is a reference counted mesh managed by this ON_SubD.
    1998  */
    1999  class ON_SubDLimitMesh LimitSurfaceMesh() const;
    2000 
    2001  ON_SubDLimitMesh UpdateLimitSurfaceMesh(
    2002  unsigned int minimum_display_density
    2003  ) const;
    2004 
    2005  void ClearLimitSurfaceMesh() const;
    2006 
    2007  void ClearEvaluationCache() const;
    2008 
    2009  /*
    2010  Description:
    2011  Get an ON_Mesh of the subdivision limit surface
    2012  Parameters:
    2013  display_parameters - [in]
    2014  mesh - [in]
    2015  If not null, the returned mesh will be stored on
    2016  the input class.
    2017  Returns:
    2018  A mesh of the subdivision limit surface.
    2019  */
    2020  class ON_Mesh* GetLimitSurfaceMesh(
    2021  const class ON_SubDDisplayParameters& display_parameters,
    2022  class ON_Mesh* mesh
    2023  ) const;
    2024 
    2025 
    2026  /*
    2027  Description:
    2028  Get a mesh of the subdivision control net.
    2029  Parameters:
    2030  level_index - [in] (>=0)
    2031  mesh - [in]
    2032  If not null, the returned mesh will be stored on
    2033  the input class.
    2034  Returns:
    2035  The subdivision level as a mesh.
    2036  */
    2037  class ON_Mesh* GetControlNetMesh(
    2038  class ON_Mesh* mesh
    2039  ) const;
    2040 
    2041 
    2042  /*
    2043  Description:
    2044  Get the limit surface mesh as a set of fragments.
    2045  Parameters:
    2046  display_parameters - [in]
    2047 
    2048  fragment_callback_context - [in]
    2049  first parameter for the FragmentCallback function
    2050 
    2051  fragment_callback_function - [in]
    2052  A function pointer with prototype:
    2053 
    2054  bool fragment_callback_function(
    2055  void *fragment_callback_context,
    2056  const class ON_SubDLimitMeshFragment* fragment
    2057  );
    2058 
    2059  For each fragment that is produced, fragment_callback_function() is called.
    2060  You must copy the retuned fragment if you want to keep it for future use.
    2061  If fragment_callback_function returns false, the calculation is canceled.
    2062  Returns:
    2063  Number of fragments produced.
    2064  */
    2065  unsigned int GetLimitSurfaceMeshInFragments(
    2066  const class ON_SubDDisplayParameters& display_parameters,
    2067  ON__UINT_PTR fragment_callback_context,
    2068  bool(*fragment_callback_function)(ON__UINT_PTR , const class ON_SubDLimitMeshFragment*)
    2069  ) const;
    2070 
    2071  /*
    2072  Returns:
    2073  The number of limit surface mesh fragments (ON_SubDLimitMeshFragment) that
    2074  GetLimitSurfaceMeshFragments() will produce.
    2075  */
    2076  unsigned int LimitSurfaceMeshFragmentCount() const;
    2077 
    2078 
    2079  /*
    2080  Description:
    2081  Get the limit surface as a set of bicubic patch fragments.
    2082  Parameters:
    2083  display_parameters - [in]
    2084 
    2085  fragment_callback_context - [in]
    2086  first parameter for the FragmentCallback function
    2087 
    2088  fragment_callback_function - [in]
    2089  A function pointer with prototype:
    2090 
    2091  bool fragment_callback_function(
    2092  void *fragment_callback_context,
    2093  const class ON_SubDLimitPatchFragment* fragment
    2094  );
    2095 
    2096  For each fragment that is produced, fragment_callback_function() is called.
    2097  You must copy the retuned fragment if you want to keep it for future use.
    2098  If fragment_callback_function returns false, the calculation is canceled.
    2099  Returns:
    2100  Number of fragments produced.
    2101  */
    2102  unsigned int GetLimitSurfaceInPatches(
    2103  const class ON_SubDDisplayParameters& display_parameters,
    2104  ON__UINT_PTR fragment_callback_context,
    2105  bool(*fragment_callback_function)(ON__UINT_PTR , const class ON_SubDLimitPatchFragment*)
    2106  ) const;
    2107 
    2108  /*
    2109  Description:
    2110  Get the SubD limit surface as a list of bicubic NURBS patches.
    2111  Parameters:
    2112  display_parameters - [in]
    2113  bClampPatchKnots - [in]
    2114  true to clamp knots
    2115  sUserStringPatchKey - [in]
    2116  If non empty, a user string with this key will be added that
    2117  contains a description of which portion of which SubD face generated
    2118  the patch.
    2119  patches - [out]
    2120  The bicubic NURBS patches are appended to this array.
    2121  Returns:
    2122  Number of patches appended to patches[]
    2123  */
    2124  unsigned int GetLimitSurfacePatches(
    2125  const class ON_SubDDisplayParameters& display_parameters,
    2126  bool bClampPatchKnots,
    2127  const wchar_t* sUserStringPatchKey,
    2129  ) const;
    2130 
    2131 public:
    2132  /*
    2133  Description:
    2134  Pretend this function and ON_SubDimple do not exist.
    2135  Returns:
    2136  Something that you are pretending does not exist.
    2137  Remarks:
    2138  It is intentional that the definition of ON_SubDimple class is not
    2139  available in the opennurbs library interface (not in a header file).
    2140  The size and design of ON_SubDimple will change constantly.
    2141  If you choose to hack and whack so you can dereference an
    2142  ON_SubDimple* pointer, then your code will crash unpredictably.
    2143  */
    2144  const class ON_SubDimple* SubDimple() const;
    2145  const class ON_SubDLevel& ActiveLevel() const;
    2146  unsigned int SubDimpleUseCount() const;
    2147 
    2148  void ShareDimple(const ON_SubD&);
    2149  void SwapDimple(ON_SubD&);
    2150 
    2151  void ShareDimple(const class ON_SubDLimitMeshImpl&);
    2152  void SwapDimple(class ON_SubDLimitMeshImpl& );
    2153 
    2154 private:
    2155  class ON_SubDimple* SubDimple(bool bCreateIfNeeded);
    2156  class ON_SubDLevel const * ActiveLevelConstPointer() const;
    2157  class ON_SubDLevel* ActiveLevelPointer();
    2158 
    2159  void CopyHelper(const ON_SubD&);
    2160 
    2161 private:
    2162  friend class ON_SubDRef;
    2163 #pragma ON_PRAGMA_WARNING_PUSH
    2164 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    2165  // C4251: ... needs to have dll-interface to be used by clients of class ...
    2166  // m_subdimple_sp is private and all code that manages m_subdimple_sp is explicitly implemented in the DLL.
    2167 private:
    2168  std::shared_ptr<class ON_SubDimple> m_subdimple_sp;
    2169 #pragma ON_PRAGMA_WARNING_POP
    2170 
    2171 public:
    2172  // The ON_SubD code increments ON_SubD::ErrorCount everytime something
    2173  // unexpected happens. This is useful for debugging.
    2174  static unsigned int ErrorCount;
    2175 };
    2176 
    2177 
    2178 //////////////////////////////////////////////////////////////////////////
    2179 //
    2180 // ON_SubDRef
    2181 //
    2182 class ON_SUBD_CLASS ON_SubDRef
    2183 {
    2184 #if defined(ON_SUBD_CENSUS)
    2185 private:
    2186  ON_SubDRefCensusCounter m_census_counter;
    2187 #endif
    2188 
    2189 public:
    2190  static const ON_SubDRef Empty;
    2191 
    2192  ON_SubDRef() ON_NOEXCEPT;
    2193  ~ON_SubDRef();
    2194  ON_SubDRef(const ON_SubDRef& src) ON_NOEXCEPT;
    2195  ON_SubDRef& operator=(const ON_SubDRef& src);
    2196 
    2197 #if defined(ON_HAS_RVALUEREF)
    2198  // rvalue copy constructor
    2199  ON_SubDRef( ON_SubDRef&& ) ON_NOEXCEPT;
    2200  // rvalue assignment operator
    2201  ON_SubDRef& operator=( ON_SubDRef&& );
    2202 #endif
    2203 
    2204  const class ON_SubD& SubD() const;
    2205 
    2206  /*
    2207  Returns:
    2208  Number of references to the ON_SubD, including the one by this ON_SubDRef.
    2209  */
    2210  unsigned int ReferenceCount() const;
    2211 
    2212  /*
    2213  Description:
    2214  Allocates a new ON_SubD and has this ON_SubDRef reference it.
    2215  */
    2216  class ON_SubD& NewSubD();
    2217 
    2218 
    2219  /*
    2220  Description:
    2221  Allocates a new ON_SubD and has this ON_SubDRef reference it.
    2222  */
    2223  class ON_SubD& CopySubD(
    2224  const ON_SubDRef& src
    2225  );
    2226  class ON_SubD& CopySubD(
    2227  const ON_SubD& src
    2228  );
    2229 
    2230  class ON_SubD& UniqueSubD();
    2231 
    2232  /*
    2233  Description:
    2234  Remove this reference to the managed ON_SubD.
    2235  If this is the last reference, then the managed ON_SubD is deleted.
    2236  */
    2237  void Clear();
    2238 
    2239 public:
    2240  class ON_SubDVertexIterator VertexIterator() const;
    2241  class ON_SubDEdgeIterator EdgeIterator() const;
    2242  class ON_SubDFaceIterator FaceIterator() const;
    2243 
    2244  /*
    2245  Description:
    2246  Expert user function to have this ON_SubDRef manage the lifetime of subd.
    2247  Parameters:
    2248  subd - [in/out]
    2249  subd must point to an ON_SubD that was constructed on the heap using
    2250  an operator new call with a public ON_SubD constructor.
    2251  Returns:
    2252  a pointer to the managed subd or nullptr subd in not valid.
    2253  Example:
    2254  ON_SubD* subd = new ON_SubD(...);
    2255  ON_SubDRef subr;
    2256  ON_SubD* managed_subd = subdr.SetSubD(subd);
    2257  // subd = nullptr
    2258  // managed_subd = pointer you can use
    2259  */
    2260  class ON_SubD* SetSubDForExperts(
    2261  class ON_SubD*& subd
    2262  );
    2263 
    2264  /*
    2265  Description:
    2266  Expert user function to have this ON_SubDRef reference the
    2267  contents of an existing ON_SubD.
    2268  Do not use if user data on the referenced subd needs to be accessed.
    2269  Parameters:
    2270  subd - [in]
    2271  Any subd on the heap or the stack.
    2272  Returns:
    2273  true if successful.
    2274  */
    2275  static ON_SubDRef CreateReferenceForExperts(
    2276  const ON_SubD& subd
    2277  );
    2278 
    2279 private:
    2280  /*
    2281  Description:
    2282  Expert user function to have this ON_SubDRef reference the
    2283  contents of an existing ON_SubD.
    2284  Do not use if user data on the referenced subd needs to be accessed.
    2285  Parameters:
    2286  subd - [in]
    2287  Any subd on the heap or the stack.
    2288  */
    2289  ON_SubDRef(
    2290  const class ON_SubD& subd
    2291  );
    2292 
    2293 private:
    2294 #pragma ON_PRAGMA_WARNING_PUSH
    2295 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    2296  // C4251: ... needs to have dll-interface to be used by clients of class ...
    2297  // m_subd_sp is private and all code that manages m_subd_sp is explicitly implemented in the DLL.
    2298 private:
    2299  std::shared_ptr<class ON_SubD> m_subd_sp;
    2300 #pragma ON_PRAGMA_WARNING_POP
    2301 };
    2302 
    2303 
    2304 //////////////////////////////////////////////////////////////////////////
    2305 //
    2306 // ON_SubDSectorType
    2307 //
    2308 class ON_SUBD_CLASS ON_SubDSectorType
    2309 {
    2310 public:
    2311  ON_SubDSectorType() = default;
    2312  ON_SubDSectorType(const ON_SubDSectorType&) = default;
    2313  ON_SubDSectorType& operator=(const ON_SubDSectorType&) = default;
    2314 
    2315  static const ON_SubDSectorType Empty;
    2316 
    2317  bool IsValid() const;
    2318 
    2319  unsigned int SectorTypeHash() const;
    2320 
    2321  static int Compare(const ON_SubDSectorType*, const ON_SubDSectorType*);
    2322 
    2323 
    2324  /////////////////////////////////////////////////////////////////////////////////////
    2325  //
    2326  // Sector Weights
    2327  //
    2328  /////////////////////////////////////////////////////////////////////////////////////
    2329  //
    2330  // In the comment below,
    2331  // F = number of faces in the sector,
    2332  // E = number of edges in the sector.
    2333  //
    2334  // There are five valid sector configurations of edges and faces. In all
    2335  // configurations, the edges have one end at the center vertex and the
    2336  // faces have one corner at the center vertex.
    2337  //
    2338  // SMOOTH
    2339  // 1) The center vertex is smooth.
    2340  // 2) F >= 2
    2341  // 3) E = F
    2342  // 4) Every edge is smooth.
    2343  // 5) Every edge is an edge of two different faces in the sector.
    2344  //
    2345  // DART
    2346  // 1) The center vertex is a dart.
    2347  // 2) F >= 2
    2348  // 3) E = F
    2349  // 4) One edge is a crease.
    2350  // 5) The crease edge is an edge of two geometrically adjacent sector faces.
    2351  //
    2352  // DART* (The same as "DART", but the crease edge has been duplicated.)
    2353  // 1) The center vertex is a dart.
    2354  // 2) F >= 2
    2355  // 3) E = F+1
    2356  // 4) Two edges are creases that have the same end locations.
    2357  // 5) Each crease edge is an edge of a single face in the sector,
    2358  // these faces are different and are geometrically adjacent.
    2359  //
    2360  // BOUNDED
    2361  // 1) The center vertex is a crease or corner vertex.
    2362  // 2) F >= 2
    2363  // 3) E = F+1
    2364  // 4) Two edges are crease edges that have different vertices at their ends.
    2365  // 5) Each crease edge is an edge of a single face in the sector,
    2366  // these faces are different and not geometrically adjacent.
    2367  //
    2368  // BOUNDED*
    2369  // 1) The center vertex is a crease or corner vertex.
    2370  // 2) F = 1
    2371  // 3) E = 2
    2372  // 4) The edges are crease edges that have different vertices at their ends.
    2373  // 5) The edges a edges of the face.
    2374  //
    2375  /////////////////////////////////////////////////////////////////////////////////////
    2376  //
    2377  // The sector weight is used when subdividing smooth edges in sectors
    2378  // with a DART, DART* or BOUNDED configuration. In these cases the
    2379  // sector weight is a value strictly between 0.0 and 1.0 that depends on
    2380  // 1) the center vertex tag (crease, corner or dart),
    2381  // 2) the value of F,
    2382  // 3) and when the center vertex is a corner, the angle between
    2383  // the boundary edges.
    2384  //
    2385  // The sector weight is ignored when dividing smooth edges in SMOOTH sectors.
    2386  // The sector weight is ignored when subdividing crease edges.
    2387  //
    2388  // For a smooth edge in a sector with a DART, DART* or BOUNDED configuration,
    2389  // with w = sector weight, C = location of the center vertex
    2390  // and P = location of the smooth vertex at the other end
    2391  // of the smooth edge, the point
    2392  //
    2393  // Q = 3/4 * (w*C + (1-w)*P)
    2394  //
    2395  // is the contribution of C and P to the edge's subdivision point.
    2396  //
    2397  // When a smooth edge has smooth vertices at both ends located
    2398  // at A and B, the contribution of A and B to the edge's subdivision
    2399  // point is
    2400  //
    2401  // Q = 3/8 * (A + B) = 3/4 * (1/2*A + 1/2*B)
    2402  //
    2403  // A crease edge's subdivision point is alwasy the edge's midpoint.
    2404  /*
    2405  Description:
    2406  Calculates sector weight value for the sector type
    2407  identified by this ON_SubDSectorType.
    2408  Returns:
    2409  w: 0.0 <= w < 1.0
    2410  w = sector theta value.
    2411  ON_SubDSectorType::ErrorSectorWeight
    2412  This ON_SubDSectorType is not valid and the calculation failed.
    2413  */
    2414  double SectorWeight() const;
    2415 
    2416 
    2417  ON_SubD::SubDType SubDType() const;
    2418 
    2419  ON_SubD::FacetType FacetType() const;
    2420 
    2421  unsigned int FacetEdgeCount() const;
    2422 
    2423  ON_SubD::VertexTag VertexTag() const;
    2424 
    2425 
    2426  unsigned int EdgeCount() const;
    2427 
    2428  unsigned int FaceCount() const;
    2429 
    2430  /*
    2431  Returns:
    2432  Number of points in the point ring.
    2433  For quad subds, this is 1 + FaceCount() + EdgeCount().
    2434  For tri subds, this is 1 + EdgeCount().
    2435  */
    2436  unsigned int PointRingCount() const;
    2437 
    2438  /*
    2439  Returns:
    2440  1 + FaceCount() + EdgeCount()
    2441  */
    2442  unsigned int ComponentRingCount() const;
    2443 
    2444  /*
    2445  Returns:
    2446  If the sector vertex tag is ON_SubD::VertexTag::Corner,
    2447  the angle between the corner crease boundary edges is
    2448  returned.
    2449  Otherwise, ON_SubDSectorType::ErrorCornerSectorAngle is returned.
    2450  */
    2451  double CornerSectorAngleRadians() const;
    2452 
    2453  /*
    2454  Returns:
    2455  a value >= 0 and <= ON_SubDSectorType::MaximumAngleIndex
    2456  */
    2457  unsigned int CornerSectorAngleIndex() const;
    2458 
    2459  /*
    2460  Description:
    2461  An angle index value of ON_SubDSectorType::MaximumAngleIndex indicates
    2462  the angle is 2pi radians.
    2463  */
    2464  static const unsigned int MaximumAngleIndex; // = 72
    2465 
    2466  /*
    2467  Parameters:
    2468  angle_radians - [in] (0.0 <= angle_radians <= 2*ON_PI
    2469  The angle between the bounding crease edges
    2470  Returns:
    2471  angle_index: >= 0 and <= ON_SubDSectorType::MaximumCornerSectorIndex
    2472  | angle_radians - angle_index/M * 2pi | <= 1/2 * 1/M * 2pi,
    2473  where M = ON_SubDSectorType::MaximumAngleIndex
    2474  ON_UNSET_UINT_INDEX
    2475  angle_radians is not valid and the calculation failed.
    2476  */
    2477  static unsigned int AngleIndexFromAngleRadians(
    2478  double angle_radians
    2479  );
    2480 
    2481  /*
    2482  Convert and angle index into radians
    2483  Parameters:
    2484  angle_index - [in]
    2485  0 to ON_SubDSectorType::MaximumAngleIndex.
    2486  Returns:
    2487  If angle_index is valid, the corresponding angle in radians is returned.
    2488  = angle_index / ON_SubDSectorType::MaximumAngleIndex * 2 * ON_PI
    2489  (double division performed)
    2490  Otherwise ON_UNSET_VALUE is returned.
    2491  */
    2492  static double AngleRadiansFromAngleIndex(
    2493  unsigned int angle_index
    2494  );
    2495 
    2496  /*
    2497  Returns:
    2498  True if this is a smooth interior vertex sector
    2499  */
    2500  bool IsSmoothSector() const;
    2501 
    2502 
    2503  /*
    2504  Returns:
    2505  True if this is a dart interior vertex sector
    2506  */
    2507  bool IsDartSector() const;
    2508 
    2509 
    2510  /*
    2511  Returns:
    2512  True if this is a crease vertex sector
    2513  */
    2514  bool IsCreaseSector() const;
    2515 
    2516  /*
    2517  Returns:
    2518  True if this is a corner vertex sector
    2519  */
    2520  bool IsCornerSector() const;
    2521 
    2522  /*
    2523  Returns:
    2524  True if this is a convex corner vertex sector (sector angle <= pi)
    2525  */
    2526  bool IsConvexCornerSector() const;
    2527 
    2528  /*
    2529  Returns:
    2530  True if this is a concave corner vertex sector (sector angle > pi)
    2531  */
    2532  bool IsConcaveCornerSector() const;
    2533 
    2534  /*
    2535  Parameters:
    2536  sector_boundary_edge0_ptr - [in]
    2537  sector_boundary_edge1_ptr - [in]
    2538  Crease edges that bound the sector containing the smooth edge.
    2539  The edge direction must identify the corner vertex.
    2540  Returns:
    2541  tagged end angle for a smooth edge that
    2542  1) ends at a vertex tagged on ON_SubD::VertexTag::Corner
    2543  2) has two adjacent faces.
    2544  3) lies in a sector bounded by 2 distinct crease edges.
    2545  */
    2546  static double CornerSectorAngleRadiansFromEdges(
    2547  ON_SubDEdgePtr sector_boundary_edge0_ptr,
    2548  ON_SubDEdgePtr sector_boundary_edge1_ptr
    2549  );
    2550 
    2551  static bool IsValidCornerSectorAngleRadians(
    2552  double corner_sector_angle_radians
    2553  );
    2554 
    2555  static double ClampCornerSectorAngleRadians(
    2556  double corner_sector_angle_radians
    2557  );
    2558 
    2559  /*
    2560  Returns:
    2561  Number of subdivision points in a sector ring
    2562  facet_type vertex_tag ring count
    2563  tri smooth N+1
    2564  tri crease N+2
    2565  quad smooth 2N+1
    2566  quad crease 2N+2
    2567  (2 * valence + 1) for quad subds
    2568  (valence + 1) for tri subds
    2569  */
    2570  static unsigned int SectorPointRingCountFromEdgeCount(
    2571  ON_SubD::SubDType subd_type,
    2572  ON_SubD::VertexTag vertex_tag,
    2573  unsigned int sector_edge_count
    2574  );
    2575 
    2576  static unsigned int SectorPointRingCountFromFaceCount(
    2577  ON_SubD::SubDType subd_type,
    2578  ON_SubD::VertexTag vertex_tag,
    2579  unsigned int sector_face_count
    2580  );
    2581 
    2582  static unsigned int SectorFaceCountFromEdgeCount(
    2583  ON_SubD::VertexTag vertex_tag,
    2584  unsigned int sector_edge_count
    2585  );
    2586 
    2587  static unsigned int SectorEdgeCountFromFaceCount(
    2588  ON_SubD::VertexTag vertex_tag,
    2589  unsigned int sector_face_count
    2590  );
    2591 
    2592  static unsigned int MinimumSectorEdgeCount(
    2593  ON_SubD::VertexTag vertex_tag
    2594  );
    2595 
    2596  static unsigned int MinimumSectorFaceCount(
    2597  ON_SubD::VertexTag vertex_tag
    2598  );
    2599 
    2600 public:
    2601  /*
    2602  Returns:
    2603  ON_SubDSectorType::IgnoredSectorWeight
    2604  */
    2605  static double SmoothSectorWeight();
    2606 
    2607  /*
    2608  Parameters:
    2609  face_type - [in]
    2610  sector_face_count - [in]
    2611  number of faces in the smooth sector.
    2612  Returns:
    2613  0:
    2614  failed to caclulate weight
    2615  ON_SubDSectorType::UnsetSectorWeight:
    2616  subd_type was set ON_SubD::SubDType::Unset
    2617  and was required to calculate the weight.
    2618  This typically happens when a SubD control net is being
    2619  created and a facet type is not specified.
    2620  The weights will be calculated at the first subdivision.
    2621  0 < w < 1:
    2622  1/2 + 1/3*cos(tagged end angle) for quadrangle facets
    2623  1/3 + 1/3*cos(tagged end angle) for triangle facets
    2624  Remarks:
    2625  This is a useful tool when calling AddEdge while a subdivision
    2626  level is being constructed.
    2627  */
    2628  static double CreaseSectorWeight(
    2629  ON_SubD::SubDType subd_type,
    2630  unsigned int sector_face_count
    2631  );
    2632 
    2633  static double DartSectorWeight(
    2634  ON_SubD::SubDType subd_type,
    2635  unsigned int sector_face_count
    2636  );
    2637 
    2638  static double CornerSectorWeight(
    2639  ON_SubD::SubDType subd_type,
    2640  unsigned int sector_face_count,
    2641  double corner_sector_angle_radians
    2642  );
    2643 
    2644  // This value is is used to set sector angles when the
    2645  // actual value is not needed. This occurs at both ends
    2646  // of a creased edge and when the end of a smooth edge
    2647  // is a smooth vertex.
    2648  static const double IgnoredCornerSectorAngle; // = 0.0;
    2649 
    2650  // This value is used to set sector weights that could not be
    2651  // correctly set because something in the calculation failed.
    2652  // It is typically used when an invalid component in SubD object
    2653  // was needed to calculate the weight.
    2654  static const double UnsetCornerSectorAngle; // = -8881.0;
    2655 
    2656  // This value is indicate a corner sector angle calculation failed.
    2657  static const double ErrorCornerSectorAngle; // = -9991.0;
    2658 
    2659 
    2660  // This value is used for smooth sector thetas
    2661  static const double SmoothSectorTheta; // = 0.5*ON_PI
    2662 
    2663  // This value is used to indicate a sector theta needs to be set
    2664  static const double UnsetSectorTheta; // = -8882.0;
    2665 
    2666  // This value is used to indicate a sector theta calculation failed.
    2667  static const double ErrorSectorTheta; // = -9992.0;
    2668 
    2669 
    2670  // This value is is used to set sector weights when the
    2671  // actual value is not needed. This occurs at both ends
    2672  // of a creased edge and when the end of a smooth edge
    2673  // is a smooth vertex.
    2674  static const double IgnoredSectorWeight; // = 0.0;
    2675 
    2676  // This value is used to mark sector weights that need to be
    2677  // set in the future when more information is available.
    2678  // It is typically used when creating a subD control net
    2679  // and the facet type is not known. Any value < 0.0 and not
    2680  // equal to ON_UNSET_VALUE would work. The fact that the actual
    2681  // value is -999.0 has no other significance.
    2682  static const double UnsetSectorWeight; // = -8883.0;
    2683 
    2684  // This value is indicate a sector weight calculation failed.
    2685  static const double ErrorSectorWeight; // = -9993.0;
    2686 
    2687  static bool IsValidSectorWeightValue(
    2688  double weight_value,
    2689  bool bAllowUnsetTaggedEndWeight
    2690  );
    2691 
    2692  /*
    2693  Returns:
    2694  ON_SubDSectorType::ErrorSectorWeight and calls debug breakpoint
    2695  */
    2696  static double SectorWeightCalculationError();
    2697 
    2698 
    2699  /*
    2700  Description:
    2701  Create a ON_SubDSectorType from a ON_SubDSectorIterator.
    2702  Parameters:
    2703  subd_type - [in]
    2704  vertex_tag - [in]
    2705  sector_face_count - [in]
    2706  Number of faces in the sector.
    2707  corner_sector_angle_radians - [in]
    2708  If vertex_tag is ON_SubD::VertexTag::Corner, this
    2709  parameter is the angle between the crease edges
    2710  that bound the corner.
    2711  If vertex_tag is not ON_SubD::VertexTag::Corner,
    2712  this parameter is ignored.
    2713  Returns:
    2714  An ON_SubDSectorType for the case the input parameters
    2715  identify.
    2716  */
    2717  static ON_SubDSectorType Create(
    2718  ON_SubD::SubDType subd_type,
    2719  ON_SubD::VertexTag vertex_tag,
    2720  unsigned int sector_face_count,
    2721  double corner_sector_angle_radians
    2722  );
    2723 
    2724 
    2725  /*
    2726  Description:
    2727  Create a ON_SubDSectorType from a ON_SubDSectorIterator.
    2728  Parameters:
    2729  subd_type - [in]
    2730  sit - [in]
    2731  Returns:
    2732  An ON_SubDSectorType for the sector identified by sit.
    2733  */
    2734  static ON_SubDSectorType Create(
    2735  ON_SubD::SubDType subd_type,
    2736  const ON_SubDSectorIterator& sit
    2737  );
    2738 
    2739  /*
    2740  Description:
    2741  Create a ON_SubDSectorType for the sector containing the face.
    2742  Parameters:
    2743  subd_type - [in]
    2744  face - [in]
    2745  face_vertex_index - [in]
    2746  face->Vertex(face_vertex_index) will be the sector's
    2747  center vertex.
    2748  Returns:
    2749  An ON_SubDSectorType for the sector containing the face.
    2750  */
    2751  static ON_SubDSectorType Create(
    2752  ON_SubD::SubDType subd_type,
    2753  const class ON_SubDFace* face,
    2754  unsigned int face_vertex_index
    2755  );
    2756 
    2757  static ON_SubDSectorType Create(
    2758  ON_SubD::SubDType subd_type,
    2759  const class ON_SubDFace* face,
    2760  const class ON_SubDVertex* vertex
    2761  );
    2762 
    2763  /*
    2764  Description:
    2765  Create a ON_SubDSectorType for the sector containing the edge.
    2766  Parameters:
    2767  subd_type - [in]
    2768  edge - [in]
    2769  edge_vertex_index - [in]
    2770  edge->Vertex(edge_vertex_index) will be the sector's
    2771  center vertex.
    2772  Returns:
    2773  An ON_SubDSectorType for the sector containing the edge.
    2774  */
    2775  static ON_SubDSectorType Create(
    2776  ON_SubD::SubDType subd_type,
    2777  const class ON_SubDEdge* edge,
    2778  unsigned int edge_vertex_index
    2779  );
    2780 
    2781  /*
    2782  Description:
    2783  Create a smooth ON_SubDSectorType.
    2784  Parameters:
    2785  subd_type - [in]
    2786  sector_face_count - [in]
    2787  Number of faces in the sector.
    2788  Returns:
    2789  An ON_SubDSectorType for the smooth sector case specified
    2790  by the input parameters.
    2791  */
    2792  static ON_SubDSectorType CreateSmoothSectorType(
    2793  ON_SubD::SubDType subd_type,
    2794  unsigned int sector_face_count
    2795  );
    2796 
    2797  /*
    2798  Description:
    2799  Create a crease ON_SubDSectorType.
    2800  Parameters:
    2801  subd_type - [in]
    2802  sector_face_count - [in]
    2803  Number of faces in the sector.
    2804  Returns:
    2805  An ON_SubDSectorType for the crease sector case specified
    2806  by the input parameters.
    2807  */
    2808  static ON_SubDSectorType CreateCreaseSectorType(
    2809  ON_SubD::SubDType subd_type,
    2810  unsigned int sector_face_count
    2811  );
    2812 
    2813  /*
    2814  Description:
    2815  Create a dart ON_SubDSectorType.
    2816  Parameters:
    2817  subd_type - [in]
    2818  sector_face_count - [in]
    2819  Number of faces in the sector.
    2820  Returns:
    2821  An ON_SubDSectorType for the dart sector case specified
    2822  by the input parameters.
    2823  */
    2824  static ON_SubDSectorType CreateDartSectorType(
    2825  ON_SubD::SubDType subd_type,
    2826  unsigned int sector_face_count
    2827  );
    2828 
    2829  /*
    2830  Description:
    2831  Create a corner ON_SubDSectorType.
    2832  Parameters:
    2833  subd_type - [in]
    2834  sector_face_count - [in]
    2835  Number of faces in the sector.
    2836  corner_sector_angle_radians - [in]
    2837  The angle between the crease edges that bound the corner.
    2838  Returns:
    2839  An ON_SubDSectorType for the corner sector case specified
    2840  by the input parameters.
    2841  */
    2842  static ON_SubDSectorType CreateCornerSectorType(
    2843  ON_SubD::SubDType subd_type,
    2844  unsigned int sector_face_count,
    2845  double sector_corner_angle_radians
    2846  );
    2847 
    2848  static int Compare(
    2849  const ON_SubDSectorType& a,
    2850  const ON_SubDSectorType& b
    2851  );
    2852 
    2853 
    2854  /*
    2855  Description:
    2856  Get the subdivision matrix for the default subdivison algorithms
    2857  used by ON_SubD.
    2858 
    2859  The matrix coefficents are ordered so that the matrix acts on
    2860  the left of the points returned by ON_SubDSectorIterator::GetVertexRing().
    2861 
    2862  For an interior vertex (smooth or dart), the coefficents are ordered
    2863  so that one iteration of subdivision is given by:
    2864  ON_SubD::SubDType::TriLoopWarren case:
    2865  S*Transpose(V, E[0], E[1], ..., E[N-1])
    2866  ON_SubD::SubDType::QuadCatmullClark case:
    2867  S*Transpose(V, E[0], F[0], E[1], F[1], ..., E[N-1], F[N-1]).
    2868  For a dart vertex, E[0] is the point at the end of the creased edge.
    2869 
    2870 
    2871  For a boundary vertex (crease or corner), the coefficents are ordered
    2872  so that one iteration of subdivision is given by:
    2873  ON_SubD::SubDType::TriLoopWarren case:
    2874  S*Transpose(V, E[0], E[1], ..., E[N-1]).
    2875  ON_SubD::SubDType::QuadCatmullClark case:
    2876  S*Transpose(V, E[0], F[0], E[1], F[1], ..., F[N-2], E[N-1]).
    2877 
    2878  N = edge valence = number of edges in the sector.
    2879  E[i] = end of i-th edge radiating from V.
    2880  In the ON_SubD::SubDType::QuadCatmullClark case, F[i] = point on the quad
    2881  that is opposite V.
    2882  The edges and faces are ordered radially so that the face for F[i]
    2883  lies between the edges for E[i] and E[(i+1)%N].
    2884 
    2885  Parameters:
    2886  matrix_capacity - [in]
    2887  S[] can store any RxR matrix with R <= matrix_capacity.
    2888  S - [out]
    2889  subdivision matrix
    2890  Matrix coefficent (i,j) = S[i][j]
    2891  0 <= i < R, 0 <= j < R, R = ON_SubDSectorType.PointRingCount()
    2892 
    2893  Returns:
    2894  R > 0:
    2895  R = PointRingCount() and S is the RxR subdivision matrix for the sector type.
    2896  0: Invalid input
    2897  */
    2898  unsigned int GetSubdivisionMatrix(
    2899  size_t matrix_capacity,
    2900  double** S
    2901  ) const;
    2902 
    2903  /*
    2904  Parameters:
    2905  S_capacity - [in]
    2906  Number of elements in S[] array
    2907  S - [out]
    2908  subdivision matrix.
    2909  Matrix coefficent (i,j) = S[i*R + j],
    2910  0 <= i < R, 0 <= j < R, R = ON_SubDSectorType.PointRingCount()
    2911  Returns:
    2912  0: Invalid input.
    2913  >0: Number of rows and columns in S.
    2914  This number is always ON_SubDSectorType.PointRingCount().
    2915  */
    2916  unsigned int GetSubdivisionMatrix(
    2917  size_t S_capacity,
    2918  double* S
    2919  ) const;
    2920 
    2921  /*
    2922  Description:
    2923  All the subdivision matrices for the ON_SubD built-in
    2924  subdivision algorithms have eigenvalues (1, lambda1, lambda2, e4, ..., eR),
    2925  where 1 > lambda1 >= lambda2 > |e4| >= ... >= |eR| > 0.
    2926 
    2927  The subdominant eigenvalue is lambda1 and,
    2928  with one exception, lambda1 = lambda2.
    2929  The exception is described in the description of
    2930  ON_SubDSectorType::SubdominantEigenvalueMulitiplicity().
    2931 
    2932  Returns:
    2933  > 0.0:
    2934  The subdominant eigenvalue for the subdivision matrix.
    2935 
    2936  ON_UNSET_VALUE:
    2937  This ON_SubDSectorType is not valid.
    2938  */
    2939  double SubdominantEigenvalue() const;
    2940 
    2941  /*
    2942  Returns:
    2943  0:
    2944  The sector type is not set.
    2945 
    2946  2:
    2947  The subdominant eigenvalue has algebraic and geometric multiplicty = 2.
    2948  This is the most common case.
    2949 
    2950  1:
    2951  The subdominant eigenvalue has algebraic and geometric multiplicty = 1.
    2952  This occures in Catmull-Clark subdivision at a crease vertex with
    2953  two crease edges and a single face. The subdivision matrix for this
    2954  case is
    2955  S is a 4 x 4 matrix with rows =
    2956  (3/4, 1/8, 0, 1/8),
    2957  (1/2, 1/2, 0, 0),
    2958  (1/4, 1/4, 1/4, 1/4),
    2959  (1/2, 0, 0, 1/2).
    2960  S has 4 real eigenvalues = (1, 1/2, 1/4, 1/4), all wtih
    2961  geometric multiplicity = 1.
    2962  The three eigenvectors are
    2963  (1, 1, 1, 1), (0, -1, 0, 1), (0, 0, 1, 0).
    2964  */
    2965  unsigned int SubdominantEigenvalueMulitiplicity() const;
    2966 
    2967  /*
    2968  Description:
    2969  With one exception, which is described below,
    2970  all the subdivision matrices for the ON_SubD built-in
    2971  subdivision algorithms have eigenvalues (1, lambda, lambda, e4, ..., eR),
    2972  where lambda is real, 1 > lambda > |e4| >= ... >= |eR| > 0, and the
    2973  geometric dimension of the lambda eigenspace is 2 (there are two
    2974  linearly independent lambda eigenvectors).
    2975 
    2976  The subdominant eigenvalue is lamda. This function returns an
    2977  orthogonal basis, (E1, E2), for the subdominant eigenspace.
    2978 
    2979  An eigenvector for the dominant eigen value 1 has is (1,1,...,1).
    2980  The domainant eignevector is orthogonal to the subdominant eigenspace.
    2981 
    2982  Put another way,
    2983  0 = E1[0] + ... + E1[R-1]
    2984  0 = E2[0] + ... + E2[R-1]
    2985  0 = E1[0]*E2[0] + ... + E1[R-1]*E2[R-1]
    2986 
    2987  Exceptional case:
    2988  The Catmull-Clark subdivision matrix for a crease vertex with
    2989  two crease edges and a single face is a special case.
    2990  In this exceptional, this function returns
    2991  lambda = 1/2, E1 = {0,-1,0,-1} and E2 = {1, -2, -5, -2}.
    2992  For more information about the exceptional case, see the description of
    2993  ON_SubDSectorType::SubdominantEigenvalueMulitiplicity().
    2994 
    2995  Parameters:
    2996  E1_capacity - [in]
    2997  Capacity of the E1[] array.
    2998  E1 - [out]
    2999  E2_capacity - [in]
    3000  Capacity of the E2[] array.
    3001  E2 - [out]
    3002  When E1_capacity > 0 and E2_capacity > 0, two orthoganal eigenvectors
    3003  spanning the subdivision matrix subdominant eigenspace are returned
    3004  in E1[] and E2[].
    3005  If one of E1_capacity or E2_capacity is > 0, then both must be > 0.
    3006 
    3007  Returns:
    3008  ON_UNSET_VALUE: Invalid input.
    3009  e > 0.0 and e < 1.0:
    3010  subdominant eigenvalue.
    3011  */
    3012  double GetSubdominantEigenvectors(
    3013  size_t E1_capacity,
    3014  double* E1,
    3015  size_t E2_capacity,
    3016  double* E2
    3017  ) const;
    3018 
    3019  /*
    3020  Parameters:
    3021  LPev_capacity - [in]
    3022  Capacity of the LPev[] array.
    3023  LPev - [out]
    3024  When LPev_capacity > 0, then the limit surface point evaluation coefficients are
    3025  returned in LPev[]. Otherwise LPev is ignored.
    3026  LT0ev_capacity - [in]
    3027  Capacity of the LPev[] array.
    3028  LT0ev - [out]
    3029  LT1ev_capacity - [in]
    3030  Capacity of the LPev[] array.
    3031  LT1ev - [out]
    3032  When LT0ev_capacity > 0 and LT1ev_capacity > 0, then the limit surface
    3033  tangent coefficients are returned in LT0ev[] and LT1ev[]. Otherwise,
    3034  LT0ev[] and LT1ev[] are ignored.
    3035  If one of LT0ev_capacity or LT1ev_capacity is > 0, then both must be > 0.
    3036  Returns:
    3037  0: Invalid input.
    3038  >0: Number of evaluation coefficients in the L*ev[] arrays.
    3039  This number is always ON_SubDSectorType.PointRingCount().
    3040  */
    3041  unsigned int GetLimitSurfaceEvaluationCoefficients(
    3042  size_t LPev_capacity,
    3043  double* LPev,
    3044  size_t LT0ev_capacity,
    3045  double* LT0ev,
    3046  size_t LT1ev_capacity,
    3047  double* LT1ev
    3048  ) const;
    3049 
    3050  // LimitSurfaceNormalSign() is a debugging tool - slow and not useful in general
    3051  double LimitSurfaceNormalSign() const;
    3052 
    3053  bool LimitEvaluationCoefficientsAvailable() const;
    3054 
    3055  /*
    3056  Parameters:
    3057  eigenvalues_capacity - [in]
    3058  Capacity of the eigenvalues[] array.
    3059  Must be 0 or >= PointRingCount()
    3060  eigenvalues - [out]
    3061  If 0 = eigenvalues_capacity, eigenvalues must be nullptr.
    3062  If eigenvalues_capacity > 0, is specifies the capactiy
    3063  of the eigenvalues[] array.
    3064  Returns:
    3065  R > 0:
    3066  A complete set of eigenvalues is available for this sector type.
    3067  The eigenvalues are (1, lambda, lambda, e3, ..., eR), where
    3068  1 > lambda > e3 >= ... >= eR > 0.
    3069  0:
    3070  Invalid input or the eigenvalues for this sector typoe are not available.
    3071  */
    3072  unsigned int GetAllEigenvalues(
    3073  size_t eigenvalues_capacity,
    3074  double* eigenvalues
    3075  );
    3076 
    3077  /*
    3078  Description:
    3079  The subdivision matrix for all cases is known.
    3080  A complete set of eigenvalues are available for some cases.
    3081  Parameters:
    3082  facet_type - [in]
    3083  vertex_tag - [in]
    3084  sector_edge_count - [in]
    3085  The input parameters identify the subdivision case.
    3086  Returns:
    3087  R > 0: Eigenvalues are known. There subdivison matrix is R x R.
    3088  0: Eigenvalues for this case are not known.
    3089  */
    3090  static unsigned int AllEigenvaluesAvailableKnown(
    3091  ON_SubD::SubDType subd_type,
    3092  ON_SubD::VertexTag vertex_tag,
    3093  unsigned int sector_edge_count
    3094  );
    3095 
    3096  /*
    3097  Description:
    3098  Create a partial subdivison sector around vertex.
    3099  The resulting ON_SubD has an outer ring with smooth edges and vertices,
    3100  which is not valid as a stand-alone subd. This is typically used for
    3101  testing.
    3102  Parameters:
    3103  radius - [in]
    3104  The center vertex is located at (0,0,0),
    3105  If radius > 0.0, then the end of the first edge is at (radius,0,0),
    3106  subsequent edges are in a radial array and quad face points, if any,
    3107  are 2*radius from the origin.
    3108  sector_angle_radians - [in]
    3109  If radius > 0,
    3110  this->VertexTag() is ON_SubD::VertexTag::Crease,
    3111  crease_sector_angle_radians > 0.0 and
    3112  crease_sector_angle_radians < 2.0*ON_PI,
    3113  then this will be the angle between the crease boundary edges.
    3114  In all other cases, crease_sector_angle_radians is ignored.
    3115  subd - [in]
    3116  If subd is not null, the vertex ring is put in this
    3117  subd.
    3118  Returns:
    3119  a pointer to the vertex ring
    3120  nullptr is returned if the input is not valid.
    3121  */
    3122  ON_SubD* SectorRingSubD(
    3123  double radius,
    3124  double sector_angle_radians,
    3125  ON_SubD* subd
    3126  ) const;
    3127 
    3128 private:
    3129  ON_SubD::SubDType m_subd_type = ON_SubD::SubDType::Unset;
    3130  ON_SubD::FacetType m_facet_type = ON_SubD::FacetType::Unset;
    3131  ON_SubD::VertexTag m_vertex_tag = ON_SubD::VertexTag::Unset;
    3132  unsigned char m_reserved1 = 0;
    3133  unsigned int m_hash = 0; // SetHash() sets this field, SectorTypeHash() returns its value.
    3134  unsigned int m_corner_sector_angle_index = 0; // >= 0 and <= ON_SubDSectorType::MaximumAngleIndex
    3135  unsigned int m_sector_face_count = 0;
    3136  double m_sector_weight = 0.0;
    3137  double m_sector_theta = 0.0;
    3138  double m_corner_sector_angle_radians = 0.0;
    3139 
    3140 private:
    3141  void SetHash();
    3142 
    3143  /*
    3144  Description:
    3145  Calculates sector theta value for the sector type
    3146  identified by this ON_SubDSectorType.
    3147  Returns:
    3148  theta: 0.0 <= theta <= ON_PI
    3149  The sector theta value.
    3150  ON_SubDSectorType::ErrorSectorTheta
    3151  This ON_SubDSectorType is not valid and the calculation failed.
    3152  */
    3153  double SectorTheta() const;
    3154 
    3155  /*
    3156  Parameters:
    3157  sector_face_count - [in] >= 1
    3158  Number of faces in the crease sector.
    3159  Returns:
    3160  theta: 0.0 < theta <= ON_PI
    3161  sector theta value for a crease sector with sector_face_count faces.
    3162  ON_SubDSectorType::ErrorSectorTheta
    3163  sector_face_count is not valid and the calculation failed.
    3164  */
    3165  static double CreaseSectorTheta(
    3166  unsigned int sector_face_count
    3167  );
    3168 
    3169  /*
    3170  Parameters:
    3171  sector_face_count - [in] >= 2
    3172  Number of faces in the dart sector.
    3173  Returns:
    3174  theta: 0.0 < theta <= ON_PI
    3175  sector theta value for a dart sector with sector_face_count faces.
    3176  ON_SubDSectorType::ErrorSectorTheta
    3177  sector_face_count is not valid and the calculation failed.
    3178  */
    3179  static double DartSectorTheta(
    3180  unsigned int sector_face_count
    3181  );
    3182 
    3183  /*
    3184  Parameters:
    3185  sector_face_count - [in] >= 2
    3186  Number of faces in the dart sector.
    3187  corner_sector_angle_radians - [in] (0.0 <= corner_sector_angle_radians <= 2*ON_PI
    3188  The angle between the bounding crease edges
    3189  Returns:
    3190  theta: 0.0 < theta <= ON_PI/2
    3191  sector theta value for the corner sector.
    3192  ON_SubDSectorType::ErrorSectorTheta
    3193  sector_face_count or corner_sector_angle_radians were not valid
    3194  and the calculation failed.
    3195  */
    3196  static double CornerSectorThetaFromCornerAngle(
    3197  unsigned int sector_face_count,
    3198  double corner_sector_angle_radians
    3199  );
    3200 
    3201  /*
    3202  Parameters:
    3203  subd_type - [in]
    3204  sector_theta - [in]
    3205  value from one of the sector theta functions.
    3206  ON_SubDEdge::SectorTheta()
    3207  ON_SubDEdge::SmoothSectorTheta()
    3208  ON_SubDEdge::CreaseSectorTheta()
    3209  ON_SubDEdge::CornerSectorTheta()
    3210  ON_SubDEdge::DartSectorTheta()
    3211  Returns:
    3212  0:
    3213  failed to caclulate weight
    3214  ON_UNSET_VALUE:
    3215  subd_type was set ON_SubD::SubDType::Unset
    3216  and the tagged end weight cannot be calculated until
    3217  the facet type is known. This typically happens
    3218  when a SubD control net is being created and
    3219  a facet type is not specified. The weights will
    3220  be calculated at the first subdivision.
    3221  0 < w < 1:
    3222  If ON_SubD::SubDType::QuadCatmullClark == subd_type,
    3223  then the returned value is
    3224  1/2 + 1/3*cos(sector_angle_radians). (1/6 <= w <= 5/6)
    3225  If ON_SubD::SubDType::TriLoopWarren == subd_type,
    3226  then the returned value is
    3227  1/3 + 1/3*cos(sector_angle_radians). (0 < w <= 2/3)
    3228  Remarks:
    3229  This is a useful tool when calling AddEdge while a subdivision
    3230  level is being constructed.
    3231  */
    3232  static double SectorWeightFromTheta(
    3233  ON_SubD::SubDType subd_type,
    3234  double sector_theta
    3235  );
    3236 };
    3237 
    3238 //////////////////////////////////////////////////////////////////////////
    3239 //
    3240 // ON_SubDLimitMeshFragment
    3241 //
    3242 // Meshes of ON_SubD limit surface are calculated in fragments.
    3243 //
    3244 class ON_SUBD_CLASS ON_SubDLimitMeshFragmentGrid
    3245 {
    3246 public:
    3247  // No construction for performance reasons.
    3248  // If you require initialization, use = ON_SubDLimitMeshFragmentGrid::Empty
    3249  //
    3250  //ON_SubDLimitMeshFragmentGrid() = default;
    3251  //~ON_SubDLimitMeshFragmentGrid() = default;
    3252  //ON_SubDLimitMeshFragmentGrid(const ON_SubDLimitMeshFragmentGrid&) = default;
    3253  //ON_SubDLimitMeshFragmentGrid& operator=(const ON_SubDLimitMeshFragmentGrid&) = default;
    3254  static const ON_SubDLimitMeshFragmentGrid Empty;
    3255 
    3256  /*
    3257  Description:
    3258  Get mesh facet quads that index into a grid of points.
    3259  Parameters:
    3260  side_segment_count - [in]
    3261  number quads in each row and column of the quad grid.
    3262  side_segment_count >= 1
    3263  side_segment_count <= ON_SubDLimitMesh::MaximumSideSegmentCount
    3264  side_segment_count must be a power of 2
    3265 
    3266  level_of_detail - [in]
    3267  0: quad count = maximum quad count = (side_count x side_count)
    3268  1: quad count = 1/4 maximum quad count
    3269  1: quad count = 1/16 maximum quad count
    3270  ...
    3271  If 4^level_of_detail > maximum quad count, then a single quad is returned.
    3272  */
    3273  static ON_SubDLimitMeshFragmentGrid Quads(
    3274  unsigned int side_segment_count,
    3275  unsigned int level_of_detail
    3276  );
    3277 
    3278  static ON_SubDLimitMeshFragmentGrid Tris(
    3279  unsigned int side_segment_count,
    3280  unsigned int level_of_detail
    3281  );
    3282 
    3283  static ON_SubDLimitMeshFragmentGrid Facets(
    3284  ON_SubD::FacetType facet_type,
    3285  unsigned int side_segment_count,
    3286  unsigned int level_of_detail
    3287  );
    3288 
    3289  /*
    3290  Description:
    3291  Get mesh facet quads that index into a grid of points.
    3292  Parameters:
    3293  side_segment_count - [in]
    3294  number quads in each row and column of the quad grid
    3295  with the highest level of detail (level_of_detail = 0)
    3296  side_count must be a power of 2
    3297  level_of_detail - [in]
    3298  Desired level of detail of the returned grid
    3299  0: highest (side_count x side_count) quads
    3300  1: 1/4 density (side_count x side_count)/4 quads
    3301  2: 1/16 density (side_count x side_count)/16 quads
    3302  ...
    3303  side_count-2: 4 quads
    3304  side_count-1: 1 quad
    3305  >= side_count: 1 quad
    3306  Returns:
    3307  Number of quads in the grid.
    3308  */
    3309  static unsigned int SetQuads(
    3310  unsigned int side_segment_count,
    3311  unsigned int level_of_detail,
    3312  size_t quad_capacity,
    3313  size_t quad_stride,
    3314  unsigned int* quads,
    3315  size_t side_capacity,
    3316  size_t side_stride,
    3317  unsigned int* sides
    3318  );
    3319 
    3320 
    3321  unsigned int SideSegmentCount() const;
    3322 
    3323  /*
    3324  Description:
    3325  The GridId() is persistent and unique based on the contents of the
    3326  grid. It is intended to be used in render applications that store
    3327  copies of ON_SubDLimitMeshFragmentGrid settings in things like
    3328  vertex object buffers and want a reliable way to index into them.
    3329  The Empty grid has id = 0;
    3330  Returns:
    3331  0:
    3332  when the grid is empty
    3333  32*n + 2*lod + t:
    3334  t = 0 for quads and 1 for tris,
    3335  (0 <= n <= 8) m_F_count = 2^(2n),
    3336  (0 <= lod <= 8) m_F_level_of_detail = lod
    3337  Remarks:
    3338  m_F_count is always
    3339  */
    3340  unsigned int GridId() const;
    3341 
    3342  /*
    3343  Returns:
    3344  3 for tris, 4 for quads, 0 for unset.
    3345  */
    3346  unsigned int GridFacetSideCount() const;
    3347 
    3348  bool GetGridParameters(
    3349  unsigned int grid_point_index,
    3350  double grid_parameters[2]
    3351  ) const;
    3352 
    3353 
    3354 private:
    3355  unsigned char m_reserved;
    3356 
    3357 public:
    3358 
    3359  ON_SubD::FacetType m_F_type;
    3360  unsigned char m_side_segment_count; // = 2^n for non-empty grids (0 <= n <= 8)
    3361  unsigned short m_F_count; // = m_side_count*m_side_count
    3362  unsigned short m_F_level_of_detail; // 0 = highest, > 0 = reduced
    3363  unsigned short m_F_stride;
    3364  const unsigned int* m_F;
    3365  const unsigned int* m_S; // [4*m_side_segment_count + 1] indices that form the polyline boundary.
    3366  const ON_SubDLimitMeshFragmentGrid* m_prev_level_of_detail; // nullptr or the previous level with more facets.
    3367  const ON_SubDLimitMeshFragmentGrid* m_next_level_of_detail; // nullptr or the next level with fewer facets.
    3368 };
    3369 
    3370 class ON_SUBD_CLASS ON_SubDLimitMeshFragment
    3371 {
    3372 public:
    3373  // No construction for performance reasons.
    3374  // If you require initialization, use = ON_SubDLimitMeshFragment::Empty
    3375  //
    3376  //ON_SubDLimitMeshFragment() = default;
    3377  //~ON_SubDLimitMeshFragment() = default;
    3378  //ON_SubDLimitMeshFragment(const ON_SubDLimitMeshFragment&) = default;
    3379  //ON_SubDLimitMeshFragment& operator=(const ON_SubDLimitMeshFragment&) = default;
    3380 
    3381  // Every field of ON_SubDLimitMeshFragment::Empty is zero.
    3382  static const ON_SubDLimitMeshFragment Empty;
    3383 
    3384  static const unsigned int MaximumSideSegmentCount;
    3385 
    3386  /*
    3387  Returns:
    3388  side_segment_count = 2^display_density
    3389  */
    3390  static unsigned int SideSegmentCountFromDisplayDensity(
    3391  unsigned int display_density
    3392  );
    3393 
    3394  /*
    3395  Returns:
    3396  base 2 log of side_segment_count.
    3397  Remarks:
    3398  side_segment_count = 2^display_density
    3399  */
    3400  static unsigned int DisplayDensityFromSideSegmentCount(
    3401  unsigned int side_segment_count
    3402  );
    3403 
    3404  /*
    3405  Parameters:
    3406  facet_type - [in]
    3407  ON_SubD::FacetType::Quad or ON_SubD::FacetType::Tri
    3408 
    3409  display_density - [in]
    3410  >= 0
    3411  Returns:
    3412  total number of points in the limit mesh fragment.
    3413  Remarks:
    3414  The number of points is the same for quad or tri subdivision limit
    3415  mesh fragments, even though one is a rectanglular collection of
    3416  quads and the other is a trianglular collection of triangles.
    3417  */
    3418  static unsigned int PointCountFromDisplayDensity(
    3419  ON_SubD::FacetType facet_type,
    3420  unsigned int display_density
    3421  );
    3422 
    3423  /*
    3424  Parameters:
    3425  display_density - [in]
    3426  >= 0
    3427  Returns:
    3428  total number of faces in the limit mesh fragment.
    3429  */
    3430  static unsigned int FaceCountFromDisplayDensity(
    3431  unsigned int display_density
    3432  );
    3433 
    3434  /*
    3435  Returns:
    3436  true if side_segment_count is valid.
    3437  Otherwise 0 is returned.
    3438  */
    3439  static bool SideSegmentCountIsValid(
    3440  unsigned int side_segment_count
    3441  );
    3442 
    3443  /*
    3444  Returns:
    3445  If side_segment_count is valide, then (side_segment_count+1) is returned.
    3446  Otherwise 0 is returned.
    3447  */
    3448  static unsigned int SidePointCountFromSideCount(
    3449  unsigned int side_segment_count
    3450  );
    3451 
    3452  /*
    3453  Returns:
    3454  If side_segment_count is valide, then (side_segment_count+1)^2 is returned.
    3455  Otherwise 0 is returned.
    3456  */
    3457  static unsigned int QuadGridPointCountFromSideCount(
    3458  unsigned int side_segment_count
    3459  );
    3460 
    3461  /*
    3462  Returns:
    3463  If side_segment_count is valide, then side_segment_count^2 is returned.
    3464  Otherwise 0 is returned.
    3465  */
    3466  static unsigned int QuadGridQuadCountFromSideCount(
    3467  unsigned int side_segment_count
    3468  );
    3469 
    3470 public:
    3471  const class ON_SubDFace* m_face;
    3472 
    3473  // m_face_vertex_index[] stores the information needed for the Vertex()
    3474  // and Edge() functions to work.
    3475  //
    3476  // If m_face is nullptr, then m_face_vertex_index[] has no meaning.
    3477  // If m_face is not nullptr and a corner of the grid is on a face
    3478  // vertex, then the corresponding m_face_vertex_index[] value
    3479  // will be <= ON_SubDFace::MaximumEdgeCount and m_face->Vertex(m_face_vertex_index[])
    3480  // is the vertex. Otherwise, the corresponding m_face_vertex_index[] value
    3481  // will be > ON_SubDFace::MaximumEdgeCount. For partial fragments,
    3482  // only some m_face_vertex_index[] identify vertices and the grid extends
    3483  // halfway along the neighboring face edges are
    3484  unsigned short m_face_vertex_index[4];
    3485 
    3486  /*
    3487  Parameters:
    3488  grid_side_index - [in]
    3489  0 to 3 for quad grids.
    3490  0 to 2 for tri grids
    3491  Returns:
    3492  The subd edge that is on the identified side of the grid.
    3493  */
    3494  const class ON_SubDEdgePtr EdgePtr(
    3495  unsigned int grid_side_index
    3496  ) const;
    3497  const class ON_SubDEdge* Edge(
    3498  unsigned int grid_side_index
    3499  ) const;
    3500 
    3501  const class ON_SubDVertexPtr VertexPtr(
    3502  unsigned int grid_corner_index
    3503  ) const;
    3504  const class ON_SubDVertex* Vertex(
    3505  unsigned int grid_corner_index
    3506  ) const;
    3507 
    3508  ON_3dPoint CornerPoint(
    3509  unsigned int grid_corner_index
    3510  ) const;
    3511 
    3512  /*
    3513  Returns:
    3514  Status of the face.
    3515  */
    3516  ON_ComponentStatus Status() const;
    3517 
    3518  /*
    3519  Returns:
    3520  True if this fragment covers a subset of a face.
    3521  */
    3522  bool IsSubFragment() const;
    3523 
    3524  /*
    3525  Returns:
    3526  True if this fragment covers an entier subd face.
    3527  */
    3528  bool IsCompleteFragment() const;
    3529 
    3530  bool Transform(
    3531  const ON_Xform& xform
    3532  );
    3533 
    3534  unsigned short m_face_fragment_count; // Number of fragments that will be delivered for this face.
    3535  unsigned short m_face_fragment_index; // First fragment has index = 0. Last fragment has index = m_face_fragment_count-1.
    3536 
    3537  // For quad based subdivision algorithms, the mesh fragment
    3538  // is a tesselation of a rectangular shaped surface,
    3539  // there are m_side_count quad edges along each side of the tesselation,
    3540  // there are a total of m_side_count X m_side_count quads, and
    3541  // m_P_count = (m_side_count+1)*(m_side_count+1).
    3542  //
    3543  // For trangle based subdivision algorithms, the mesh fragment
    3544  // is a tesselation of a triangular shaped surface,
    3545  // there are m_side_count triangle edges along each side of the tesselation,
    3546  // there are a total of m_side_count X m_side_count triangles, and
    3547  // m_P_count = (m_side_count+1)*(m_side_count+2)/2.
    3548  //
    3549 
    3550  // Number of points
    3551  unsigned short m_P_count;
    3552  unsigned short m_P_capacity;
    3553 
    3554  // points
    3555  size_t m_P_stride;
    3556  // The memory m_P references is managed by some other class or function.
    3557  // Never modify the values in m_P.
    3558  double* m_P;
    3559 
    3560  // surface normals parallel to m_P[] array
    3561  size_t m_N_stride;
    3562  // If m_N is not nullptr, then it can accomodate up to m_P_capacity normals.
    3563  // The memory m_N references is managed by some other class or function.
    3564  // Never modify the values in m_N.
    3565  double* m_N;
    3566 
    3567  // quads or tris
    3568  ON_SubDLimitMeshFragmentGrid m_grid; //
    3569 
    3570  ON_BoundingBox m_bbox;
    3571 
    3572  ON_SubDLimitMeshFragment* m_next_fragment;
    3573  ON_SubDLimitMeshFragment* m_prev_fragment;
    3574 };
    3575 
    3576 class ON_SUBD_CLASS ON_SubDManagedLimitMeshFragment : public ON_SubDLimitMeshFragment
    3577 {
    3578 public:
    3579  ON_SubDManagedLimitMeshFragment() ON_NOEXCEPT;
    3580  ~ON_SubDManagedLimitMeshFragment() ON_NOEXCEPT;
    3581  ON_SubDManagedLimitMeshFragment(const ON_SubDManagedLimitMeshFragment&) ON_NOEXCEPT;
    3582  ON_SubDManagedLimitMeshFragment& operator=(const ON_SubDManagedLimitMeshFragment&) ON_NOEXCEPT;
    3583 
    3584  static ON_SubDManagedLimitMeshFragment Create(const ON_SubDLimitMeshFragment& src) ON_NOEXCEPT;
    3585 
    3586 #if defined(ON_HAS_RVALUEREF)
    3587  // rvalue copy constructor
    3588  ON_SubDManagedLimitMeshFragment( ON_SubDManagedLimitMeshFragment&& ) ON_NOEXCEPT;
    3589 
    3590  // rvalue assignment operator
    3591  ON_SubDManagedLimitMeshFragment& operator=( ON_SubDManagedLimitMeshFragment&& ) ON_NOEXCEPT;
    3592 #endif
    3593 
    3594  void Clear() ON_NOEXCEPT;
    3595 
    3596  void Destroy() ON_NOEXCEPT;
    3597 
    3598  bool ReserveCapacity(
    3599  ON_SubD::FacetType facet_type,
    3600  unsigned int mesh_density
    3601  ) ON_NOEXCEPT;
    3602 
    3603 private:
    3604  void CopyHelper(const ON_SubDLimitMeshFragment& src);
    3605  size_t m_storage_capacity = 0;
    3606  double* m_storage = nullptr;
    3607 };
    3608 
    3609 //////////////////////////////////////////////////////////////////////////
    3610 //
    3611 // ON_SubDDisplayParameters
    3612 //
    3613 // A collection of parameters that are passed to functions that
    3614 // calculate a various representations of the limit surface.
    3615 //
    3616 class ON_SUBD_CLASS ON_SubDDisplayParameters
    3617 {
    3618 public:
    3619  static const ON_SubDDisplayParameters Empty;
    3620 
    3621  // Parameters for the default limit surface display mesh.
    3622  static const ON_SubDDisplayParameters DefaultDisplayMeshParameters;
    3623 
    3624  /*
    3625  Description:
    3626  In most applications, the caller sets the mesh_density
    3627  and leaves the other parameters set to the default
    3628  values.
    3629  */
    3630  static ON_SubDDisplayParameters CreateFromDisplayDensity(
    3631  unsigned int display_density
    3632  );
    3633 
    3634  ON_SubDDisplayParameters() = default;
    3635  ~ON_SubDDisplayParameters() = default;
    3636  ON_SubDDisplayParameters(const ON_SubDDisplayParameters&) = default;
    3637  ON_SubDDisplayParameters& operator=(const ON_SubDDisplayParameters&) = default;
    3638 
    3639  unsigned int m_display_density = 0;
    3640 
    3641  bool m_bUseMultipleThreads = false;
    3642  ON_Terminator* m_terminator = nullptr;
    3643  // optional progress reporting
    3644  ON_ProgressReporter* m_progress_reporter = nullptr;
    3645  ON_Interval m_progress_reporter_interval = ON_Interval::ZeroToOne;
    3646 };
    3647 
    3648 //////////////////////////////////////////////////////////////////////////
    3649 //
    3650 // ON_SubDLimitMesh
    3651 //
    3652 class ON_SUBD_CLASS ON_SubDLimitMesh
    3653 {
    3654 #if defined(ON_SUBD_CENSUS)
    3655 private:
    3656  ON_SubDLimitMeshCensusCounter m_census_counter;
    3657 #endif
    3658 
    3659 public:
    3660  static const ON_SubDLimitMesh Empty;
    3661 
    3662  /*
    3663  Returns:
    3664  A runtime number that changes if the limit mesh content changes.
    3665  0: Empty limit mesh
    3666  Remarks:
    3667  This is a runtime number. It is not saved in archives and begins
    3668  at 1 with each new runtime instance of the opennurbs library.
    3669  */
    3670  unsigned int ContentSerialNumber() const;
    3671 
    3672  enum : unsigned int
    3673  {
    3674  DefaultDisplayDensity = 4, // default limit mesh density 16x16 quads per SubD quad 16 = 2^4
    3675  MaximumDisplayDensity = 8 // 8 (256x256 quads per SubD quad 256 = 2^8)
    3676  //MaximumLevelOfDetail = 0, // 0 = most facets per fragment
    3677  //MinimumLevelOfDetail = 8 // 8 = fewest facets per fragment
    3678  };
    3679 
    3680  static ON_SubDLimitMesh* Create(
    3681  const ON_SubD& subd,
    3682  const class ON_SubDDisplayParameters& limit_mesh_parameters,
    3683  ON_SubDLimitMesh* destination_mesh
    3684  );
    3685 
    3686  /*
    3687  Description:
    3688  This version is for expert users who want to take
    3689  responsibility for managing the subd and limit mesh
    3690  */
    3691  static ON_SubDLimitMesh* Create(
    3692  ON_SubDFaceIterator fit,
    3693  const class ON_SubDDisplayParameters& limit_mesh_parameters,
    3694  ON_SubDLimitMesh* destination_mesh
    3695  );
    3696 
    3697  ON_SubDLimitMesh() = default;
    3698  ~ON_SubDLimitMesh() = default;
    3699  ON_SubDLimitMesh(const ON_SubDLimitMesh&) = default;
    3700  ON_SubDLimitMesh& operator=(const ON_SubDLimitMesh&) = default;
    3701 
    3702 
    3703 #if defined(ON_HAS_RVALUEREF)
    3704  // rvalue copy constructor
    3705  ON_SubDLimitMesh( ON_SubDLimitMesh&& ) ON_NOEXCEPT;
    3706  // rvalue assignment operator
    3707  ON_SubDLimitMesh& operator=( ON_SubDLimitMesh&& );
    3708 #endif
    3709 
    3710  ON_SubDLimitMesh Copy() const;
    3711 
    3712  ON_SubDLimitMesh& CopyFrom(
    3713  const ON_SubDLimitMesh& src
    3714  );
    3715 
    3716  static void Swap(
    3717  ON_SubDLimitMesh& a,
    3718  ON_SubDLimitMesh& b
    3719  );
    3720 
    3721  bool Transform(
    3722  const ON_Xform& xform
    3723  );
    3724 
    3725  unsigned int DisplayDensity() const;
    3726  ON_SubDDisplayParameters DisplayParameters() const;
    3727  unsigned int FragmentCount() const;
    3728  const ON_SubDLimitMeshFragment* FirstFragment() const; // linked list of mesh fragments
    3729 
    3730  /*
    3731  Description:
    3732  If the subd referenced by m_subd_ref changes, then call
    3733  Update to update the limit mesh.
    3734  */
    3735  bool Update(
    3736  bool bShareUpdate
    3737  );
    3738 
    3739  /*
    3740  Description:
    3741  The ON__INT_PTRs in the tree are const ON_SubDLimitMeshFragment* pointers.
    3742  */
    3743  const ON_RTree& FragmentTree() const;
    3744 
    3745  /*
    3746  Description:
    3747  Clears everything.
    3748  */
    3749  void Clear();
    3750 
    3751  /*
    3752  Description:
    3753  If the tree is not needed and memory resources are tight, then call ClearTree()
    3754  to remove the RTree.
    3755  */
    3756  void ClearTree();
    3757 
    3758  bool IsEmpty() const;
    3759 
    3760  ON_SubD::FacetType GridType() const;
    3761 
    3762  ON_BoundingBox BoundingBox() const;
    3763 
    3764  bool GetTightBoundingBox(
    3765  ON_BoundingBox& bbox,
    3766  bool bGrowBox,
    3767  const ON_Xform* xform
    3768  ) const;
    3769 
    3770  ON_SubDRef SubDRef() const;
    3771  ON_SubD SubD() const;
    3772 
    3773 public:
    3774  /*
    3775  Description:
    3776  Pretend this function and ON_SubDLimitMeshImpl do not exist.
    3777  Returns:
    3778  Something that you are pretending does not exist.
    3779  Remarks:
    3780  It is intentional that the definition of ON_SubDLimitMeshImpl class is not
    3781  available in the opennurbs library interface (not in a header file).
    3782  The size and design of ON_SubDLimitMeshImpl will change constantly.
    3783  If you choose to hack and whack so you can dereference an
    3784  ON_SubDLimitMeshImpl* pointer, then your code will crash unpredictably.
    3785  */
    3786  class ON_SubDLimitMeshImpl* SubLimple() const;
    3787  unsigned int SubLimpleUseCount() const;
    3788 
    3789 private:
    3790 #pragma ON_PRAGMA_WARNING_PUSH
    3791 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    3792  friend class ON_SubDLimitMeshImpl;
    3793  // C4251: ... needs to have dll-interface to be used by clients of class ...
    3794  // m_impl_sp is private and all code that manages m_impl_sp is explicitly implemented in the DLL.
    3795 private:
    3796  std::shared_ptr< class ON_SubDLimitMeshImpl > m_impl_sp;
    3797 #pragma ON_PRAGMA_WARNING_POP
    3798 
    3799 };
    3800 
    3801 
    3802 
    3803 class ON_SUBD_CLASS ON_SubDLimitPatchFragment
    3804 {
    3805 public:
    3806  // No construction for performance reasons.
    3807  // If you require initialization, use = ON_SubDLimitMeshFragment::Empty
    3808  //
    3809  //ON_SubDLimitMeshFragment() = default;
    3810  //~ON_SubDLimitMeshFragment() = default;
    3811  //ON_SubDLimitMeshFragment(const ON_SubDLimitMeshFragment&) = default;
    3812  //ON_SubDLimitMeshFragment& operator=(const ON_SubDLimitMeshFragment&) = default;
    3813 
    3814  // Every field of ON_SubDLimitPatchFragment::Empty is zero.
    3815  static const ON_SubDLimitPatchFragment Empty;
    3816 
    3817  // Every m_patch_cv[][][] value is ON_UNSET_VALUE.
    3818  // Every other field of ON_SubDLimitPatchFragment::Unset is zero.
    3819  static const ON_SubDLimitPatchFragment Unset;
    3820 
    3821  // Every m_patch_cv[][][] value is ON_DBL_QNAN.
    3822  // Every other field of ON_SubDLimitPatchFragment::Unset is zero.
    3823  static const ON_SubDLimitPatchFragment Nan;
    3824 
    3825 #pragma region RH_C_SHARED_ENUM [SubD::PatchType] [Rhino.Geometry.SubD.PatchType] [internal:nested:byte]
    3826  enum class PatchType : unsigned char
    3827  {
    3828  ///<summary>Not a valid patch type.</summary>
    3829  Unset = 0,
    3830 
    3831  ///<summary>Entire subdivision face is an exact bicubic patch.</summary>
    3832  Bicubic = 1,
    3833 
    3834  ///<summary>A quadrant of the subdivision face is an exact bicubic patch.</summary>
    3835  BicubicQuadrant = 2,
    3836 
    3837  ///<summary>Entire subdivision face is approximately a bicubic patch.</summary>
    3838  ApproximateBicubic = 3,
    3839 
    3840  ///<summary>A quadrant of the subdivision face is approximately a bicubic patch.</summary>
    3841  ApproximateBicubicQuadrant = 4,
    3842 
    3843  ///<summary>A patch cannot be calculated at the current subdivision level.</summary>
    3844  None = 5
    3845  };
    3846 #pragma endregion
    3847 
    3848 public:
    3849  double m_patch_cv[5][5][3];
    3850  const double* m_patch_knots[2]; // nullptr or 7 uniform cubic knots. Never modify these values.
    3851 
    3852  const class ON_SubDFace* m_level0_face;
    3853 
    3854 
    3855  // m_patch_state[] reports what information is returned in m_patch_cv[] and m_patch_knots[].
    3856  // m_patch_state[0] report the state for the cubic patch:
    3857  // CV[0][0] = m_patch_cv[0][0], knot[0] = m_patch_knots[0], knot[1] = m_patch_knots[1]
    3858  // m_patch_state[1] report the state for the cubic patch:
    3859  // CV[0][0] = m_patch_cv[1][0], knot[0] = m_patch_knots[0]+1, knot[1] = m_patch_knots[1]
    3860  // m_patch_state[2] report the state for the cubic patch:
    3861  // CV[0][0] = m_patch_cv[1][1], knot[0] = m_patch_knots[0]+1, knot[1] = m_patch_knots[1]+1
    3862  // m_patch_state[3] report the state for the cubic patch:
    3863  // CV[0][0] = m_patch_cv[0][1], knot[0] = m_patch_knots[0], knot[1] = m_patch_knots[1]+1
    3864  ON_SubDLimitPatchFragment::PatchType m_patch_type[4];
    3865 
    3866  unsigned short m_patch_level;
    3867 
    3868  // When the subdivision method is quad based and m_face is a quad, there is one region.
    3869  // When the subdivision method is quad based and m_face is not a quad, there are m_face->m_edge_count regions.
    3870  unsigned short m_level0_face_region_count; // Number of regions in m_face.
    3871  unsigned short m_level0_face_region_index; // First region has index = 0. Last region has index = m_face_region_count-1.
    3872 
    3873  unsigned short m_face_subdivision_count;
    3874  unsigned short m_face_region_index[10]; // vertex index for subdivision
    3875 
    3876 public:
    3877  ON_SubDLimitPatchFragment* m_next_fragment;
    3878  ON_SubDLimitPatchFragment* m_prev_fragment;
    3879 };
    3880 
    3881 
    3882 class ON_SUBD_CLASS ON_SubDSectorLimitPoint
    3883 {
    3884 public:
    3885  // For performance reasons, the default the data members are
    3886  // not initialized by the default constructor
    3887  // Use = ON_SubDSectorLimitPoint::Unset when initialization is required
    3888  static const ON_SubDSectorLimitPoint Unset; // all doubles are ON_UNSET_VALUE, all pointer are nullptr
    3889  static const ON_SubDSectorLimitPoint Nan; // all doubles are ON_DBL_QNAN, all pointer are nullptr
    3890  static const ON_SubDSectorLimitPoint Zero; // all doubles are 0.0, all pointer are nullptr
    3891 
    3892  /*
    3893  Returns:
    3894  true if m_limitP[0] is a nan (like ON_DBL_QNAN).
    3895  false otherwise.
    3896  */
    3897  bool IsUnset() const;
    3898 
    3899  /*
    3900  Returns:
    3901  true if m_limitP[0] is ON_UNSET_VALUE.
    3902  false otherwise.
    3903  */
    3904  bool IsNan() const;
    3905 
    3906  /*
    3907  Returns:
    3908  true if all coordinates are zero.
    3909  false otherwise.
    3910  */
    3911  bool IsZero() const;
    3912 
    3913  /*
    3914  Returns:
    3915  true if all coordinates are valid doubles and the tangents and normal have at least
    3916  one nonzero coordinate.
    3917  false otherwise.
    3918  */
    3919  bool IsSet() const;
    3920 
    3921  bool Transform(
    3922  const ON_Xform& xform
    3923  );
    3924 
    3925  // limit surface point, tangents and normal
    3926  double m_limitP[3]; // point
    3927  double m_limitT1[3]; // first unit tangent
    3928  double m_limitT2[3]; // second unit tangent
    3929  double m_limitN[3]; // unit normal (same direction as m_limitT1 x m_limitT2)
    3930 
    3931  // When an ON_SubDVertex has a single sector, these pointers are both null.
    3932  // When an ON_SubDVertex has a multiple sectors,
    3933  // m_sector_face is the "first" face in the sector and
    3934  // m_next_sector_limit_point is used to create a linked list.
    3935  // (The "first" face in a sector is the one ON_SubDSectorIterator.IncrementToCrease(-1) returns.)
    3936  const class ON_SubDSectorLimitPoint* m_next_sector_limit_point; // nullptr for vertices with one sector
    3937  const class ON_SubDFace* m_sector_face; // nullptr for vertices with one sector
    3938 };
    3939 
    3940 
    3941 
    3942 ////////////////////////////////////////////////////////////////////////////
    3943 //
    3944 // ON_SubDComponentBase
    3945 //
    3946 class ON_SUBD_CLASS ON_SubDComponentBase
    3947 {
    3948 public:
    3949  static const ON_SubDComponentBase Unset;
    3950 
    3951  ///*
    3952  //Returns:
    3953  // True if component is not nullptr, component->m_id > 0 and component->m_archive_id != ON_UNSET_UINT_INDEX.
    3954  //*/
    3955  //static bool IsActive(
    3956  // const ON_SubDComponentBase* component
    3957  // );
    3958 
    3959 public:
    3960  ON_SubDComponentBase() = default;
    3961  ~ON_SubDComponentBase() = default;
    3962  ON_SubDComponentBase(const ON_SubDComponentBase&) = default;
    3963  ON_SubDComponentBase& operator=(const ON_SubDComponentBase&) = default;
    3964 
    3965 public:
    3966  // The audience for this comment is anybody who wants to change the data
    3967  // fields in ON_SubDComponentBase. Everyone else should ignore this comment.
    3968  // ON_SubD components come from ON_FixedSizePool and ON_SubD code
    3969  // uses ON_FixedSizePool.ReturnElement. The first sizeof(void*) bytes
    3970  // must be a data field that is not referenced in returned elements.
    3971  // Since a returned element cannot have a "next level vertex",
    3972  // m_subd_point1 is a good data member to put first.
    3973 
    3974  // m_subd_point1 points to the next level's vertex when this component
    3975  // has been subdivided using an algorithm like Catmull-Clark or Loop-Warren.
    3976  const class ON_SubDVertex* m_subd_point1 = nullptr;
    3977 
    3978 public:
    3979  // The audience for this comment is anybody who wants to change the data
    3980  // fields in ON_SubDComponentBase. Everyone else should ignore this comment.
    3981  // It is critical that the offset of m_id in ON_SubDComponentBase be >= sizeof(void*).
    3982  // ON_SubD components come from ON_FixedSizePool and ON_SubD code
    3983  // use ON_FixedSizePool.ElementFromId and ON_FixedSizePool.ReturnElement.
    3984  // Once assigned, m_id is never changed and that allows ON_SubD component
    3985  // indices to work.
    3986 
    3987  // Id assigned to this component. Never modify this value. It is assigned
    3988  // by allocators and used to find the component from an ON_COMPONENT_INDEX.
    3989  unsigned int m_id = 0;
    3990 
    3991 private:
    3992  // The m_archive_id must be immediately after the m_id field.
    3993  mutable unsigned int m_archive_id = 0;
    3994 
    3995 public:
    3996  unsigned short m_level = 0;
    3997 
    3998 public:
    4000 
    4001 public:
    4002 
    4003  //////////////////////////////////////////////////////////////
    4004  //
    4005  // Saved subdivision point
    4006  //
    4007  /*
    4008  Description:
    4009  Set the saved subdivision point.
    4010  Parameters:
    4011  subdivision_point_type - [in]
    4012  Specifies subdivision algorithm.
    4013  Use ON_SubD::SubDType::Unset to clear the cache.
    4014  subdivision_point - [in]
    4015  includes displacement if it exists
    4016  Returns:
    4017  true if successful
    4018  */
    4019  bool SetSavedSubdivisionPoint(
    4020  ON_SubD::SubDType subd_type,
    4021  const double subdivision_point[3]
    4022  ) const;
    4023 
    4024  bool GetSavedSubdivisionPoint(
    4025  ON_SubD::SubDType subd_type,
    4026  double subdivision_point[3]
    4027  ) const;
    4028 
    4029  ON_SubD::SubDType SavedSubdivisionPointType() const;
    4030 
    4031  /*
    4032  Description:
    4033  Clears saved subdivision information for this component.
    4034  */
    4035  void ClearSavedSubdivisionPoint() const;
    4036 
    4037  //////////////////////////////////////////////////////////////
    4038  //
    4039  // displacement applied to subdivision point
    4040  //
    4041  bool SetDisplacement(
    4042  ON_SubD::SubDType subd_type,
    4043  const double displacement[3]
    4044  );
    4045 
    4046  bool GetDisplacement(
    4047  ON_SubD::SubDType subd_type,
    4048  double displacement[3]
    4049  ) const;
    4050 
    4051  ON_SubD::SubDType DisplacementType() const;
    4052 
    4053  void ClearDisplacement() const;
    4054 
    4055 protected:
    4056  // GetSubdivisionPoint( bUseSavedSubdivisionPoint=true ) can change the value of m_saved_points_flags
    4057  // m_saved_points_flags & 0x1F = ON_SubD::SubDType value
    4058  // m_saved_points_flags & 0x40 != 0 if m_cache_subd_P is set.
    4059  // m_saved_points_flags & 0x80 != 0 if m_displacementV is set.
    4060  // GetLimitPoint( bUseSavedLimitPoint=true ) can change the value of m_saved_points_flags
    4061  // m_saved_points_flags & 0x20 != 0 if ON_subDVertex.m_limit* values are set.
    4062  mutable unsigned char m_saved_points_flags = 0U;
    4063 
    4064 public:
    4065 
    4066  // All the faces with the same nonzero value of m_group_id are in the same "group".
    4067  // SDK interface on ON_SubD will be added after we get a better idea of how this
    4068  // feature will be used.
    4069  unsigned int m_group_id = 0U;
    4070 
    4071 protected:
    4072  // GetSubdivisionPoint( bUseSavedSubdivisionPoint=true ) can change the value of m_cache_subd_P
    4073  mutable double m_saved_subd_point1[3]; // saved subdivision point
    4074 
    4075 protected:
    4076  // optional displacement applied to standard subdivision point.
    4077  double m_displacement_V[3];
    4078 
    4079 public:
    4080  /*
    4081  Description:
    4082  Pretend ArchiveId() and SetArchiveId() do not exist.
    4083  Returns:
    4084  The ArchiveId is a value set and used by ON_BinaryArchive Read() and Write()
    4085  functions and copy constructors and operator=().
    4086  A public interface is supplied because it is not practical to use friends.
    4087  Remarks:
    4088  A value of ON_UNSET_UINT_INDEX indicates the component is not in use.
    4089  */
    4090  unsigned int ArchiveId() const
    4091  {
    4092  return m_archive_id;
    4093  }
    4094 
    4095  void SetArchiveId(
    4096  unsigned int archive_id
    4097  ) const
    4098  {
    4099  // m_archive_id is mutable
    4100  if ( ON_UNSET_UINT_INDEX != archive_id )
    4101  m_archive_id = archive_id;
    4102  }
    4103 
    4104 protected:
    4105  void CopyBaseFrom(
    4106  const ON_SubDComponentBase* src
    4107  );
    4108 };
    4109 
    4110 ////////////////////////////////////////////////////////////////////////////
    4111 //
    4112 // ON_SubDVertex
    4113 //
    4114 class ON_SUBD_CLASS ON_SubDVertex : public ON_SubDComponentBase
    4115 {
    4116 public:
    4117  static const ON_SubDVertex Empty;
    4118 
    4119  bool Write (
    4120  class ON_BinaryArchive& archive
    4121  ) const;
    4122 
    4123  static bool Read (
    4124  class ON_BinaryArchive& archive,
    4125  class ON_SubD& subd,
    4126  class ON_SubDVertex*& vertex
    4127  );
    4128 
    4129  /*
    4130  Description:
    4131  Apply a tranxfomration matrix to vertex geometry information.
    4132  Parameters:
    4133  bTransformationSavedSubdivisionPoint - [in]
    4134  If the transformation is being applied to every vertex, edge and
    4135  face in every level of a subdivision object, and the transformation
    4136  is an isometry (rotation, translation, ...), a uniform scale, or a
    4137  composition of these types, then set
    4138  bTransformationSavedSubdivisionPoint = true to apply the
    4139  transformation to saved subdivision and saved limit point information.
    4140  In all other cases, set bTransformationSavedSubdivisionPoint = false
    4141  and any saved subdivision points or saved limit points will be
    4142  deleted. When in doubt, pass false.
    4143 
    4144  xform - [in]
    4145  */
    4146  bool Transform(
    4147  bool bTransformationSavedSubdivisionPoint,
    4148  const class ON_Xform& xform
    4149  );
    4150 
    4151  bool SetLocation(
    4152  ON_3dPoint location,
    4153  bool bClearNeighborhoodCache
    4154  );
    4155 
    4156 
    4157  ON_BoundingBox ControlNetBoundingBox() const;
    4158  ON_BoundingBox LimitSurfaceBoundingBox(
    4159  const ON_SubD& subd
    4160  ) const;
    4161 
    4162 public:
    4163  ON_COMPONENT_INDEX ComponentIndex() const;
    4164  ON_SubDComponentPtr ComponentPtr() const;
    4165 
    4166 public:
    4167  const class ON_SubDVertex* m_prev_vertex = nullptr; // linked list of vertices on this level
    4168  const class ON_SubDVertex* m_next_vertex = nullptr; // linked list of vertices on this level
    4169 
    4170 public:
    4171  ON_SubD::VertexTag m_vertex_tag = ON_SubD::VertexTag::Unset;
    4172 
    4173 
    4174 private:
    4175  //ON_SubD::VertexEdgeOrder m_vertex_edge_order = ON_SubD::VertexEdgeOrder::unset;
    4176  unsigned char m_reserved1 = 0;
    4177  unsigned short m_reserved2 = 0;
    4178  unsigned int m_reserved3 = 0;
    4179 
    4180 public:
    4181  unsigned short m_edge_count = 0;
    4182  unsigned short m_face_count = 0;
    4183 
    4184  unsigned short m_edge_capacity = 0;
    4185  unsigned short m_face_capacity = 0;
    4186 
    4187 public:
    4188  // Array of m_edge_count edges.
    4189  // m_edge[i].EdgeDirection() indicates which edge end is located at this vertex
    4190  // If m_edge_capacity > 0, m_edge_capacity is the number of elements that
    4191  // may be used in m_edges[].
    4192  class ON_SubDEdgePtr* m_edges = nullptr;
    4193 
    4194  // Array of m_face_count faces.
    4195  // If m_face_capacity > 0, m_face_capacity is the number of elements that
    4196  // may be used in m_faces[].
    4197  const class ON_SubDFace** m_faces = nullptr;
    4198 
    4199 public:
    4200  double m_P[3]; // vertex location
    4201 
    4202 private:
    4203  // Cached limit point and limit normal
    4204  // GetLimitPoint( bUseSavedLimitPoint=true ) can change the value of m_limitP_type
    4205  // If the limit point is set and vertex has a single sector, then
    4206  // m_limit_point.m_sector_face = nullptr and m_limit_point.m_next_sector_limit_point = nullptr.
    4207  // If the limit point is set and vertex has a multiple sectors, then
    4208  // m_limit_point.m_sector_face = first face in the sector.
    4209  // If multiple limit points are set, then are in a linked list
    4210  // traversed using the ON_SubDSectorLimitPointm_next_sector_limit_point.
    4211  // The second and any additional limit points are managed by a fixed size pool.
    4212  // Calling ClearLimitPoint() will return these to the pool.
    4213  mutable ON_SubDSectorLimitPoint m_limit_point = ON_SubDSectorLimitPoint::Unset;
    4214 
    4215 public:
    4216  static const unsigned int MaximumEdgeCount;
    4217  static const unsigned int MaximumFaceCount;
    4218 
    4219  static int CompareUnorderedEdges(
    4220  const ON_SubDVertex* a,
    4221  const ON_SubDVertex* b
    4222  );
    4223 
    4224  static int CompareUnorderedFaces(
    4225  const ON_SubDVertex* a,
    4226  const ON_SubDVertex* b
    4227  );
    4228 
    4229  static int CompareUnorderedEdgesAndFaces(
    4230  const ON_SubDVertex* a,
    4231  const ON_SubDVertex* b
    4232  );
    4233 
    4234  ///*
    4235  //Description:
    4236  // Sort the m_edges[] and m_faces[] arrays so radial groups are together.
    4237  // After the sorting is completed, m_vertex_edge_order is set to recored
    4238  // the current sorting state and its value is returned.
    4239  // The sorting is done unconditionally.
    4240  //*/
    4241  //ON_SubD::VertexEdgeOrder SortEdges();
    4242 
    4243  unsigned int EdgeCount(
    4244  ON_SubD::EdgeTag edge_tag
    4245  ) const;
    4246 
    4247  unsigned int EdgeCount() const;
    4248 
    4249  const class ON_SubDEdge* Edge(
    4250  unsigned int i
    4251  ) const;
    4252 
    4253  const ON_SubDEdgePtr EdgePtr(
    4254  unsigned int i
    4255  ) const;
    4256 
    4257  ON__UINT_PTR EdgeDirection(
    4258  unsigned int i
    4259  ) const;
    4260 
    4261  unsigned int EdgeArrayIndex(
    4262  const ON_SubDEdge* edge
    4263  ) const;
    4264 
    4265  unsigned int FaceCount() const;
    4266 
    4267  const class ON_SubDFace* Face(
    4268  unsigned int i
    4269  ) const;
    4270 
    4271  unsigned int FaceArrayIndex(
    4272  const ON_SubDFace* face
    4273  ) const;
    4274 
    4275  ON_SubD::FacetType FirstFaceFacetType() const;
    4276 
    4277  /*
    4278  Returns
    4279  true if m_vertex_tag is ON_SubD::VertexTag::Crease, ON_SubD::VertexTag::Corner or ON_SubD::VertexTag::Dart.
    4280  */
    4281  bool IsTagged() const;
    4282 
    4283  ///*
    4284  //Parameters:
    4285  // subd_type - [in]
    4286  // Specifies subdivision algorithm
    4287  // vertex_tag_filter - [in]
    4288  // If vertex_tag is not ON_SubD::VertexTag::Unset and vertex_tag != m_vertex_tag,
    4289  // then false is returned. This parameter can be used when a smooth or crease
    4290  // vertex is explicity required.
    4291  // bTestFaces - [in]
    4292  // If true, and the edge and face count tests succeed, then the faces in the
    4293  // vertex m_faces[] array are tested to insure they are
    4294  // quads (ccquad subdivisiontype) or tris (lwtri subdivisiontype).
    4295  //Returns:
    4296  // If m_vertex_tag is ON_SubD::Vertex::Tag::smooth,
    4297  // and the number of edges = number of faces,
    4298  // and there are 4 (ccquad subdivisiontype) or 6 (lwtri subdivisiontype) edges,
    4299  // and bTestFaces is false or the faces pass the face test,
    4300  // then true is returned.
    4301  //
    4302  // If m_vertex_tag is ON_SubD::Vertex::Tag::crease,
    4303  // and the number of edges = 1 + number of faces,
    4304  // and there are 3 (ccquad subdivisiontype) or 4 (lwtri subdivisiontype) edges,
    4305  // and bTestFaces is false or the faces pass the face test,
    4306  // then true is returned.
    4307 
    4308  // In all other cases, false is returned.
    4309  //*/
    4310  //bool IsOrdinary(
    4311  // ON_SubD::SubDType subd_type,
    4312  // ON_SubD::VertexTag vertex_tag_filter,
    4313  // bool bTestFaces
    4314  // ) const;
    4315 
    4316 
    4317  /*
    4318  Returns:
    4319  True if m_vertex_tag is ON_SubD::VertexTag::Smooth.
    4320  */
    4321  bool IsSmooth() const;
    4322 
    4323  /*
    4324  Returns:
    4325  True if m_vertex_tag is ON_SubD::VertexTag::Crease.
    4326  */
    4327  bool IsCrease() const;
    4328 
    4329  /*
    4330  Returns:
    4331  True if m_vertex_tag is ON_SubD::VertexTag::Corner.
    4332  */
    4333  bool IsCorner() const;
    4334 
    4335  /*
    4336  Returns:
    4337  True if m_vertex_tag is ON_SubD::VertexTag::Dart.
    4338  */
    4339  bool IsDart() const;
    4340 
    4341  /*
    4342  Returns:
    4343  True if m_vertex_tag is ON_SubD::VertexTag::Smooth or ON_SubD::VertexTag::Crease.
    4344  */
    4345  bool IsSmoothOrCrease() const;
    4346 
    4347  /*
    4348  Returns:
    4349  True if m_vertex_tag is ON_SubD::VertexTag::Crease or ON_SubD::VertexTag::Corner.
    4350  */
    4351  bool IsCreaseOrCorner() const;
    4352 
    4353  /*
    4354  Returns:
    4355  True if m_vertex_tag is ON_SubD::VertexTag::Crease or ON_SubD::VertexTag::Corner or ON_SubD::VertexTag::Dart.
    4356  */
    4357  bool IsCreaseOrCornerOrDart() const;
    4358 
    4359  /*
    4360  Returns:
    4361  True if m_vertex_tag is ON_SubD::VertexTag::Smooth or ON_SubD::VertexTag::Dart.
    4362  */
    4363  bool IsSmoothOrDart() const;
    4364 
    4365  /*
    4366  Description:
    4367  A "standard" vertex is one where the standard subdivsion matrix for that vertex
    4368  can be used to calculate the subdivision point.
    4369  This function is desinged to be useful for testing and debugging code when
    4370  a certain situation is expected to exist. It is not used for evaluation
    4371  because it is too slow.
    4372 
    4373  Returns:
    4374  True if the subdivison point of the vertex can be calulated using the standard
    4375  subdivion matrix for the vertex type and face count.
    4376 
    4377  Remarks:
    4378  If the vertex is tagged and has multiple sectors, like an interior
    4379  crease or corner vertex, then this function will return false.
    4380  In this situation, it is possible that the vertex, as the center of a
    4381  sector, is standard.
    4382  */
    4383  bool IsStandard(
    4384  ON_SubD::SubDType subd_type
    4385  ) const;
    4386 
    4387  /*
    4388  Parameters:
    4389  subdivision_point_type - [in]
    4390  Selects subdivision algorithm. Must be either
    4391  ON_SubD::SubDType::TriLoopWarren or ON_SubD::SubDType::QuadCatmullClark.
    4392  bUseSavedSubdivisionPoint - [in]
    4393  If there is a saved subdivision point and bUseSavedSubdivisionPoint
    4394  is true, then the saved value is returned.
    4395  subdivision_point - [out]
    4396  Returns:
    4397  true if successful
    4398  */
    4399  bool GetSubdivisionPoint(
    4400  ON_SubD::SubDType subdivision_point_type,
    4401  bool bUseSavedSubdivisionPoint,
    4402  double subdivision_point[3]
    4403  ) const;
    4404 
    4405  /*
    4406  Parameters:
    4407  facet_type - [in]
    4408  Selects subdivision algorithm.
    4409  bUseSavedLimitPoint - [in]
    4410  If there is a saved limit point and normal and bUseSavedLimitPoint
    4411  is true, then the saved value is used.
    4412  limit_point - [out]
    4413  Returns:
    4414  true if successful
    4415  */
    4416  bool GetLimitPoint(
    4417  ON_SubD::SubDType subd_type,
    4418  const ON_SubDFace* sector_face,
    4419  bool bUseSavedLimitPoint,
    4420  class ON_SubDSectorLimitPoint& limit_point
    4421  ) const;
    4422 
    4423  /*
    4424  Description:
    4425  Save limit point and limit normal for future use.
    4426  Parameters:
    4427  subd_type - [in]
    4428  limit_point - [in]
    4429  limit_normal - [in]
    4430  Returns:
    4431  true if successful
    4432  */
    4433  bool SetSavedLimitPoint(
    4434  ON_SubD::SubDType subd_type,
    4435  const ON_SubDSectorLimitPoint limit_point
    4436  ) const;
    4437 
    4438  void ClearSavedLimitPoints() const;
    4439 
    4440  /*
    4441  Returns:
    4442  ON_SubD::SubDType::TriLoopWarren
    4443  The vertex limit point and normal are saved for Loop trianglular subdivision.
    4444  ON_SubD::SubDType::QuadCatmullClark
    4445  The vertex limit point and normal are saved for Catmull-Clark quad subdivision.
    4446  ON_SubD::SubDType::Unset
    4447  The vertex limit point and normal are not saved.
    4448  */
    4449  ON_SubD::SubDType SavedLimitPointType() const;
    4450 
    4451  /*
    4452  Description:
    4453  Report what type of facet or facets use this vertex.
    4454  */
    4455  ON_SubD::VertexFacetType VertexFacetTypes() const;
    4456 
    4457 
    4458  /*
    4459  Description:
    4460  Call this function if the vertex is modified and it will clear any
    4461  cached subdivision information that needs to be recalculated.
    4462  */
    4463  void VertexModifiedNofification() const;
    4464 
    4465 private:
    4466  static bool GetQuadPoint(
    4467  const class ON_SubDVertex* vertex, // smooth or dart
    4468  bool bUseSavedSubdivisionPoint,
    4469  double vertex_point[3]
    4470  );
    4471 
    4472  static bool GetTriPoint(
    4473  const class ON_SubDVertex* vertex, // smooth or dart
    4474  bool bUseSavedSubdivisionPoint,
    4475  double vertex_point[3]
    4476  );
    4477 
    4478  static unsigned int GetFacePointSum(
    4479  const ON_SubDFace* face,
    4480  const ON_SubDVertex* vertex,
    4481  double* facePsum // sum of points that are not immediately adjacent to vertex
    4482  );
    4483 
    4484 
    4485  /*
    4486  Description:
    4487  Used for smooth and dart vertices when there are faces
    4488  that use the vertex have different numbers of sides.
    4489  This typically happen when a quad subd control net is
    4490  being subdivided for the first time.
    4491  Parameters:
    4492  vertex - [in]
    4493  vertex_point - [out]
    4494  Returns:
    4495  true if successful
    4496  */
    4497  static bool GetGeneralQuadSubdivisionPoint(
    4498  const class ON_SubDVertex* vertex,
    4499  bool bUseSavedSubdivisionPoint,
    4500  double vertex_point[3]
    4501  );
    4502 
    4503 private:
    4504  friend class ON_SubDArchiveIdMap;
    4505  void CopyFrom(
    4506  const ON_SubDVertex* src,
    4507  bool bCopyEdgeArray,
    4508  bool bCopyFaceArray,
    4509  bool bCopyLimitPointList
    4510  );
    4511 };
    4512 
    4513 //////////////////////////////////////////////////////////////////////////
    4514 //
    4515 // ON_SubDEdge
    4516 //
    4517 class ON_SUBD_CLASS ON_SubDEdge : public ON_SubDComponentBase
    4518 {
    4519 public:
    4520  static const ON_SubDEdge Empty;
    4521 
    4522  bool Write (
    4523  class ON_BinaryArchive& archive
    4524  ) const;
    4525 
    4526  static bool Read (
    4527  class ON_BinaryArchive& archive,
    4528  class ON_SubD& subd,
    4529  class ON_SubDEdge*& edge
    4530  );
    4531 
    4532  /*
    4533  Description:
    4534  Apply a tranxfomration matrix to vertex geometry information.
    4535 
    4536  Parameters:
    4537  bTransformationSavedSubdivisionPoint - [in]
    4538  If the transformation is being applied to every vertex, edge and
    4539  face in every level of a subdivision object, and the transformation
    4540  is an isometry (rotation, translation, ...), a uniform scale, or a
    4541  composition of these types, then set
    4542  bTransformationSavedSubdivisionPoint = true to apply the
    4543  transformation to saved subdivision and saved limit point information.
    4544  In all other cases, set bTransformationSavedSubdivisionPoint = false
    4545  and any saved subdivision points or saved limit points will be
    4546  deleted. When in doubt, pass false.
    4547 
    4548  xform - [in]
    4549  */
    4550  bool Transform(
    4551  bool bTransformationSavedSubdivisionPoint,
    4552  const class ON_Xform& xform
    4553  );
    4554 
    4555  ON_BoundingBox ControlNetBoundingBox() const;
    4556  ON_BoundingBox LimitSurfaceBoundingBox(
    4557  const ON_SubD& subd
    4558  ) const;
    4559 
    4560 
    4561  /*
    4562  Description:
    4563  Call this function if the edge is modified and it will clear any
    4564  cached subdivision information that needs to be recalculated.
    4565  */
    4566  void EdgeModifiedNofification() const;
    4567 
    4568 
    4569 public:
    4570  ON_COMPONENT_INDEX ComponentIndex() const;
    4571  ON_SubDComponentPtr ComponentPtr() const;
    4572 
    4573 public:
    4574  const class ON_SubDEdge* m_prev_edge = nullptr; // linked list of edges on this level
    4575  const class ON_SubDEdge* m_next_edge = nullptr; // linked list of edges on this level
    4576 
    4577 public:
    4578  // When checking the edge tag, it is important to consider what
    4579  // should happen in the ON_SubD::EdgeTag::X case. It is strongly
    4580  // suggested that you use the member functions ON_SubDEdge::IsSmooth()
    4581  // and ON_SubDEdge::IsCrease() instead of comparing m_edge_tag to
    4582  // ON_SubD::EdgeTag values.
    4583  ON_SubD::EdgeTag m_edge_tag = ON_SubD::EdgeTag::Unset;
    4584 
    4585 private:
    4586  unsigned char m_reserved1 = 0;
    4587  unsigned short m_reserved2 = 0;
    4588 
    4589 public:
    4590  // Array of m_face_count faces.
    4591  //
    4592  // The first two are in m_face2[0] and m_face2[1].
    4593  // When m_face_count > 3, the third and additional faces
    4594  // are in m_facex[0], ..., m_facex[m_face_count-3];
    4595  //
    4596  // The value of ON_SubDFacePtr.FaceDirection() is 0 if the
    4597  // edge's natural orientation from m_vertex[0] to m_vertex[1]
    4598  // agrees with the face's boundary orientation.
    4599  //
    4600  // The value of ON_SubDFacePtr.FaceDirection() is 1 if the
    4601  // edge's natural orientation from m_vertex[0] to m_vertex[1]
    4602  // is opposited the face's boundary orientation.
    4603  static const unsigned int MaximumFaceCount;
    4604  unsigned short m_face_count = 0;
    4605  unsigned short m_facex_capacity = 0;
    4606  ON_SubDFacePtr m_face2[2];
    4607  ON_SubDFacePtr* m_facex = nullptr;
    4608 
    4609  // m_vertex[0] = vertex at the start of the edge.
    4610  // m_vertex[1] = vertex at the end of the edge.
    4611  const class ON_SubDVertex* m_vertex[2];
    4612 
    4613  // If the value of vertex->m_vertex_tag is not ON_SubD::VertexTag::Smooth,
    4614  // then that vertex is "tagged".
    4615  //
    4616  // If the value of m_edge_tag is ON_SubD::EdgeTag::Crease,
    4617  // then m_sector_coefficient[] should be {0,0}.
    4618  // In any case m_sector_coefficient[] values are ignored and the
    4619  // midpoint of the edge is the location of the edge.s subdivision point.
    4620  // The edge's subdivision vertex will be tagged as ON_SubD::VertexTag::Crease
    4621  // and both subdivision edges will be tagged as ON_SubD::EdgeTag::Crease.
    4622  //
    4623  // If the value of m_edge_tag is ON_SubD::EdgeTag::Smooth
    4624  // and neither end vertex is tagged, then m_sector_coefficient[] should be {0,0}.
    4625  // In any case m_sector_coefficient[] values are ignored on smooth edges
    4626  // with smooth vertices at both ends.
    4627  // The edge's subdivision vertex will be tagged as ON_SubD::VertexTag::Smooth
    4628  // and both subdivision edges will be tagged as ON_SubD::EdgeTag::Smooth.
    4629  //
    4630  // If the value of m_edge_tag is ON_SubD::EdgeTag::Smooth and
    4631  // exactly one end vertex is tagged, then the m_sector_coefficient[]
    4632  // value for the tagged end is calculated by ON_SubDSectorType::SectorWeight().
    4633  // tagged_weight*tagged_vertex + (1.0 - tagged_weight)*untagged_vertex
    4634  // is used when combining the edge ends.
    4635  // The edge's subdivision vertex will be tagged as ON_SubD::VertexTag::Smooth
    4636  // and both subdivision edges will be tagged as ON_SubD::EdgeTag::Smooth.
    4637  //
    4638  // If the value of m_edge_tag is ON_SubD::EdgeTag::X, then the edge
    4639  // must have exactly two neighboring faces,
    4640  // both vertices must be tagged and the m_sector_coefficient[]
    4641  // values are calculated by ON_SubDSectorType::SectorWeight().
    4642  // When the edge is subdivided, the midpoint of the edge is the
    4643  // location of the edge.s subdivision point.
    4644  // The edge's subdivision vertex will be tagged as ON_SubD::VertexTag::Smooth
    4645  // and both subdivision edges will be tagged as ON_SubD::EdgeTag::Smooth.
    4646  //
    4647  // If the value of m_edge_tag is ON_SubD::EdgeTag::Smooth
    4648  // and both end vertices are tagged, that is a severe error
    4649  // condition and the edge is subdivided at its midpoint.
    4650  //
    4651  // If the value of m_edge_tag is ON_SubD::EdgeTag::X
    4652  // and both end vertices are not tagged, that is a severe error
    4653  // condition and the edge is subdivided at its midpoint.
    4654  double m_sector_coefficient[2];
    4655 
    4656  // If m_edge_tag is not ON_SubD::EdgeTag::Sharp, then m_sharpness is ignored.
    4657  // If m_edge_tag is ON_SubD::EdgeTag::Sharp, then m_sharpness controls how hard/soft
    4658  // the edge appears.
    4659  // The behavior of a "sharp" edge with m_sharpness = 1 is identical to a crease edge.
    4660  // A "sharp" edge with m_sharpness = 0 is identical to a smooth edge.
    4661  // For this reason, m_sharpness must be > 0 and < 1.
    4662  double m_sharpness = 0.0;
    4663 
    4664 public:
    4665  unsigned int FaceCount() const;
    4666 
    4667  ON_SubDFacePtr FacePtr(
    4668  unsigned int i
    4669  ) const;
    4670 
    4671  ON_SubDFacePtr FacePtr(
    4672  const class ON_SubDFace* f
    4673  ) const;
    4674 
    4675  const class ON_SubDFace* Face(
    4676  unsigned int i
    4677  ) const;
    4678 
    4679  ON__UINT_PTR FaceDirection(
    4680  unsigned int i
    4681  ) const;
    4682 
    4683  unsigned int FaceArrayIndex(
    4684  const class ON_SubDFace* f
    4685  ) const;
    4686 
    4687  /*
    4688  Description:
    4689  Expert user tool to remove a face from the edges's face array.
    4690  Remarks:
    4691  Does not modify the face. If the edge is referenced in the face's edge array,
    4692  then the edge must be removed from the face's edge array.
    4693  */
    4694  bool RemoveFaceFromArray(
    4695  const ON_SubDFace* f
    4696  );
    4697 
    4698  /*
    4699  Description:
    4700  Expert user tool to remove a face from the edges's face array.
    4701  Remarks:
    4702  Does not modify the face. If the edge is referenced in the face's edge array,
    4703  then the edge must be removed from the face's edge array.
    4704  */
    4705  bool RemoveFaceFromArray(
    4706  unsigned int i,
    4707  ON_SubDFacePtr& removed_face
    4708  );
    4709 
    4710  /*
    4711  Description:
    4712  Expert user tool to add a face from the edges's face array.
    4713  Remarks:
    4714  Does not modify the face. If the edge is not referenced in the face's edge array,
    4715  then the edge must be inserted in the correct location in the faces array.
    4716  If you are creating a non-manifold SubD, you must first reserve m_facex[]
    4717  capacity by calling ON_SubD::GrowEdgeFaceArray().
    4718  */
    4719  bool AddFaceToArray(
    4720  ON_SubDFacePtr face_ptr
    4721  );
    4722 
    4723  const class ON_SubDVertex* Vertex(
    4724  unsigned int i
    4725  ) const;
    4726 
    4727  /*
    4728  Description:
    4729  Return the vertex at the other end of the edge.
    4730  Parameters:
    4731  vertex - [in]
    4732  A vertex referenced in the edge's m_vertex[] array.
    4733  Returns:
    4734  If vertex is not nullptr and exactly one of m_vertex[] is equal to vertex,
    4735  then the other m_vertex[] pointer is returned.
    4736  In any other case, nullptr is returned.
    4737  */
    4738  const ON_SubDVertex* OtherEndVertex(
    4739  const ON_SubDVertex* vertex
    4740  ) const;
    4741 
    4742  /*
    4743  Description:
    4744  Return the neighboring face.
    4745  Parameters:
    4746  face - [in]
    4747  A face referenced in the edge's m_face2[] array.
    4748  bStopAtCrease - [in]
    4749  If true and if m_edge_tag = ON_SubD::EdgeTag::Crease,
    4750  then nullptr is returned.
    4751  Returns:
    4752  If the m_face_count = 2,
    4753  m_edge_tag is smooth or x or passes the crease tag test,
    4754  one of m_face2[0,1] points a face, then
    4755  the neighboring face is returned.
    4756  In any other case, nullptr is returned.
    4757  */
    4758  const ON_SubDFace* NeighborFace(
    4759  const ON_SubDFace* face,
    4760  bool bStopAtCrease
    4761  ) const;
    4762 
    4763  /*
    4764  Description:
    4765  Return the neighboring face.
    4766  Parameters:
    4767  face - [in]
    4768  A face referenced in the edge's m_face2[] array.
    4769  bStopAtCrease - [in]
    4770  If true and if m_edge_tag = ON_SubD::EdgeTag::Crease,
    4771  then nullptr is returned.
    4772  Returns:
    4773  If the m_face_count = 2,
    4774  m_edge_tag is smooth or x or passes the crease tag test,
    4775  one of m_face2[0,1] points a face, then
    4776  the neighboring face is returned.
    4777  In any other case, ON_SubDFacePtr::Null is returned.
    4778  */
    4779  const ON_SubDFacePtr NeighborFacePtr(
    4780  const ON_SubDFace* face,
    4781  bool bStopAtCrease
    4782  ) const;
    4783 
    4784 
    4785 
    4786  /*
    4787  Returns:
    4788  True if m_edge_tag is ON_SubD::EdgeTag::Smooth.
    4789  bEdgeTagXresult if m_edge_tag is ON_SubD::EdgeTag::X.
    4790  False in all other cases.
    4791  */
    4792  bool IsSmooth(
    4793  bool bEdgeTagXresult
    4794  ) const;
    4795 
    4796  /*
    4797  Returns:
    4798  True if m_edge_tag is ON_SubD::EdgeTag::Crease.
    4799  bEdgeTagXresult if m_edge_tag is ON_SubD::EdgeTag::X.
    4800  False in all other cases.
    4801  */
    4802  bool IsCrease(
    4803  bool bEdgeTagXresult
    4804  ) const;
    4805 
    4806  /*
    4807  Returns:
    4808  0: end vertices are not tagged as darts
    4809  1: one end vertex is tagged as a dart.
    4810  2: both end vertices are tagged as a darts.
    4811  */
    4812  unsigned int DartCount() const;
    4813 
    4814  /*
    4815  Returns:
    4816  bitwise or of applicable ON_ComponentAttributes::EdgeFlags values.
    4817  */
    4818  unsigned int EdgeFlags() const;
    4819 
    4820  /*
    4821  Parameters:
    4822  subdivision_point_type - [in]
    4823  Selects subdivision algorithm. Must be either
    4824  ON_SubD::SubDType::TriLoopWarren or ON_SubD::SubDType::QuadCatmullClark.
    4825  bUseSavedSubdivisionPoint - [in]
    4826  If there is a saved subdivision point and bUseSavedSubdivisionPoint
    4827  is true, then the saved value is returned.
    4828  subdivision_point - [out]
    4829  Returns:
    4830  true if successful
    4831  */
    4832  bool GetSubdivisionPoint(
    4833  ON_SubD::SubDType subdivision_point_type,
    4834  bool bUseSavedSubdivisionPoint,
    4835  double subdivision_point[3]
    4836  ) const;
    4837 
    4838  /*
    4839  Parameters:
    4840  edge_vertex_index - [in]
    4841  0 or 1
    4842  edge_ptr0 - [out]
    4843  edge_ptr1 - [out]
    4844  Crease edges that bound the sector containing this edge.
    4845  The direction value of the edge pointer identifies the end
    4846  of the sector boundary edge this->at m_vertex[edge_vertex_index].
    4847  Returns:
    4848  Number of faces in the sector.
    4849  */
    4850  unsigned int GetSectorBoundaryEdges(
    4851  unsigned int edge_vertex_index,
    4852  ON_SubDEdgePtr* edge_ptr0,
    4853  ON_SubDEdgePtr* edge_ptr1
    4854  ) const;
    4855 
    4856  /*
    4857  Returns:
    4858  0: m_vertex[0] is tagged and m_vertex[1] is not tagged.
    4859  1: m_vertex[0] is tagged and m_vertex[1] is not tagged.
    4860  2: m_vertex[0] and m_vertex[1] are both tagged.
    4861  3: neither m_vertex[0] nor m_vertex[1] is tagged.
    4862  */
    4863  unsigned int TaggedEndIndex() const;
    4864 
    4865 private:
    4866  static unsigned int GetFacePointSum(
    4867  const ON_SubDFace* face,
    4868  const ON_SubDEdge* edge,
    4869  double* facePsum // sum of face vertex points not on the edge
    4870  );
    4871 
    4872 private:
    4873  friend class ON_SubDArchiveIdMap;
    4874  void CopyFrom(
    4875  const ON_SubDEdge* src,
    4876  bool bReverseEdge,
    4877  bool bCopyVertexArray,
    4878  bool bCopyFaceArray
    4879  );
    4880 };
    4881 
    4882 //////////////////////////////////////////////////////////////////////////
    4883 //
    4884 // ON_SubDFace
    4885 //
    4886 class ON_SUBD_CLASS ON_SubDFace : public ON_SubDComponentBase
    4887 {
    4888 public:
    4889  static const ON_SubDFace Empty;
    4890 
    4891  bool Write (
    4892  class ON_BinaryArchive& archive
    4893  ) const;
    4894 
    4895  static bool Read (
    4896  class ON_BinaryArchive& archive,
    4897  class ON_SubD& subd,
    4898  class ON_SubDFace*& face
    4899  );
    4900 
    4901  /*
    4902  Description:
    4903  Apply a tranxfomration matrix to vertex geometry information.
    4904 
    4905  Parameters:
    4906  bTransformationSavedSubdivisionPoint - [in]
    4907  If the transformation is being applied to every vertex, edge and
    4908  face in every level of a subdivision object, and the transformation
    4909  is an isometry (rotation, translation, ...), a uniform scale, or a
    4910  composition of these types, then set
    4911  bTransformationSavedSubdivisionPoint = true to apply the
    4912  transformation to saved subdivision and saved limit point information.
    4913  In all other cases, set bTransformationSavedSubdivisionPoint = false
    4914  and any saved subdivision points or saved limit points will be
    4915  deleted. When in doubt, pass false.
    4916 
    4917  xform - [in]
    4918  */
    4919  bool Transform(
    4920  bool bTransformationSavedSubdivisionPoint,
    4921  const class ON_Xform& xform
    4922  );
    4923 
    4924  ON_BoundingBox ControlNetBoundingBox() const;
    4925  ON_BoundingBox LimitSurfaceBoundingBox(
    4926  const ON_SubD& subd
    4927  ) const;
    4928 
    4929 
    4930  ON_COMPONENT_INDEX ComponentIndex() const;
    4931  ON_SubDComponentPtr ComponentPtr() const;
    4932 
    4933  /*
    4934  Description:
    4935  Call this function if the face is modified and it will clear any
    4936  cached subdivision information that needs to be recalculated.
    4937  */
    4938  void FaceModifiedNofification() const;
    4939 
    4940 
    4941 public:
    4942  const class ON_SubDFace* m_prev_face = nullptr; // linked list of faces on this level
    4943  const class ON_SubDFace* m_next_face = nullptr; // linked list of faces on this level
    4944 
    4945 public:
    4946  unsigned int m_zero_face_id = 0; // id of level zero face
    4947  unsigned int m_parent_face_id = 0; // id of previous level face
    4948 
    4949 private:
    4950  unsigned int m_reserved = 0; // id of previous level face
    4951 
    4952 public:
    4953  // Array of m_edge_count edges that form the boundary of the face.
    4954  // The edges are in ordered to form a continuous loop.
    4955  //
    4956  // The first four are in m_edge4[0], ..., m_edge4[3].
    4957  // When m_edge_count > 4, the fifth and additional edges
    4958  // are in m_edgex[0], ..., m_edgex[m_edge_count-5];
    4959  //
    4960  // The value of ON_SubDEdgePtr.EdgeDirection() is 0 if the
    4961  // edge's natural orientation from m_vertex[0] to m_vertex[1]
    4962  // agrees with the face's boundary orientation.
    4963  //
    4964  // The value of ON_SubDEdgePtr.EdgeDirection() is 1 if the
    4965  // edge's natural orientation from m_vertex[0] to m_vertex[1]
    4966  // is opposited the face's boundary orientation.
    4967  static const unsigned int MaximumEdgeCount;
    4968  unsigned short m_edge_count = 0;
    4969  unsigned short m_edgex_capacity = 0;
    4970 
    4971  ON_SubDEdgePtr m_edge4[4];
    4972  ON_SubDEdgePtr* m_edgex = nullptr;
    4973 
    4974 public:
    4975  unsigned int EdgeCount() const;
    4976 
    4977  ON_SubDEdgePtr EdgePtr(
    4978  unsigned int i
    4979  ) const;
    4980 
    4981  ON_SubDEdgePtr EdgePtr(
    4982  const class ON_SubDEdge* e
    4983  ) const;
    4984 
    4985  const class ON_SubDVertex* Vertex(
    4986  unsigned int i
    4987  ) const;
    4988 
    4989  unsigned int VertexIndex(
    4990  const ON_SubDVertex* vertex
    4991  ) const;
    4992 
    4993  const class ON_SubDEdge* Edge(
    4994  unsigned int i
    4995  ) const;
    4996 
    4997  ON__UINT_PTR EdgeDirection(
    4998  unsigned int i
    4999  ) const;
    5000 
    5001  unsigned int EdgeArrayIndex(
    5002  const ON_SubDEdge* e
    5003  ) const;
    5004 
    5005  /*
    5006  Description:
    5007  Expert user tool to remove an edge from the face's edge array.
    5008  Remarks:
    5009  Does not modify the edge. If the face is referenced in the edge's face array,
    5010  then the face must be removed from the edge's face array.
    5011  */
    5012  bool RemoveEdgeFromArray(
    5013  const ON_SubDEdge* e
    5014  );
    5015 
    5016  /*
    5017  Description:
    5018  Expert user tool to remove an edge from the face's edge array.
    5019  Remarks:
    5020  Does not modify the edge. If the face is referenced in the edge's face array,
    5021  then the face must be removed from the edge's face array.
    5022  */
    5023  bool RemoveEdgeFromArray(
    5024  unsigned int i,
    5025  ON_SubDEdgePtr& removed_edge
    5026  );
    5027 
    5028  /*
    5029  Description:
    5030  Expert user tool to replace one edge with another in the face's edge array.
    5031  Parameters:
    5032  edge_to_remove - [in]
    5033  edge_to_insert - [in]
    5034  The inserted edge is assigned the same boundary orientation as the
    5035  removed edge.
    5036  Remarks:
    5037  Does not modify the edge. The corresponding reference to this face must
    5038  be removed from the first edge and added to the second edge.
    5039  */
    5040  bool ReplaceEdgeInArray(
    5041  unsigned int fei0,
    5042  ON_SubDEdge* edge_to_remove,
    5043  ON_SubDEdge* edge_to_insert
    5044  );
    5045 
    5046  /*
    5047  Description:
    5048  Expert user tool to replace one edge with another in the face's edge array.
    5049  Parameters:
    5050  edge_to_remove - [in]
    5051  edge_to_insert - [in]
    5052  The inserted edge is assigned the same boundary orientation specified
    5053  in edgeptr_to_insert.
    5054  Remarks:
    5055  Does not modify the edge. The corresponding reference to this face must
    5056  be removed from the first edge and added to the second edge.
    5057  */
    5058  bool ReplaceEdgeInArray(
    5059  unsigned int fei0,
    5060  ON_SubDEdge* edge_to_remove,
    5061  ON_SubDEdgePtr edgeptr_to_insert
    5062  );
    5063 
    5064  const ON_SubDEdge* PrevEdge(
    5065  const ON_SubDEdge* edge
    5066  ) const;
    5067 
    5068  const ON_SubDEdge* NextEdge(
    5069  const ON_SubDEdge* edge
    5070  ) const;
    5071 
    5072  unsigned int PrevEdgeArrayIndex(
    5073  unsigned int edge_array_index
    5074  ) const;
    5075 
    5076  unsigned int NextEdgeArrayIndex(
    5077  unsigned int edge_array_index
    5078  ) const;
    5079 
    5080  /*
    5081  Description:
    5082  If the face is a quad, get the opposite corner vertex.
    5083  Parameters:
    5084  vertex - [in]
    5085  a vertex on this face.
    5086  Returns:
    5087  If the face is a quad and vertex is a vertex of the face, then
    5088  the vertex on the opposite corner is returned.
    5089  Otherwise, nullptr is returned.
    5090  */
    5091  const ON_SubDVertex* QuadOppositeVertex(
    5092  const ON_SubDVertex* vertex
    5093  ) const;
    5094 
    5095  /*
    5096  Description:
    5097  If the face is a quad, get the opposite side edge.
    5098  Parameters:
    5099  edge - [in]
    5100  an edge on this face.
    5101  Returns:
    5102  If the face is a quad and edge is an edge of the face, then
    5103  the edge on the opposite side is returned.
    5104  Otherwise, nullptr is returned.
    5105  */
    5106  const ON_SubDEdge* QuadOppositeEdge(
    5107  const ON_SubDEdge* edge
    5108  ) const;
    5109 
    5110  ///*
    5111  //Parameters:
    5112  // subd_type - [in]
    5113  // bTestFaces - [in]
    5114  // If true, then false is returned if any neighboring face is not
    5115  // a quad (ccquad subdivision type) or tri (lwtri subdivsion type).
    5116  //*/
    5117  //bool IsOrdinary(
    5118  // ON_SubD::SubDType subd_type,
    5119  // bool bTestFaces
    5120  // ) const;
    5121 
    5122  /*
    5123  Parameters:
    5124  subdivision_point_type - [in]
    5125  Selects subdivision algorithm. Must be either
    5126  ON_SubD::SubDType::TriLoopWarren or ON_SubD::SubDType::QuadCatmullClark.
    5127  bUseSavedSubdivisionPoint - [in]
    5128  If there is a saved subdivision point and bUseSavedSubdivisionPoint
    5129  is true, then the saved value is returned.
    5130  subdivision_point - [out]
    5131  The average of the face vertex locations.
    5132  Returns:
    5133  true if successful
    5134  */
    5135  bool GetSubdivisionPoint(
    5136  ON_SubD::SubDType subdivision_point_type,
    5137  bool bUseSavedSubdivisionPoint,
    5138  double subdivision_point[3]
    5139  ) const;
    5140 
    5141  /*
    5142  Description:
    5143  Reverse the order and orientation of the edges that form
    5144  the boundary of this face.
    5145  */
    5146  bool ReverseEdgeList();
    5147 
    5148  /*
    5149  Description:
    5150  Get the bicubic b-spline control points for the limit surface.
    5151  The corresponding knots are uniform.
    5152  Parameters:
    5153  vertex - [in]
    5154  limit_surface_cv_stride0 - [int]
    5155  limit_surface_cv_stride1 - [out]
    5156  limit_surface_cv - [out]
    5157  control points for a cubic spline surface
    5158  CV[i][j][k] = limit_surface_cv[i*limit_bspline_cv_stride0 + j*limit_bspline_cv_stride1 + k]
    5159  0 <= i < 4, 0 <= j < 4, 0 <= k < 3
    5160  Returns:
    5161  true if successful
    5162  false if the limit surface for this face is not a cubic surface
    5163  Remarks:
    5164  The knots for the bicubic b-spline surface are uniform.
    5165  */
    5166  bool GetQuadLimitSurface(
    5167  size_t limit_surface_cv_stride0,
    5168  size_t limit_surface_cv_stride1,
    5169  double* limit_surface_cv
    5170  ) const;
    5171 
    5172  bool GetQuadLimitSurface(
    5173  class ON_NurbsSurface& limit_surface
    5174  ) const;
    5175 
    5176  bool GetQuadLimitSurface(
    5177  class ON_BezierSurface& limit_surface
    5178  ) const;
    5179 
    5180 private:
    5181  friend class ON_SubDArchiveIdMap;
    5182  void CopyFrom(
    5183  const ON_SubDFace* src,
    5184  bool bCopyEdgeArray
    5185  );
    5186 };
    5187 
    5188 //////////////////////////////////////////////////////////////////////////
    5189 //
    5190 // ON_SubDVertexArray
    5191 //
    5192 class ON_SUBD_CLASS ON_SubDVertexArray
    5193 {
    5194 public:
    5195  ON_SubDVertexArray(
    5196  const ON_SubD& subd
    5197  );
    5198  ON_SubDVertexArray() = default;
    5199  ON_SubDVertexArray(const ON_SubDVertexArray&) = default;
    5200  ON_SubDVertexArray& operator=(const ON_SubDVertexArray&) = default;
    5201 
    5202 #if defined(ON_HAS_RVALUEREF)
    5203  // rvalue copy constructor
    5204  ON_SubDVertexArray(ON_SubDVertexArray&&) ON_NOEXCEPT;
    5205 
    5206  // rvalue copy operator-=
    5207  ON_SubDVertexArray& operator=(ON_SubDVertexArray&&);
    5208 #endif
    5209 
    5210  const ON_SubD& SubD() const
    5211  {
    5212  return m_subd;
    5213  }
    5214 
    5215  unsigned int VertexCount() const
    5216  {
    5217  return m_vertex_count;
    5218  }
    5219 
    5220  const class ON_SubDVertex* operator[](unsigned int i) const
    5221  {
    5222  return (i < m_vertex_count) ? m_a[i] : nullptr;
    5223  }
    5224 
    5225 private:
    5226  ON_SubD m_subd;
    5227  const class ON_SubDVertex*const* m_a = nullptr;
    5228  unsigned int m_vertex_count = 0;
    5229 
    5230 #pragma ON_PRAGMA_WARNING_PUSH
    5231 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    5232  // C4251: ... needs to have dll-interface to be used by clients of class ...
    5233  // m_sp is private and all code that manages m_sp is explicitly implemented in the DLL.
    5234 private:
    5235  std::shared_ptr< const class ON_SubDVertex* > m_sp;
    5236 #pragma ON_PRAGMA_WARNING_POP
    5237 };
    5238 
    5239 //////////////////////////////////////////////////////////////////////////
    5240 //
    5241 // ON_SubDEdgeArray
    5242 //
    5243 class ON_SUBD_CLASS ON_SubDEdgeArray
    5244 {
    5245 public:
    5246  ON_SubDEdgeArray(
    5247  const ON_SubD& subd
    5248  );
    5249  ON_SubDEdgeArray() = default;
    5250  ON_SubDEdgeArray(const ON_SubDEdgeArray&) = default;
    5251  ON_SubDEdgeArray& operator=(const ON_SubDEdgeArray&) = default;
    5252 
    5253 #if defined(ON_HAS_RVALUEREF)
    5254  // rvalue copy constructor
    5255  ON_SubDEdgeArray(ON_SubDEdgeArray&&) ON_NOEXCEPT;
    5256 
    5257  // rvalue copy operator-=
    5258  ON_SubDEdgeArray& operator=(ON_SubDEdgeArray&&);
    5259 #endif
    5260 
    5261  const ON_SubD& SubD() const
    5262  {
    5263  return m_subd;
    5264  }
    5265 
    5266  unsigned int EdgeCount() const
    5267  {
    5268  return m_edge_count;
    5269  }
    5270 
    5271  const class ON_SubDEdge* operator[](unsigned int i) const
    5272  {
    5273  return (i < m_edge_count) ? m_a[i] : nullptr;
    5274  }
    5275 
    5276 private:
    5277  ON_SubD m_subd;
    5278  const class ON_SubDEdge*const* m_a = nullptr;
    5279  unsigned int m_edge_count = 0;
    5280 
    5281 #pragma ON_PRAGMA_WARNING_PUSH
    5282 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    5283  // C4251: ... needs to have dll-interface to be used by clients of class ...
    5284  // m_sp is private and all code that manages m_sp is explicitly implemented in the DLL.
    5285 private:
    5286  std::shared_ptr< const class ON_SubDEdge* > m_sp;
    5287 #pragma ON_PRAGMA_WARNING_POP
    5288 };
    5289 
    5290 //////////////////////////////////////////////////////////////////////////
    5291 //
    5292 // ON_SubDFaceArray
    5293 //
    5294 class ON_SUBD_CLASS ON_SubDFaceArray
    5295 {
    5296 public:
    5297  ON_SubDFaceArray(
    5298  const ON_SubD& subd
    5299  );
    5300  ON_SubDFaceArray() = default;
    5301  ON_SubDFaceArray(const ON_SubDFaceArray&) = default;
    5302  ON_SubDFaceArray& operator=(const ON_SubDFaceArray&) = default;
    5303 
    5304 #if defined(ON_HAS_RVALUEREF)
    5305  // rvalue copy constructor
    5306  ON_SubDFaceArray(ON_SubDFaceArray&&) ON_NOEXCEPT;
    5307 
    5308  // rvalue copy operator-=
    5309  ON_SubDFaceArray& operator=(ON_SubDFaceArray&&);
    5310 #endif
    5311 
    5312  const ON_SubD& SubD() const
    5313  {
    5314  return m_subd;
    5315  }
    5316 
    5317  unsigned int FaceCount() const
    5318  {
    5319  return m_face_count;
    5320  }
    5321 
    5322  const class ON_SubDFace* operator[](unsigned int i) const
    5323  {
    5324  return (i < m_face_count) ? m_a[i] : nullptr;
    5325  }
    5326 
    5327 private:
    5328  ON_SubD m_subd;
    5329  const class ON_SubDFace*const* m_a = nullptr;
    5330  unsigned int m_face_count = 0;
    5331 
    5332 #pragma ON_PRAGMA_WARNING_PUSH
    5333 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    5334  // C4251: ... needs to have dll-interface to be used by clients of class ...
    5335  // m_sp is private and all code that manages m_sp is explicitly implemented in the DLL.
    5336 private:
    5337  std::shared_ptr< const class ON_SubDFace* > m_sp;
    5338 #pragma ON_PRAGMA_WARNING_POP
    5339 };
    5340 
    5341 //////////////////////////////////////////////////////////////////////////
    5342 //
    5343 // ON_SubDVertexIterator
    5344 //
    5345 class ON_SUBD_CLASS ON_SubDVertexIterator
    5346 {
    5347 public:
    5348  // The ON_SubD member function
    5349  // ON_SubDVertexIterator ON_SubD::VertexIterator(subd_level_index)
    5350  // is the best way to get a vertex iterator.
    5351  ON_SubDVertexIterator(
    5352  const class ON_SubD& subd
    5353  );
    5354  ON_SubDVertexIterator(
    5355  const class ON_SubDRef& subd_ref
    5356  );
    5357 
    5358  // Construct and interator that iterates over a single vertex.
    5359  ON_SubDVertexIterator(
    5360  const class ON_SubD& subd,
    5361  const class ON_SubDVertex& vertex
    5362  );
    5363 
    5364  // Construct and interator that iterates over a single vertex.
    5365  ON_SubDVertexIterator(
    5366  const class ON_SubDRef& subd_ref,
    5367  const class ON_SubDVertex& vertex
    5368  );
    5369 
    5370  // Construct and interator that iterates over the vertices of an edge.
    5371  ON_SubDVertexIterator(
    5372  const class ON_SubD& subd,
    5373  const class ON_SubDEdge& edge
    5374  );
    5375 
    5376  // Construct and interator that iterates over the vertices of an edge.
    5377  ON_SubDVertexIterator(
    5378  const class ON_SubDRef& subd_ref,
    5379  const class ON_SubDEdge& edge
    5380  );
    5381 
    5382  // Construct and interator that iterates over the vertices of a face.
    5383  ON_SubDVertexIterator(
    5384  const class ON_SubD& subd,
    5385  const class ON_SubDFace& face
    5386  );
    5387 
    5388  // Construct and interator that iterates over the vertices of a face.
    5389  ON_SubDVertexIterator(
    5390  const class ON_SubDRef& subd_ref,
    5391  const class ON_SubDFace& face
    5392  );
    5393 
    5394  ON_SubDVertexIterator() = default;
    5395  ON_SubDVertexIterator(const ON_SubDVertexIterator&) = default;
    5396  ON_SubDVertexIterator& operator=(const ON_SubDVertexIterator&) = default;
    5397 
    5398 #if defined(ON_HAS_RVALUEREF)
    5399  // rvalue copy constructor
    5400  ON_SubDVertexIterator( ON_SubDVertexIterator&& ) ON_NOEXCEPT;
    5401  // rvalue assignment operator
    5402  ON_SubDVertexIterator& operator=( ON_SubDVertexIterator&& );
    5403 #endif
    5404 
    5405  /*
    5406  Returns:
    5407  The subD object for this iterator.
    5408  */
    5409  const class ON_SubD& SubD() const
    5410  {
    5411  return m_subd_ref.SubD();
    5412  }
    5413 
    5414  const class ON_SubDRef& SubDRef() const
    5415  {
    5416  return m_subd_ref;
    5417  }
    5418 
    5419  /*
    5420  Description:
    5421  Increment the iterator.
    5422  Returns:
    5423  Current vertex.
    5424  Remarks:
    5425  operator++ and NextVertex() behave differently.
    5426  */
    5427  const class ON_SubDVertex* operator++()
    5428  {
    5429  const class ON_SubDVertex* v = m_v_current;
    5430  NextVertex();
    5431  return v;
    5432  }
    5433 
    5434  /*
    5435  Return:
    5436  Number of vertices this iterator will iterate through.
    5437  */
    5438  unsigned int VertexCount() const
    5439  {
    5440  return m_vertex_count;
    5441  }
    5442 
    5443  /*
    5444  Return:
    5445  Interator index of the current vertex.
    5446  */
    5447  unsigned int CurrentVertexIndex() const
    5448  {
    5449  return m_vertex_index;
    5450  }
    5451 
    5452  /*
    5453  Description:
    5454  Set the iterator to the beginning of the vertex list.
    5455  Returns:
    5456  First vertex in the list.
    5457  */
    5458  const class ON_SubDVertex* FirstVertex()
    5459  {
    5460  m_vertex_index = 0;
    5461  return (m_v_current = m_v_first);
    5462  }
    5463 
    5464  /*
    5465  Description:
    5466  Increment the iterator.
    5467  Returns:
    5468  Next vertex.
    5469  Remarks:
    5470  operator++ and NextVertex() behave differently.
    5471  */
    5472  const class ON_SubDVertex* NextVertex()
    5473  {
    5474  m_vertex_index++;
    5475  if (m_vertex_index < m_vertex_count)
    5476  {
    5477  if (0 == m_component_ptr.m_ptr)
    5478  {
    5479  if (nullptr != m_v_current)
    5480  m_v_current = m_v_current->m_next_vertex;
    5481  }
    5482  else
    5483  {
    5484  const ON_SubDEdge* edge = m_component_ptr.Edge();
    5485  if (nullptr != edge)
    5486  {
    5487  m_v_current = edge->Vertex(m_vertex_index);
    5488  }
    5489  else
    5490  {
    5491  const ON_SubDFace* face = m_component_ptr.Face();
    5492  if (nullptr != face)
    5493  m_v_current = face->Vertex(m_vertex_index);
    5494  else
    5495  m_v_current = nullptr;
    5496  }
    5497  }
    5498  }
    5499  else
    5500  {
    5501  m_vertex_index = m_vertex_count;
    5502  m_v_current = nullptr;
    5503  }
    5504  return m_v_current;
    5505  }
    5506 
    5507  /*
    5508  Returns:
    5509  Current vertex;
    5510  */
    5511  const class ON_SubDVertex* CurrentVertex() const
    5512  {
    5513  return m_v_current;
    5514  }
    5515 
    5516  /*
    5517  Description:
    5518  Set the iterator to the end of the vertex list.
    5519  Returns:
    5520  Last vertex in the list.
    5521  */
    5522  const class ON_SubDVertex* LastVertex()
    5523  {
    5524  m_vertex_index = (m_vertex_count > 0) ? (m_vertex_count - 1) : 0;
    5525  return (m_v_current = m_v_last);
    5526  }
    5527 
    5528 private:
    5529  void Internal_Init(
    5530  const ON_SubDRef& subd_ref,
    5531  unsigned int vertex_count,
    5532  const ON_SubDVertex* first,
    5533  const ON_SubDVertex* last,
    5534  ON_SubDComponentPtr component_ptr
    5535  );
    5536  ON_SubDRef m_subd_ref;
    5537  const ON_SubDVertex* m_v_first = nullptr;
    5538  const ON_SubDVertex* m_v_last = nullptr;
    5539  const ON_SubDVertex* m_v_current = nullptr;
    5540  unsigned int m_vertex_index = 0;
    5541  unsigned int m_vertex_count = 0;
    5542  ON_SubDComponentPtr m_component_ptr = ON_SubDComponentPtr::Null;
    5543 };
    5544 
    5545 //////////////////////////////////////////////////////////////////////////
    5546 //
    5547 // ON_SubDEdgeIterator
    5548 //
    5549 class ON_SUBD_CLASS ON_SubDEdgeIterator
    5550 {
    5551 public:
    5552  // The ON_SubD member function
    5553  // ON_SubDEdgeIterator ON_SubD::EdgeIterator()
    5554  // is the best way to get an edge iterator from an ON_SubD.
    5555  ON_SubDEdgeIterator(
    5556  const class ON_SubD& subd
    5557  );
    5558 
    5559  // The ON_SubDRef member function
    5560  // ON_SubDEdgeIterator ON_SubDRef::EdgeIterator()
    5561  // is the best way to get an edge iterator from an ON_SubDRef.
    5562  ON_SubDEdgeIterator(
    5563  const class ON_SubDRef& subd_ref
    5564  );
    5565 
    5566  // Construct and interator that iterates over a single edge.
    5567  ON_SubDEdgeIterator(
    5568  const class ON_SubD& subd,
    5569  const class ON_SubDEdge& edge
    5570  );
    5571 
    5572  // Construct and interator that iterates over a single edge.
    5573  ON_SubDEdgeIterator(
    5574  const class ON_SubDRef& subd_ref,
    5575  const class ON_SubDEdge& edge
    5576  );
    5577 
    5578  // Construct and interator that iterates over the edges of a vertex.
    5579  ON_SubDEdgeIterator(
    5580  const class ON_SubD& subd,
    5581  const class ON_SubDVertex& vertex
    5582  );
    5583 
    5584  // Construct and interator that iterates over the edges of a vertex.
    5585  ON_SubDEdgeIterator(
    5586  const class ON_SubDRef& subd_ref,
    5587  const class ON_SubDVertex& vertex
    5588  );
    5589 
    5590  // Construct and interator that iterates over the edges of a face.
    5591  ON_SubDEdgeIterator(
    5592  const class ON_SubD& subd,
    5593  const class ON_SubDFace& face
    5594  );
    5595 
    5596  // Construct and interator that iterates over the edges of a face.
    5597  ON_SubDEdgeIterator(
    5598  const class ON_SubDRef& subd_ref,
    5599  const class ON_SubDFace& face
    5600  );
    5601 
    5602  ON_SubDEdgeIterator() = default;
    5603  ON_SubDEdgeIterator(const ON_SubDEdgeIterator&) = default;
    5604  ON_SubDEdgeIterator& operator=(const ON_SubDEdgeIterator&) = default;
    5605 
    5606 #if defined(ON_HAS_RVALUEREF)
    5607  // rvalue copy constructor
    5608  ON_SubDEdgeIterator( ON_SubDEdgeIterator&& ) ON_NOEXCEPT;
    5609  // rvalue assignment operator
    5610  ON_SubDEdgeIterator& operator=( ON_SubDEdgeIterator&& );
    5611 #endif
    5612 
    5613  /*
    5614  Returns:
    5615  The subD object for this iterator.
    5616  */
    5617  const class ON_SubD& SubD() const
    5618  {
    5619  return m_subd_ref.SubD();
    5620  }
    5621 
    5622  const class ON_SubDRef& SubDRef() const
    5623  {
    5624  return m_subd_ref;
    5625  }
    5626 
    5627  /*
    5628  Description:
    5629  Increment the iterator.
    5630  Returns:
    5631  Current edge.
    5632  Remarks:
    5633  operator++ and NextEdge() behave differently.
    5634  */
    5635  const class ON_SubDEdge* operator++()
    5636  {
    5637  const class ON_SubDEdge* e = m_e_current;
    5638  NextEdge();
    5639  return e;
    5640  }
    5641 
    5642  /*
    5643  Return:
    5644  Number of edges this iterator will iterate through.
    5645  */
    5646  unsigned int EdgeCount() const
    5647  {
    5648  return m_edge_count;
    5649  }
    5650 
    5651  /*
    5652  Return:
    5653  Interator index of the current edge.
    5654  */
    5655  unsigned int CurrentEdgeIndex() const
    5656  {
    5657  return m_edge_index;
    5658  }
    5659 
    5660  /*
    5661  Description:
    5662  Set the iterator to the beginning of the edge list.
    5663  Returns:
    5664  First edge in the list.
    5665  */
    5666  const class ON_SubDEdge* FirstEdge()
    5667  {
    5668  m_edge_index = 0;
    5669  return m_e_current = m_e_first;
    5670  }
    5671 
    5672  /*
    5673  Description:
    5674  Increment the iterator.
    5675  Returns:
    5676  Next edge.
    5677  Remarks:
    5678  operator++ and NextEdge() behave differently.
    5679  */
    5680  const class ON_SubDEdge* NextEdge()
    5681  {
    5682  m_edge_index++;
    5683  if (m_edge_index < m_edge_count)
    5684  {
    5685  if (0 == m_component_ptr.m_ptr)
    5686  {
    5687  if (nullptr != m_e_current)
    5688  m_e_current = m_e_current->m_next_edge;
    5689  }
    5690  else
    5691  {
    5692  const ON_SubDVertex* vertex = m_component_ptr.Vertex();
    5693  if (nullptr != vertex)
    5694  {
    5695  m_e_current = vertex->Edge(m_edge_index);
    5696  }
    5697  else
    5698  {
    5699  const ON_SubDFace* face = m_component_ptr.Face();
    5700  if (nullptr != face)
    5701  m_e_current = face->Edge(m_edge_index);
    5702  else
    5703  m_e_current = nullptr;
    5704  }
    5705  }
    5706  }
    5707  else
    5708  {
    5709  m_edge_index = m_edge_count;
    5710  m_e_current = nullptr;
    5711  }
    5712  return m_e_current;
    5713  }
    5714 
    5715  /*
    5716  Returns:
    5717  Current edge;
    5718  */
    5719  const class ON_SubDEdge* CurrentEdge() const
    5720  {
    5721  return m_e_current;
    5722  }
    5723 
    5724  /*
    5725  Description:
    5726  Set the iterator to the end of the edge list.
    5727  Returns:
    5728  Last edge in the list.
    5729  */
    5730  const class ON_SubDEdge* LastEdge()
    5731  {
    5732  m_edge_index = (m_edge_count > 0) ? (m_edge_count - 1) : 0;
    5733  return m_e_current = m_e_last;
    5734  }
    5735 
    5736 private:
    5737  void Internal_Init(
    5738  const ON_SubDRef& subd_ref,
    5739  unsigned int edge_count,
    5740  const ON_SubDEdge* first,
    5741  const ON_SubDEdge* last,
    5742  ON_SubDComponentPtr component_ptr
    5743  );
    5744  ON_SubDRef m_subd_ref;
    5745  const ON_SubDEdge* m_e_first = nullptr;
    5746  const ON_SubDEdge* m_e_last = nullptr;
    5747  const ON_SubDEdge* m_e_current = nullptr;
    5748  unsigned int m_edge_index = 0;
    5749  unsigned int m_edge_count = 0;
    5750  ON_SubDComponentPtr m_component_ptr = ON_SubDComponentPtr::Null;
    5751 };
    5752 
    5753 //////////////////////////////////////////////////////////////////////////
    5754 //
    5755 // ON_SubDFaceIterator
    5756 //
    5757 class ON_SUBD_CLASS ON_SubDFaceIterator
    5758 {
    5759 public:
    5760  // The ON_SubD member function
    5761  // ON_SubDFaceIterator ON_SubD::FaceIterator()
    5762  // is the best way to get a face iterator from an ON_SubD.
    5763  ON_SubDFaceIterator(
    5764  const class ON_SubD& subd
    5765  );
    5766 
    5767  // The ON_SubDRef member function
    5768  // ON_SubDFaceIterator ON_SubDRef::FaceIterator()
    5769  // is the best way to get a face iterator from an ON_SubDRef.
    5770  ON_SubDFaceIterator(
    5771  const class ON_SubDRef& subd_ref
    5772  );
    5773 
    5774  // Construct and interator that iterates over the single face.
    5775  ON_SubDFaceIterator(
    5776  const class ON_SubD& subd,
    5777  const class ON_SubDFace& face
    5778  );
    5779 
    5780  // Construct and interator that iterates over the single face.
    5781  ON_SubDFaceIterator(
    5782  const class ON_SubDRef& subd_ref,
    5783  const class ON_SubDFace& face
    5784  );
    5785 
    5786  // Construct and interator that iterates over the faces of a vertex.
    5787  ON_SubDFaceIterator(
    5788  const class ON_SubD& subd,
    5789  const class ON_SubDVertex& vertex
    5790  );
    5791 
    5792  // Construct and interator that iterates over the faces of a vertex.
    5793  ON_SubDFaceIterator(
    5794  const class ON_SubDRef& subd_ref,
    5795  const class ON_SubDVertex& vertex
    5796  );
    5797 
    5798  // Construct and interator that iterates over the faces of an edge.
    5799  ON_SubDFaceIterator(
    5800  const class ON_SubD& subd,
    5801  const class ON_SubDEdge& edge
    5802  );
    5803 
    5804  // Construct and interator that iterates over the faces of an edge.
    5805  ON_SubDFaceIterator(
    5806  const class ON_SubDRef& subd_ref,
    5807  const class ON_SubDEdge& edge
    5808  );
    5809 
    5810  ON_SubDFaceIterator() = default;
    5811  ON_SubDFaceIterator(const ON_SubDFaceIterator&) = default;
    5812  ON_SubDFaceIterator& operator=(const ON_SubDFaceIterator&) = default;
    5813 
    5814 #if defined(ON_HAS_RVALUEREF)
    5815  // rvalue copy constructor
    5816  ON_SubDFaceIterator( ON_SubDFaceIterator&& ) ON_NOEXCEPT;
    5817  // rvalue assignment operator
    5818  ON_SubDFaceIterator& operator=( ON_SubDFaceIterator&& );
    5819 #endif
    5820 
    5821  /*
    5822  Returns:
    5823  The subD object for this iterator.
    5824  */
    5825  const class ON_SubD& SubD() const
    5826  {
    5827  return m_subd_ref.SubD();
    5828  }
    5829 
    5830  const class ON_SubDRef& SubDRef() const
    5831  {
    5832  return m_subd_ref;
    5833  }
    5834 
    5835  /*
    5836  Description:
    5837  Returns the current face and increment the iterator.
    5838  Returns:
    5839  Current face.
    5840  Remarks:
    5841  operator++ and NextFace() behave differently.
    5842  */
    5843  const class ON_SubDFace* operator++()
    5844  {
    5845  const class ON_SubDFace* f = m_face_current;
    5846  NextFace();
    5847  return f;
    5848  }
    5849 
    5850  /*
    5851  Return:
    5852  Number of faces this iterator will iterate through.
    5853  */
    5854  unsigned int FaceCount() const
    5855  {
    5856  return m_face_count;
    5857  }
    5858 
    5859  /*
    5860  Return:
    5861  Interator index of the current face.
    5862  */
    5863  unsigned int CurrentFaceIndex() const
    5864  {
    5865  return m_face_index;
    5866  }
    5867 
    5868 
    5869  /*
    5870  Description:
    5871  Set the iterator to the beginning of the face list.
    5872  Returns:
    5873  First face in the list.
    5874  */
    5875  const class ON_SubDFace* FirstFace()
    5876  {
    5877  m_face_index = 0;
    5878  return (m_face_current = m_face_first);
    5879  }
    5880 
    5881  /*
    5882  Description:
    5883  Returns the next face and incrments the iterator.
    5884  Returns:
    5885  Next face.
    5886  Remarks:
    5887  operator++ and NextFace() behave differently.
    5888  */
    5889  const class ON_SubDFace* NextFace()
    5890  {
    5891  m_face_index++;
    5892  if (m_face_index < m_face_count)
    5893  {
    5894  if (0 == m_component_ptr.m_ptr)
    5895  {
    5896  if (nullptr != m_face_current)
    5897  m_face_current = m_face_current->m_next_face;
    5898  }
    5899  else
    5900  {
    5901  const ON_SubDVertex* vertex = m_component_ptr.Vertex();
    5902  if (nullptr != vertex)
    5903  {
    5904  m_face_current = vertex->Face(m_face_index);
    5905  }
    5906  else
    5907  {
    5908  const ON_SubDEdge* edge = m_component_ptr.Edge();
    5909  if (nullptr != edge)
    5910  m_face_current = edge->Face(m_face_index);
    5911  else
    5912  m_face_current = nullptr;
    5913  }
    5914  }
    5915  }
    5916  else
    5917  {
    5918  m_face_index = m_face_count;
    5919  m_face_current = nullptr;
    5920  }
    5921  return m_face_current;
    5922  }
    5923 
    5924  /*
    5925  Returns:
    5926  Current face;
    5927  */
    5928  const class ON_SubDFace* CurrentFace() const
    5929  {
    5930  return m_face_current;
    5931  }
    5932 
    5933  /*
    5934  Description:
    5935  Set the iterator to the end of the face list.
    5936  Returns:
    5937  Last face in the list.
    5938  */
    5939  const class ON_SubDFace* LastFace()
    5940  {
    5941  m_face_index = (m_face_count > 0) ? (m_face_count - 1) : 0;
    5942  return (m_face_current = m_face_last);
    5943  }
    5944 
    5945  unsigned int LimitSurfaceMeshFragmentCount(
    5946  ON_SubD::FacetType facet_type
    5947  ) const;
    5948 
    5949 private:
    5950  void Internal_Init(
    5951  const ON_SubDRef& subd_ref,
    5952  unsigned int face_count,
    5953  const ON_SubDFace* first,
    5954  const ON_SubDFace* last,
    5955  ON_SubDComponentPtr component_ptr
    5956  );
    5957  ON_SubDRef m_subd_ref;
    5958  const ON_SubDFace* m_face_first = nullptr;
    5959  const ON_SubDFace* m_face_last = nullptr;
    5960  const ON_SubDFace* m_face_current = nullptr;
    5961  unsigned int m_face_index = 0;
    5962  unsigned int m_face_count = 0;
    5963  ON_SubDComponentPtr m_component_ptr = ON_SubDComponentPtr::Null;
    5964 };
    5965 
    5966 //////////////////////////////////////////////////////////////////////////
    5967 //
    5968 // ON_SubDComponentIterator
    5969 //
    5970 class ON_SUBD_CLASS ON_SubDComponentIterator
    5971 {
    5972 public:
    5973  static const ON_SubDComponentIterator Empty;
    5974 
    5975  // The ON_SubD member function
    5976  // ON_SubDComponentIterator ON_SubD::ComponentIterator(subd_level_index)
    5977  // is the best way to get a component iterator for a subd level.
    5978  ON_SubDComponentIterator(
    5979  const class ON_SubD& subd
    5980  );
    5981  ON_SubDComponentIterator(
    5982  const class ON_SubDRef& subd_ref
    5983  );
    5984 
    5985  ON_SubDComponentIterator() = default;
    5986  ON_SubDComponentIterator(const ON_SubDComponentIterator&) = default;
    5987  ON_SubDComponentIterator& operator=(const ON_SubDComponentIterator&) = default;
    5988 
    5989 #if defined(ON_HAS_RVALUEREF)
    5990  // rvalue copy constructor
    5991  ON_SubDComponentIterator( ON_SubDComponentIterator&& ) ON_NOEXCEPT;
    5992  // rvalue assignment operator
    5993  ON_SubDComponentIterator& operator=( ON_SubDComponentIterator&& );
    5994 #endif
    5995 
    5996  /*
    5997  Returns:
    5998  The subD object for this iterator.
    5999  */
    6000  const class ON_SubD& SubD() const
    6001  {
    6002  return m_subd_ref.SubD();
    6003  }
    6004 
    6005  const class ON_SubDRef& SubDRef() const
    6006  {
    6007  return m_subd_ref;
    6008  }
    6009 
    6010  /*
    6011  Returns:
    6012  The subD level for this iterator.
    6013  */
    6014  unsigned int SubDLevel() const
    6015  {
    6016  return m_subd_level;
    6017  }
    6018 
    6019  /*
    6020  Description:
    6021  Returns the current component and increment the iterator.
    6022  Returns:
    6023  Current component.
    6024  Remarks:
    6025  operator++ and NextComponent() behave differently.
    6026  */
    6027  const class ON_SubDComponentPtr operator++()
    6028  {
    6029  const class ON_SubDComponentPtr cptr = m_cptr_current;
    6030  NextComponent();
    6031  return cptr;
    6032  }
    6033 
    6034  /*
    6035  Description:
    6036  Set the iterator to the beginning of the component list.
    6037  Returns:
    6038  First component in the list.
    6039  */
    6040  const class ON_SubDComponentPtr FirstComponent();
    6041 
    6042  /*
    6043  Description:
    6044  Returns the next component and incrments the iterator.
    6045  Returns:
    6046  Next component.
    6047  Remarks:
    6048  operator++ and NextComponent() behave differently.
    6049  */
    6050  const class ON_SubDComponentPtr NextComponent();
    6051 
    6052  /*
    6053  Returns:
    6054  Current component;
    6055  */
    6056  const class ON_SubDComponentPtr CurrentComponent() const
    6057  {
    6058  return m_cptr_current;
    6059  }
    6060 
    6061  /*
    6062  Description:
    6063  Set the iterator to the end of the component list.
    6064  Returns:
    6065  Last component in the list.
    6066  */
    6067  const class ON_SubDComponentPtr LastComponent();
    6068 
    6069 private:
    6070  ON_SubDRef m_subd_ref;
    6071  unsigned int m_subd_level = 0;
    6072  const ON_SubDVertex* m_vertex_first = nullptr;
    6073  const ON_SubDVertex* m_vertex_last = nullptr;
    6074  const ON_SubDEdge* m_edge_first = nullptr;
    6075  const ON_SubDEdge* m_edge_last = nullptr;
    6076  const ON_SubDFace* m_face_first = nullptr;
    6077  const ON_SubDFace* m_face_last = nullptr;
    6078  ON_SubDComponentPtr m_cptr_current = ON_SubDComponentPtr::Null;
    6079 };
    6080 
    6081 //////////////////////////////////////////////////////////////////////////
    6082 //
    6083 // ON_SubDSectorIterator
    6084 //
    6085 
    6086 class ON_SUBD_CLASS ON_SubDSectorIterator
    6087 {
    6088 public:
    6089  static const ON_SubDSectorIterator Empty;
    6090 
    6091  ON_SubDSectorIterator() = default;
    6092  ~ON_SubDSectorIterator() = default;
    6093  ON_SubDSectorIterator(const ON_SubDSectorIterator&) = default;
    6094  ON_SubDSectorIterator& operator=(const ON_SubDSectorIterator&) = default;
    6095 
    6096  /*
    6097  Parameters:
    6098  center_vertex - [in]
    6099  The vertex on initial_face that will be iterated around.
    6100  center_vertex->Face(0) is used to select the sector.
    6101  Returns:
    6102  If input is valid, a pointer to the center vertex is returned.
    6103  Otherwise, nullptr is returned.
    6104  */
    6105  const ON_SubDVertex* Initialize(
    6106  const ON_SubDVertex* center_vertex
    6107  );
    6108 
    6109  /*
    6110  Parameters:
    6111  initial_face - [in]
    6112  iterator_orientation - [in]
    6113  0: (more common)
    6114  "next" means counter-clockwise with respect to the orientation of initial_face
    6115  1: (less common)
    6116  "next" means clockwise with respect to the orientation of initial_face
    6117  center_vertex - [in]
    6118  The vertex on initial_face that will be iterated around.
    6119  Returns:
    6120  If input is valid, a pointer to the center vertex is returned.
    6121  Otherwise, nullptr is returned.
    6122  */
    6123  const ON_SubDVertex* Initialize(
    6124  const ON_SubDFace* initial_face,
    6125  ON__UINT_PTR iterator_orientation,
    6126  const ON_SubDVertex* center_vertex
    6127  );
    6128 
    6129  /*
    6130  Parameters:
    6131  initial_face - [in]
    6132  iterator_orientation - [in]
    6133  0: (more common)
    6134  "next" means counter-clockwise with respect to the orientation of initial_face
    6135  1: (less common)
    6136  "next" means clockwise with respect to the orientation of initial_face
    6137  face_vertex_index - [in]
    6138  initial_face->Vertex(face_vertex_index) is the center vertex
    6139  that will be iterated around.
    6140  Returns:
    6141  If input is valid, a pointer to the center vertex is returned.
    6142  Otherwise, nullptr is returned.
    6143  */
    6144  const ON_SubDVertex* Initialize(
    6145  const ON_SubDFace* initial_face,
    6146  ON__UINT_PTR iterator_orientation,
    6147  unsigned int face_vertex_index
    6148  );
    6149 
    6150  bool InitializeToCurrentFace();
    6151 
    6152  void Initialize();
    6153 
    6154  /*
    6155  Description:
    6156  The current ring index reports the total increment from the
    6157  start to the current state. It can be positive or negative.
    6158  */
    6159  int CurrentRingIndex() const;
    6160 
    6161  const ON_SubDVertex* CenterVertex() const;
    6162 
    6163  const ON_SubDFace* InitialFace() const;
    6164 
    6165  unsigned int InitialFaceCenterVertexIndex() const;
    6166 
    6167  const ON_SubDFace* CurrentFace() const;
    6168 
    6169  unsigned int CurrentFaceDirection() const;
    6170 
    6171  ON_SubDFacePtr CurrentFacePtr() const;
    6172 
    6173  unsigned int CurrentFaceCenterVertexIndex() const;
    6174 
    6175 
    6176  /*
    6177  Parameters:
    6178  face_side_index - [in]
    6179  0: Return the edge entering the center vertex.
    6180  1: Return the edge leaving the center vertex.
    6181  Returns:
    6182  The requested edge.
    6183  */
    6184  ON_SubDEdgePtr CurrentEdgePtr(
    6185  unsigned int face_side_index
    6186  ) const;
    6187 
    6188  /*
    6189  Description:
    6190 
    6191  CurrentEdge(1)
    6192  |
    6193  |
    6194  NextFace() | CurrentFace()
    6195  |
    6196  |
    6197  *------------- CurrentEdge(0)
    6198  PrevFace()
    6199 
    6200  The asterisk (*) marks the center vertex.
    6201  The diagram is With respect to the initial iterator orientation.
    6202 
    6203  Parameters:
    6204  face_side_index - [in]
    6205  CurrentEdge(0) = edge on the clockwise (PrevFace) side of the current face
    6206  CurrentEdge(1) = edge on the counterclockwise (NextFace) side of the current face
    6207  The directions "counterclockwise" and "clockwise" are with respect to the
    6208  initial iterator orientation.
    6209  Returns:
    6210  The requested edge or nullptr if the iterator is not initialized,
    6211  has terminated, or is not valid.
    6212  */
    6213  const ON_SubDEdge* CurrentEdge(
    6214  unsigned int face_side_index
    6215  ) const;
    6216 
    6217  ON__UINT_PTR CurrentEdgeDirection(
    6218  unsigned int face_side_index
    6219  ) const;
    6220 
    6221  /*
    6222  Returns:
    6223  The vertex on CurrentEdge(face_side_index) that is opposite
    6224  the central vertex.
    6225  */
    6226  const ON_SubDVertex* CurrentEdgeRingVertex(
    6227  unsigned int face_side_index
    6228  ) const;
    6229 
    6230  /*
    6231  Description:
    6232  Advance the "current" face to the "next" face in the ring
    6233  by "hopping across" CurrentEdge(1).
    6234 
    6235  If the current face is not reversed (1 == CurrentFaceDirection),
    6236  then this rotation is counter-clockwise with respect to
    6237  the current face's orientation.
    6238 
    6239  If the current face is reversed (1 == CurrentFaceDirection),
    6240  then this rotation is clockwise with respect to
    6241  the current face's orientation.
    6242  Parameters:
    6243  bStopAtCrease - [in]
    6244  If true and CurrentEdge(1) is tagged ON_SubD:EdgeTag::crease,
    6245  iteration terminates.
    6246  Returns:
    6247  When the input CurrentEdge(1) has exactly two faces and
    6248  is not tagged as a crease or bStopAtCrease is false, the
    6249  face on the other side of CurrentEdge(1) becomes the new
    6250  current face and a pointer to this face is returned.
    6251  Remarks:
    6252  Identical to calling IncrementFace(+1,bStopAtCrease);
    6253  */
    6254  const ON_SubDFace* NextFace(
    6255  bool bStopAtCrease
    6256  );
    6257 
    6258  /*
    6259  Description:
    6260  Advance the "current" face to the "previous" face in the ring
    6261  by "hopping across" CurrentEdge(0).
    6262 
    6263  If the current face is not reversed (0 == CurrentFaceDirection),
    6264  then this rotation is clockwise with respect to
    6265  the current face's orientation.
    6266 
    6267  If the current face is reversed (1 == CurrentFaceDirection),
    6268  then this rotation is counter-clockwise with respect to
    6269  the current face's orientation.
    6270  Parameters:
    6271  bStopAtCrease - [in]
    6272  If true and CurrentEdge(0) is tagged ON_SubD:EdgeTag::crease,
    6273  iteration terminates.
    6274  Returns:
    6275  When the input CurrentEdge(0) has exactly two faces and
    6276  is not tagged as a crease or bStopAtCrease is false, the
    6277  face on the other side of CurrentEdge(0) becomes the new
    6278  current face and a pointer to this face is returned.
    6279  In all other cases, nullptr is returned
    6280  Remarks:
    6281  Identical to calling IncrementFace(-1,bStopAtCrease);
    6282  */
    6283  const ON_SubDFace* PrevFace(
    6284  bool bStopAtCrease
    6285  );
    6286 
    6287  /*
    6288  Description:
    6289  Advance the "current" face by "hopping across" the edge
    6290  CurrentEdge((increment_direction>0) ? 1 : 0).
    6291 
    6292  If the current face is not reversed (0 == CurrentFaceDirection),
    6293  then increment_direction>0 rotates counter-clockwise with respect to
    6294  the current face's orientation.
    6295 
    6296  If the current face is reversed (1 == CurrentFaceDirection),
    6297  then increment_direction>0 rotates clockwise with respect to
    6298  the current face's orientation.
    6299  Parameters:
    6300  increment_direction - [in]
    6301  > 0 advance the "current" face to next face
    6302  <= 0 advance the "current" face to previous face
    6303  bStopAtCrease - [in]
    6304  If true and the input value of CurrentEdge((increment_direction>0) ? 1 : 0)
    6305  is tagged as ON_SubD:EdgeTag::crease, iteration terminates.
    6306  When iteration terminates at a crease,
    6307  CurrentFace() becomes nullptr
    6308  CurrentEdge((increment_direction>0) ? 1 : 0) becomes nullptr
    6309  CurrentEdge((increment_direction>0) ? 0 : 1) points at the crease
    6310  and nullptr returned.
    6311  Returns:
    6312  nullptr if iteration terminates.
    6313  */
    6314  const ON_SubDFace* IncrementFace(
    6315  int increment_direction,
    6316  bool bStopAtCrease
    6317  );
    6318 
    6319  /*
    6320  Description:
    6321  Increment the iterator until it reaches a face with
    6322  a crease
    6323  Parameters:
    6324  increment_direction - [in]
    6325  > 0 advance next until CurrentEdge(1) is a crease.
    6326  <= 0 advance previous until CurrentEdge(0) is a crease.
    6327  Returns:
    6328  nullptr - the sector has no creases.
    6329  not nullptr - incremented to a crease
    6330  */
    6331  const ON_SubDFace* IncrementToCrease(
    6332  int increment_direction
    6333  );
    6334 
    6335  /*
    6336  Description:
    6337  Reset iterator to initial face.
    6338  */
    6339  const ON_SubDFace* FirstFace();
    6340 
    6341  bool IsValid() const;
    6342 
    6343 private:
    6344  const ON_SubDVertex* m_center_vertex = nullptr;
    6345  const ON_SubDFace* m_initial_face = nullptr;
    6346  const ON_SubDFace* m_current_face = nullptr;
    6347 
    6348  // m_current_eptr[0].Edge() = "prev" side edge
    6349  // m_current_eptr[1].Edge() = "next" side edge
    6350  // When m_current_eptr[i].Edge() is not null,
    6351  // center vertex = m_current_eptr[i].Edge()->m_vertex[m_current_eptr[i].Direction()]
    6352  ON_SubDEdgePtr m_current_eptr[2]; // default = { ON_SubDEdgePtr::Null, ON_SubDEdgePtr::Null };
    6353 
    6354  unsigned int m_initial_fvi = 0;
    6355  unsigned int m_current_fvi = 0;
    6356  unsigned int m_current_fei[2]; // default = { 0, 0 }; // "prev" and "next"
    6357 
    6358  // m_initial_face_dir
    6359  // 0: "next" means clockwise with respect to the initial face's orientation.
    6360  // 1: "next" means counter-clockwise with respect to the initial face's orientation.
    6361  unsigned int m_initial_face_dir = 0;
    6362 
    6363  // m_current_face_dir
    6364  // 0: "next" means clockwise with respect to the initial face's orientation.
    6365  // 1: "next" means counter-clockwise with respect to the initial face's orientation.
    6366  // When the subd faces around the center vertex are consistently oriented,
    6367  // m_current_face_dir is always equal to m_initial_face_dir.
    6368  unsigned int m_current_face_dir = 0;
    6369 
    6370  int m_current_ring_index = 0;
    6371 };
    6372 
    6373 
    6374 //////////////////////////////////////////////////////////////////////////
    6375 //
    6376 // ON_SubDFaceEdgeIterator
    6377 //
    6378 class ON_SUBD_CLASS ON_SubDFaceEdgeIterator
    6379 {
    6380 public:
    6381  ON_SubDFaceEdgeIterator();
    6382 
    6383  /*
    6384  Description:
    6385  Construct an iterator for going around the edges on a face.
    6386  Parameters:
    6387  face - [in]
    6388  first_edge - [in]
    6389  starting edge for the iterator or nullptr to start at face->Edge(0).
    6390  */
    6391  ON_SubDFaceEdgeIterator(
    6392  const ON_SubDFace* face
    6393  );
    6394 
    6395  ON_SubDFaceEdgeIterator(
    6396  const ON_SubDFace* face,
    6397  const ON_SubDEdge* first_edge
    6398  );
    6399 
    6400 
    6401  /*
    6402  Description:
    6403  Initialize an iterator for going around the edges on a face.
    6404  Parameters:
    6405  face - [in]
    6406  first_edge - [in]
    6407  starting edge for the iterator or nullptr to start at face->Edge(0).
    6408  */
    6409  unsigned int Initialize(
    6410  const ON_SubDFace* face
    6411  );
    6412 
    6413  unsigned int Initialize(
    6414  const ON_SubDFace* face,
    6415  const ON_SubDEdge* first_edge
    6416  );
    6417 
    6418  unsigned int EdgeCount() const;
    6419 
    6420  /*
    6421  Returns:
    6422  Resets the iterator and returns the first edge.
    6423  */
    6424  const ON_SubDEdge* FirstEdge();
    6425 
    6426  /*
    6427  Description:
    6428  Increments the iterator and returns the edge.
    6429  */
    6430  const ON_SubDEdge* NextEdge();
    6431 
    6432  /*
    6433  Description:
    6434  Decrements the iterator and returns the edge.
    6435  */
    6436  const ON_SubDEdge* PrevEdge();
    6437 
    6438  /*
    6439  Returns:
    6440  Current edge.
    6441  */
    6442  const ON_SubDEdge* CurrentEdge() const;
    6443 
    6444  unsigned int FirstEdgeIndex() const;
    6445 
    6446  unsigned int CurrentEdgeIndex() const;
    6447 
    6448 private:
    6449  const ON_SubDFace* m_face;
    6450  unsigned int m_edge_count;
    6451  unsigned int m_edge_index0;
    6452  unsigned int m_edge_index;
    6453 };
    6454 
    6455 //////////////////////////////////////////////////////////////////////////
    6456 //
    6457 // ON_SubDFromMeshOptions
    6458 //
    6459 class ON_SUBD_CLASS ON_SubDFromMeshOptions
    6460 {
    6461 public:
    6462 
    6463  // Default construction is identical to ON_SubDFromMeshOptions::Smooth.
    6464  ON_SubDFromMeshOptions() = default;
    6465  ~ON_SubDFromMeshOptions() = default;
    6466  ON_SubDFromMeshOptions(const ON_SubDFromMeshOptions&) = default;
    6467  ON_SubDFromMeshOptions& operator=(const ON_SubDFromMeshOptions&) = default;
    6468 
    6469  ///////////////////////////////////////////////////////////////////////////////////////
    6470  //
    6471  // Crease options
    6472  //
    6473 
    6474  // No interior creases and no corners.
    6475  static const ON_SubDFromMeshOptions Smooth;
    6476 
    6477  // Create an interior sub-D crease along coincident input mesh edges
    6478  // where the vertex normal directions at one end differ by at
    6479  // least 30 degrees.
    6480  static const ON_SubDFromMeshOptions InteriorCreaseAtMeshCrease;
    6481 
    6482  // Create an interior sub-D crease along all coincident input mesh edges.
    6483  static const ON_SubDFromMeshOptions InteriorCreaseAtMeshEdge;
    6484 
    6485  ///////////////////////////////////////////////////////////////////////////////////////
    6486  //
    6487  // Custom interior crease options
    6488  //
    6489 #pragma region RH_C_SHARED_ENUM [SubD::InteriorCreaseOption] [Rhino.Geometry.SubD.InteriorCreaseOption] [nested:byte]
    6490  ///<summary>
    6491  ///Defines how interior creases are treated.
    6492  ///</summary>
    6493  enum class InteriorCreaseOption : unsigned char
    6494  {
    6495  ///<summary>The interior creases option is not defined.</summary>
    6496  Unset = 0,
    6497 
    6498  ///<summary>No interior creases.</summary>
    6499  None = 1,
    6500 
    6501  ///<summary>An interior subd crease will appear along coincident
    6502  ///mesh edges where the angle between coindident vertex
    6503  ///normals &gt;= MinimumCreaseAngleRadians().</summary>
    6504  AtMeshCrease = 2,
    6505 
    6506  ///<summary>An interior subd crease will appear all coincident mesh edges.
    6507  ///Input mesh vertex normals are ignored.</summary>
    6508  AtMeshEdge = 3
    6509  };
    6510 #pragma endregion
    6511 
    6512  static ON_SubDFromMeshOptions::InteriorCreaseOption InteriorCreaseOptionFromUnsigned(
    6513  unsigned int interior_crease_option_as_unsigned
    6514  );
    6515 
    6516  /*
    6517  Parameters:
    6518  interior_crease_option - [in]
    6519  */
    6520  void SetInteriorCreaseOption(
    6521  ON_SubDFromMeshOptions::InteriorCreaseOption interior_crease_option
    6522  );
    6523 
    6524  /*
    6525  Returns:
    6526  The interior crease option.
    6527  */
    6528  ON_SubDFromMeshOptions::InteriorCreaseOption InteriorCreaseTest() const;
    6529 
    6530 
    6531  /*
    6532  Description:
    6533  When the interior crease option is
    6534  ON_SubDFromMeshOptions::InteriorCreaseOption::AtMeshCreases,
    6535  the value of MinimumCreaseAngleRadians() determines which
    6536  coincident input mesh edges generate sub-D creases.
    6537 
    6538  If the input mesh has vertex normals, and the angle between
    6539  vertex normals is > MinimumCreaseAngleRadians() at an end
    6540  of a coincident input mesh edge, the the correspondeing sub-D
    6541  edge will be a crease.
    6542 
    6543  Parameters:
    6544  minimum_crease_angle_radians - [in]
    6545  >= 0.0 and < ON_PI
    6546  */
    6547  void SetMinimumCreaseAngleRadians(
    6548  double minimum_crease_angle_radians
    6549  );
    6550 
    6551  /*
    6552  Description:
    6553  When the interior crease option is
    6554  ON_SubDFromMeshOptions::InteriorCreaseOption::AtMeshCreases,
    6555  the value of MinimumCreaseAngleRadians() determines which
    6556  coincident input mesh edges generate sub-D creases.
    6557 
    6558  If the input mesh has vertex normals, and the angle between
    6559  vertex normals is > MinimumCreaseAngleRadians() at an end
    6560  of a coincident input mesh edge, the the correspondeing sub-D
    6561  edge will be a crease.
    6562  Returns:
    6563  Current value of
    6564  */
    6565  double MinimumCreaseAngleRadians() const;
    6566 
    6567  /*
    6568  Description:
    6569  Copy all interior crease option settings from source_options to this.
    6570  Parameters:
    6571  source_options - [in]
    6572  Returns:
    6573  The currently selected interior crease option.
    6574  */
    6575  ON_SubDFromMeshOptions::InteriorCreaseOption CopyInteriorCreaseTest(
    6576  ON_SubDFromMeshOptions source_options
    6577  );
    6578 
    6579 
    6580  ///////////////////////////////////////////////////////////////////////////////////////
    6581  //
    6582  // Convex corner options
    6583  //
    6584 
    6585  // Look for convex corners at sub-D vertices with 2 edges
    6586  // that have an included angle <= 90 degrees.
    6587  static const ON_SubDFromMeshOptions ConvexCornerAtMeshCorner;
    6588 
    6589  ///////////////////////////////////////////////////////////////////////////////////////
    6590  //
    6591  // Custom convex corner options
    6592  //
    6593 #pragma region RH_C_SHARED_ENUM [SubD::ConvexCornerOption] [Rhino.Geometry.SubD.ConvexCornerOption] [nested:byte]
    6594  ///<summary>
    6595  ///Defines how convex corners are treated.
    6596  ///</summary>
    6597  enum class ConvexCornerOption : unsigned char
    6598  {
    6599  ///<summary>The option is not set.</summary>
    6600  Unset = 0,
    6601 
    6602  ///<summary>No convex coners.</summary>
    6603  None = 1,
    6604 
    6605  ///<summary>A convext subd corner will appear at input mesh/ boundary vertices
    6606  /// where the corner angle &lt;= MaximumConvexCornerAngleRadians() and
    6607  /// the number of edges the end at the vertex is &lt;= MaximumConvexCornerEdgeCount().
    6608  ///</summary>
    6609  AtMeshCorner = 2
    6610  };
    6611 #pragma endregion
    6612 
    6613  static ON_SubDFromMeshOptions::ConvexCornerOption ConvexCornerOptionFromUnsigned(
    6614  unsigned int convex_corner_option_as_unsigned
    6615  );
    6616 
    6617  /*
    6618  Parameters:
    6619  convex_corner_option - [in]
    6620  */
    6621  void SetConvexCornerOption(
    6622  ON_SubDFromMeshOptions::ConvexCornerOption convex_corner_option
    6623  );
    6624 
    6625  /*
    6626  Returns:
    6627  The currently selected convex corner option.
    6628  */
    6629  ON_SubDFromMeshOptions::ConvexCornerOption ConvexCornerTest() const;
    6630 
    6631  /*
    6632  Description:
    6633  If ConvexCornerTest() ConvexCornerOption::at_mesh_corner, then an
    6634  input mesh boundary vertex becomes a sub-D corner when the number of
    6635  edges that end at the vertex is <= MaximumConvexCornerEdgeCount() edges
    6636  and the corner angle is <= MaximumConvexCornerAngleRadians().
    6637  Parameters:
    6638  maximum_convex_corner_edge_count - [in]
    6639  */
    6640  void SetMaximumConvexCornerEdgeCount(
    6641  unsigned int maximum_convex_corner_edge_count
    6642  );
    6643 
    6644  /*
    6645  Description:
    6646  If ConvexCornerTest() ConvexCornerOption::at_mesh_corner, then an
    6647  input mesh boundary vertex becomes a sub-D corner when the number of
    6648  edges that end at the vertex is <= MaximumConvexCornerEdgeCount() edges
    6649  and the corner angle is <= MaximumConvexCornerAngleRadians().
    6650  Returns:
    6651  The maximum number of edges at a convex corner vertex.
    6652  */
    6653  unsigned int MaximumConvexCornerEdgeCount() const;
    6654 
    6655  /*
    6656  Description:
    6657  If ConvexCornerTest() ConvexCornerOption::at_mesh_corner, then an
    6658  input mesh boundary vertex becomes a sub-D corner when the number of
    6659  edges that end at the vertex is <= MaximumConvexCornerEdgeCount() edges
    6660  and the corner angle is <= MaximumConvexCornerAngleRadians().
    6661  Parameters:
    6662  maximum_convex_corner_angle_radians - [in]
    6663  > 0.0 and < ON_PI
    6664  */
    6665  void SetMaximumConvexCornerAngleRadians(
    6666  double maximum_convex_corner_angle_radians
    6667  );
    6668 
    6669  /*
    6670  Description:
    6671  If ConvexCornerTest() ConvexCornerOption::at_mesh_corner, then an
    6672  input mesh boundary vertex becomes a sub-D corner when the number of
    6673  edges that end at the vertex is <= MaximumConvexCornerEdgeCount() edges
    6674  and the corner angle is <= MaximumConvexCornerAngleRadians().
    6675  Returns:
    6676  The maximum corner angle.
    6677  */
    6678  double MaximumConvexCornerAngleRadians() const;
    6679 
    6680  /*
    6681  Description:
    6682  Copy all convex corner option settings from source_options to this.
    6683  Parameters:
    6684  source_options - [in]
    6685  Returns:
    6686  The currently selected convex corner option.
    6687  */
    6688  ON_SubDFromMeshOptions::ConvexCornerOption CopyConvexCornerTest(
    6689  ON_SubDFromMeshOptions source_parameters
    6690  );
    6691 
    6692 
    6693  ///////////////////////////////////////////////////////////////////////////////////////
    6694  //
    6695  // Sub-D type option
    6696  //
    6697  ON_SubD::SubDType SubDType() const;
    6698 
    6699  void SetSubDType(
    6700  ON_SubD::SubDType subd_type
    6701  );
    6702 
    6703 private:
    6704  ON_SubD::SubDType m_subd_type = ON_SubD::SubDType::Unset;
    6705  unsigned char m_reserved1 = 0;
    6706  unsigned short m_reserved2 = 0;
    6707 
    6708  ON_SubDFromMeshOptions::InteriorCreaseOption m_interior_crease_option = ON_SubDFromMeshOptions::InteriorCreaseOption::None;
    6709  ON_SubDFromMeshOptions::ConvexCornerOption m_convex_corner_option = ON_SubDFromMeshOptions::ConvexCornerOption::None;
    6710  unsigned short m_maximum_convex_corner_edge_count = 2U;
    6711 
    6712  double m_minimum_crease_angle_radians = ON_PI/6.0; // 30 degrees in radians
    6713  double m_maximum_convex_corner_angle_radians = 0.501*ON_PI; // 90 degrees (+ a smidge) in radians
    6714 };
    6715 
    6716 //////////////////////////////////////////////////////////////////////////
    6717 //
    6718 // ON_SubDComponentRef
    6719 //
    6720 // Used when an ON_SubD vertex, edge or face needs to be sent around as
    6721 // a piece of ON_Geometry.
    6722 //
    6723 class ON_SUBD_CLASS ON_SubDComponentRef : public ON_Geometry
    6724 {
    6725  ON_OBJECT_DECLARE(ON_SubDComponentRef);
    6726 public:
    6727  static const ON_SubDComponentRef Empty;
    6728 
    6729  ON_SubDComponentRef() = default;
    6730  ~ON_SubDComponentRef() = default;
    6731  ON_SubDComponentRef(const ON_SubDComponentRef&) ON_NOEXCEPT;
    6732  ON_SubDComponentRef& operator=(const ON_SubDComponentRef&);
    6733 
    6734 #if defined(ON_HAS_RVALUEREF)
    6735  // rvalue copy constructor
    6736  ON_SubDComponentRef( ON_SubDComponentRef&& ) ON_NOEXCEPT;
    6737 
    6738  // The rvalue assignment operator calls ON_Object::operator=(ON_Object&&)
    6739  // which could throw exceptions. See the implementation of
    6740  // ON_Object::operator=(ON_Object&&) for details.
    6741  ON_SubDComponentRef& operator=( ON_SubDComponentRef&& );
    6742 #endif
    6743 
    6744  /*
    6745  Parameters:
    6746  subd_ref - [in]
    6747  component_index - [in]
    6748  bLimitSurface - [in]
    6749  true - the reference is to the limit surface location
    6750  false - the reference is to the control net location
    6751  */
    6752  static ON_SubDComponentRef Create(
    6753  const ON_SubDRef& subd_ref,
    6754  ON_COMPONENT_INDEX component_index,
    6755  ON_SubDComponentLocation component_location
    6756  );
    6757 
    6758  static ON_SubDComponentRef Create(
    6759  const ON_SubDRef& subd_ref,
    6760  ON_SubDComponentPtr component_ptr,
    6761  ON_SubDComponentLocation component_location
    6762  );
    6763 
    6764  static ON_SubDComponentRef Create(
    6765  const ON_SubDRef& subd_ref,
    6766  const class ON_SubDVertex* vertex,
    6767  ON_SubDComponentLocation component_location
    6768  );
    6769 
    6770  static ON_SubDComponentRef Create(
    6771  const ON_SubDRef& subd_ref,
    6772  const class ON_SubDEdge* edge,
    6773  ON_SubDComponentLocation component_location
    6774  );
    6775 
    6776  static ON_SubDComponentRef Create(
    6777  const ON_SubDRef& subd_ref,
    6778  const class ON_SubDFace* face,
    6779  ON_SubDComponentLocation component_location
    6780  );
    6781 
    6782  void Clear();
    6783 
    6784  ON_SubDRef SubDRef() const;
    6785 
    6786  const class ON_SubD& SubD() const;
    6787 
    6788  ON_COMPONENT_INDEX ComponentIndex() const override;
    6789 
    6790  ON_SubDComponentPtr ComponentPtr() const;
    6791 
    6792  ON_SubDComponentLocation ComponentLocation() const;
    6793 
    6794  const class ON_SubDVertex* Vertex() const;
    6795 
    6796  const class ON_SubDEdge* Edge() const;
    6797 
    6798  const class ON_SubDFace* Face() const;
    6799 
    6800 private:
    6801  ON_SubDRef m_subd_ref;
    6802  ON_SubDComponentPtr m_component_ptr = ON_SubDComponentPtr::Null;
    6803  ON_COMPONENT_INDEX m_component_index = ON_COMPONENT_INDEX::UnsetComponentIndex;
    6804  ON_SubDComponentLocation m_component_location = ON_SubDComponentLocation::Unset;
    6805 
    6806 public:
    6807  // overrides of virtual ON_Object functions
    6808  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    6809  void Dump( ON_TextLog& ) const override;
    6810  unsigned int SizeOf() const override;
    6811  ON::object_type ObjectType() const override;
    6812 
    6813  // overrides of virtual ON_Geometry functions
    6814  int Dimension() const override;
    6815 
    6816  // virtual ON_Geometry GetBBox override
    6817  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    6818 };
    6819 
    6820 //////////////////////////////////////////////////////////////////////////
    6821 //
    6822 // ON_SubDComponentPoint
    6823 //
    6824 // Used in selection tests to return a point and parameters on a component.
    6825 //
    6826 class ON_SUBD_CLASS ON_SubDComponentPoint
    6827 {
    6828 public:
    6829  static const ON_SubDComponentPoint Unset;
    6830 
    6831  ON_SubDComponentPoint() = default;
    6832  ~ON_SubDComponentPoint() = default;
    6833  ON_SubDComponentPoint(const ON_SubDComponentPoint&) = default;
    6834  ON_SubDComponentPoint& operator=(const ON_SubDComponentPoint&) = default;
    6835 
    6836  /*
    6837  Description:
    6838  Compares the m_component_ptr values. This function is useful for sorting
    6839  arrays of ON_SubDComponentPoint values remove duplicates.
    6840  */
    6841  static int CompareComponentPtr(
    6842  const ON_SubDComponentPoint* a,
    6843  const ON_SubDComponentPoint* b
    6844  );
    6845 
    6846  // m_component_ptr will be face, edge or vertex
    6847  ON_SubDComponentPtr m_component_ptr = ON_SubDComponentPtr::Null;
    6848 
    6849  //// If the point is on a a face that does not have the ordinary number of
    6850  //// edges for the subdivision type, then m_face_corner_index identifies the
    6851  //// subfragment corner.
    6852  //unsigned int m_face_corner_index = ON_UNSET_UINT_INDEX;
    6853 
    6854  //// If m_level_index is ON_UNSET_UINT_INDEX, the point is on the limit surface.
    6855  //// Otherwise the point is on the control net at the specified level.
    6856  //unsigned int m_level_index = ON_UNSET_UINT_INDEX;
    6857 
    6858  ON_PickPoint m_pick_point = ON_PickPoint::Unset;
    6859 };
    6860 
    6861 //////////////////////////////////////////////////////////////////////////
    6862 //
    6863 // ON_SubDMatrix
    6864 //
    6865 class ON_SUBD_CLASS ON_SubDMatrix
    6866 {
    6867 public:
    6868  ON_SubDMatrix() = default;
    6869 
    6870  static const ON_SubDMatrix Empty;
    6871 
    6872  /*
    6873  Description:
    6874  Precise evaluation of cos(a) and cos(a) where a = i/n pi.
    6875  These values are required for high qualitiy limit surface evaluation.
    6876  Parameters:
    6877  j - [in]
    6878  n - [in]
    6879  cos_theta - [out]
    6880  cos(j/n pi)
    6881  sin_theta - [out]
    6882  sin(j/n pi)
    6883  */
    6884  static bool EvaluateCosAndSin(
    6885  unsigned int j,
    6886  unsigned int n,
    6887  double* cos_theta,
    6888  double* sin_theta
    6889  );
    6890 
    6891  bool IsValid() const;
    6892 
    6893  bool IsValidPointRing(
    6894  size_t point_ring_count,
    6895  size_t point_ring_stride,
    6896  const double* point_ring
    6897  ) const;
    6898 
    6899  bool EvaluateSubdivisionPoint(
    6900  unsigned int component_index,
    6901  size_t point_ring_count,
    6902  size_t point_ring_stride,
    6903  const double* point_ring,
    6904  double subd_point[3]
    6905  ) const;
    6906 
    6907  bool EvaluateLimitPoint(
    6908  size_t point_ring_count,
    6909  size_t point_ring_stride,
    6910  const double* point_ring,
    6911  double limit_point[3],
    6912  double limit_tangent1[3],
    6913  double limit_tangent2[3],
    6914  double limit_normal[3]
    6915  ) const;
    6916 
    6917  bool EvaluateLimitPoint(
    6918  size_t point_ring_count,
    6919  size_t point_ring_stride,
    6920  const double* point_ring,
    6921  class ON_SubDSectorLimitPoint& limit_point
    6922  ) const;
    6923 
    6924  /*
    6925  Description:
    6926  Get the subdivision matrix information for the case specified
    6927  by the input parameters. This information is retrieved from
    6928  a cache. In some cases, it will be calculated the first time
    6929  it is needed.
    6930  Parameters:
    6931  facet_type - [in]
    6932  vertex_tag - [in]
    6933  valence - [in]
    6934  The input parameters identify the subdivision case.
    6935  Remarks:
    6936  Every member function of ON_SubDMatrix, including this one
    6937  is thread safe.
    6938  */
    6939  static const ON_SubDMatrix& FromCache(
    6940  ON_SubDSectorType sector_type
    6941  );
    6942 
    6943  ON_SubDSectorType m_sector_type;
    6944 
    6945  unsigned int m_R = 0; // the matrix m_S is m_R x m_R (m_R = m_sector_type.PointRingCount())
    6946 
    6947  // The term "standard vertex ring points" is used below.
    6948  //
    6949  // If "C" is an interior vertex (m_vertex_tag is smooth or dart),
    6950  // (E[0], ...., E[N-1]) is a radially sorted list of its edges,
    6951  // (F[0], ..., F[N-1]) is a radially sorted list of its faces,
    6952  // and (P[0], ..., P[N-1]) is a list of the edge vertices opposite C,
    6953  // E0type = smooth for a smooth vertex and crease for a dart vertex,
    6954  // then C is "standard" if E[0] has type E0type, every other
    6955  // edge E[i] is smooth, every outer vertex/ P[i] is smooth, and every
    6956  // face F[i] has the stadard facet type (tri or quad) for the subdivision
    6957  // algorithm.
    6958  //
    6959  // If If "C" is a boundary vertex (m_vertex_tag is crease or corner), the conditions
    6960  // listed above are satisified except
    6961  // E[0] and E[N-1] are tagged as crease edges,
    6962  // P[0] and P[N-1] are tagged as crease vertices (NOT corners),
    6963  // and there are N-2 faces,
    6964  // then "C" is a standard boundary vertex.
    6965  //
    6966  // If the facet type is triangle and C is a standard interior or boundary vertex,
    6967  // then the "standard vertex ring" is the list of N+1 points
    6968  // (C, P[0], ...., P[N-1]).
    6969  //
    6970  // If the facet type is quad, and C is a standard interior vertex,
    6971  // then the "standard vertex ring" is the list of 2*N+1 points
    6972  // (C, P[0], Q[0], ...., P[N-1], Q[N-1]), where Q[I] is the average of the
    6973  // four corners of the quad F[i].
    6974  //
    6975  // If the facet type is quad, and C is a standard boundary vertex,
    6976  // then the "standard vertex ring" is the list of 2*N points
    6977  // (C, P[0], Q[0], ...., P[N-1]).
    6978 
    6979  // m_S = R x R subdivision matrix
    6980  // If (vertexR[0], ..., vertexR[R-1]) is a list of standard vertex ring points,
    6981  // then then the location of the subdivided ring points
    6982  // (vertexR1[0], ..., vertexR1[R-1]) can be calculated from m_S.
    6983  // vertexR1[i] = m_S[i][0]*vertexR[0] + ... + m_S[i][R-1]*vertexR[R-1]
    6984  const double* const* m_S = nullptr;
    6985 
    6986  // m_LP[] = limit point evaluation vector.
    6987  // The array m_LP[] has m_R elements.
    6988  // If (vertexR[0], ..., vertexR[R-1]) is a list of standard vertex ring points,
    6989  // then Limit point = m_LP[0]*vertexR[0] + ... + m_LP[R-1]*vertexR[R-1].
    6990  // m_LP is the eigenvector of Transpose(m_S) with eigenvalue = 1.
    6991  // Length(m_LP) = 1.
    6992  const double* m_LP = nullptr;
    6993 
    6994  // m_L1 and m_L2 = tangent space evaluation vectors.
    6995  // The arrays m_L1[] and m_L2[] have m_R elements.
    6996  // If (vertexR[0], ..., vertexR[R-1]) is a list of standard vertex ring points,
    6997  // then the two vectors
    6998  // V1 = m_L1[0]*vertexR[0] + ... + m_L1[R-1]*vertexR[R-1].
    6999  // V2 = m_L2[0]*vertexR[0] + ... + m_L2[R-1]*vertexR[R-1].
    7000  // span the tangent plane and
    7001  // N = V1 x V2 is perpindicular to the limit tangent plane.
    7002  // In general and almost always in practice, V1 and V2 are not unit vectors
    7003  // and it is best to noramalize V1 and V2 before taking the cross product.
    7004  // m_L1 and m_L2 are subdominant eigenvectors of Transpose(m_S).
    7005  // When the subdominant eigenvalue has geometric multiplicity 2,
    7006  // m_L1 and m_L2 span the same space as m_E1 and m_E2.
    7007  // The values stored in m_L1 and m_L2 are chosen to provide accurate
    7008  // evaluation. In come common cases m_L1 and m_L2 are equal to m_E1 and m_E2,
    7009  // but not in all cases.
    7010  const double* m_L1 = nullptr;
    7011  const double* m_L2 = nullptr;
    7012 
    7013  /*
    7014  Description:
    7015  Set the values in this ON_SubDMatrix so the information
    7016  can be used to evaluate the case identified by the input
    7017  parameters.
    7018  Parameters:
    7019  facet_type - [in]
    7020  vertex_tag - [in]
    7021  sector_edge_count - [in]
    7022  The input parameters identify the subdivision case.
    7023  Returns:
    7024  R > 0: Success. The matrix is R x R.
    7025  0: Failure.
    7026  */
    7027  unsigned int SetFromSectorType(
    7028  ON_SubDSectorType sector_type
    7029  );
    7030 
    7031  /*
    7032  Returns:
    7033  ON_UNSET_VALUE - serious error
    7034  >= 0:
    7035  Maximum value of numbers that should be zero in and ideal world.
    7036  When the matrices, eigenvalues and eigenvectors are correctly calculated,
    7037  this returned value is in the range from 1e-16 to 5e-13 as valence goes
    7038  from 3 to 100.
    7039  For valences < 100, if a value larger than 1.0e-12 occurs, there is a bug in the code.
    7040  */
    7041  double TestMatrix() const;
    7042 
    7043  /*
    7044  Description:
    7045  Run evaluation tests on this subdivision case.
    7046  Returns:
    7047  >= 0.0: Test passed. Maximum deviation found in any test is returned.
    7048  ON_UNSET_VALUE: Test failed.
    7049  */
    7050  double TestEvaluation() const;
    7051 
    7052  /*
    7053  Description:
    7054  Run evaluation tests on a range of subdivision cases.
    7055  Parameters:
    7056  sector_type - [in]
    7057  If ON_SubDSectorType::Empty, then all supported sector types types are tested.
    7058  minimum_sector_face_count - [in]
    7059  If 0, then testing begins at ON_SubDSectorType::MinimumSectorFaceCount(vertex_tag)
    7060  when testing vertex_tag types
    7061  maximum_sector_face_count - [in]
    7062  If 0, then testing stops at ON_SubD::maximum_evaluation_valence.
    7063  text_log - [out]
    7064  If not nullptr, then a brief written report is printed for each test case.
    7065  Returns:
    7066  >= 0.0: Test passed. Maximum deviation found in any test is returned.
    7067  ON_UNSET_VALUE: Test failed.
    7068  */
    7069  static double TestEvaluation(
    7070  ON_SubDSectorType sector_type,
    7071  unsigned int minimum_sector_face_count,
    7072  unsigned int maximum_sector_face_count,
    7073  ON_TextLog* text_log
    7074  );
    7075 
    7076  double TestComponentRing(
    7077  size_t component_ring_count,
    7078  const ON_SubDComponentPtr* component_ring
    7079  ) const;
    7080 
    7081  /*
    7082  Description:
    7083  Test cached subdivision matrix on sector identified by sit.
    7084  Parameters:
    7085  subd_type - [in]
    7086  subd_recursion_count - [in]
    7087  number of times to subdivide
    7088  sit - [in]
    7089  vertex to subdivide
    7090  component_ring - [out]
    7091  subd_points - [out]
    7092  limit_point - [out]
    7093  limit_tangent0 - [out]
    7094  limit_tangent1 - [out]
    7095  limit_normal - [out]
    7096  */
    7097  static double TestEvaluation(
    7098  ON_SubD::SubDType subd_type,
    7099  const unsigned int subd_recursion_count,
    7100  ON_SubDSectorIterator sit,
    7101  ON_SimpleArray<ON_SubDComponentPtr>& component_ring,
    7102  ON_SimpleArray< ON_3dPoint >& subd_points,
    7103  class ON_SubDSectorLimitPoint& limit_point
    7104  );
    7105 
    7106 private:
    7107  unsigned int m__max_R = 0;
    7108  ON_Matrix m__S; // m_S matrix memory
    7109  ON_SimpleArray<double> m__buffer; // m_LP, m_L1, m_L2, m_E1, m_E2 memory
    7110 };
    7111 
    7112 //////////////////////////////////////////////////////////////////////////
    7113 //
    7114 // ON_SubD_FixedSizeHeap
    7115 //
    7116 
    7117 class ON_SUBD_CLASS ON_SubD_FixedSizeHeap
    7118 {
    7119 private:
    7120  static unsigned int m__sn_factory;
    7121 
    7122 public:
    7123  // The serial number is used for debugging purposes.
    7124  const unsigned int m_sn = ++m__sn_factory;
    7125 
    7126 public:
    7127  ON_SubD_FixedSizeHeap() = default;
    7128  ~ON_SubD_FixedSizeHeap();
    7129 
    7130  /*
    7131  Description:
    7132  Reserve enough room to accomodate a face
    7133  with one extraordinary vertex.
    7134  Parameters:
    7135  subd_type - [in]
    7136  extraordinary_valence - [in]
    7137  */
    7138  bool ReserveSubDWorkspace(
    7139  ON_SubD::SubDType subd_type,
    7140  unsigned int extraordinary_valence
    7141  );
    7142 
    7143  bool ReserveSubDWorkspace(
    7144  size_t vertex_capacity,
    7145  size_t edge_capacity,
    7146  size_t face_capacity,
    7147  size_t array_capacity
    7148  );
    7149 
    7150  /*
    7151  Description:
    7152  Reset this ON_SubD_FixedSizeHeap so it can be used again.
    7153  */
    7154  void Reset();
    7155 
    7156  /*
    7157  Description:
    7158  Deallocate all reserved heap.
    7159  */
    7160  void Destroy();
    7161 
    7162  bool InUse() const;
    7163 
    7164  ON_SubDVertex* AllocateVertex(
    7165  const double vertexP[3],
    7166  unsigned int edge_capacity,
    7167  unsigned int face_capacity
    7168  );
    7169 
    7170  ON_SubDVertex* AllocateVertex(
    7171  const ON_SubDVertex* vertex0,
    7172  ON_SubD::SubDType subd_type,
    7173  bool bUseSavedSubdivisionPoint,
    7174  unsigned int edge_capacity,
    7175  unsigned int face_capacity
    7176  );
    7177 
    7178  ON_SubDVertex* AllocateVertex(
    7179  const ON_SubDEdge* edge0,
    7180  ON_SubD::SubDType subd_type,
    7181  bool bUseSavedSubdivisionPoint,
    7182  unsigned int edge_capacity,
    7183  unsigned int face_capacity
    7184  );
    7185 
    7186  ON_SubDVertex* AllocateVertex(
    7187  const ON_SubDFace* face0,
    7188  ON_SubD::SubDType subd_type,
    7189  bool bUseSavedSubdivisionPoint,
    7190  unsigned int edge_capacity,
    7191  unsigned int face_capacity
    7192  );
    7193 
    7194  /*
    7195  Parameters:
    7196  v0 - [in]
    7197  v0_sector_weight - [in]
    7198  If v0 null or ON_SubD::VertexTag::Smooth == v0->m_vertex_tag, and v1 is null or tagged,
    7199  then m_sector_weight[0] is set to v0_sector_weight.
    7200  In all other cases the value of v0_sector_weight is ignored and m_sector_weight[0]
    7201  is set to ON_SubDSectorType::IgnoredSectorWeight.
    7202  v1 - [in]
    7203  v1_sector_weight - [in]
    7204  If v1 null or ON_SubD::VertexTag::Smooth == v1->m_vertex_tag, and v0 is null or tagged,
    7205  then m_sector_weight[1] is set to v1_sector_weight.
    7206  In all other cases the value of v1_sector_weight is ignored and m_sector_weight[1]
    7207  is set to ON_SubDSectorType::IgnoredSectorWeight.
    7208  Returns:
    7209  An edge.
    7210  The vertex parameter information is used to set the ON_SubDEdge.m_vertex[]
    7211  and ON_SubDEdge.m_sector_weight[] values.
    7212  If v0 and v1 are not null and both are tagged, then ON_SubDEdge.m_edge_tag is
    7213  set to ON_SubD::EdgeTag::Crease.
    7214  In all other cases, ON_SubDEdge.m_edge_tag is set to ON_SubD::EdgeTag::Smooth.
    7215  If v0 or v1 is not null, then ON_SubDEdge.m_level is set to the
    7216  maximum of v0->m_level or v1->m_level.
    7217  */
    7218  ON_SubDEdge* AllocateEdge(
    7219  ON_SubDVertex* v0,
    7220  double v0_sector_weight,
    7221  ON_SubDVertex* v1,
    7222  double v1_sector_weight
    7223  );
    7224 
    7225  /*
    7226  Returns:
    7227  A face with all field values zero (same values as ON_SubDEdge::Face), except ON_SubDFace.m_id.
    7228  */
    7229  ON_SubDFace* AllocateFace(
    7230  unsigned int zero_face_id,
    7231  unsigned int parent_face_id
    7232  );
    7233 
    7234  ON_SubDFace* AllocateQuad(
    7235  unsigned int zero_face_id,
    7236  unsigned int parent_face_id,
    7237  const ON_SubDEdgePtr eptrs[4]
    7238  );
    7239 
    7240  ON_SubDFace* AllocateTri(
    7241  unsigned int zero_face_id,
    7242  unsigned int parent_face_id,
    7243  const ON_SubDEdgePtr eptrs[3]
    7244  );
    7245 
    7246  /*
    7247  Parameters:
    7248  capacity - [in]
    7249  desired array size
    7250  bZeroMemory - [in]
    7251  If true, all array element values are zero.
    7252  If false, array element values are undefined.
    7253  Returns:
    7254  An array of capacity ON__UINT_PTR pointers.
    7255  */
    7256  ON__UINT_PTR* AllocatePtrArray(
    7257  unsigned int capacity,
    7258  bool bZeroMemory
    7259  );
    7260 
    7261  /*
    7262  Description:
    7263  Return the most recent array obtained from AllocatePtrArray().
    7264  so it can be reused.
    7265  Returns:
    7266  True:
    7267  Success.
    7268  False:
    7269  Failure. The array was not the most recent array obtained
    7270  from AllocatePtrArray().
    7271  */
    7272  bool ReturnPtrArray(
    7273  unsigned int capacity,
    7274  void* p
    7275  );
    7276 
    7277 private:
    7278  //unsigned int m_max_valence = 0;
    7279 
    7280  ON_SubDVertex* m_v = nullptr;
    7281  unsigned int m_v_capacity = 0;
    7282  unsigned int m_v_index = 0;
    7283 
    7284  ON_SubDEdge* m_e = nullptr;
    7285  unsigned int m_e_capacity = 0;
    7286  unsigned int m_e_index = 0;
    7287 
    7288  ON_SubDFace* m_f = nullptr;
    7289  unsigned int m_f_capacity = 0;
    7290  unsigned int m_f_index = 0;
    7291 
    7292  ON__UINT_PTR* m_p = nullptr;
    7293  unsigned int m_p_capacity = 0;
    7294  unsigned int m_p_index = 0;
    7295 
    7296 private:
    7297  // copies not supported
    7298  ON_SubD_FixedSizeHeap(const ON_SubD_FixedSizeHeap&) = delete;
    7299  ON_SubD_FixedSizeHeap& operator=(const ON_SubD_FixedSizeHeap&) = delete;
    7300 };
    7301 
    7302 #if defined(ON_COMPILING_OPENNURBS)
    7303 /*
    7304 The ON_SubDAsUserData class is used to attach a subd to it proxy mesh
    7305 when writing V6 files in commerical rhino.
    7306 */
    7307 class ON_SubDMeshProxyUserData : public ON_UserData
    7308 {
    7309 public:
    7310  /*
    7311  Returns:
    7312  A pointer to a mesh that now manages subd.
    7313  */
    7314  static ON_Mesh* MeshProxyFromSubD(
    7315  const ON_SubD* subd
    7316  );
    7317 
    7318  /*
    7319  Returns:
    7320  A pointer to a subd and deletes mesh.
    7321  */
    7322  static ON_SubD* SubDFromMeshProxy(
    7323  const ON_Mesh* mesh
    7324  );
    7325 
    7326  /*
    7327  Returns:
    7328  A pointer to a subd and deletes mesh.
    7329  */
    7330  static bool IsSubDMeshProxy(
    7331  const ON_Mesh* mesh
    7332  );
    7333 
    7334  static const ON_SubDDisplayParameters MeshProxyDisplayParameters();
    7335 
    7336 private:
    7337  ON_OBJECT_DECLARE(ON_SubDMeshProxyUserData);
    7338 
    7339 public:
    7340  ON_SubDMeshProxyUserData();
    7341  ~ON_SubDMeshProxyUserData();
    7342  ON_SubDMeshProxyUserData(const ON_SubDMeshProxyUserData&);
    7343  ON_SubDMeshProxyUserData& operator=(const ON_SubDMeshProxyUserData&);
    7344 
    7345 private:
    7346  // ON_Object overrides
    7347  bool Write(ON_BinaryArchive& archive) const override;
    7348  bool Read(ON_BinaryArchive& archive) override;
    7349  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    7350 
    7351  bool ParentMeshValid() const;
    7352 
    7353 private:
    7354  // ON_UserData overrides
    7355  bool GetDescription(ON_wString& description) override;
    7356  bool WriteToArchive(
    7357  const class ON_BinaryArchive& archive,
    7358  const class ON_Object* parent_object
    7359  ) const override;
    7360 
    7361 private:
    7362  // The subd
    7363  mutable ON_SubD* m_subd = nullptr;
    7364 
    7365 private:
    7366  // information used to see if the parent mesh has been modified.
    7367  mutable unsigned int m_mesh_face_count = 0;
    7368  mutable unsigned int m_mesh_vertex_count = 0;
    7369  mutable ON_SHA1_Hash m_mesh_face_array_sha1 = ON_SHA1_Hash::EmptyContentHash;
    7370  mutable ON_SHA1_Hash m_mesh_vertex_array_sha1 = ON_SHA1_Hash::EmptyContentHash;
    7371 
    7372 private:
    7373  void Internal_CopyFrom(const ON_SubDMeshProxyUserData& src);
    7374  void Internal_Destroy();
    7375  static const bool Internal_MeshHasFaces(const ON_Mesh* mesh);
    7376  static const ON_SHA1_Hash Internal_FaceSHA1(const ON_Mesh* mesh);
    7377  static const ON_SHA1_Hash Internal_VertexSHA1(const ON_Mesh* mesh);
    7378 };
    7379 #endif
    7380 
    7381 #endif
    7382 
    7383 #endif
    Definition: opennurbs_progress_reporter.h:25
    static const ON_SHA1_Hash EmptyContentHash
    SHA-1 hash of zero bytes.
    Definition: opennurbs_sha1.h:23
    Definition: opennurbs_nurbssurface.h:62
    -
    virtual bool GetBBox(double *boxmin, double *boxmax, bool bGrowBox=false) const
    Definition: opennurbs_rtree.h:381
    -
    virtual bool DeleteComponents(const ON_COMPONENT_INDEX *ci_list, size_t ci_count)
    static const ON_Interval ZeroToOne
    (0.0, 1.0)
    Definition: opennurbs_point.h:50
    Definition: opennurbs_array.h:36
    -
    virtual void DestroyRuntimeCache(bool bDelete=true)
    -
    virtual bool EvaluatePoint(const class ON_ObjRef &objref, ON_3dPoint &P) const
    -
    virtual bool MakeDeformable()
    Definition: opennurbs_sha1.h:19
    -
    virtual bool SwapCoordinates(int i, int j)
    -
    virtual unsigned int SetComponentStates(ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_set) const
    Definition: opennurbs_string.h:2089
    -
    virtual ON::object_type ObjectType() const
    static const ON_PickPoint Unset
    Definition: opennurbs_xform.h:1363
    -
    virtual ON_COMPONENT_INDEX ComponentIndex() const
    Definition: opennurbs_geometry.h:36
    Definition: opennurbs_xform.h:1360
    -
    virtual bool HasBrepForm() const
    -
    virtual bool GetTightBoundingBox(class ON_BoundingBox &tight_bbox, bool bGrowBox=false, const class ON_Xform *xform=nullptr) const
    -
    virtual unsigned int ClearComponentStates(ON_ComponentStatus states_to_clear) const
    -
    virtual unsigned int SizeOf() const
    Definition: opennurbs_compstat.h:413
    Definition: opennurbs_bounding_box.h:25
    Definition: opennurbs_xform.h:28
    -
    virtual void ClearBoundingBox()
    -
    virtual void Dump(ON_TextLog &) const
    Definition: opennurbs_mesh.h:2241
    -
    virtual bool IsDeformable() const
    Definition: opennurbs_compstat.h:88
    Definition: opennurbs_matrix.h:22
    Definition: opennurbs_brep.h:1513
    Definition: opennurbs_object.h:433
    -
    ON_Geometry & operator=(const ON_Geometry &)=default
    Definition: opennurbs_terminator.h:20
    Definition: opennurbs_textlog.h:20
    < use for generic serialization of binary data
    Definition: opennurbs_archive.h:1866
    Definition: opennurbs_bezier.h:1015
    Definition: opennurbs_userdata.h:20
    -
    virtual bool Read(ON_BinaryArchive &binary_archive)
    static const ON_ComponentStatus NoneSet
    Definition: opennurbs_compstat.h:92
    -
    virtual unsigned int GetComponentsWithSetStates(ON_ComponentStatus states_filter, bool bAllEqualStates, ON_SimpleArray< ON_COMPONENT_INDEX > &components) const
    Definition: opennurbs_objref.h:163
    Definition: opennurbs_point.h:480
    -
    bool IsValid(class ON_TextLog *text_log=nullptr) const override
    -
    virtual bool Write(ON_BinaryArchive &binary_archive) const
    -
    virtual ON__UINT32 DataCRC(ON__UINT32 current_remainder) const
    -
    virtual void MarkAggregateComponentStatusAsNotCurrent() const
    -
    virtual class ON_Brep * BrepForm(class ON_Brep *brep=nullptr) const
    -
    virtual ON_AggregateComponentStatus AggregateComponentStatus() const
    Definition: opennurbs_point.h:46
    diff --git a/6/d5/d8a/opennurbs__box_8h_source.html b/6/d5/d8a/opennurbs__box_8h_source.html index 0a23cd81..1caf6f4d 100644 --- a/6/d5/d8a/opennurbs__box_8h_source.html +++ b/6/d5/d8a/opennurbs__box_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_box.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_box.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d5/d8d/class_o_n___referenced_component_settings.html b/6/d5/d8d/class_o_n___referenced_component_settings.html index 0ac2651d..ebcd5700 100644 --- a/6/d5/d8d/class_o_n___referenced_component_settings.html +++ b/6/d5/d8d/class_o_n___referenced_component_settings.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ReferencedComponentSettings Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_ReferencedComponentSettings() [1/2]

    @@ -452,9 +448,9 @@ Public Member Functions
    diff --git a/6/d5/d97/class_o_n___polynomial_surface-members.html b/6/d5/d97/class_o_n___polynomial_surface-members.html index 8049f18c..15e1ce9d 100644 --- a/6/d5/d97/class_o_n___polynomial_surface-members.html +++ b/6/d5/d97/class_o_n___polynomial_surface-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/da2/class_o_n___bounding_box_and_hash.html b/6/d5/da2/class_o_n___bounding_box_and_hash.html index 344d5d16..a4473224 100644 --- a/6/d5/da2/class_o_n___bounding_box_and_hash.html +++ b/6/d5/da2/class_o_n___bounding_box_and_hash.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BoundingBoxAndHash Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/dab/opennurbs__group_8h_source.html b/6/d5/dab/opennurbs__group_8h_source.html index ec1a8699..4508da89 100644 --- a/6/d5/dab/opennurbs__group_8h_source.html +++ b/6/d5/dab/opennurbs__group_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_group.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_group.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/dac/class_o_n___brep_face_side-members.html b/6/d5/dac/class_o_n___brep_face_side-members.html index a2abb708..d71bbbb4 100644 --- a/6/d5/dac/class_o_n___brep_face_side-members.html +++ b/6/d5/dac/class_o_n___brep_face_side-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/dae/class_o_n__3d_vector.html b/6/d5/dae/class_o_n__3d_vector.html index cac917e5..25792751 100644 --- a/6/d5/dae/class_o_n__3d_vector.html +++ b/6/d5/dae/class_o_n__3d_vector.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dVector Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    ◆ operator<()

    +

    ◆ operator<()

    @@ -1759,7 +1757,7 @@ Static Public Attributes
    -

    ◆ operator<=()

    +

    ◆ operator<=()

    @@ -1991,7 +1989,7 @@ Static Public Attributes
    -

    ◆ operator>()

    +

    ◆ operator>()

    @@ -2009,7 +2007,7 @@ Static Public Attributes
    -

    ◆ operator>=()

    +

    ◆ operator>=()

    @@ -2580,9 +2578,9 @@ Static Public Attributes
    diff --git a/6/d5/db3/class_o_n___decode_base64.html b/6/d5/db3/class_o_n___decode_base64.html index b29abd4b..fb47c2ce 100644 --- a/6/d5/db3/class_o_n___decode_base64.html +++ b/6/d5/db3/class_o_n___decode_base64.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_DecodeBase64 Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d5/db5/class_o_n__2f_point-members.html b/6/d5/db5/class_o_n__2f_point-members.html index 0bebbb6d..125da719 100644 --- a/6/d5/db5/class_o_n__2f_point-members.html +++ b/6/d5/db5/class_o_n__2f_point-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/db7/class_o_n___file_iterator.html b/6/d5/db7/class_o_n___file_iterator.html index 47496c2e..a485dc5b 100644 --- a/6/d5/db7/class_o_n___file_iterator.html +++ b/6/d5/db7/class_o_n___file_iterator.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_FileIterator Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Current item query
    -Returns: Current file or directory name in the directory being iterated. Use CurrentFullPathItemName() to get the full path name.

    +

    Current item query Returns: Current file or directory name in the directory being iterated. Use CurrentFullPathItemName() to get the full path name.

    @@ -332,8 +329,7 @@ Returns: Current file or directory name in the directory being iterated. Use Cur
    -

    Iteratation iteration tools
    - Description: Find the first matching item in the directory. Example: / Iterate through the files in a directory named "\rootdir\subdir" ON_FileIterator fit; fit.Initialize("\\rootdir\\subdir"); for ( bool bHaveItem = fit.FirstItem(); bHaveItem; bHaveItem = fit.NextItem() ) { if ( fit.CurrentFileIsDirectory() ) continue; ON_String fullpath = fit.CurrentItemFullPathName(); FILE* fp = ON_FileStream::Open(fullpath,"rb"); if ( 0 == fp ) { continue; } ... ON_FileStream::Close(fp); fp = 0; } }

    +

    Iteratation iteration tools Description: Find the first matching item in the directory. Example: / Iterate through the files in a directory named "\rootdir\subdir" ON_FileIterator fit; fit.Initialize("\\rootdir\\subdir"); for ( bool bHaveItem = fit.FirstItem(); bHaveItem; bHaveItem = fit.NextItem() ) { if ( fit.CurrentFileIsDirectory() ) continue; ON_String fullpath = fit.CurrentItemFullPathName(); FILE* fp = ON_FileStream::Open(fullpath,"rb"); if ( 0 == fp ) { continue; } ... ON_FileStream::Close(fp); fp = 0; } }

    Returns: true: The iterator is set to the first item. false: There are no matching items.

    @@ -353,8 +349,7 @@ Returns: Current file or directory name in the directory being iterated. Use Cur
    -

    Iteratation initialization tools
    -Description: Initialize where the search should occur. Parameters: directory_name - [in] The directory to look in. item_name_filter - [in] If this paramter is null, then the iteration includes all names in the directory. The item name to search for. This parameter can include wildcard characters, such as an asterisk (*) or a question mark (?). For example, "\rootdir\subdir\*.*" will iterate all files in the \ directory.

    +

    Iteratation initialization tools Description: Initialize where the search should occur. Parameters: directory_name - [in] The directory to look in. item_name_filter - [in] If this paramter is null, then the iteration includes all names in the directory. The item name to search for. This parameter can include wildcard characters, such as an asterisk (*) or a question mark (?). For example, "\rootdir\subdir\*.*" will iterate all files in the \ directory.

    Returns: true: The iterator is set to the first item. false: There are no matching items.

    Remarks: Calling FirstItem() is eqivalent to calling Initialize() and then calling NextItem().

    @@ -473,9 +468,9 @@ Description: Initialize where the search should occur. Parameters: directory_nam
    diff --git a/6/d5/dba/class_o_n___uncompress_stream-members.html b/6/d5/dba/class_o_n___uncompress_stream-members.html index cb894af4..9b6359a5 100644 --- a/6/d5/dba/class_o_n___uncompress_stream-members.html +++ b/6/d5/dba/class_o_n___uncompress_stream-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/dc9/opennurbs__userdata_8h_source.html b/6/d5/dc9/opennurbs__userdata_8h_source.html index fd7ada4c..50bdfc94 100644 --- a/6/d5/dc9/opennurbs__userdata_8h_source.html +++ b/6/d5/dc9/opennurbs__userdata_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_userdata.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_userdata.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_userdata.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_USERDATA_INC_)
    18 #define OPENNURBS_USERDATA_INC_
    19 
    20 class ON_CLASS ON_UserData : public ON_Object
    21 {
    22  ON_OBJECT_DECLARE(ON_UserData);
    23 public:
    24  ON_UserData();
    25  ON_UserData(const ON_UserData&);
    27 
    28  //////////
    29  // The destructor automatically removes the user data
    30  // from ON_Object::m_userdata_list.
    31  ~ON_UserData();
    32 
    33  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    34 
    35  /*
    36  Description:
    37  Overrides virtual ON_Object::Dump().
    38  Prints class name, description, and uuid.
    39  Parameters:
    40  text_log - [in] Information is sent to this text log.
    41  Remarks:
    42  */
    43  void Dump( ON_TextLog& text_log ) const override;
    44 
    45  /*
    46  Description:
    47  Overrides virtual ON_Object::SizeOf().
    48  Returns:
    49  Approximate number of bytes this class uses.
    50  */
    51  unsigned int SizeOf() const override;
    52 
    53  ////////
    54  // Returns object that owns the user data
    55  ON_Object* Owner() const;
    56 
    57  ////////
    58  // Used for traversing list of user data attached
    59  // to an object.
    60  ON_UserData* Next() const;
    61 
    62  ////////
    63  // Returns the class id which is not necessarily the
    64  // same as m_userdata_uuid.
    65  ON_UUID UserDataClassUuid() const;
    66 
    67  //////////
    68  // Returns true if the user data is anonymous. This happens
    69  // when the user data class is not defined at the time the
    70  // user data is read from an archive. For example, if a class
    71  // derived from ON_UserData is defined in application A
    72  // but is not defined in application B, then the class can be
    73  // defined when an archive is written by A but not exist when
    74  // an archive is read by B. In this case, the
    75  // user data is not lost, it is just read as ON_UnknownUserData
    76  // by application B. If application B saves the parent
    77  // object in an archive, the unknown user data is resaved in
    78  // a form that can be read by application A.
    79  bool IsUnknownUserData() const;
    80 
    81  /*
    82  Parameters:
    83  description - [out] description of user data shown in
    84  object properties dump.
    85  Returns:
    86  True if user data class is ready.
    87  */
    88  virtual
    89  bool GetDescription( ON_wString& description );
    90 
    91  /*
    92  Description:
    93  If Archive() returns true, m_application_uuid is not nil,
    94  and the virtual Read() and Write() are functions are overridden,
    95  then this user data will be written to and read from 3dm archives.
    96 
    97  Returns:
    98  true if user data should be saved in binary archives.
    99  false if the user data should not be saved in binary archives.
    100 
    101  Remarks:
    102  The default implementation returns false. If you override
    103  ON_UserData::Archive so that it returns true, then your
    104  constructor must set m_application_uuid, you must override
    105  the virtual ON_Object::Read and ON_Object::Write functions and
    106  you must CAREFULLY TEST your code.
    107 
    108  ON_UserData requires expert programming and testing skills.
    109 
    110  If you need to know more details about the archive or
    111  parent object to determine if the userdata should be saved,
    112  then override WriteToArchive().
    113 
    114  YOU SHOULD READ AND UNDERSTAND EVERY COMMENT IN THIS
    115  HEADER FILE IN BEFORE ATTEMPTING TO USE ON_UserData.
    116  */
    117  virtual
    118  bool Archive() const;
    119 
    120  /*
    121  Description:
    122  If WriteToArchive() returns true, m_application_uuid is not nil,
    123  and the virtual Read() and Write() are functions are overridden,
    124  then this user data will be written to and read from the
    125  identified archive.
    126 
    127  Parameters:
    128  archive - [in]
    129  The archive being written to. Typically, you will test
    130  archive.Archive3dmVersion() to deterime if your userdata
    131  should be saved.
    132  parent_object - [in]
    133  The object managing this userdata.
    134  Returns:
    135  true if user data should be saved in the binary archives.
    136  false if the user data should not be saved in binary archives.
    137 
    138  Remarks:
    139  The default implementation calls the legacy Archive() function.
    140  */
    141  virtual
    142  bool WriteToArchive(
    143  const class ON_BinaryArchive& archive,
    144  const class ON_Object* parent_object
    145  ) const;
    146 
    147  /*
    148  Description:
    149  DeleteAfterWrite() is used when opennurbs is writing earlier
    150  versions of 3dm archives that used some type of user data that
    151  has since become obsolete.
    152 
    153  Parameters:
    154  archive - [in]
    155  archive that will be written to.
    156  If needed, you can inspect the version of 3dm archive this
    157  is being saved and other information that you may need to
    158  determine the approprite return value.
    159  parent_object - [in]
    160  If needed, you can inspect the parent object to determine
    161  the approprite return value.
    162 
    163  Returns:
    164  True if the user data should be written the next
    165  time the parent object is saved to a 3dm archive and
    166  then deleted.
    167 
    168  Remarks:
    169  Typically, DeleteAfterWrite() is used in the situation where
    170  1) User data was used to add information to an opennurbs class
    171  whose data fields could not be modified because the SDK
    172  was fixed at the time.
    173  2) Once the class data fields could be modified, the new data
    174  fields were added to the class and the user data from step 1
    175  became obsolete.
    176  3) The class's Write function is called and the value of
    177  ON_BinaryArchive::Archive3dmVersion() corresponds to
    178  the version of the 3dm archive that was being saved in
    179  step 1. The write function fills in and attaches the obsolete
    180  user data to the class. When ON_BinaryArchive::WriteObject()
    181  writes the obsolete user data to the earlier version file,
    182  it then deletes it.
    183  */
    184  virtual
    185  bool DeleteAfterWrite(
    186  const class ON_BinaryArchive& archive,
    187  const class ON_Object* parent_object
    188  ) const;
    189 
    190  /*
    191  Description:
    192  DeleteAfterRead() is used when opennurbs is reading earlier
    193  versions of 3dm archives that used some type of user data that
    194  has since become obsolete.
    195 
    196  Parameters:
    197  archive - [in]
    198  archive that was read from.
    199  If needed, you can inspect the version of 3dm archive this
    200  is being saved and other information that you may need to
    201  determine the approprite return value.
    202  parent_object - [in]
    203  If needed, you can inspect the parent object to determine
    204  the approprite return value.
    205 
    206  Returns:
    207  True if the user data should be deleted because the
    208  information it contains has been added to the parent
    209  object using the methods that are current.
    210  */
    211  virtual
    212  bool DeleteAfterRead(
    213  const class ON_BinaryArchive& archive,
    214  class ON_Object* parent_object
    215  ) const;
    216 
    217  /*
    218  Description:
    219  If Transform() return false, then the userdata is destroyed when
    220  its parent object is transformed. The default Transform()
    221  updates m_userdata_xform and returns true.
    222  Carefully read the comments above m_userdata_xform
    223  */
    224  virtual
    225  bool Transform( const ON_Xform& );
    226 
    227  /*
    228  Description:
    229  This uuid is the value that must be passed to
    230  ON_Object::GetUserData() to retrieve
    231  this piece of user data.
    232  */
    234 
    235  /*
    236  Description:
    237  This uuid is used to identify the application that
    238  created this piece of user data. In the case of
    239  Rhino, this is the id of the plug-in that created
    240  the user data. User data with a nil application id
    241  will not be saved in 3dm archives.
    242  */
    244 
    245  ////////
    246  // If m_userdata_copycount is 0, user data is not copied when
    247  // object is copied. If > 0, user data is copied and m_copycount
    248  // is incremented when parent object is copied. The user data's
    249  // operator=() is used to copy.
    250  // The default ON_UserData::ON_UserData() constructor sets
    251  // m_userdata_copycount to zero.
    252  unsigned int m_userdata_copycount;
    253 
    254  ////////
    255  // Updated if user data is attached to a piece of geometry that is
    256  // transformed and the virtual ON_UserData::Transform() is not
    257  // overridden. If you override ON_UserData::Transform() and want
    258  // m_userdata_xform to be updated, then call the
    259  // ON_UserData::Transform() in your override.
    260  // The default constructor sets m_userdata_xform to the identity.
    262 
    263 private: // don't look and don't touch - these may change
    264  friend class ON_Object;
    265  friend int ON_BinaryArchive::ReadObject( ON_Object** );
    266  friend bool ON_BinaryArchive::WriteObject( const ON_Object& );
    268  friend bool ON_BinaryArchive::WriteObjectUserData( const ON_Object& );
    269  ON_Object* m_userdata_owner;
    270  ON_UserData* m_userdata_next;
    271 };
    272 
    273 class ON_CLASS ON_UnknownUserData : public ON_UserData
    274 {
    275  ON_OBJECT_DECLARE(ON_UnknownUserData);
    276  // used to hold user data when the application class is not loaded
    277  // at time data is read
    278 public:
    283 
    284  // ON_Object overrides
    285 
    286  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    287  void Dump( ON_TextLog& ) const override;
    288  bool Write( ON_BinaryArchive& ) const override;
    289  bool Read( ON_BinaryArchive& ) override;
    290 
    291  unsigned int SizeOf() const override; // return amount of memory used by user data
    292  bool GetDescription( ON_wString& ) override; // description of user data
    293  bool Archive() const override;
    294 
    295  // Convert unknown user data to actual user data. Useful if
    296  // definition of actual user data is dynamically linked after
    297  // archive containing user data is read.
    298  ON_UserData* Convert() const;
    299 
    300  /*
    301  Description:
    302  This is the uuid of the missing class. This uuid
    303  is the 3rd parameter to the ON_OBJECT_IMPLEMENT()
    304  macro of the missing class.
    305  */
    308  void* m_buffer;
    309 
    310  // These version numbers are set when unknown user data is read
    311  // from a file record the version of the 3dm archive and the
    312  // version of opennurbs that were used when the plug-in wrote
    313  // the user data.
    314  // This information was added in to V5 opennurbs 200910190.
    315  // For files written with earlier versions of opennurbs, these
    316  // values are set from the archive containing the user data.
    317  // The purpose of this version information is to have it accompany
    318  // unknown user data so that if is is eventually read by the plug-in
    319  // an ON_BinaryArchive with correct version information can be
    320  // passed to the plug-in's reading code. In archives, these values
    321  // are stored in the TCODE_USER_TABLE_RECORD_HEADER chunk.
    322  int m_3dm_version; // 3dm archive version (0,1,2,3,4,5,50,...)
    323 
    324 
    325  // In V5 and earlier, m_3dm_opennurbs_version had the format YYYYMMDDN
    326  // For V6 the unsigned int value is calculated by ON_VersionNumberConstruct()
    327  // and has the high bit set (it will be negative if used as a signed int).
    328  // When writing files in previous version formats (V5 or earlier) it is important
    329  // to write a YYYYMMDDN version number in the file. Use ON_VersionNumberParse()
    330  // get the YYYY, MM, DD and N values from m_3dm_opennurbs_version.
    332 };
    333 
    334 class ON_CLASS ON_ObsoleteUserData : public ON_UserData
    335 {
    336  ON_OBJECT_DECLARE(ON_ObsoleteUserData);
    337  // used to write obsolete user data when earlier versions
    338  // of 3dm archives are written and the class id for the
    339  // earlier version of the user data is still in use
    340  // in the current version of opennurbs.
    341 public:
    343  virtual ~ON_ObsoleteUserData();
    346 
    347  // This is the user data class id that will be saved in the 3dm archive.
    349 };
    350 
    351 // Do not export this class
    352 // It is used internally to read and write 3dm achives with versions < 60.
    354 {
    355  // NO ON_OBJECT_DECLARE() for classes derived from ON_ObsoleteUserData
    356 private:
    357  static const ON_UUID m_archive_class_id_ctor;
    358  static const ON_UUID m_archive_userdata_uuid_ctor;
    359  static const ON_UUID m_archive_application_uuid_ctor;
    360  static const unsigned int m_userdata_copycount_ctor;
    361  static const ON_Xform m_userdata_xform_ctor;
    362 
    363 public:
    365  ON_UUID class_id,
    366  ON_UUID userdata_id,
    367  ON_UUID app_id,
    368  ON_Object* object
    369  );
    370 
    375 
    376  // virtual ON_Object override
    377  bool Read(
    379  ) override;
    380 
    381  // virtual ON_Object override
    382  bool Write(
    384  ) const override;
    385 
    386  // virtual ON_UserData override
    387  bool GetDescription(ON_wString& description) override;
    388 
    389  // virtual ON_UserData override
    390  bool WriteToArchive(
    391  const class ON_BinaryArchive& archive,
    392  const class ON_Object* parent_object
    393  ) const override;
    394 
    395  // virtual ON_UserData override
    396  bool DeleteAfterWrite(
    397  const ON_BinaryArchive& archive,
    398  const ON_Object* parent_object
    399  ) const override;
    400 
    401  // virtual ON_UserData override
    402  bool DeleteAfterRead(
    403  const ON_BinaryArchive& archive,
    404  ON_Object* parent_object
    405  ) const override;
    406 
    408 };
    409 
    410 class ON_CLASS ON_UserStringList : public ON_UserData
    411 {
    412  ON_OBJECT_DECLARE(ON_UserStringList);
    413 public:
    414 
    417 
    418  static ON_UserStringList* FromObject(
    419  const ON_Object*
    420  );
    421 
    422  // override virtual ON_Object::Dump function
    423  void Dump( ON_TextLog& text_log ) const override;
    424 
    425  // override virtual ON_Object::SizeOf function
    426  unsigned int SizeOf() const override;
    427 
    428  // override virtual ON_Object::DataCRC function
    429  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const override;
    430 
    431  // override virtual ON_Object::Write function
    432  bool Write(ON_BinaryArchive& binary_archive) const override;
    433 
    434  // override virtual ON_Object::Read function
    435  bool Read(ON_BinaryArchive& binary_archive) override;
    436 
    437  // override virtual ON_UserData::GetDescription function
    438  bool GetDescription( ON_wString& description ) override;
    439 
    440  // override virtual ON_UserData::Archive function
    441  bool Archive() const override;
    442 
    443  /*
    444  Description:
    445  Add, replace or remove a user string.
    446  Parameters:
    447  key - [in]
    448  must be a non-empty string. If an entry with the same key
    449  (case insensitive compares are used) exists, the existing
    450  entry is updated.
    451  string_value - [in]
    452  If string_value is empty and an entry with a matching key
    453  exists, the entry is deleted.
    454  Returns:
    455  True if the key is valid.
    456  */
    457  bool SetUserString( const wchar_t* key, const wchar_t* string_value );
    458 
    459  bool GetUserString( const wchar_t* key, ON_wString& string_value ) const;
    460 
    461  /*
    462  Description:
    463  Append entries to the user string list
    464  Parameters:
    465  count - [in]
    466  number of element in us[] array
    467  us - [in]
    468  entries to append.
    469  bReplace - [in]
    470  If bReplace is true, then existing entries with the same key are
    471  updated with the new entry's value. If bReplace is false, then
    472  existing entries are not updated.
    473  Returns:
    474  Number of entries added, deleted, or modified.
    475  */
    476  int SetUserStrings( int count, const ON_UserString* us, bool bReplace );
    477 
    479 };
    480 
    481 class ON_CLASS ON_UserDataHolder : public ON_Object
    482 {
    483 public:
    484 
    485  /*
    486  Description:
    487  Transfers the user data from source_object to "this".
    488  When MoveUserDataFrom() returns source_object will not
    489  have any user data. If "this" had user data when
    490  MoveUserDataFrom() was called, then that user data is
    491  destroyed.
    492  Parameters:
    493  source_object - [in] The "const" is a lie. It is
    494  there because, in practice the source object is frequently
    495  const and const_cast ends up being excessively used.
    496  Returns:
    497  Number of user data items that were moved from source_object to "this" ON_UserDataHolder.
    498  */
    499  unsigned int MoveUserDataFrom(
    500  const ON_Object& source_object
    501  );
    502 
    503 
    504  /*
    505  Description:
    506  Copies the data from source_object with copy_count > 0 to "this" ON_UserDataHolder.
    507  Parameters:
    508  source_object - [in]
    509  This object and it's user data are not modified.
    510  user_data_item_id - [in]
    511  If not nil, then only userdata with this item id will be coped
    512  Returns:
    513  Number of user data items that were copied from source_object to "this" ON_UserDataHolder.
    514  */
    515  unsigned int CopyUserDataFrom(
    516  const ON_Object& source_object,
    517  ON_UUID user_data_item_id
    518  );
    519 
    520  /*
    521  Description:
    522  Moves the user data on "this" ON_UserDataHolder to destination_object.
    523  When MoveUserDataTo() returns "this" ON_UserDataHolder will not have any user data.
    524  Parameters:
    525  destination_object - [in] The "const" is a lie. It is
    526  there because, in practice the source object is generally
    527  const and const_cast ends up being constantly used.
    528  bAppend - [in]
    529  true:
    530  Existing user data on destination_object is left unchanged.
    531  MoveUserDataTo( destination_object, true ) is identical to calling
    532  MoveUserDataTo( destination_object, ON_Object::UserDataConflictResolution::destination_object).
    533  false:
    534  Existing user data on destination_object is destroyed.
    535  Returns:
    536  Number of user data items moved from "this" ON_UserDataHolder to destination_object.
    537  */
    538  unsigned int MoveUserDataTo(
    539  const ON_Object& destination_object,
    540  bool bAppend
    541  );
    542 
    543  /*
    544  Description:
    545  Moves the user data on "this" ON_UserDataHolder to destination_object.
    546  When MoveUserDataTo() returns "this" ON_UserDataHolder will not have any user data.
    547  Parameters:
    548  destination_object - [in]
    549  The "const" is a lie. It is there because, in practice the source object is generally
    550  const and const_cast ends up being constantly used.
    551  user_data_item_id - [in]
    552  If not nil, then only user data items with this id will be considered for moving.
    553  userdata_conflict_resolution - [in]
    554  If destination_object and "this" ON_UserDataHolder have the same
    555  type of user data item, then userdata_conflict_resolution
    556  is used to determine if that destination_object user data item
    557  is replaced with the one on "this" ON_UserDataHolder.
    558  Returns:
    559  Number of user data items moved from "this" ON_UserDataHolder to destination_object.
    560  */
    561  unsigned int MoveUserDataTo(
    562  const ON_Object& destination_object,
    563  ON_UUID user_data_item_id,
    564  ON_Object::UserDataConflictResolution userdata_conflict_resolution
    565  );
    566 
    567 
    568  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    569 };
    570 
    571 /*
    572 Description:
    573  An ON_DocumentUserStringList object is saved in the list of user
    574  tables. The Rhino SetDocumentText and GetDocumentText
    575  commands use the ON_Object SetUserString, GetUserString,
    576  GetUserStrings, GetUserStringKeys functions on an
    577  ON_DocumentUserStringList class to manage the tag-value pairs of
    578  strings.
    579 */
    580 class ON_CLASS ON_DocumentUserStringList : public ON_Object
    581 {
    582  ON_OBJECT_DECLARE(ON_DocumentUserStringList);
    583 public:
    586 
    587  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    588  void Dump( ON_TextLog& ) const override;
    589  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const override;
    590  bool Write(ON_BinaryArchive& binary_archive) const override;
    591  bool Read(ON_BinaryArchive& binary_archive) override;
    592 
    593  // Use the
    594  // ON_Object::SetUserString()
    595  // ON_Object::GetUserString()
    596  // ON_Object::GetUserStrings()
    597  // ON_Object::GetUserStringKeys()
    598  // ON_Object::UserStringCount()
    599  // functions to access and modify user string information.
    600 };
    601 
    602 #endif
    unsigned int SizeOf() const override
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_USERDATA_INC_)
    18 #define OPENNURBS_USERDATA_INC_
    19 
    20 class ON_CLASS ON_UserData : public ON_Object
    21 {
    22  ON_OBJECT_DECLARE(ON_UserData);
    23 public:
    24  ON_UserData();
    25  ON_UserData(const ON_UserData&);
    27 
    28  //////////
    29  // The destructor automatically removes the user data
    30  // from ON_Object::m_userdata_list.
    31  ~ON_UserData();
    32 
    33  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    34 
    35  /*
    36  Description:
    37  Overrides virtual ON_Object::Dump().
    38  Prints class name, description, and uuid.
    39  Parameters:
    40  text_log - [in] Information is sent to this text log.
    41  Remarks:
    42  */
    43  void Dump( ON_TextLog& text_log ) const override;
    44 
    45  /*
    46  Description:
    47  Overrides virtual ON_Object::SizeOf().
    48  Returns:
    49  Approximate number of bytes this class uses.
    50  */
    51  unsigned int SizeOf() const override;
    52 
    53  ////////
    54  // Returns object that owns the user data
    55  ON_Object* Owner() const;
    56 
    57  ////////
    58  // Used for traversing list of user data attached
    59  // to an object.
    60  ON_UserData* Next() const;
    61 
    62  ////////
    63  // Returns the class id which is not necessarily the
    64  // same as m_userdata_uuid.
    65  ON_UUID UserDataClassUuid() const;
    66 
    67  //////////
    68  // Returns true if the user data is anonymous. This happens
    69  // when the user data class is not defined at the time the
    70  // user data is read from an archive. For example, if a class
    71  // derived from ON_UserData is defined in application A
    72  // but is not defined in application B, then the class can be
    73  // defined when an archive is written by A but not exist when
    74  // an archive is read by B. In this case, the
    75  // user data is not lost, it is just read as ON_UnknownUserData
    76  // by application B. If application B saves the parent
    77  // object in an archive, the unknown user data is resaved in
    78  // a form that can be read by application A.
    79  bool IsUnknownUserData() const;
    80 
    81  /*
    82  Parameters:
    83  description - [out] description of user data shown in
    84  object properties dump.
    85  Returns:
    86  True if user data class is ready.
    87  */
    88  virtual
    89  bool GetDescription( ON_wString& description );
    90 
    91  /*
    92  Description:
    93  If Archive() returns true, m_application_uuid is not nil,
    94  and the virtual Read() and Write() are functions are overridden,
    95  then this user data will be written to and read from 3dm archives.
    96 
    97  Returns:
    98  true if user data should be saved in binary archives.
    99  false if the user data should not be saved in binary archives.
    100 
    101  Remarks:
    102  The default implementation returns false. If you override
    103  ON_UserData::Archive so that it returns true, then your
    104  constructor must set m_application_uuid, you must override
    105  the virtual ON_Object::Read and ON_Object::Write functions and
    106  you must CAREFULLY TEST your code.
    107 
    108  ON_UserData requires expert programming and testing skills.
    109 
    110  If you need to know more details about the archive or
    111  parent object to determine if the userdata should be saved,
    112  then override WriteToArchive().
    113 
    114  YOU SHOULD READ AND UNDERSTAND EVERY COMMENT IN THIS
    115  HEADER FILE IN BEFORE ATTEMPTING TO USE ON_UserData.
    116  */
    117  virtual
    118  bool Archive() const;
    119 
    120  /*
    121  Description:
    122  If WriteToArchive() returns true, m_application_uuid is not nil,
    123  and the virtual Read() and Write() are functions are overridden,
    124  then this user data will be written to and read from the
    125  identified archive.
    126 
    127  Parameters:
    128  archive - [in]
    129  The archive being written to. Typically, you will test
    130  archive.Archive3dmVersion() to deterime if your userdata
    131  should be saved.
    132  parent_object - [in]
    133  The object managing this userdata.
    134  Returns:
    135  true if user data should be saved in the binary archives.
    136  false if the user data should not be saved in binary archives.
    137 
    138  Remarks:
    139  The default implementation calls the legacy Archive() function.
    140  */
    141  virtual
    142  bool WriteToArchive(
    143  const class ON_BinaryArchive& archive,
    144  const class ON_Object* parent_object
    145  ) const;
    146 
    147  /*
    148  Description:
    149  DeleteAfterWrite() is used when opennurbs is writing earlier
    150  versions of 3dm archives that used some type of user data that
    151  has since become obsolete.
    152 
    153  Parameters:
    154  archive - [in]
    155  archive that will be written to.
    156  If needed, you can inspect the version of 3dm archive this
    157  is being saved and other information that you may need to
    158  determine the approprite return value.
    159  parent_object - [in]
    160  If needed, you can inspect the parent object to determine
    161  the approprite return value.
    162 
    163  Returns:
    164  True if the user data should be written the next
    165  time the parent object is saved to a 3dm archive and
    166  then deleted.
    167 
    168  Remarks:
    169  Typically, DeleteAfterWrite() is used in the situation where
    170  1) User data was used to add information to an opennurbs class
    171  whose data fields could not be modified because the SDK
    172  was fixed at the time.
    173  2) Once the class data fields could be modified, the new data
    174  fields were added to the class and the user data from step 1
    175  became obsolete.
    176  3) The class's Write function is called and the value of
    177  ON_BinaryArchive::Archive3dmVersion() corresponds to
    178  the version of the 3dm archive that was being saved in
    179  step 1. The write function fills in and attaches the obsolete
    180  user data to the class. When ON_BinaryArchive::WriteObject()
    181  writes the obsolete user data to the earlier version file,
    182  it then deletes it.
    183  */
    184  virtual
    185  bool DeleteAfterWrite(
    186  const class ON_BinaryArchive& archive,
    187  const class ON_Object* parent_object
    188  ) const;
    189 
    190  /*
    191  Description:
    192  DeleteAfterRead() is used when opennurbs is reading earlier
    193  versions of 3dm archives that used some type of user data that
    194  has since become obsolete.
    195 
    196  Parameters:
    197  archive - [in]
    198  archive that was read from.
    199  If needed, you can inspect the version of 3dm archive this
    200  is being saved and other information that you may need to
    201  determine the approprite return value.
    202  parent_object - [in]
    203  If needed, you can inspect the parent object to determine
    204  the approprite return value.
    205 
    206  Returns:
    207  True if the user data should be deleted because the
    208  information it contains has been added to the parent
    209  object using the methods that are current.
    210  */
    211  virtual
    212  bool DeleteAfterRead(
    213  const class ON_BinaryArchive& archive,
    214  class ON_Object* parent_object
    215  ) const;
    216 
    217  /*
    218  Description:
    219  If Transform() return false, then the userdata is destroyed when
    220  its parent object is transformed. The default Transform()
    221  updates m_userdata_xform and returns true.
    222  Carefully read the comments above m_userdata_xform
    223  */
    224  virtual
    225  bool Transform( const ON_Xform& );
    226 
    227  /*
    228  Description:
    229  This uuid is the value that must be passed to
    230  ON_Object::GetUserData() to retrieve
    231  this piece of user data.
    232  */
    234 
    235  /*
    236  Description:
    237  This uuid is used to identify the application that
    238  created this piece of user data. In the case of
    239  Rhino, this is the id of the plug-in that created
    240  the user data. User data with a nil application id
    241  will not be saved in 3dm archives.
    242  */
    244 
    245  ////////
    246  // If m_userdata_copycount is 0, user data is not copied when
    247  // object is copied. If > 0, user data is copied and m_copycount
    248  // is incremented when parent object is copied. The user data's
    249  // operator=() is used to copy.
    250  // The default ON_UserData::ON_UserData() constructor sets
    251  // m_userdata_copycount to zero.
    252  unsigned int m_userdata_copycount;
    253 
    254  ////////
    255  // Updated if user data is attached to a piece of geometry that is
    256  // transformed and the virtual ON_UserData::Transform() is not
    257  // overridden. If you override ON_UserData::Transform() and want
    258  // m_userdata_xform to be updated, then call the
    259  // ON_UserData::Transform() in your override.
    260  // The default constructor sets m_userdata_xform to the identity.
    262 
    263 private: // don't look and don't touch - these may change
    264  friend class ON_Object;
    265  friend int ON_BinaryArchive::ReadObject( ON_Object** );
    266  friend bool ON_BinaryArchive::WriteObject( const ON_Object& );
    268  friend bool ON_BinaryArchive::WriteObjectUserData( const ON_Object& );
    269  ON_Object* m_userdata_owner;
    270  ON_UserData* m_userdata_next;
    271 };
    272 
    273 class ON_CLASS ON_UnknownUserData : public ON_UserData
    274 {
    275  ON_OBJECT_DECLARE(ON_UnknownUserData);
    276  // used to hold user data when the application class is not loaded
    277  // at time data is read
    278 public:
    283 
    284  // ON_Object overrides
    285 
    286  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    287  void Dump( ON_TextLog& ) const override;
    288  bool Write( ON_BinaryArchive& ) const override;
    289  bool Read( ON_BinaryArchive& ) override;
    290 
    291  unsigned int SizeOf() const override; // return amount of memory used by user data
    292  bool GetDescription( ON_wString& ) override; // description of user data
    293  bool Archive() const override;
    294 
    295  // Convert unknown user data to actual user data. Useful if
    296  // definition of actual user data is dynamically linked after
    297  // archive containing user data is read.
    298  ON_UserData* Convert() const;
    299 
    300  /*
    301  Description:
    302  This is the uuid of the missing class. This uuid
    303  is the 3rd parameter to the ON_OBJECT_IMPLEMENT()
    304  macro of the missing class.
    305  */
    308  void* m_buffer;
    309 
    310  // These version numbers are set when unknown user data is read
    311  // from a file record the version of the 3dm archive and the
    312  // version of opennurbs that were used when the plug-in wrote
    313  // the user data.
    314  // This information was added in to V5 opennurbs 200910190.
    315  // For files written with earlier versions of opennurbs, these
    316  // values are set from the archive containing the user data.
    317  // The purpose of this version information is to have it accompany
    318  // unknown user data so that if is is eventually read by the plug-in
    319  // an ON_BinaryArchive with correct version information can be
    320  // passed to the plug-in's reading code. In archives, these values
    321  // are stored in the TCODE_USER_TABLE_RECORD_HEADER chunk.
    322  int m_3dm_version; // 3dm archive version (0,1,2,3,4,5,50,...)
    323 
    324 
    325  // In V5 and earlier, m_3dm_opennurbs_version had the format YYYYMMDDN
    326  // For V6 the unsigned int value is calculated by ON_VersionNumberConstruct()
    327  // and has the high bit set (it will be negative if used as a signed int).
    328  // When writing files in previous version formats (V5 or earlier) it is important
    329  // to write a YYYYMMDDN version number in the file. Use ON_VersionNumberParse()
    330  // get the YYYY, MM, DD and N values from m_3dm_opennurbs_version.
    332 };
    333 
    334 class ON_CLASS ON_ObsoleteUserData : public ON_UserData
    335 {
    336  ON_OBJECT_DECLARE(ON_ObsoleteUserData);
    337  // used to write obsolete user data when earlier versions
    338  // of 3dm archives are written and the class id for the
    339  // earlier version of the user data is still in use
    340  // in the current version of opennurbs.
    341 public:
    343  virtual ~ON_ObsoleteUserData();
    346 
    347  // This is the user data class id that will be saved in the 3dm archive.
    349 };
    350 
    351 // Do not export this class
    352 // It is used internally to read and write 3dm achives with versions < 60.
    354 {
    355  // NO ON_OBJECT_DECLARE() for classes derived from ON_ObsoleteUserData
    356 private:
    357  static const ON_UUID m_archive_class_id_ctor;
    358  static const ON_UUID m_archive_userdata_uuid_ctor;
    359  static const ON_UUID m_archive_application_uuid_ctor;
    360  static const unsigned int m_userdata_copycount_ctor;
    361  static const ON_Xform m_userdata_xform_ctor;
    362 
    363 public:
    364  static bool IsRdkMaterialInstanceIdUserData(
    365  ON_UUID class_id,
    366  ON_UUID userdata_id,
    367  ON_UUID app_id,
    368  ON_Object* object
    369  );
    370 
    375 
    376  // virtual ON_Object override
    377  bool Read(
    379  ) override;
    380 
    381  // virtual ON_Object override
    382  bool Write(
    384  ) const override;
    385 
    386  // virtual ON_UserData override
    387  bool GetDescription(ON_wString& description) override;
    388 
    389  // virtual ON_UserData override
    390  bool WriteToArchive(
    391  const class ON_BinaryArchive& archive,
    392  const class ON_Object* parent_object
    393  ) const override;
    394 
    395  // virtual ON_UserData override
    396  bool DeleteAfterWrite(
    397  const ON_BinaryArchive& archive,
    398  const ON_Object* parent_object
    399  ) const override;
    400 
    401  // virtual ON_UserData override
    402  bool DeleteAfterRead(
    403  const ON_BinaryArchive& archive,
    404  ON_Object* parent_object
    405  ) const override;
    406 
    408 };
    409 
    410 class ON_CLASS ON_UserStringList : public ON_UserData
    411 {
    412  ON_OBJECT_DECLARE(ON_UserStringList);
    413 public:
    414 
    417 
    418  static ON_UserStringList* FromObject(
    419  const ON_Object*
    420  );
    421 
    422  // override virtual ON_Object::Dump function
    423  void Dump( ON_TextLog& text_log ) const override;
    424 
    425  // override virtual ON_Object::SizeOf function
    426  unsigned int SizeOf() const override;
    427 
    428  // override virtual ON_Object::DataCRC function
    429  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const override;
    430 
    431  // override virtual ON_Object::Write function
    432  bool Write(ON_BinaryArchive& binary_archive) const override;
    433 
    434  // override virtual ON_Object::Read function
    435  bool Read(ON_BinaryArchive& binary_archive) override;
    436 
    437  // override virtual ON_UserData::GetDescription function
    438  bool GetDescription( ON_wString& description ) override;
    439 
    440  // override virtual ON_UserData::Archive function
    441  bool Archive() const override;
    442 
    443  /*
    444  Description:
    445  Add, replace or remove a user string.
    446  Parameters:
    447  key - [in]
    448  must be a non-empty string. If an entry with the same key
    449  (case insensitive compares are used) exists, the existing
    450  entry is updated.
    451  string_value - [in]
    452  If string_value is empty and an entry with a matching key
    453  exists, the entry is deleted.
    454  Returns:
    455  True if the key is valid.
    456  */
    457  bool SetUserString( const wchar_t* key, const wchar_t* string_value );
    458 
    459  bool GetUserString( const wchar_t* key, ON_wString& string_value ) const;
    460 
    461  /*
    462  Description:
    463  Append entries to the user string list
    464  Parameters:
    465  count - [in]
    466  number of element in us[] array
    467  us - [in]
    468  entries to append.
    469  bReplace - [in]
    470  If bReplace is true, then existing entries with the same key are
    471  updated with the new entry's value. If bReplace is false, then
    472  existing entries are not updated.
    473  Returns:
    474  Number of entries added, deleted, or modified.
    475  */
    476  int SetUserStrings( int count, const ON_UserString* us, bool bReplace );
    477 
    479 };
    480 
    481 class ON_CLASS ON_UserDataHolder : public ON_Object
    482 {
    483 public:
    484 
    485  /*
    486  Description:
    487  Transfers the user data from source_object to "this".
    488  When MoveUserDataFrom() returns source_object will not
    489  have any user data. If "this" had user data when
    490  MoveUserDataFrom() was called, then that user data is
    491  destroyed.
    492  Parameters:
    493  source_object - [in] The "const" is a lie. It is
    494  there because, in practice the source object is frequently
    495  const and const_cast ends up being excessively used.
    496  Returns:
    497  Number of user data items that were moved from source_object to "this" ON_UserDataHolder.
    498  */
    499  unsigned int MoveUserDataFrom(
    500  const ON_Object& source_object
    501  );
    502 
    503 
    504  /*
    505  Description:
    506  Copies the data from source_object with copy_count > 0 to "this" ON_UserDataHolder.
    507  Parameters:
    508  source_object - [in]
    509  This object and it's user data are not modified.
    510  user_data_item_id - [in]
    511  If not nil, then only userdata with this item id will be coped
    512  Returns:
    513  Number of user data items that were copied from source_object to "this" ON_UserDataHolder.
    514  */
    515  unsigned int CopyUserDataFrom(
    516  const ON_Object& source_object,
    517  ON_UUID user_data_item_id
    518  );
    519 
    520  /*
    521  Description:
    522  Moves the user data on "this" ON_UserDataHolder to destination_object.
    523  When MoveUserDataTo() returns "this" ON_UserDataHolder will not have any user data.
    524  Parameters:
    525  destination_object - [in] The "const" is a lie. It is
    526  there because, in practice the source object is generally
    527  const and const_cast ends up being constantly used.
    528  bAppend - [in]
    529  true:
    530  Existing user data on destination_object is left unchanged.
    531  MoveUserDataTo( destination_object, true ) is identical to calling
    532  MoveUserDataTo( destination_object, ON_Object::UserDataConflictResolution::destination_object).
    533  false:
    534  Existing user data on destination_object is destroyed.
    535  Returns:
    536  Number of user data items moved from "this" ON_UserDataHolder to destination_object.
    537  */
    538  unsigned int MoveUserDataTo(
    539  const ON_Object& destination_object,
    540  bool bAppend
    541  );
    542 
    543  /*
    544  Description:
    545  Moves the user data on "this" ON_UserDataHolder to destination_object.
    546  When MoveUserDataTo() returns "this" ON_UserDataHolder will not have any user data.
    547  Parameters:
    548  destination_object - [in]
    549  The "const" is a lie. It is there because, in practice the source object is generally
    550  const and const_cast ends up being constantly used.
    551  user_data_item_id - [in]
    552  If not nil, then only user data items with this id will be considered for moving.
    553  userdata_conflict_resolution - [in]
    554  If destination_object and "this" ON_UserDataHolder have the same
    555  type of user data item, then userdata_conflict_resolution
    556  is used to determine if that destination_object user data item
    557  is replaced with the one on "this" ON_UserDataHolder.
    558  Returns:
    559  Number of user data items moved from "this" ON_UserDataHolder to destination_object.
    560  */
    561  unsigned int MoveUserDataTo(
    562  const ON_Object& destination_object,
    563  ON_UUID user_data_item_id,
    564  ON_Object::UserDataConflictResolution userdata_conflict_resolution
    565  );
    566 
    567 
    568  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    569 };
    570 
    571 /*
    572 Description:
    573  An ON_DocumentUserStringList object is saved in the list of user
    574  tables. The Rhino SetDocumentText and GetDocumentText
    575  commands use the ON_Object SetUserString, GetUserString,
    576  GetUserStrings, GetUserStringKeys functions on an
    577  ON_DocumentUserStringList class to manage the tag-value pairs of
    578  strings.
    579 */
    580 class ON_CLASS ON_DocumentUserStringList : public ON_Object
    581 {
    582  ON_OBJECT_DECLARE(ON_DocumentUserStringList);
    583 public:
    586 
    587  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    588  void Dump( ON_TextLog& ) const override;
    589  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const override;
    590  bool Write(ON_BinaryArchive& binary_archive) const override;
    591  bool Read(ON_BinaryArchive& binary_archive) override;
    592 
    593  // Use the
    594  // ON_Object::SetUserString()
    595  // ON_Object::GetUserString()
    596  // ON_Object::GetUserStrings()
    597  // ON_Object::GetUserStringKeys()
    598  // ON_Object::UserStringCount()
    599  // functions to access and modify user string information.
    600 };
    601 
    602 #endif
    unsigned int SizeOf() const override
    ON_Xform m_userdata_xform
    Definition: opennurbs_userdata.h:261
    ON_UUID m_rdk_material_instance_id
    Definition: opennurbs_userdata.h:407
    -
    bool GetUserString(const wchar_t *key, ON_wString &string_value) const
    Definition: opennurbs_object.h:399
    ON_UUID is a 16 byte universally unique identifier.
    Definition: opennurbs_uuid.h:32
    virtual bool GetDescription(ON_wString &description)
    Definition: opennurbs_userdata.h:273
    unsigned int m_userdata_copycount
    Definition: opennurbs_userdata.h:252
    -
    ON_RdkMaterialInstanceIdObsoleteUserData & operator=(const ON_RdkMaterialInstanceIdObsoleteUserData &)
    void Dump(ON_TextLog &text_log) const override
    ON_UUID m_userdata_uuid
    Definition: opennurbs_userdata.h:233
    -
    static bool IsRdkMaterialInstanceIdUserData(ON_UUID class_id, ON_UUID userdata_id, ON_UUID app_id, ON_Object *object)
    Definition: opennurbs_string.h:2089
    -
    bool DeleteAfterWrite(const ON_BinaryArchive &archive, const ON_Object *parent_object) const override
    virtual ON_UserData override
    -
    bool SetUserString(const wchar_t *key, const wchar_t *string_value)
    ON_UUID m_archive_class_uuid
    This is the user data class id that will be saved in the 3dm archive.
    Definition: opennurbs_userdata.h:348
    ON_ClassArray< ON_UserString > m_e
    Definition: opennurbs_userdata.h:478
    int ReadObject(ON_Object **ppObject)
    @@ -92,16 +85,13 @@ $(function() {
    int m_sizeof_buffer
    Definition: opennurbs_userdata.h:307
    UserDataConflictResolution
    Definition: opennurbs_object.h:844
    virtual bool Archive() const
    -
    unsigned int m_3dm_opennurbs_version_number
    Definition: opennurbs_userdata.h:331
    void * m_buffer
    Definition: opennurbs_userdata.h:308
    -
    bool Write(ON_BinaryArchive &) const override
    virtual ON_Object override
    bool WriteObjectUserData(const ON_Object &object)
    virtual unsigned int SizeOf() const
    bool IsValid(class ON_TextLog *text_log=nullptr) const override
    ON_UUID m_unknownclass_uuid
    Definition: opennurbs_userdata.h:306
    Definition: opennurbs_xform.h:28
    -
    bool DeleteAfterRead(const ON_BinaryArchive &archive, ON_Object *parent_object) const override
    virtual ON_UserData override
    Definition: opennurbs_userdata.h:481
    Definition: opennurbs_userdata.h:353
    virtual void Dump(ON_TextLog &) const
    @@ -111,7 +101,6 @@ $(function() {
    Definition: opennurbs_userdata.h:580
    Definition: opennurbs_object.h:433
    Definition: opennurbs_userdata.h:334
    -
    bool WriteToArchive(const class ON_BinaryArchive &archive, const class ON_Object *parent_object) const override
    virtual ON_UserData override
    Definition: opennurbs_textlog.h:20
    ON_UserData & operator=(const ON_UserData &)
    @@ -122,17 +111,12 @@ $(function() {
    ON_UUID m_application_uuid
    Definition: opennurbs_userdata.h:243
    virtual bool Write(ON_BinaryArchive &binary_archive) const
    Definition: opennurbs_userdata.h:410
    -
    virtual ON__UINT32 DataCRC(ON__UINT32 current_remainder) const
    -
    bool Read(ON_BinaryArchive &) override
    virtual ON_Object override
    -
    int SetUserStrings(int count, const ON_UserString *user_strings, bool bReplace)
    -
    bool GetDescription(ON_wString &description) override
    virtual ON_UserData override
    -
    diff --git a/6/d5/dcb/class_o_n___text_context.html b/6/d5/dcb/class_o_n___text_context.html index 35684c3a..52b3304a 100644 --- a/6/d5/dcb/class_o_n___text_context.html +++ b/6/d5/dcb/class_o_n___text_context.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextContext Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d5/dd4/class_o_n__2f_point_array.html b/6/d5/dd4/class_o_n__2f_point_array.html index d0d1ae60..489a9e14 100644 --- a/6/d5/dd4/class_o_n__2f_point_array.html +++ b/6/d5/dd4/class_o_n__2f_point_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2fPointArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/dd7/class_o_n___offset_surface.html b/6/d5/dd7/class_o_n___offset_surface.html index b6a7bbdb..48e508c7 100644 --- a/6/d5/dd7/class_o_n___offset_surface.html +++ b/6/d5/dd7/class_o_n___offset_surface.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_OffsetSurface Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    N_iso = 6, iso_count = 7
    - } - pure virtual class for surface objects More...
    + } pure virtual class for surface objects More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -717,9 +715,9 @@ Additional Inherited Members
    diff --git a/6/d5/dd9/opennurbs__freetype_8h_source.html b/6/d5/dd9/opennurbs__freetype_8h_source.html index c37afa91..bed4c81f 100644 --- a/6/d5/dd9/opennurbs__freetype_8h_source.html +++ b/6/d5/dd9/opennurbs__freetype_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_freetype.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_freetype.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_freetype.h
    -
    1 /*
    2 //
    3 // Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved.
    4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    5 // McNeel & Associates.
    6 //
    7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    10 //
    11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    12 //
    13 ////////////////////////////////////////////////////////////////
    14 */
    15 
    16 #if !defined(OPENNURBS_FREETYPE_INC_)
    17 #define OPENNURBS_FREETYPE_INC_
    18 
    19 #if defined(ON_COMPILER_MSC)
    20 //&& defined(ON_64BIT_RUNTIME)
    21 // freetype is not delivered in a 32-bit version.
    22 // To disable freetype support, comment out the following define.
    23 // To enable freetype support, define OPENNURBS_FREETYPE_SUPPORT
    24 
    25 #define OPENNURBS_FREETYPE_SUPPORT
    26 
    27 #elif defined(ON_RUNTIME_APPLE)
    28 // To disable freetype support, comment out the following define.
    29 // To enable freetype support, define OPENNURBS_FREETYPE_SUPPORT
    30 
    31 #define OPENNURBS_FREETYPE_SUPPORT
    32 
    33 #endif
    34 
    35 /*
    36 Parameters:
    37  font_unit_font_metrics - [in]
    38  metrics in font units (freetype face loaded with FT_LOAD_NO_SCALE) unless
    39  it is a "tricky" font.
    40 */
    41 ON_DECL
    42 void ON_FreeTypeGetFontMetrics(
    43  const ON_Font* font,
    44  ON_FontMetrics& font_unit_font_metrics
    45  );
    46 
    47 /*
    48 Parameters:
    49  font_unit_glyph_box - [in]
    50  box in font units (freetype face loaded with FT_LOAD_NO_SCALE) unless
    51  it is a "tricky" font.
    52 Returns:
    53  0 if box was not set.
    54  >0: font glyph id (or other non-zero value) when box is set
    55 */
    56 ON_DECL
    57 ON__UINT_PTR ON_FreeTypeGetGlyphMetrics(
    58  const ON_Font* font,
    59  ON__UINT32 unicode_code_point,
    60  class ON_TextBox& font_unit_glyph_box
    61 );
    62 
    63 ON_DECL
    64 bool ON_FreeTypeGetGlyphOutline(
    65  const ON_FontGlyph* glyph,
    66  bool bSingleStrokeFont,
    67  double text_height,
    69  ON_BoundingBox* glyph_bbox,
    70  ON_3dVector* glyph_advance
    71 );
    72 
    73 /*
    74 Description:
    75  A wrapper for calculating parameters and calling FreeType library
    76  functions FT_Set_Char_Size() FT_Load_Glyph().
    77 Parameters:
    78  ft_face - [in]
    79  A pointer to and FT_Face. One way to get this value is to call ON_Font::FreeTypeFace()
    80  font_glyph_id - [in]
    81  font glyph id
    82 Returns:
    83  True if glyph is available and loaded.
    84 */
    85 ON_DECL
    86 bool ON_FreeTypeLoadGlyph(
    87  ON__UINT_PTR ft_face,
    88  ON__UINT_PTR font_glyph_id,
    89  bool bLoadRenderBitmap
    90 );
    91 
    92 
    93 #endif
    Definition: opennurbs_font.h:2097
    +
    1 /*
    2 //
    3 // Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved.
    4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    5 // McNeel & Associates.
    6 //
    7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    10 //
    11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    12 //
    13 ////////////////////////////////////////////////////////////////
    14 */
    15 
    16 #if !defined(OPENNURBS_FREETYPE_INC_)
    17 #define OPENNURBS_FREETYPE_INC_
    18 
    19 #if defined(ON_COMPILER_MSC)
    20 //&& defined(ON_64BIT_RUNTIME)
    21 // freetype is not delivered in a 32-bit version.
    22 // To disable freetype support, comment out the following define.
    23 // To enable freetype support, define OPENNURBS_FREETYPE_SUPPORT
    24 
    25 #define OPENNURBS_FREETYPE_SUPPORT
    26 
    27 #elif defined(ON_RUNTIME_APPLE)
    28 // To disable freetype support, comment out the following define.
    29 // To enable freetype support, define OPENNURBS_FREETYPE_SUPPORT
    30 
    31 #define OPENNURBS_FREETYPE_SUPPORT
    32 
    33 #endif
    34 
    35 /*
    36 Parameters:
    37  font_unit_font_metrics - [in]
    38  metrics in font units (freetype face loaded with FT_LOAD_NO_SCALE) unless
    39  it is a "tricky" font.
    40 */
    41 ON_DECL
    42 void ON_FreeTypeGetFontMetrics(
    43  const ON_Font* font,
    44  ON_FontMetrics& font_unit_font_metrics
    45  );
    46 
    47 /*
    48 Parameters:
    49  font_unit_glyph_box - [in]
    50  box in font units (freetype face loaded with FT_LOAD_NO_SCALE) unless
    51  it is a "tricky" font.
    52 Returns:
    53  0 if box was not set.
    54  >0: font glyph id (or other non-zero value) when box is set
    55 */
    56 ON_DECL
    57 ON__UINT_PTR ON_FreeTypeGetGlyphMetrics(
    58  const ON_Font* font,
    59  ON__UINT32 unicode_code_point,
    60  class ON_TextBox& font_unit_glyph_box
    61 );
    62 
    63 ON_DECL
    64 bool ON_FreeTypeGetGlyphOutline(
    65  const ON_FontGlyph* glyph,
    66  bool bSingleStrokeFont,
    67  double text_height,
    69  ON_BoundingBox* glyph_bbox,
    70  ON_3dVector* glyph_advance
    71 );
    72 
    73 /*
    74 Description:
    75  A wrapper for calculating parameters and calling FreeType library
    76  functions FT_Set_Char_Size() FT_Load_Glyph().
    77 Parameters:
    78  ft_face - [in]
    79  A pointer to and FT_Face. One way to get this value is to call ON_Font::FreeTypeFace()
    80  font_glyph_id - [in]
    81  font glyph id
    82 Returns:
    83  True if glyph is available and loaded.
    84 */
    85 ON_DECL
    86 bool ON_FreeTypeLoadGlyph(
    87  ON__UINT_PTR ft_face,
    88  ON__UINT_PTR font_glyph_id,
    89  bool bLoadRenderBitmap
    90 );
    91 
    92 
    93 #endif
    Definition: opennurbs_font.h:1988
    -
    Definition: opennurbs_font.h:2224
    +
    Definition: opennurbs_font.h:2115
    Definition: opennurbs_font.h:18
    Definition: opennurbs_bounding_box.h:25
    An ON_Font is a face in a font family. It corresponds to a Windows LOGFONT, a .NET System...
    Definition: opennurbs_font.h:225
    @@ -80,9 +78,9 @@ $(function() {
    diff --git a/6/d5/ddd/class_o_n___text_context-members.html b/6/d5/ddd/class_o_n___text_context-members.html index 376da954..42378334 100644 --- a/6/d5/ddd/class_o_n___text_context-members.html +++ b/6/d5/ddd/class_o_n___text_context-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d5/df0/class_o_n___text_hash.html b/6/d5/df0/class_o_n___text_hash.html index aa3d1040..8486ab38 100644 --- a/6/d5/df0/class_o_n___text_hash.html +++ b/6/d5/df0/class_o_n___text_hash.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextHash Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/df5/class_o_n___mesh_ngon.html b/6/d5/df5/class_o_n___mesh_ngon.html index 92da9920..97e77b28 100644 --- a/6/d5/df5/class_o_n___mesh_ngon.html +++ b/6/d5/df5/class_o_n___mesh_ngon.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshNgon Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Get a list of vertices that form the boundary of a set of faces. Parameters: mesh_vertex_list - [in] mesh_face_list - [in] vertex_face_map - [in] null or a vertex map made from the information in mesh_vertex_list and mesh_face_list. ngon_fi_count - [in] length of ngon_fi[] array ngon_fi - [in] An array of length ngon_fi_count that contains the indices of the faces that form the ngon. ngon_vi - [out] An array of vertex indices that make the ngon boundary.
    -Returns: Number of vertices in the ngon outer boundary or 0 if the input is not valid.

    +

    Description: Get a list of vertices that form the boundary of a set of faces. Parameters: mesh_vertex_list - [in] mesh_face_list - [in] vertex_face_map - [in] null or a vertex map made from the information in mesh_vertex_list and mesh_face_list. ngon_fi_count - [in] length of ngon_fi[] array ngon_fi - [in] An array of length ngon_fi_count that contains the indices of the faces that form the ngon. ngon_vi - [out] An array of vertex indices that make the ngon boundary. Returns: Number of vertices in the ngon outer boundary or 0 if the input is not valid.

    @@ -628,9 +625,7 @@ Returns: Number of vertices in the ngon outer boundary or 0 if the input is not
    -

    Tools for validation output
    -Description: Test ngon to see if the vertex and face references are valid and pass partial boundary validity checks, Parameters: ngon - [in] ngon to test ngon_index - [in] This index is used in messages sent to text_log text_log - [in] nullptr or a place to send information about problems. mesh_vertex_count - [in] Number of vertices in the mesh mesh_face_count - [in] Number of face in the mesh mesh_F - [in] nullptr of mesh faces - required for boundary checks workspace_buffer - [in] If you are passing in mesh_F and you are testing testing multple ngons, then consider providing a workspace_buffer that will be automatically reused for successive ngons. Returns: 0: ngon is not valid >0: number of boundary edges.
    - If this number is > ngon->m_V_count, then the ngon has inner boundaries or duplicate vertices.

    +

    Tools for validation output Description: Test ngon to see if the vertex and face references are valid and pass partial boundary validity checks, Parameters: ngon - [in] ngon to test ngon_index - [in] This index is used in messages sent to text_log text_log - [in] nullptr or a place to send information about problems. mesh_vertex_count - [in] Number of vertices in the mesh mesh_face_count - [in] Number of face in the mesh mesh_F - [in] nullptr of mesh faces - required for boundary checks workspace_buffer - [in] If you are passing in mesh_F and you are testing testing multple ngons, then consider providing a workspace_buffer that will be automatically reused for successive ngons. Returns: 0: ngon is not valid >0: number of boundary edges. If this number is > ngon->m_V_count, then the ngon has inner boundaries or duplicate vertices.

    @@ -739,8 +734,7 @@ Description: Test ngon to see if the vertex and face references are valid and pa
    -

    Description: Create an ngon pointer that contains a triangle (3-gon) or quad (4-gon) from a mesh face.
    - This is handy when your code needs to handle both ngons and faces because it lets you convert a face to its ngon format and the rest of the code can work exclusively with ngons. Parameters: buffer - [in] an array with a capacity for at least 9 ON__UINT_PTR elements. The returned ngon information will be stored in this memory. mesh_face_index - [in] fvi - [in] mesh face vertex indices. If "f" is an ON_MeshFace, then pass (const unsigned int*)f.vi. Returns: If the input is valid, the returned ngon pointer is is the face's triangle or quad. All returned information is in the buffer[]. null - invalid input. See Also: ON_Mesh::NgonFromComponentIndex()

    +

    Description: Create an ngon pointer that contains a triangle (3-gon) or quad (4-gon) from a mesh face. This is handy when your code needs to handle both ngons and faces because it lets you convert a face to its ngon format and the rest of the code can work exclusively with ngons. Parameters: buffer - [in] an array with a capacity for at least 9 ON__UINT_PTR elements. The returned ngon information will be stored in this memory. mesh_face_index - [in] fvi - [in] mesh face vertex indices. If "f" is an ON_MeshFace, then pass (const unsigned int*)f.vi. Returns: If the input is valid, the returned ngon pointer is is the face's triangle or quad. All returned information is in the buffer[]. null - invalid input. See Also: ON_Mesh::NgonFromComponentIndex()

    @@ -783,8 +777,7 @@ Description: Test ngon to see if the vertex and face references are valid and pa
    -

    Description: Create an array of a single ngon pointer that contains a triangle (3-gon) or quad (4-gon) from a mesh face.
    - This is handy when your code needs to handle both ngons and faces because it lets you convert a face to its ngon format and the rest of the code can work exclusively with ngons. Parameters: ngon_buffer - [in] memory used to create ngon classan array with a capacity for at least 10 ON__UINT_PTR elements. mesh_face_index - [in] fvi - [in] mesh face vertex indices. If "f" is an ON_MeshFace, then pass (const unsigned int*)f.vi. Returns: If the input is valid, the returned pointer is an array of a single ngon that is the face's triangle or quad. All returned information is in the buffer[]. null - invalid input.

    +

    Description: Create an array of a single ngon pointer that contains a triangle (3-gon) or quad (4-gon) from a mesh face. This is handy when your code needs to handle both ngons and faces because it lets you convert a face to its ngon format and the rest of the code can work exclusively with ngons. Parameters: ngon_buffer - [in] memory used to create ngon classan array with a capacity for at least 10 ON__UINT_PTR elements. mesh_face_index - [in] fvi - [in] mesh face vertex indices. If "f" is an ON_MeshFace, then pass (const unsigned int*)f.vi. Returns: If the input is valid, the returned pointer is an array of a single ngon that is the face's triangle or quad. All returned information is in the buffer[]. null - invalid input.

    @@ -833,8 +826,7 @@ Description: Test ngon to see if the vertex and face references are valid and pa
    -

    Description: If a component index identifies a face or ngon, Get an array Create an array of a single ngon pointer that contains a triangle (3-gon) or quad (4-gon) from a mesh face.
    - This is handy when your code needs to handle both ngons and faces because it lets you convert a face to its ngon format and the rest of the code can work exclusively with ngons. Parameters: ngon_buffer - [in] memory used to create ON_MeshNgon class ci - [in] mesh - [in] ngon_list - [out] An array of ngon pointers. Some pointers may be null. Returns: Number of ngon pointers in ngon_list.

    +

    Description: If a component index identifies a face or ngon, Get an array Create an array of a single ngon pointer that contains a triangle (3-gon) or quad (4-gon) from a mesh face. This is handy when your code needs to handle both ngons and faces because it lets you convert a face to its ngon format and the rest of the code can work exclusively with ngons. Parameters: ngon_buffer - [in] memory used to create ON_MeshNgon class ci - [in] mesh - [in] ngon_list - [out] An array of ngon pointers. Some pointers may be null. Returns: Number of ngon pointers in ngon_list.

    @@ -1034,9 +1026,9 @@ Description: Test ngon to see if the vertex and face references are valid and pa diff --git a/6/d5/dfb/class_o_n__4f_point_array-members.html b/6/d5/dfb/class_o_n__4f_point_array-members.html index df4d05ef..edc55256 100644 --- a/6/d5/dfb/class_o_n__4f_point_array-members.html +++ b/6/d5/dfb/class_o_n__4f_point_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d5/dfe/class_o_n___mesh_partition-members.html b/6/d5/dfe/class_o_n___mesh_partition-members.html index d081d100..607c256e 100644 --- a/6/d5/dfe/class_o_n___mesh_partition-members.html +++ b/6/d5/dfe/class_o_n___mesh_partition-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d0b/class_o_n___tensor_product.html b/6/d6/d0b/class_o_n___tensor_product.html index 88bf1598..927543f0 100644 --- a/6/d6/d0b/class_o_n___tensor_product.html +++ b/6/d6/d0b/class_o_n___tensor_product.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TensorProduct Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Definition of NURBS surface

    Constructor & Destructor Documentation

    @@ -283,9 +277,9 @@ Public Member Functions
    diff --git a/6/d6/d0b/class_o_n___windows_bitmap_ex.html b/6/d6/d0b/class_o_n___windows_bitmap_ex.html index c2eaed2c..ccaa524c 100644 --- a/6/d6/d0b/class_o_n___windows_bitmap_ex.html +++ b/6/d6/d0b/class_o_n___windows_bitmap_ex.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_WindowsBitmapEx Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -804,9 +802,9 @@ Additional Inherited Members
    diff --git a/6/d6/d0f/class_o_n___bounding_box_and_hash-members.html b/6/d6/d0f/class_o_n___bounding_box_and_hash-members.html index b6dcdded..551338dc 100644 --- a/6/d6/d0f/class_o_n___bounding_box_and_hash-members.html +++ b/6/d6/d0f/class_o_n___bounding_box_and_hash-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d10/class_o_n___mesh_ngon_iterator.html b/6/d6/d10/class_o_n___mesh_ngon_iterator.html index 251cb679..a3129b97 100644 --- a/6/d6/d10/class_o_n___mesh_ngon_iterator.html +++ b/6/d6/d10/class_o_n___mesh_ngon_iterator.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshNgonIterator Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d10/class_o_n___poly_edge_curve.html b/6/d6/d10/class_o_n___poly_edge_curve.html index 7d01da37..b46d83a3 100644 --- a/6/d6/d10/class_o_n___poly_edge_curve.html +++ b/6/d6/d10/class_o_n___poly_edge_curve.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_PolyEdgeCurve Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d11/class_o_n___number_formatter.html b/6/d6/d11/class_o_n___number_formatter.html index b27f3eaa..5739d749 100644 --- a/6/d6/d11/class_o_n___number_formatter.html +++ b/6/d6/d11/class_o_n___number_formatter.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_NumberFormatter Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    ON_Table class.

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Member Function Documentation

    ◆ FormatAngleStringDecimal()

    @@ -486,9 +482,9 @@ Static Public Attributes
    diff --git a/6/d6/d13/struct_o_n__3_d_m___c_h_u_n_k.html b/6/d6/d13/struct_o_n__3_d_m___c_h_u_n_k.html index b9895633..26d5884a 100644 --- a/6/d6/d13/struct_o_n__3_d_m___c_h_u_n_k.html +++ b/6/d6/d13/struct_o_n__3_d_m___c_h_u_n_k.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3DM_CHUNK Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d17/struct_o_n___mesh_topology_edge.html b/6/d6/d17/struct_o_n___mesh_topology_edge.html index cd7c46f4..54ae8381 100644 --- a/6/d6/d17/struct_o_n___mesh_topology_edge.html +++ b/6/d6/d17/struct_o_n___mesh_topology_edge.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshTopologyEdge Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d1e/opennurbs__gl_8h_source.html b/6/d6/d1e/opennurbs__gl_8h_source.html index 609ee572..545db151 100644 --- a/6/d6/d1e/opennurbs__gl_8h_source.html +++ b/6/d6/d1e/opennurbs__gl_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_gl.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_gl.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d24/opennurbs__mapchan_8h_source.html b/6/d6/d24/opennurbs__mapchan_8h_source.html index 94371769..11ebfc27 100644 --- a/6/d6/d24/opennurbs__mapchan_8h_source.html +++ b/6/d6/d24/opennurbs__mapchan_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_mapchan.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_mapchan.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d32/opennurbs__input__libsdir_8h_source.html b/6/d6/d32/opennurbs__input__libsdir_8h_source.html index 3103f9c8..4c74b51a 100644 --- a/6/d6/d32/opennurbs__input__libsdir_8h_source.html +++ b/6/d6/d32/opennurbs__input__libsdir_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_input_libsdir.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_input_libsdir.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /*
    2 //
    3 // Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved.
    4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    5 // McNeel & Associates.
    6 //
    7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    10 //
    11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    12 //
    13 ////////////////////////////////////////////////////////////////
    14 */
    15 
    16 #if !defined(OPENNURBS_INPUT_LIBSDIR_INC_)
    17 #define OPENNURBS_INPUT_LIBSDIR_INC_
    18 
    19 #if defined(ON_COMPILER_MSC) && !defined(OPENNURBS_INPUT_LIBS_DIR)
    20 
    21 // This header file insures OPENNURBS_INPUT_LIBS_DIR is defined to be
    22 // the path to were the libraries opennurbs.dll links with are located.
    23 // Examples of these libaries are zlib and freetype.
    24 
    25 #if defined(OPENNURBS_OUTPUT_DIR)
    26 // Typically, OPENNURBS_OUTPUT_DIR is defined in the
    27 // MSBuild property sheet opennurbs_msbuild.Cpp.props.
    28 #define OPENNURBS_INPUT_LIBS_DIR OPENNURBS_OUTPUT_DIR
    29 #elif defined(RHINO_LIB_DIR)
    30 // Typically, RHINO_LIB_DIR is defined in a Rhino module property sheet.
    31 #define OPENNURBS_INPUT_LIBS_DIR RHINO_LIB_DIR
    32 #else
    33 
    34 // Please define OPENNURBS_INPUT_LIBS_DIR in your build environment
    35 // Please do not modify the opennurbs vcxproj files. Instead use
    36 // a property sheet (.props file), .sln file, or define it here.
    37 #error You must define OPENNURBS_INPUT_LIBS_DIR
    38 
    39 #endif
    40 
    41 #endif
    42 
    43 #endif
    diff --git a/6/d6/d3a/class_o_n___rendering_attributes-members.html b/6/d6/d3a/class_o_n___rendering_attributes-members.html index 06771d7a..351312b4 100644 --- a/6/d6/d3a/class_o_n___rendering_attributes-members.html +++ b/6/d6/d3a/class_o_n___rendering_attributes-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d3d/class_o_n___aerial_photo_camera_position.html b/6/d6/d3d/class_o_n___aerial_photo_camera_position.html index 794981f9..19d91be6 100644 --- a/6/d6/d3d/class_o_n___aerial_photo_camera_position.html +++ b/6/d6/d3d/class_o_n___aerial_photo_camera_position.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_AerialPhotoCameraPosition Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d46/class_o_n___model_component_type_iterator-members.html b/6/d6/d46/class_o_n___model_component_type_iterator-members.html index dd02081c..44e7c6fe 100644 --- a/6/d6/d46/class_o_n___model_component_type_iterator-members.html +++ b/6/d6/d46/class_o_n___model_component_type_iterator-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d4c/class_o_n___windows_bitmap.html b/6/d6/d4c/class_o_n___windows_bitmap.html index d1d9eb3c..400a16ea 100644 --- a/6/d6/d4c/class_o_n___windows_bitmap.html +++ b/6/d6/d4c/class_o_n___windows_bitmap.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_WindowsBitmap Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -901,8 +899,7 @@ Additional Inherited Members
    -

    bool SetColor( ///< sets entire map to specified color ON_Color );
    -Returns: True if m_bmi and m_bits are in a single contiguous block of memory. False if m_bmi and m_bits are in two blocks of memory.

    +

    bool SetColor( ///< sets entire map to specified color ON_Color ); Returns: True if m_bmi and m_bits are in a single contiguous block of memory. False if m_bmi and m_bits are in two blocks of memory.

    @@ -1370,9 +1367,9 @@ Returns: True if m_bmi and m_bits are in a single contiguous block of memory. Fa diff --git a/6/d6/d56/class_o_n___offset_surface_function-members.html b/6/d6/d56/class_o_n___offset_surface_function-members.html index bcc58db6..9370af4b 100644 --- a/6/d6/d56/class_o_n___offset_surface_function-members.html +++ b/6/d6/d56/class_o_n___offset_surface_function-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d60/class_o_n___parse_settings.html b/6/d6/d60/class_o_n___parse_settings.html index 182e5bd3..4f770dd7 100644 --- a/6/d6/d60/class_o_n___parse_settings.html +++ b/6/d6/d60/class_o_n___parse_settings.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ParseSettings Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    ◆ operator &=()

    +

    ◆ operator &=()

    @@ -1720,8 +1718,7 @@ Static Public Attributes

    Returns: True if a number may use scientific E notation to specify mulitiplication by a power of 10. Example: If parsing scientific E notation is enables, then the string "2.99792458e8" will be parsed as 2999792458. Remarks:

    • The default value is true.
    • -
    • The "E" may be 'e', 'E', unicode decimal exponent symbol (code point 0x23E8).
      -See Also: ON_ParseSettings::ParseScientificDNotation.
    • +
    • The "E" may be 'e', 'E', unicode decimal exponent symbol (code point 0x23E8). See Also: ON_ParseSettings::ParseScientificDNotation.
    @@ -2056,8 +2053,7 @@ See Also: ON_ParseSettings::ParseScientificDNotation.
    -

    Description: Set every possible expression parsing setting to false. Remarks: This is a simple way to disable all possible parsing of expressions. This function calls this->SetParseExplicitFormulaExpression(false); this->SetParseArithmeticExpression(false); this->SetParseMultiplication(false); this->SetParseDivision(false);
    - this->SetParseAddition(false); this->SetParseSubtraction(false); this->SetParseMathFunctions(false); this->SetParseMathFunctions(false); this->SetParsePairedParentheses(false);

    +

    Description: Set every possible expression parsing setting to false. Remarks: This is a simple way to disable all possible parsing of expressions. This function calls this->SetParseExplicitFormulaExpression(false); this->SetParseArithmeticExpression(false); this->SetParseMultiplication(false); this->SetParseDivision(false); this->SetParseAddition(false); this->SetParseSubtraction(false); this->SetParseMathFunctions(false); this->SetParseMathFunctions(false); this->SetParsePairedParentheses(false);

    @@ -3196,8 +3192,8 @@ See Also: ON_ParseSettings::ParseScientificDNotation.

    Description:

    @@ -3372,9 +3368,9 @@ See Also: ON_ParseSettings::ParseScientificDNotation. diff --git a/6/d6/d65/class_o_n___text_builder_1_1_text_props-members.html b/6/d6/d65/class_o_n___text_builder_1_1_text_props-members.html index e91d7a7c..a4764eca 100644 --- a/6/d6/d65/class_o_n___text_builder_1_1_text_props-members.html +++ b/6/d6/d65/class_o_n___text_builder_1_1_text_props-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d66/class_o_n___compressed_buffer.html b/6/d6/d66/class_o_n___compressed_buffer.html index 075f3ada..4f49740f 100644 --- a/6/d6/d66/class_o_n___compressed_buffer.html +++ b/6/d6/d66/class_o_n___compressed_buffer.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_CompressedBuffer Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d78/class_o_n___layer.html b/6/d6/d78/class_o_n___layer.html index b135f3a9..e7393d35 100644 --- a/6/d6/d78/class_o_n___layer.html +++ b/6/d6/d78/class_o_n___layer.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Layer Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -690,9 +688,7 @@ Additional Inherited Members

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Member Enumeration Documentation

    ◆ PER_VIEWPORT_SETTINGS

    @@ -909,8 +905,7 @@ Additional Inherited Members

    ON_DEPRECATED ON_Color Color( const ON_UUID& ) const;.

    -

    /* use ON_Layer::PerViewportColor
    -Description: Remove any per viewport layer color setting so the layer's overall setting will be used for all viewports. Parameters: viewport_id - [in] If viewport_id is not nil, then the setting for this viewport will be deleted. If viewport_id is nil, the all per viewport layer color settings will be removed.

    +

    /* use ON_Layer::PerViewportColor Description: Remove any per viewport layer color setting so the layer's overall setting will be used for all viewports. Parameters: viewport_id - [in] If viewport_id is not nil, then the setting for this viewport will be deleted. If viewport_id is nil, the all per viewport layer color settings will be removed.

    @@ -1386,8 +1381,8 @@ Description: Remove any per viewport layer color setting so the layer's overall
    -

    Parameters: viewport_id - [in] If viewport_id is not nil, then the visibility setting for that viewport is returned.
    - If viewport_id is nil, the ON_Layer::IsVisible() is returned. Returns: Returns true if objects on layer are visible.

    +

    Parameters: viewport_id - [in] If viewport_id is not nil, then the visibility setting for that viewport is returned.

    +

    If viewport_id is nil, the ON_Layer::IsVisible() is returned. Returns: Returns true if objects on layer are visible.

    @@ -2208,8 +2203,8 @@ Description: Remove any per viewport layer color setting so the layer's overall
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -2413,9 +2408,9 @@ Description: Remove any per viewport layer color setting so the layer's overall diff --git a/6/d6/d7e/class_o_n___offset_surface-members.html b/6/d6/d7e/class_o_n___offset_surface-members.html index a407d9cf..fe5d7468 100644 --- a/6/d6/d7e/class_o_n___offset_surface-members.html +++ b/6/d6/d7e/class_o_n___offset_surface-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archiveserialize definition to binary archive
    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/d6/d81/class_o_n___bezier_cage.html b/6/d6/d81/class_o_n___bezier_cage.html index 2e3ed5f1..e9301158 100644 --- a/6/d6/d81/class_o_n___bezier_cage.html +++ b/6/d6/d81/class_o_n___bezier_cage.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BezierCage Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d82/class_o_n___mesh_face_list.html b/6/d6/d82/class_o_n___mesh_face_list.html index e641cb99..4fec935d 100644 --- a/6/d6/d82/class_o_n___mesh_face_list.html +++ b/6/d6/d82/class_o_n___mesh_face_list.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshFaceList Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d95/opennurbs__object_8h_source.html b/6/d6/d95/opennurbs__object_8h_source.html index 18a171f0..1bcf5418 100644 --- a/6/d6/d95/opennurbs__object_8h_source.html +++ b/6/d6/d95/opennurbs__object_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_object.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_object.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/d97/class_o_n___bitmap-members.html b/6/d6/d97/class_o_n___bitmap-members.html index ccaa8f99..00f420ec 100644 --- a/6/d6/d97/class_o_n___bitmap-members.html +++ b/6/d6/d97/class_o_n___bitmap-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/da0/class_o_n___bezier_cage-members.html b/6/d6/da0/class_o_n___bezier_cage-members.html index 70a8e5e3..1e4b6424 100644 --- a/6/d6/da0/class_o_n___bezier_cage-members.html +++ b/6/d6/da0/class_o_n___bezier_cage-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/da3/opennurbs__file__utilities_8h_source.html b/6/d6/da3/opennurbs__file__utilities_8h_source.html index 1ddcf44f..e0e8bdcd 100644 --- a/6/d6/da3/opennurbs__file__utilities_8h_source.html +++ b/6/d6/da3/opennurbs__file__utilities_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_file_utilities.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_file_utilities.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_file_utilities.h
    -
    1 /*
    2 //
    3 // Copyright (c) 1993-2015 Robert McNeel & Associates. All rights reserved.
    4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    5 // McNeel & Associates.
    6 //
    7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    10 //
    11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    12 //
    13 ////////////////////////////////////////////////////////////////
    14 */
    15 
    16 #if !defined(OPENNURBS_FILE_UTILITIES_INC_)
    17 #define OPENNURBS_FILE_UTILITIES_INC_
    18 
    19 class ON_CLASS ON_FileSystem
    20 {
    21 private:
    22  ON_FileSystem() = delete;
    23  ~ON_FileSystem() = delete;
    24  ON_FileSystem(const ON_FileSystem&) = delete;
    25  ON_FileSystem& operator=(const ON_FileSystem&) = delete;
    26 
    27 public:
    28  static bool PathExists(
    29  const char* path
    30  );
    31 
    32  static bool PathExists(
    33  const wchar_t* path
    34  );
    35 
    36  /*
    37  Returns:
    38  True if path is a directory.
    39  False otherwise.
    40  */
    41  static bool IsDirectory(
    42  const char* path
    43  );
    44 
    45  /*
    46  Returns:
    47  True if path is a directory.
    48  False otherwise.
    49  */
    50  static bool IsDirectory(
    51  const wchar_t* path
    52  );
    53 
    54  /*
    55  Returns:
    56  True if path is a directory where files can be written.
    57  False otherwise.
    58  */
    59  static bool IsDirectoryWithWriteAccess(
    60  const char* path
    61  );
    62 
    63  /*
    64  Returns:
    65  True if path is a directory where files can be written.
    66  False otherwise.
    67  */
    68  static bool IsDirectoryWithWriteAccess(
    69  const wchar_t* path
    70  );
    71 
    72  /*
    73  Returns:
    74  True if path is a file.
    75  False otherwise.
    76  */
    77  static bool IsFile(
    78  const char* path
    79  );
    80 
    81  /*
    82  Returns:
    83  True if path is a file.
    84  False otherwise.
    85  */
    86  static bool IsFile(
    87  const wchar_t* path
    88  );
    89 
    90  /*
    91  Description
    92  Remove a file
    93  Parameters:
    94  file_path - [in]
    95  name of file to delete
    96  Returns:
    97  True if the fuke existed and was removed.
    98  */
    99  static bool RemoveFile(
    100  const char* file_path
    101  );
    102 
    103  /*
    104  Description
    105  Remove a file
    106  Parameters:
    107  file_path - [in]
    108  name of file to delete
    109  Returns:
    110  True if the fuke existed and was removed.
    111  */
    112  static bool RemoveFile(
    113  const wchar_t* file_path
    114  );
    115 };
    116 
    117 class ON_CLASS ON_FileSystemPath
    118 {
    119 private:
    120  ON_FileSystemPath() = delete;
    121  ~ON_FileSystemPath() = delete;
    122  ON_FileSystemPath(const ON_FileSystemPath&) = delete;
    123  ON_FileSystemPath& operator=(const ON_FileSystemPath&) = delete;
    124 
    125 public:
    126  /*
    127  Platform dependent character used to separate directory names.
    128  On Windows platforms:
    129  ON_FileSystemPath::DirectorySeparator = ON_wString::Backslash.
    130  On UNIX (including modern Apple) platforms:
    131  ON_FileSystemPath::DirectorySeparator = ON_wString::Slash.
    132  */
    133  static const char DirectorySeparatorAsChar;
    134  static const wchar_t DirectorySeparator;
    135 
    137  static const wchar_t AlternateDirectorySeparator;
    138 
    139  static bool IsDirectorySeparator(
    140  char c,
    141  bool bAllowAlternate
    142  );
    143 
    144  static bool IsDirectorySeparator(
    145  wchar_t c,
    146  bool bAllowAlternate
    147  );
    148 
    149  /*
    150  Description:
    151  Find the locations in a path the specify the drive, directory,
    152  file name and file extension.
    153  Parameters:
    154  path - [in]
    155  path to split
    156  volume - [out] (pass null if you don't need the volume)
    157  If volume is not null and the path parameter begins with a
    158  Windows volume specification, *volume will either be
    159  the Windows volume letter followed by the trailing colon
    160  or a Windows UNC \<hostname>. Otherwise volume will
    161  be the empty string.
    162  dir - [out] (pass null if you don't need the directory)
    163  If dir is not null and the path parameter contains a
    164  directory specification, then the returned value of *dir
    165  will be the directory specification including the trailing
    166  slash.
    167  file_name_stem - [out] (pass null if you don't need the file name stem)
    168  If file_name_stem is not null and the path parameter contains a
    169  file name specification, then the returned value of *file_name_stem
    170  will be the file name stem.
    171  file_name_ext - [out] (pass null if you don't need the extension)
    172  If file_name_ext is not null and the path parameter contains a
    173  file name extension specification, then the returned value of
    174  *file_name_ext will be the file name extension including the initial
    175  '.' character.
    176  Remarks:
    177  This function will treat a front slash ( / ) and a back slash
    178  ( \ ) as directory separators. Because this function parses
    179  file names store in .3dm files and the .3dm file may have been
    180  written on a Windows computer and then read on a another
    181  computer, it looks for a volume specification even when the
    182  operating system is not Windows.
    183  This function will not return an directory that does not
    184  end with a trailing slash.
    185  This function will not return an empty filename and a non-empty
    186  extension.
    187  This function parses the path string according to these rules.
    188  It does not check the actual file system to see if the answer
    189  is correct.
    190  See Also:
    191  on_splitpath
    192  */
    193  static void SplitPath(
    194  const char* path,
    195  ON_String* volume,
    196  ON_String* dir,
    197  ON_String* file_name_stem,
    198  ON_String* file_name_ext
    199  );
    200 
    201  static void SplitPath(
    202  const char* path,
    203  ON_wString* volume,
    204  ON_wString* dir,
    205  ON_wString* file_name_stem,
    206  ON_wString* file_name_ext
    207  );
    208 
    209  static void SplitPath(
    210  const wchar_t* path,
    211  ON_wString* volume,
    212  ON_wString* dir,
    213  ON_wString* file_name_stem,
    214  ON_wString* file_name_ext
    215  );
    216 
    217  static void SplitPath(
    218  const wchar_t* path,
    219  ON_wString* volume,
    220  ON_wString* dir,
    221  ON_wString* file_name_stem_and_extension
    222  );
    223 
    224  static bool FilePathHas3dmExtension(
    225  const wchar_t* file_path,
    226  bool bAllow3dmbakExtension
    227  );
    228 
    229  static bool FilePathHas3dmExtension(
    230  const char* file_path,
    231  bool bAllow3dmbakExtension
    232  );
    233 
    234  /*
    235  Description:
    236  Determine if the file_name string is a permitted file name.
    237  Valid file names must be non empty, cannot have two periods in a row,
    238  and cannot contain directory separators, tildes, and other
    239  platform specific values.
    240  Parameters:
    241  file_name - [in]
    242  string to test.
    243  bAllPlatforms - [in]
    244  If true, test name for all supported platforms.
    245  Returns:
    246  True if the string can be a file name.
    247  */
    248  static bool IsValidFileName(
    249  const char* file_name,
    250  bool bAllPlatforms
    251  );
    252 
    253  /*
    254  Description:
    255  Determine if the file_name string is a permitted file name.
    256  Valid file names must be non empty, cannot have two periods in a row,
    257  and cannot contain directory separators, tildes, and other
    258  platform specific values.
    259  Parameters:
    260  file_name - [in]
    261  string to test.
    262  bAllPlatforms - [in]
    263  If true, test name for all supported platforms.
    264  Returns:
    265  True if the string can be a file name.
    266  */
    267  static bool IsValidFileName(
    268  const wchar_t* file_name,
    269  bool bAllPlatforms
    270  );
    271 
    272  /*
    273  Parameters:
    274  path - [in]
    275  path to split
    276  Returns:
    277  The volume portion of the path.
    278  */
    279  static const ON_wString VolumeFromPath(
    280  const wchar_t* path
    281  );
    282 
    283  /*
    284  Parameters:
    285  path - [in]
    286  path to split
    287  Returns:
    288  The directory portion of the path.
    289  */
    290  static const ON_wString DirectoryFromPath(
    291  const wchar_t* path
    292  );
    293 
    294  /*
    295  Parameters:
    296  path - [in]
    297  path to split
    298  Returns:
    299  The volume and directory portion of the path.
    300  */
    301  static const ON_wString VolumeAndDirectoryFromPath(
    302  const wchar_t* path
    303  );
    304 
    305  /*
    306  Parameters:
    307  path - [in]
    308  path to split
    309  bIncludeExtension - [in]
    310  Returns:
    311  The file name portion of the path.
    312  */
    313  static const ON_wString FileNameFromPath(
    314  const wchar_t* path,
    315  bool bIncludeExtension
    316  );
    317 
    318  /*
    319  Parameters:
    320  path - [in]
    321  path to split
    322  Returns:
    323  The file name extension portion of the path, inlcuding the leading period or "dot".
    324  */
    325  static const ON_wString FileNameExtensionFromPath(
    326  const wchar_t* path
    327  );
    328 
    329  /*
    330  Description:
    331  Condenses // to /
    332  Condenses /./ to /
    333  Condenses /sfsdf/../ to /
    334  Sets all directory separators to directory_separator.
    335  Parameters:
    336  bAllowWindowsUNCHostNameOrDiskLetter - [in]
    337  If bAllowWindowsUNCHostNameOrDiskLetter and the path begins with \\HostName followed by
    338  a directory separator, then the initial \\ is not condensed.
    339  If the path begins with X: followed by a directory separator, where "X" is a single
    340  letter in the range A to Z or a to z, then the path is considered valid.
    341  bDeleteWindowsUNCHostNameOrDiskLetter - [in]
    342  If bAllowWindowsUNCHostNameOrDiskLetter is true and the path begins with a UNC
    343  host name or disk letter followed by a directory separator, then host name or disk letter
    344  is deleted. This is useful when using paths from a Windows platform on a
    345  non-Windows platform.
    346  directory_separator - [in]
    347  If 0 == directory_separator, then the first directory separator
    348  is kept when condensing occurs.
    349  ON_wString::FileSystemPathSeparator is a good choice if you want
    350  to use the current runtime's separator.
    351  dirty_path - [in]
    352  path to clean.
    353  Return:
    354  Cleaned path.
    355  */
    356  static const ON_wString CleanPath(
    357  bool bTrimLeft,
    358  bool bTrimRight,
    359  bool bAllowWindowsUNCHostNameOrDiskLetter,
    360  bool bDeleteWindowsUNCHostNameOrDiskLetter,
    361  const wchar_t directory_separator,
    362  const wchar_t* dirty_path
    363  );
    364 
    365  /*
    366  Parameters:
    367  path - [in]
    368  path to test
    369  directory_separator - [in]
    370  If 0 == directory_separator, then either ON_wString::FileSystemPathSeparator
    371  or ON_wString::AlternateFileSystemPathSeparator is permitted as a directory
    372  separator.
    373  ON_wString::FileSystemPathSeparator is a good choice if you want
    374  to use the current runtime's separator.
    375  Returns:
    376  True if path begins with ../ or ./
    377  */
    378  static bool IsRelativePath(
    379  const wchar_t* path,
    380  const wchar_t directory_separator
    381  );
    382 
    383 
    384  /*
    385  Parameters:
    386  path - [in]
    387  path to test
    388  Returns:
    389  True if path begins with ../ or ..\ or ./ or .\
    390  */
    391  static bool IsRelativePath(
    392  const wchar_t* path
    393  );
    394  /*
    395  Description:
    396  Condenses // to /
    397  Condenses /./ to /
    398  Condenses /sfsdf/../ to /
    399  Trims left and right white space.
    400  Sets all directory separators to ON_FileSystemPath::DirectorySeparator.
    401  If the Platform is not windows, the UNC host names and volume letters are deleted.
    402  */
    403  static const ON_wString CleanPath(
    404  const wchar_t* dirty_path
    405  );
    406 
    407  /*
    408  Description:
    409  Get a the relative path from base_path to full_path.
    410  Parameters:
    411  full_path - [in]
    412  base_path - [in]
    413 
    414  Example
    415  full_path = L"c:/a/b/c/d/somefile.txt";
    416  base_path = L"C:/A/B/X/Y/Z/model.3dm";
    417  ON_wString::GetRelativePath(full_path,base_path) returns
    418  L"../../../c/d/somefile.txt"
    419 
    420  Example
    421  full_path = L"c:/a/b/somefile.txt";
    422  base_path = L"C:/A/B/model.3dm";
    423  ON_wString::GetRelativePath(full_path,base_path) returns
    424  L"./somefile.txt"
    425 
    426  Remarks:
    427  Path separators on the input can be mixed.
    428  Path separators on the returned relative path are ON_wString::FileSystemPathSeparator
    429  */
    430  static const ON_wString RelativePath(
    431  const wchar_t* full_path,
    432  bool bFullPathIncludesFileName,
    433  const wchar_t* base_path,
    434  bool bBasePathIncludesFileName
    435  );
    436 
    437  static const ON_wString FullPathFromRelativePath(
    438  const wchar_t* base_path,
    439  bool bBasePathIncludesFileName,
    440  const wchar_t* relative_path
    441  );
    442 
    443  /*
    444  Returns:
    445  true if the platform file system ignores case.
    446  Remarks:
    447  Windows and default installations of OS X 10.10.3, and default installations of the UNIX
    448  terminal interface in OS X 10.10.3 and later ignore case.
    449  In the case of OX X, a user can override the default setting.
    450  */
    451  static bool PlatformPathIgnoreCase();
    452 
    453  /*
    454  Parameters:
    455  bWithTrailingDirectorySeparator - [in]
    456  true - returned path will have a trailing directory separator.
    457  false - returned path will not have a trailing directory separator.
    458  Returns:
    459  The platform current working directory which should be the directory
    460  where ON::OpenFile("fname","r") would look for a file named "fname".
    461  */
    462  static const ON_wString CurrentDirectory(
    463  bool bWithTrailingDirectorySeparator
    464  );
    465 
    466  /*
    467  Description:
    468  Removes file name from path.
    469  Parameters:
    470  path - [in]
    471  file system path with a file name.
    472  file_name - [out]
    473  If file_name is not nullptr, the removed portion of path
    474  is returned here.
    475  Returns:
    476  path with any file name removed.
    477  Remarks:
    478  This function uses on_wsplitpath() to decide if the path ends with characters that
    479  could be a file name. It does not inspect the file system to see if the file exists.
    480  */
    481  static const ON_wString RemoveFileName(
    482  const wchar_t* path,
    483  ON_wString* file_name
    484  );
    485 
    486  /*
    487  Description:
    488  Removes Windows volume name from path.
    489  Parameters:
    490  path - [in]
    491  file system path
    492  volume_name - [out]
    493  If volume_name is not nullptr, the removed portion of path
    494  is returned here.
    495  Returns:
    496  path with any volume name removed.
    497  Remarks:
    498  This function uses on_wsplitpath() to decide if the path begins with characters that
    499  could be a volume name. It does not inspect the file system to see if the volume exists.
    500  */
    501  static const ON_wString RemoveVolumeName(
    502  const wchar_t* path,
    503  ON_wString* volume_name
    504  );
    505 
    506  /*
    507  Description:
    508  Combine paths into a single valid path name. Remove internal .. and .
    509  directory references. If necessary remove file names.
    510  Parameters:
    511  left_side - [in]
    512  bLeftSideContainsFileName - [in]
    513  true if left_side path ends in a file name and that
    514  file name is removed and discarded.
    515  right_side - [in]
    516  bRightSideContainsFileName - [in]
    517  true if right_side path ends in a file name.
    518  If bAppendTrailingDirectorySeparator is true, that file name is removed
    519  and discarded. If bAppendTrailingDirectorySeparator is false, the
    520  returned path ends in that file name.
    521  bAppendTrailingDirectorySeparator - [in]
    522  If true, any file names are removed and a directory separator
    523  is appended to the returned string.
    524  Returns:
    525  a path made left_side + right_side
    526  Remarks:
    527  This function manipulates string information.
    528  This function does not look at storage media
    529  to see if the paths currently exist.
    530  */
    531  static const ON_wString CombinePaths(
    532  const wchar_t* left_side,
    533  bool bLeftSideContainsFileName,
    534  const wchar_t* right_side,
    535  bool bRightSideContainsFileName,
    536  bool bAppendTrailingDirectorySeparator
    537  );
    538 
    539  // ids used by ON_FileSystemPath::GetPath()
    540  enum class PathId : unsigned int
    541  {
    542  Unset = 0,
    543  DesktopDirectory = 1,
    544  DocumentsDirectory = 2,
    545  DownloadsDirectory = 3
    546  };
    547 
    548  /*
    549  Parameters:
    550  path_id - [in]
    551  Specifies path to get.
    552  Returns:
    553  Requested path. If the path does not exist in the current context,
    554  the empty string is returned.
    555  */
    556  static const ON_wString PlatformPath(
    558  );
    559 
    560 
    561  ON_DEPRECATED_MSG("Use ON_FileSystem::PathExists")
    562  static bool PathExists(
    563  const char* path
    564  );
    565 
    566  ON_DEPRECATED_MSG("Use ON_FileSystem::PathExists")
    567  static bool PathExists(
    568  const wchar_t* path
    569  );
    570 
    571  ON_DEPRECATED_MSG("Use ON_FileSystem::IsDirectory")
    572  static bool IsDirectory(
    573  const char* path
    574  );
    575 
    576  ON_DEPRECATED_MSG("Use ON_FileSystem::IsDirectory")
    577  static bool IsDirectory(
    578  const wchar_t* path
    579  );
    580 
    581  ON_DEPRECATED_MSG("Use ON_FileSystem::IsFile")
    582  static bool IsFile(
    583  const char* path
    584  );
    585 
    586  ON_DEPRECATED_MSG("Use ON_FileSystem::IsFile")
    587  static bool IsFile(
    588  const wchar_t* path
    589  );
    590 };
    591 
    592 class ON_CLASS ON_FileStream
    593 {
    594 public:
    595  /*
    596  Description:
    597  Portable wrapper for C runtime fopen().
    598  Parameters:
    599  filename - [in]
    600  mode - [in]
    601  Remarks:
    602  Use the ON_FileStream static functions for reading, writing,
    603  seeking, position finding with the FILE pointer returned
    604  by this function.
    605  */
    606  static FILE* Open( const wchar_t* filename, const wchar_t* mode );
    607 
    608  /*
    609  Description:
    610  Portable wrapper for C runtime fopen().
    611  Parameters:
    612  filename - [in]
    613  mode - [in]
    614  Remarks:
    615  Use the ON_FileStream static functions for reading, writing,
    616  seeking, position finding with the FILE pointer returned
    617  by this function.
    618  */
    619  static FILE* Open( const char* filename, const char* mode );
    620 
    621  /*
    622  Description:
    623  Portable wrapper for C runtime fclose().
    624  Parameters:
    625  fp - [in]
    626  FILE pointer returned by ON_FileStream::Open().
    627  Returns:
    628  0: successful
    629  -1: null fp parameter
    630  != 0: fclose() failure code
    631  */
    632  static int Close( FILE* fp );
    633 
    634  /*
    635  Returns:
    636  True if the file is a 3dm archive.
    637  */
    638  static bool Is3dmFile(
    639  const wchar_t* file_path,
    640  bool bAllow3dmbakExtension
    641  );
    642 
    643  /*
    644  Returns:
    645  True if the file is a 3dm archive.
    646  */
    647  static bool Is3dmFile(
    648  const char* file_path,
    649  bool bAllow3dmbakExtension
    650  );
    651 
    652  /*
    653  Description:
    654  Open the file and seek to the location where the 3dm archive information begins.
    655  Returns:
    656  A file stream with the current position at the beginning of the 3dm archive.
    657  nullptr if the file is not a 3dm archive.
    658  */
    659  static FILE* Open3dmToRead(
    660  const wchar_t* file_path
    661  );
    662 
    663  /*
    664  Description:
    665  Open the file and seek to the location where the 3dm archive information begins.
    666  Returns:
    667  A file stream with the current position at the beginning of the 3dm archive.
    668  nullptr if the file is not a 3dm archive.
    669  */
    670  static FILE* Open3dmToRead(
    671  const char* file_path
    672  );
    673 
    674  /*
    675  Description:
    676  Portable wrapper for C runtime ftell().
    677  Parameters:
    678  fp - [in]
    679  FILE pointer returned by ON_FileStream::Open().
    680  Returns:
    681  >= 0: current file position
    682  -1: an error occured
    683  */
    684  static ON__INT64 CurrentPosition( FILE* fp );
    685 
    686  /*
    687  Description:
    688  Portable wrapper for C runtime fseek(fp,offset,SEEK_CUR).
    689  Parameters:
    690  fp - [in]
    691  FILE pointer returned by ON_FileStream::Open().
    692  offset - [in]
    693  */
    694  static bool SeekFromCurrentPosition( FILE* fp, ON__INT64 offset );
    695 
    696  /*
    697  Description:
    698  Portable wrapper for C runtime fseek(fp,offset,SEEK_SET).
    699  Parameters:
    700  fp - [in]
    701  FILE pointer returned by ON_FileStream::Open().
    702  offset - [in]
    703  */
    704  static bool SeekFromStart( FILE* fp, ON__INT64 offset );
    705 
    706  /*
    707  Description:
    708  Portable wrapper for C runtime fseek(fp,offset,SEEK_END).
    709  Parameters:
    710  fp - [in]
    711  FILE pointer returned by ON_FileStream::Open().
    712  offset - [in]
    713  */
    714  static bool SeekFromEnd( FILE* fp, ON__INT64 offset );
    715 
    716  /*
    717  Description:
    718  Portable wrapper for C runtime fseek(fp,offset,origin).
    719  Parameters:
    720  fp - [in]
    721  FILE pointer returned by ON_FileStream::Open().
    722  offset - [in]
    723  origin - [in]
    724  SEEK_SET (0): seek from beginning of file.
    725  SEEK_CUR (1): seek from current position of file pointer.
    726  SEEK_END (2): seek from end of file.
    727  */
    728  static bool Seek( FILE* fp, ON__INT64 offset, int orgin );
    729 
    730  /*
    731  Description:
    732  Portable wrapper for C runtime fread(buffer,1,count,fp).
    733  Parameters:
    734  fp - [in]
    735  FILE pointer returned by ON_FileStream::Open()
    736  count - [in]
    737  number of bytes to read.
    738  buffer - [out]
    739  read bytes are stored in this buffer
    740  Returns:
    741  number of bytes read
    742  */
    743  static ON__UINT64 Read( FILE* fp, ON__UINT64 count, void* buffer );
    744 
    745  /*
    746  Description:
    747  Portable wrapper for C runtime fwrite(buffer,1,count,fp).
    748  Parameters:
    749  fp - [in]
    750  FILE pointer returned by ON_FileStream::Open()
    751  count - [in]
    752  number of bytes to write
    753  buffer - [in]
    754  data to be written
    755  Returns:
    756  number of bytes written.
    757  */
    758  static ON__UINT64 Write( FILE* fp, ON__UINT64 count, const void* buffer );
    759 
    760  /*
    761  Description:
    762  Portable wrapper for C runtime fflush(fp).
    763  Parameters:
    764  fp - [in]
    765  FILE pointer returned by ON_FileStream::Open().
    766  Returns:
    767  true if flush was successful. False if an error occured.
    768  */
    769  static bool Flush( FILE* fp );
    770 
    771  /*
    772  Description:
    773  Portable wrapper for C runtime fstat().
    774  Parameters:
    775  fp - [in]
    776  FILE pointer returned by ON_FileStream::Open().
    777  file_size - [out]
    778  If file_size is not null, the the size of the file
    779  in bytes returned here
    780  file_metadata_last_modified_time - [out]
    781  If file_metadata_last_modified_time is not null, then the time the
    782  file's metadata (owner, permissions, ...) were last modified is returned
    783  here as the number of seconds since midnight January 1, 1970.
    784  file_contents_last_modified_time - [out]
    785  If file_contents_last_modified_time is not null, then the time the
    786  file's contents were last modified is returned here as the number of
    787  seconds since midnight January 1, 1970.
    788  Returns:
    789  true if the query was successful. False if an error occured.
    790  */
    791  static bool GetFileInformation(
    792  FILE* fp,
    793  ON__UINT64* file_size,
    794  ON__UINT64* file_metadata_last_modified_time,
    795  ON__UINT64* file_contents_last_modified_time
    796  );
    797  static bool GetFileInformation(
    798  const wchar_t* file_name,
    799  ON__UINT64* file_size,
    800  ON__UINT64* file_metadata_last_modified_time,
    801  ON__UINT64* file_contents_last_modified_time
    802  );
    803  static bool GetFileInformation(
    804  const char* file_name,
    805  ON__UINT64* file_size,
    806  ON__UINT64* file_metadata_last_modified_time,
    807  ON__UINT64* file_contents_last_modified_time
    808  );
    809 };
    810 
    811 class ON_CLASS ON_ContentHash
    812 {
    813 public:
    814  static const ON_ContentHash Unset;
    815 
    816 public:
    817  ON_ContentHash() = default;
    818  ~ON_ContentHash() = default;
    819  ON_ContentHash(const ON_ContentHash&) = default;
    820  ON_ContentHash& operator=(const ON_ContentHash&) = default;
    821 
    822  /*
    823  Descripton:
    824  Create an ON_ContentHash class with the specified size, hash and times.
    825  Parameters:
    826  sha1_name_hash - [in]
    827  The SHA-1 hash of the name (typically a full path file name).
    828  When the content is identified by a file name in a file system,
    829  use ON_SHA1_Hash::FileSystemPathHash() to calculate this value.
    830  byte_count - [in]
    831  number of bytes in the content.
    832  sha1_content_hash - [in]
    833  The SHA-1 hash of the content (typically a buffer or file).
    834  You may use ON_SHA1_Has::FileContentHash() or ON_SHA1_Hash::BufferContentHash()
    835  to calculate this value.
    836  hash_time - [in]
    837  The time the sha1_hash was calculated in seconds since January 1, 1970 UCT.
    838  If 0 is passed in, the current time is used.
    839  content_last_modified_time - [in]
    840  Pass 0 if not known.
    841  The time the hashed information that was last modifed in seconds since January 1, 1970 UCT.
    842  If content_last_modified_time > hash_time, then 0 is used.
    843  Returns:
    844  An ON_ContentHash with size and SHA-1 hash and times set from the parameters,
    845  */
    846  static ON_ContentHash Create(
    847  ON_SHA1_Hash sha1_name_hash,
    848  ON__UINT64 byte_count,
    849  ON_SHA1_Hash sha1_content_hash,
    850  ON__UINT64 hash_time,
    851  ON__UINT64 content_last_modified_time
    852  );
    853 
    854  /*
    855  Descripton:
    856  Create an ON_ContentHash from a memory buffer.
    857  Parameters:
    858  sha1_name_hash - [in]
    859  A SHA-1 hash of the name associated with this content.
    860  If the buffer has no name, pass ON_SHA1_Hash::ZeroDigest.
    861  If the buffer has an empty name, pass ON_SHA1_Hash::EmptyContentHash.
    862  buffer - [in]
    863  byte_count - [in]
    864  number of bytes in buffer[]
    865  Returns:
    866  An ON_ContentHash with size and SHA-1 hash calculated from the parameters,
    867  hash time = now, and content last modified time = 0.
    868  */
    869  static ON_ContentHash CreateFromBuffer(
    870  ON_SHA1_Hash sha1_name_hash,
    871  const void* buffer,
    872  size_t byte_count
    873  );
    874 
    875  /*
    876  Descripton:
    877  Create an ON_ContentHash from a file stream.
    878  Parameters:
    879  sha1_file_name_hash - [in]
    880  A SHA-1 hash of the file name associated with fp.
    881  Use ON_SHA1_Has::FileSystemPathHash() to create the value.
    882  If the name is not known, pass ON_SHA1_Hash::ZeroDigest.
    883  fp - [in] pointer to a file opened with ON:FileOpen(...,"rb")
    884  Returns:
    885  An ON_ContentHash with size and SHA-1 hash and times set from the file,
    886  hash time = now, and content last modifed time set from the file system
    887  information returned by ON_FileStream::GetFileInformation().
    888  */
    889  static ON_ContentHash CreateFromFile(
    890  ON_SHA1_Hash sha1_file_name_hash,
    891  FILE* fp
    892  );
    893 
    894  /*
    895  Descripton:
    896  Create an ON_ContentHash from a file stream.
    897  Parameters:
    898  filename - [in] name of file.
    899  Returns:
    900  An ON_ContentHash with size and SHA-1 hash and times set from the file,
    901  hash time = now, and content last modifed time set from the file system
    902  information returned by ON_FileStream::GetFileInformation().
    903  */
    904  static ON_ContentHash CreateFromFile(
    905  const wchar_t* filename
    906  );
    907 
    908  static ON_ContentHash CreateFromFile(
    909  const char* filename
    910  );
    911 
    912  /*
    913  Returns:
    914  True if the SHA-1 hash has been set.
    915  */
    916  bool IsSet() const;
    917 
    918  /*
    919  Returns:
    920  True if the SHA-1 hash is not set.
    921  */
    922  bool IsNotSet() const;
    923 
    924  /*
    925  Returns:
    926  Number of bytes in the content (typically a file or buffer).
    927  */
    928  ON__UINT64 ByteCount() const;
    929 
    930  /*
    931  Returns:
    932  Time the hash SHA-1 hash was cacluated in seconds since January 1, 1970 UCT.
    933  */
    934  ON__UINT64 HashCalculationTime() const;
    935 
    936  /*
    937  Returns:
    938  Time the hashed content was last modifed in seconds since January 1, 1970 UCT.
    939  0 is returned if this time is not known.
    940 
    941  This time should be used for important decisions as a last resort.
    942 
    943  When hash values differ, this time may be considered to
    944  which content is newer (or most recently copied).
    945 
    946  Unfortunately, in many cases this time is often unknown and incorrectly set.
    947  For example, some file systems set the last modified time of a copy of
    948  an "old" file to the time the copy was created. Thus a copy of "old" content
    949  may appear to be newer than "new" content that has not been copied.
    950  */
    951  ON__UINT64 ContentLastModifiedTime() const;
    952 
    953  /*
    954  Returns:
    955  SHA-1 hash of the name (typically a full path file name).
    956  */
    957  ON_SHA1_Hash NameHash() const;
    958 
    959  /*
    960  Returns:
    961  SHA-1 hash of the content (typically a buffer or file).
    962  */
    963  ON_SHA1_Hash ContentHash() const;
    964 
    965  /*
    966  Description:
    967  Test a buffer to see if it has a matching size and SHA-1 hash.
    968  Parameters:
    969  buffer - [in]
    970  byte_count - [in]
    971  number of bytes in buffer[]
    972  Returns:
    973  True if the buffer has a matching byte_count and SHA-1 hash.
    974  */
    975  bool IsSameBufferContent(
    976  const void* buffer,
    977  size_t byte_count
    978  ) const;
    979 
    980  /*
    981  Description:
    982  Test a file to see if it has a matching size and SHA-1 hash.
    983  Paramters:
    984  fp - [in] pointer to file opened with ON::OpenFile(...,"rb")
    985  bSkipTimeCheck - [in] if true, the time of last
    986  modification is not checked.
    987  Returns:
    988  True if the file existes, can be read, and has a matching byte_count
    989  and SHA-1 hash.
    990  */
    991  bool IsSameFileContent(
    992  FILE* fp
    993  ) const;
    994 
    995  /*
    996  Description:
    997  Test a file to see if it has a matching size and SHA-1 content hash.
    998  Paramters:
    999  filename - [in]
    1000  Returns:
    1001  True if the file exists, can be read, and has a matching byte_count
    1002  and SHA-1 content hash.
    1003  */
    1004  bool IsSameFileContent(
    1005  const wchar_t* filename
    1006  ) const;
    1007 
    1008  bool IsSameFileContent(
    1009  const char* filename
    1010  ) const;
    1011 
    1012  /// <summary>
    1013  /// ON_ContentHash::Compare are the possible results of calling ON_ContentHash::CompareFile().
    1014  /// </summary>
    1015  enum class CompareResult : unsigned char
    1016  {
    1017  /// <summary>
    1018  /// Not set. This value is never returned by ON_ContentHash::CheckFile().
    1019  /// </summary>
    1020  Unset = 0,
    1021 
    1022  /// <summary>
    1023  /// File exists and its size and content matches the information
    1024  /// used to set the content hash.
    1025  /// </summary>
    1026  EqualContent = 1,
    1027 
    1028  /// <summary>
    1029  /// File exists and its size or content differs from the information
    1030  /// used to set the content hash. Unable to reliably determine which
    1031  /// is newer.
    1032  /// </summary>
    1033  DifferentContent = 2,
    1034 
    1035  /// <summary>
    1036  /// File exists and its size or content differs from the information
    1037  /// used to set the content hash. The file's laste modified time
    1038  /// is older than ContentLastModifiedTime().
    1039  /// </summary>
    1040  DifferentContentFileIsOlder = 3,
    1041 
    1042  /// <summary>
    1043  /// File exists and its size or content differs from the information
    1044  /// used to set the content hash. The file's last modified time
    1045  /// is newer than ContentLastModifiedTime().
    1046  /// </summary>
    1047  ContentDifferentFileIsNewer = 4,
    1048 
    1049  /// <summary>
    1050  /// File does not exist.
    1051  /// </summary>
    1052  FileDoesNotExist = 5,
    1053 
    1054  /// <summary>
    1055  /// File cannot be opened, read, or some other file system issue prevents checking.
    1056  /// </summary>
    1057  FileSystemFailure = 6
    1058  };
    1059 
    1060  static ON_ContentHash::CompareResult CompareResultFromUnsigned(
    1061  unsigned int compare_result_as_unsigned
    1062  );
    1063 
    1064  /*
    1065  Description:
    1066  Compare the information used to set this content hash with
    1067  the contents of the file.
    1068  Parameters:
    1069  file_path - [in]
    1070  bFastCompare - [in]
    1071  If bFastCompare is true and the file_path, create time, last modified time, and size
    1072  exactly match the values in ON_ContentHash, then
    1073  ON_ContentHash::CompareResult::EqualContent is returned
    1074  without performing the expensive SHA1 test on the file's content.
    1075  If bFastCompare is false, the SHA-1 hash of the file's content will be
    1076  calculated and compared before ON_ContentHash::CompareResult::EqualContent
    1077  is returned.
    1078  Returns:
    1079  Result of compare test as a ON_ContentHash::CompareResult enum.
    1080  ON_ContentHash::CompareResult::DifferentContentFileIsOlder means file_path content is different and older than "this".
    1081  ON_ContentHash::CompareResult::DifferentContentFileIsNewer means file_path content is different and newer than "this".
    1082  */
    1084  const wchar_t* file_path,
    1085  bool bFastTest
    1086  ) const;
    1087 
    1088  /*
    1089  Description:
    1090  Compare the byte count and SHA-1 content hash.
    1091  Parameters:
    1092  file_content_hash - [in]
    1093  ON_ContentHash to compare against this one.
    1094  Returns:
    1095  Result of compare test as a ON_ContentHash::CompareResult enum.
    1096  ON_ContentHash::CompareResult::DifferentContentFileIsOlder means file_content_hash is different and older than "this".
    1097  ON_ContentHash::CompareResult::DifferentContentFileIsNewer means file_content_hash is different and newer than "this".
    1098  */
    1100  ON_ContentHash file_content_hash
    1101  ) const;
    1102 
    1103  /*
    1104  Returns:
    1105  true if a and b have identical ByteCount() and SHA-1 content hash values.
    1106  */
    1107  static bool EqualContent(
    1108  const ON_ContentHash& a,
    1109  const ON_ContentHash& b
    1110  );
    1111 
    1112  /*
    1113  Returns:
    1114  true if a and b have differnt ByteCount() or SHA-1 content hash values.
    1115  */
    1116  static bool DifferentContent(
    1117  const ON_ContentHash& a,
    1118  const ON_ContentHash& b
    1119  );
    1120 
    1121 
    1122  /*
    1123  Description:
    1124  Compares content byte count and content SHA-1
    1125  */
    1126  static int CompareContent(
    1127  const ON_ContentHash& a,
    1128  const ON_ContentHash& b
    1129  );
    1130 
    1131  /*
    1132  Description:
    1133  Compares all fields
    1134  */
    1135  static int Compare(
    1136  const ON_ContentHash& a,
    1137  const ON_ContentHash& b
    1138  );
    1139 
    1140  /*
    1141  Parameters:
    1142  filename - [in]
    1143  Returns:
    1144  True if the file exists, has size > 0, has the same name, same size, and same last modified time
    1145  than this content hash.
    1146  False otherwise.
    1147  Remarks:
    1148  Faster than the ON_ContentHash::EqualContent() and reliable if this content
    1149  hash was set on the same file system.
    1150  Unreliable if the file system does not correctly set last modified times
    1151  or the file was modified less than 2 seconds before the call.
    1152  */
    1153  bool EqualFileNameSizeAndTime(
    1154  const wchar_t* filename
    1155  ) const;
    1156 
    1157  bool Write(
    1158  class ON_BinaryArchive& archive
    1159  ) const;
    1160 
    1161  bool Read(
    1162  class ON_BinaryArchive& archive
    1163  );
    1164 
    1165  void Dump(
    1166  class ON_TextLog& text_log
    1167  ) const;
    1168 
    1169 private:
    1170  // Number of bytes in the buffer or file
    1171  ON__UINT64 m_byte_count = 0;
    1172 
    1173  // Time this hash was set (always > 0 if this ON_ContentHash is set).
    1174  ON__UINT64 m_hash_time = 0; // number of seconds since Jan 1, 1970, UCT
    1175 
    1176  // Time the content was last modifed.
    1177  // This time is often unknown, or set incorrectly.
    1178  ON__UINT64 m_content_time = 0; // number of seconds since Jan 1, 1970, UCT
    1179 
    1180  // SHA-1 hash of the content name (file name or other assigned name)
    1181  ON_SHA1_Hash m_sha1_name_hash = ON_SHA1_Hash::ZeroDigest;
    1182 
    1183  // SHA-1 hash of the content (buffer or file).
    1184  ON_SHA1_Hash m_sha1_content_hash = ON_SHA1_Hash::ZeroDigest;
    1185 };
    1186 
    1187 class ON_CLASS ON_FileReference
    1188 {
    1189 public:
    1190  static const ON_FileReference Unset;
    1191 
    1192 #pragma region RH_C_SHARED_ENUM [ON_FileReference::Status] [Rhino.FileIO.FileReferenceStatus] [int]
    1193  ///<summary>Enumerates a list of file statuses.</summary>
    1194  enum class Status : unsigned int
    1195  {
    1196  /// <summary>
    1197  /// Status of a the full path is not known.
    1198  /// </summary>
    1199  Unknown = 0,
    1200 
    1201  /// <summary>
    1202  /// Full path is valid.
    1203  /// </summary>
    1204  FullPathValid = 1,
    1205 
    1206  /// <summary>
    1207  /// Unable to locate file.
    1208  /// </summary>
    1209  FileNotFound = 2
    1210  };
    1211 #pragma endregion
    1212 
    1213  static int Compare(
    1214  const ON_FileReference& a,
    1215  const ON_FileReference& b
    1216  );
    1217 
    1218  static ON_FileReference::Status StatusFromUnsigned(
    1219  unsigned int full_path_status_as_unsigned
    1220  );
    1221 
    1222  ON_FileReference() = default;
    1223  ~ON_FileReference() = default;
    1224  ON_FileReference(const ON_FileReference&) = default;
    1225  ON_FileReference& operator=(const ON_FileReference&) = default;
    1226 
    1228  const wchar_t* full_path,
    1229  const wchar_t* relative_path,
    1230  ON_ContentHash content_hash,
    1231  ON_FileReference::Status full_path_status
    1232  );
    1233 
    1234  static ON_FileReference CreateFromFullPath(
    1235  const wchar_t* full_path,
    1236  bool bSetContentHash,
    1237  bool bSetFullPathStatus
    1238  );
    1239 
    1240 #pragma region RH_C_SHARED_ENUM [ON_FileReference::FindFilePreference] [Rhino.FileIO.FileFindPreference] [int]
    1241  ///<summary>Defines options for file search.</summary>
    1242  enum class FindFilePreference : unsigned char
    1243  {
    1244  ///<summary>The choice is not defined.</summary>
    1245  None = 0,
    1246 
    1247  ///<summary>File name exists in FullPath().</summary>
    1248  FullPath = 1,
    1249 
    1250  ///<summary>File name exists in base path + RelativePath().</summary>
    1251  RelativePath = 2,
    1252 
    1253  ///<summary>File name exists in base path directory.</summary>
    1254  BasePath = 3,
    1255 
    1256  ///<summary>File with mathing content exists.</summary>
    1257  ContentMatch = 4,
    1258 
    1259  ///<summary>Most recently modifed file.</summary>
    1260  MostRecent = 5
    1261  };
    1262 #pragma endregion
    1263 
    1264  /*
    1265  Description:
    1266  Uses the full path, relative path and parameter information to find a
    1267  full path to a file that exists.
    1268  Parameters:
    1269  base_path - [in]
    1270  If base_path and RelativePath() are not empty, then path base_path+RelativePath().
    1271  If base_path is not empty, then base_path + filename is considered.
    1272  bBasePathIncludesFileName - [in]
    1273  True if base_path contains a file name that must be removed to get a directory path.
    1274  first_choice - [in]
    1275  When multiple files are found in different locations, the first_choice, second_choice,
    1276  third_choice, forth_choice, and fifth_choice parameters are used to select which file
    1277  is returned.
    1278  second_choice - [in]
    1279  When multiple files are found in different locations, the first_choice, second_choice,
    1280  third_choice, forth_choice, and fifth_choice parameters are used to select which file
    1281  is returned.
    1282  third_choice - [in]
    1283  When multiple files are found in different locations, the first_choice, second_choice,
    1284  third_choice, forth_choice, and fifth_choice parameters are used to select which file
    1285  is returned.
    1286  forth_choice - [in]
    1287  When multiple files are found in different locations, the first_choice, second_choice,
    1288  third_choice, forth_choice, and fifth_choice parameters are used to select which file
    1289  is returned.
    1290  fifth_choice - [in]
    1291  When multiple files are found in different locations, the first_choice, second_choice,
    1292  third_choice, forth_choice, and fifth_choice parameters are used to select which file
    1293  is returned.
    1294  full_path - [out]
    1295  A full path to a file that exists.
    1296  If FullPath() and base_path+RelativePath() resolve to different files,
    1297  the content hash information is used to select the file.
    1298  Returns:
    1299  If the file is found, then the returned ON_FileReference::FindFilePreference enum value
    1300  indicates why it was selected.
    1301  If the file is not found, then ON_FileReference::FindFilePreference::None is returned
    1302  and full_path is empty.
    1303  Remarks:
    1304  The locations FullPath(), base_path+RelativePath(), and base_path+FileName() are tested.
    1305  If multiple files are found, first_choice, second_choice, third_choice, forth_choice,
    1306  and fifth_choice are used to select which file is returned.
    1307  */
    1309  const wchar_t* base_path,
    1310  bool bBasePathIncludesFileName,
    1316  ON_wString& found_file_full_path
    1317  ) const;
    1318 
    1319  /*
    1320  Description:
    1321  Uses the full path, relative path and parameter information to find a
    1322  full path to a file that exists.
    1323  Parameters:
    1324  base_path - [in]
    1325  If base_path and RelativePath() are not empty, then path base_path+RelativePath().
    1326  If base_path is not empty, then base_path + filename is considered.
    1327  bBasePathIncludesFileName - [in]
    1328  True if base_path contains a file name that must be removed to get a directory path.
    1329  Returns:
    1330  If the file is found, then the returned ON_FileReference::FindFilePreference enum value
    1331  indicates why it was selected.
    1332  If the file is not found, then ON_FileReference::FindFilePreference::None is returned
    1333  and full_path is empty.
    1334  Remarks:
    1335  The locations FullPath(), base_path+RelativePath(), and base_path+FileName() are tested.
    1336  If multiple files are found, the returned file is selected in the order
    1337  relative path, full path, content match, base path and most recently modified.
    1338  If you prefer a different order, use the version of ON_FileReference::FindFile
    1339  with 5 ON_FileReference::FindFilePreference parameters.
    1340  */
    1342  const wchar_t* base_path,
    1343  bool bBasePathIncludesFileName,
    1344  ON_wString& found_file_full_path
    1345  ) const;
    1346 
    1347  /*
    1348  Description:
    1349  The search for the file is identical to the one performed by find file.
    1350  If a file is found, the full path setting in this reference is updated.
    1351  */
    1352  ON_FileReference::FindFilePreference FindFileAndUpdateReference(
    1353  const wchar_t* base_path,
    1354  bool bBasePathIncludesFileName,
    1360  bool bUpdateContentHash,
    1361  ON_wString& found_file_full_path
    1362  );
    1363 
    1364  /*
    1365  Description:
    1366  The search for the file is identical to the one performed by find file.
    1367  If a file is found, the full path setting in this reference is updated.
    1368  */
    1369  ON_FileReference::FindFilePreference FindFileAndUpdateReference(
    1370  const wchar_t* base_path,
    1371  bool bBasePathIncludesFileName,
    1372  bool bUpdateContentHash,
    1373  ON_wString& found_file_full_path
    1374  );
    1375 
    1376  ON_FileReference::FindFilePreference FindFileAndUpdateReference(
    1377  const wchar_t* base_path,
    1378  bool bBasePathIncludesFileName,
    1379  bool bUpdateContentHash
    1380  );
    1381 
    1382  /*
    1383  Returns:
    1384  True if FullPath() is not empty.
    1385  */
    1386  bool IsSet() const;
    1387 
    1388  /*
    1389  Returns:
    1390  True if FullPath() is empty.
    1391  */
    1392  bool IsNotSet() const;
    1393 
    1394  /*
    1395  Parameters:
    1396  bUseArchiveBasePath - [in]
    1397  If bUseArchiveBasePath is true and a file is being written, then the
    1398  base path of the file being written use used as the base path to
    1399  calculate the relative path.
    1400  If bUseArchiveBasePath is false, then the current value of RelativePath()
    1401  is saved in the archive.
    1402  */
    1403  bool Write(
    1404  bool bUseArchiveDirectoryAsBasePath,
    1405  ON_BinaryArchive& archive
    1406  ) const;
    1407 
    1408  /*
    1409  Parameters:
    1410  base_path - [in]
    1411  If base_path is not empty, then the relative path saved
    1412  in the archive will be calculated from FullPath() and base_path.
    1413  If base_path is nullptr or empty, then RelativePath() is saved in
    1414  the archive.
    1415  */
    1416  bool Write(
    1417  const wchar_t* base_path,
    1418  bool bBasePathIncludesFileName,
    1419  ON_BinaryArchive& archive
    1420  ) const;
    1421 
    1422  /*
    1423  Remarks:
    1424  Calling Read() sets m_full_path_status = ON_FileReference::Status::Unknown,
    1425  even if that was not the status when Write() was called.
    1426  */
    1427  bool Read(
    1428  ON_BinaryArchive& archive
    1429  );
    1430 
    1431  void Dump(
    1432  class ON_TextLog& text_log
    1433  ) const;
    1434 
    1435  unsigned int SizeOf() const;
    1436 
    1437  const ON_wString& FullPath() const;
    1438  const wchar_t* FullPathAsPointer() const;
    1439  void SetFullPath(
    1440  const wchar_t* full_path,
    1441  bool bSetContentHash
    1442  );
    1443  void SetFullPath(
    1444  const char* full_path,
    1445  bool bSetContentHash
    1446  );
    1447  void ClearFullPath();
    1448 
    1449  const ON_wString& RelativePath() const;
    1450  const wchar_t* RelativePathAsPointer() const;
    1451  void SetRelativePath(
    1452  const wchar_t* relative_path
    1453  );
    1454  void SetRelativePath(
    1455  const char* relative_path
    1456  );
    1457  void SetRelativePathFromBasePath(
    1458  const wchar_t* base_path,
    1459  bool bBasePathContainsFileName
    1460  );
    1461  void SetRelativePathFromBasePath(
    1462  const char* base_path,
    1463  bool bBasePathContainsFileName
    1464  );
    1465  void ClearRelativePath();
    1466 
    1467  /*
    1468  Returns:
    1469  File content hash. This value is persistent, saved in 3dm archive,
    1470  and could have been calculated a long time ago on a different computer.
    1471  */
    1472  const ON_ContentHash& ContentHash() const;
    1473  void SetContentHash(
    1474  ON_ContentHash content_hash
    1475  );
    1476  void ClearContentHash();
    1477 
    1478  bool UpdateContentHash();
    1479 
    1480  /*
    1481  Returns:
    1482  Parameters:
    1483  recent_time - [in]
    1484  The time, in number of seconds since January 1, 1970 UTC, to use
    1485  when deciding what content hashes can be considered recent.
    1486  If recent_time is 0 or in the future, then the current value of
    1487  ON_SecondsSinceJanOne1970UTC() is used.
    1488  Typically this parameter is the value of ON_SecondsSinceJanOne1970UTC()
    1489  at the beginning of a calculation durint which any referenced files will
    1490  not be changed.
    1491  Returns:
    1492  A file content hash value calculated on or after a specified time in the current
    1493  instance of the application. This value is used to detect changed files
    1494  in the current instance of the application. It is cached for performance reasons.
    1495  This value is never saved in 3dm files.
    1496  */
    1497  const ON_ContentHash& RecentContentHash(
    1498  ON__UINT64 recent_time
    1499  ) const;
    1500 
    1501  /*
    1502  Returns:
    1503  ON_SHA1_Hash::FileSystemPathHash(FullPath());
    1504  Remarks:
    1505  The value of the hash is saved in a runtime cache so
    1506  using this function when comparing paths is efficient
    1507  when multple compares are required.
    1508  See Also:
    1509  ON_NameHash::CreateFilePathHash( ON_FileReference& file_reference );
    1510  */
    1511  const ON_SHA1_Hash& FullPathHash() const;
    1512 
    1513  ON_FileReference::Status FullPathStatus() const;
    1514  void SetFullPathStatus(
    1515  ON_FileReference::Status full_path_status
    1516  );
    1517 
    1518  ON_UUID EmbeddedFileId() const;
    1519  void SetEmbeddedFileId(
    1520  ON_UUID embedded_file_id
    1521  );
    1522 
    1523 private:
    1524  ON_wString m_full_path;
    1525  ON_wString m_relative_path;
    1526 
    1527  // If the referenced file is saved in the model as an embedded file,
    1528  // the ON_BinaryArchive read code sets m_embedded_file_id
    1529  // at read time.
    1530  mutable ON_UUID m_embedded_file_id = ON_nil_uuid;
    1531 
    1532  // file content hash. Can be calculated long ago, on a different computer,
    1533  // and is saved in 3dm archived.
    1534  ON_ContentHash m_content_hash; // File content hash.
    1535 
    1536  mutable ON_ContentHash m_recent_content_hash;
    1537 
    1538  // m_full_path_hash is chached runtime information. The value is not saved
    1539  // in .3dm archives. It is calculated on demand.
    1540  mutable ON_SHA1_Hash m_full_path_hash = ON_SHA1_Hash::EmptyContentHash; // File path hash.
    1541 
    1543 
    1544 private:
    1545  ON_FileReference::FindFilePreference Internal_FindFile(
    1546  const wchar_t* base_path,
    1547  bool bBasePathIncludesFileName,
    1548  const ON_FileReference::FindFilePreference* file_preference,
    1549  unsigned int file_preference_count,
    1550  ON_wString& found_file_full_path,
    1551  ON_ContentHash* found_file_content_hash
    1552  ) const;
    1553 };
    1554 
    1555 /*
    1556 Description:
    1557  Iterates through every item in a file system directory.
    1558 */
    1559 class ON_CLASS ON_FileIterator
    1560 {
    1561 public:
    1562  ON_FileIterator() = default;
    1563  ~ON_FileIterator();
    1564 
    1565 private:
    1566  ON_FileIterator(const ON_FileIterator&) = delete;
    1567  ON_FileIterator& operator=(const ON_FileIterator&) = delete;
    1568 
    1569 public:
    1570 
    1571  //////////////////////////////////////////////////////////////////////////////////
    1572  //
    1573  // Iteratation initialization tools
    1574  //
    1575  /*
    1576  Description:
    1577  Initialize where the search should occur.
    1578  Parameters:
    1579  directory_name - [in]
    1580  The directory to look in.
    1581  item_name_filter - [in]
    1582  If this paramter is null, then the iteration
    1583  includes all names in the directory.
    1584  The item name to search for. This parameter can
    1585  include wildcard characters, such as an
    1586  asterisk (*) or a question mark (?). For example,
    1587  "\rootdir\subdir\*.*" will iterate all files in
    1588  the \rootdir\subdir\ directory.
    1589 
    1590  Returns:
    1591  true:
    1592  The iterator is set to the first item.
    1593  false:
    1594  There are no matching items.
    1595 
    1596  Remarks:
    1597  Calling FirstItem() is eqivalent to calling Initialize() and then calling NextItem().
    1598  */
    1599  bool Initialize(
    1600  const wchar_t* directory_name
    1601  );
    1602  bool Initialize(
    1603  const wchar_t* directory_name,
    1604  const wchar_t* item_name_filter
    1605  );
    1606  bool Initialize(
    1607  const char* directory_name
    1608  );
    1609  bool Initialize(
    1610  const char* directory_name,
    1611  const char* item_name_filter
    1612  );
    1613 
    1614  //////////////////////////////////////////////////////////////////////////////////
    1615  //
    1616  // Iteratation iteration tools
    1617  //
    1618 
    1619  /*
    1620  Description:
    1621  Find the first matching item in the directory.
    1622  Example:
    1623  // Iterate through the files in a directory named "\rootdir\subdir"
    1624  ON_FileIterator fit;
    1625  fit.Initialize("\\rootdir\\subdir");
    1626  for ( bool bHaveItem = fit.FirstItem(); bHaveItem; bHaveItem = fit.NextItem() )
    1627  {
    1628  if ( fit.CurrentFileIsDirectory() )
    1629  continue;
    1630  ON_String fullpath = fit.CurrentItemFullPathName();
    1631  FILE* fp = ON_FileStream::Open(fullpath,"rb");
    1632  if ( 0 == fp )
    1633  {
    1634  continue;
    1635  }
    1636  ...
    1637  ON_FileStream::Close(fp);
    1638  fp = 0;
    1639  }
    1640  }
    1641 
    1642  Returns:
    1643  true:
    1644  The iterator is set to the first item.
    1645  false:
    1646  There are no matching items.
    1647  */
    1648  bool FirstItem();
    1649 
    1650  /*
    1651  Description:
    1652  Find the next matching item in the directory.
    1653  Returns:
    1654  true:
    1655  The iterator was advanced to the next item.
    1656  false:
    1657  There are no more matching items.
    1658  */
    1659  bool NextItem();
    1660 
    1661  /*
    1662  Description:
    1663  Reset this ON_FileIterator so it can be used again.
    1664  */
    1665  void Reset();
    1666 
    1667  //////////////////////////////////////////////////////////////////////////////////
    1668  //
    1669  // Current item query
    1670  //
    1671 
    1672  /*
    1673  Returns:
    1674  Current file or directory name in the directory being iterated.
    1675  Use CurrentFullPathItemName() to get the full path name.
    1676  */
    1677  const ON_wString CurrentItemName() const;
    1678 
    1679  /*
    1680  Returns:
    1681  The name of the directory being iterated.
    1682  */
    1683  const ON_wString DirectoryName() const;
    1684 
    1685  /*
    1686  Returns:
    1687  If the current item is a file, then the size of the file in bytes is returned.
    1688  If the current item is a directory, then 0 is returned.
    1689  */
    1690  ON__UINT64 CurrentItemSize() const;
    1691 
    1692  /*
    1693  Returns
    1694  true if the current item is a directory.
    1695  */
    1696  bool CurrentItemIsDirectory() const;
    1697 
    1698  /*
    1699  Returns
    1700  true if the current item is a file.
    1701  */
    1702  bool CurrentItemIsFile() const;
    1703 
    1704  /*
    1705  Returns
    1706  true if the current file or directory is hidden.
    1707  This means its name begins with a '.' or it's
    1708  Windows hidden attribute is true.
    1709  */
    1710  bool CurrentItemIsHidden() const;
    1711 
    1712  const ON_wString CurrentItemFullPathName() const;
    1713 
    1714  /*
    1715  Returns:
    1716  File last modified time in seconds since January 1, 1970
    1717  Remarks:
    1718  The times returned by ON_FileIterator can differ from the time
    1719  returned by ON_FileStream::GetFileInformation().
    1720  */
    1721  ON__UINT64 CurrentItemLastModifiedTime() const;
    1722 
    1723  /*
    1724  Returns:
    1725  Number of matching items iterated through.
    1726  */
    1727  ON__UINT64 CurrentItemCount() const;
    1728 
    1729 private:
    1730  ON__UINT32 m_state = 0; // 0 unset, 1=initialized, 2 = itereation in progress. 3 = iteration finished.
    1731  ON__UINT32 m_reserved = 0;
    1732 
    1733  ON_wString m_directory; // directory passed to Initialize() or FirstItem
    1734  ON_wString m_item_name_filter; // item_name_filter passed to Initialize() or FirstItem
    1735  ON_wString m_item_name; // Current item name.
    1736 
    1737  // cached full path name
    1738  // m_directory + directory separator + m_item_name
    1739  // (length = 0 if it is not set)
    1740  mutable ON_wString m_full_path_name;
    1741 
    1742  ON__UINT64 m_count = 0; // number of items iterated through so far
    1743  class ON_DirectoryIteratorImpl* m_impl = nullptr;
    1744 };
    1745 
    1746 #endif
    PathId
    ids used by ON_FileSystemPath::GetPath()
    Definition: opennurbs_file_utilities.h:540
    +
    1 /*
    2 //
    3 // Copyright (c) 1993-2015 Robert McNeel & Associates. All rights reserved.
    4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    5 // McNeel & Associates.
    6 //
    7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    10 //
    11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    12 //
    13 ////////////////////////////////////////////////////////////////
    14 */
    15 
    16 #if !defined(OPENNURBS_FILE_UTILITIES_INC_)
    17 #define OPENNURBS_FILE_UTILITIES_INC_
    18 
    19 class ON_CLASS ON_FileSystem
    20 {
    21 private:
    22  ON_FileSystem() = delete;
    23  ~ON_FileSystem() = delete;
    24  ON_FileSystem(const ON_FileSystem&) = delete;
    25  ON_FileSystem& operator=(const ON_FileSystem&) = delete;
    26 
    27 public:
    28  static bool PathExists(
    29  const char* path
    30  );
    31 
    32  static bool PathExists(
    33  const wchar_t* path
    34  );
    35 
    36  /*
    37  Returns:
    38  True if path is a directory.
    39  False otherwise.
    40  */
    41  static bool IsDirectory(
    42  const char* path
    43  );
    44 
    45  /*
    46  Returns:
    47  True if path is a directory.
    48  False otherwise.
    49  */
    50  static bool IsDirectory(
    51  const wchar_t* path
    52  );
    53 
    54  /*
    55  Returns:
    56  True if path is a directory where files can be written.
    57  False otherwise.
    58  */
    59  static bool IsDirectoryWithWriteAccess(
    60  const char* path
    61  );
    62 
    63  /*
    64  Returns:
    65  True if path is a directory where files can be written.
    66  False otherwise.
    67  */
    68  static bool IsDirectoryWithWriteAccess(
    69  const wchar_t* path
    70  );
    71 
    72  /*
    73  Returns:
    74  True if path is a file.
    75  False otherwise.
    76  */
    77  static bool IsFile(
    78  const char* path
    79  );
    80 
    81  /*
    82  Returns:
    83  True if path is a file.
    84  False otherwise.
    85  */
    86  static bool IsFile(
    87  const wchar_t* path
    88  );
    89 
    90  /*
    91  Description
    92  Remove a file
    93  Parameters:
    94  file_path - [in]
    95  name of file to delete
    96  Returns:
    97  True if the fuke existed and was removed.
    98  */
    99  static bool RemoveFile(
    100  const char* file_path
    101  );
    102 
    103  /*
    104  Description
    105  Remove a file
    106  Parameters:
    107  file_path - [in]
    108  name of file to delete
    109  Returns:
    110  True if the fuke existed and was removed.
    111  */
    112  static bool RemoveFile(
    113  const wchar_t* file_path
    114  );
    115 };
    116 
    117 class ON_CLASS ON_FileSystemPath
    118 {
    119 private:
    120  ON_FileSystemPath() = delete;
    121  ~ON_FileSystemPath() = delete;
    122  ON_FileSystemPath(const ON_FileSystemPath&) = delete;
    123  ON_FileSystemPath& operator=(const ON_FileSystemPath&) = delete;
    124 
    125 public:
    126  /*
    127  Platform dependent character used to separate directory names.
    128  On Windows platforms:
    129  ON_FileSystemPath::DirectorySeparator = ON_wString::Backslash.
    130  On UNIX (including modern Apple) platforms:
    131  ON_FileSystemPath::DirectorySeparator = ON_wString::Slash.
    132  */
    133  static const char DirectorySeparatorAsChar;
    134  static const wchar_t DirectorySeparator;
    135 
    137  static const wchar_t AlternateDirectorySeparator;
    138 
    139  static bool IsDirectorySeparator(
    140  char c,
    141  bool bAllowAlternate
    142  );
    143 
    144  static bool IsDirectorySeparator(
    145  wchar_t c,
    146  bool bAllowAlternate
    147  );
    148 
    149  /*
    150  Description:
    151  Find the locations in a path the specify the drive, directory,
    152  file name and file extension.
    153  Parameters:
    154  path - [in]
    155  path to split
    156  volume - [out] (pass null if you don't need the volume)
    157  If volume is not null and the path parameter begins with a
    158  Windows volume specification, *volume will either be
    159  the Windows volume letter followed by the trailing colon
    160  or a Windows UNC \<hostname>. Otherwise volume will
    161  be the empty string.
    162  dir - [out] (pass null if you don't need the directory)
    163  If dir is not null and the path parameter contains a
    164  directory specification, then the returned value of *dir
    165  will be the directory specification including the trailing
    166  slash.
    167  file_name_stem - [out] (pass null if you don't need the file name stem)
    168  If file_name_stem is not null and the path parameter contains a
    169  file name specification, then the returned value of *file_name_stem
    170  will be the file name stem.
    171  file_name_ext - [out] (pass null if you don't need the extension)
    172  If file_name_ext is not null and the path parameter contains a
    173  file name extension specification, then the returned value of
    174  *file_name_ext will be the file name extension including the initial
    175  '.' character.
    176  Remarks:
    177  This function will treat a front slash ( / ) and a back slash
    178  ( \ ) as directory separators. Because this function parses
    179  file names store in .3dm files and the .3dm file may have been
    180  written on a Windows computer and then read on a another
    181  computer, it looks for a volume specification even when the
    182  operating system is not Windows.
    183  This function will not return an directory that does not
    184  end with a trailing slash.
    185  This function will not return an empty filename and a non-empty
    186  extension.
    187  This function parses the path string according to these rules.
    188  It does not check the actual file system to see if the answer
    189  is correct.
    190  See Also:
    191  on_splitpath
    192  */
    193  static void SplitPath(
    194  const char* path,
    195  ON_String* volume,
    196  ON_String* dir,
    197  ON_String* file_name_stem,
    198  ON_String* file_name_ext
    199  );
    200 
    201  static void SplitPath(
    202  const char* path,
    203  ON_wString* volume,
    204  ON_wString* dir,
    205  ON_wString* file_name_stem,
    206  ON_wString* file_name_ext
    207  );
    208 
    209  static void SplitPath(
    210  const wchar_t* path,
    211  ON_wString* volume,
    212  ON_wString* dir,
    213  ON_wString* file_name_stem,
    214  ON_wString* file_name_ext
    215  );
    216 
    217  static void SplitPath(
    218  const wchar_t* path,
    219  ON_wString* volume,
    220  ON_wString* dir,
    221  ON_wString* file_name_stem_and_extension
    222  );
    223 
    224  static bool FilePathHas3dmExtension(
    225  const wchar_t* file_path,
    226  bool bAllow3dmbakExtension
    227  );
    228 
    229  static bool FilePathHas3dmExtension(
    230  const char* file_path,
    231  bool bAllow3dmbakExtension
    232  );
    233 
    234  /*
    235  Description:
    236  Determine if the file_name string is a permitted file name.
    237  Valid file names must be non empty, cannot have two periods in a row,
    238  and cannot contain directory separators, tildes, and other
    239  platform specific values.
    240  Parameters:
    241  file_name - [in]
    242  string to test.
    243  bAllPlatforms - [in]
    244  If true, test name for all supported platforms.
    245  Returns:
    246  True if the string can be a file name.
    247  */
    248  static bool IsValidFileName(
    249  const char* file_name,
    250  bool bAllPlatforms
    251  );
    252 
    253  /*
    254  Description:
    255  Determine if the file_name string is a permitted file name.
    256  Valid file names must be non empty, cannot have two periods in a row,
    257  and cannot contain directory separators, tildes, and other
    258  platform specific values.
    259  Parameters:
    260  file_name - [in]
    261  string to test.
    262  bAllPlatforms - [in]
    263  If true, test name for all supported platforms.
    264  Returns:
    265  True if the string can be a file name.
    266  */
    267  static bool IsValidFileName(
    268  const wchar_t* file_name,
    269  bool bAllPlatforms
    270  );
    271 
    272  /*
    273  Parameters:
    274  path - [in]
    275  path to split
    276  Returns:
    277  The volume portion of the path.
    278  */
    279  static const ON_wString VolumeFromPath(
    280  const wchar_t* path
    281  );
    282 
    283  /*
    284  Parameters:
    285  path - [in]
    286  path to split
    287  Returns:
    288  The directory portion of the path.
    289  */
    290  static const ON_wString DirectoryFromPath(
    291  const wchar_t* path
    292  );
    293 
    294  /*
    295  Parameters:
    296  path - [in]
    297  path to split
    298  Returns:
    299  The volume and directory portion of the path.
    300  */
    301  static const ON_wString VolumeAndDirectoryFromPath(
    302  const wchar_t* path
    303  );
    304 
    305  /*
    306  Parameters:
    307  path - [in]
    308  path to split
    309  bIncludeExtension - [in]
    310  Returns:
    311  The file name portion of the path.
    312  */
    313  static const ON_wString FileNameFromPath(
    314  const wchar_t* path,
    315  bool bIncludeExtension
    316  );
    317 
    318  /*
    319  Parameters:
    320  path - [in]
    321  path to split
    322  Returns:
    323  The file name extension portion of the path, inlcuding the leading period or "dot".
    324  */
    325  static const ON_wString FileNameExtensionFromPath(
    326  const wchar_t* path
    327  );
    328 
    329  /*
    330  Description:
    331  Condenses // to /
    332  Condenses /./ to /
    333  Condenses /sfsdf/../ to /
    334  Sets all directory separators to directory_separator.
    335  Parameters:
    336  bAllowWindowsUNCHostNameOrDiskLetter - [in]
    337  If bAllowWindowsUNCHostNameOrDiskLetter and the path begins with \\HostName followed by
    338  a directory separator, then the initial \\ is not condensed.
    339  If the path begins with X: followed by a directory separator, where "X" is a single
    340  letter in the range A to Z or a to z, then the path is considered valid.
    341  bDeleteWindowsUNCHostNameOrDiskLetter - [in]
    342  If bAllowWindowsUNCHostNameOrDiskLetter is true and the path begins with a UNC
    343  host name or disk letter followed by a directory separator, then host name or disk letter
    344  is deleted. This is useful when using paths from a Windows platform on a
    345  non-Windows platform.
    346  directory_separator - [in]
    347  If 0 == directory_separator, then the first directory separator
    348  is kept when condensing occurs.
    349  ON_wString::FileSystemPathSeparator is a good choice if you want
    350  to use the current runtime's separator.
    351  dirty_path - [in]
    352  path to clean.
    353  Return:
    354  Cleaned path.
    355  */
    356  static const ON_wString CleanPath(
    357  bool bTrimLeft,
    358  bool bTrimRight,
    359  bool bAllowWindowsUNCHostNameOrDiskLetter,
    360  bool bDeleteWindowsUNCHostNameOrDiskLetter,
    361  const wchar_t directory_separator,
    362  const wchar_t* dirty_path
    363  );
    364 
    365  /*
    366  Parameters:
    367  path - [in]
    368  path to test
    369  directory_separator - [in]
    370  If 0 == directory_separator, then either ON_wString::FileSystemPathSeparator
    371  or ON_wString::AlternateFileSystemPathSeparator is permitted as a directory
    372  separator.
    373  ON_wString::FileSystemPathSeparator is a good choice if you want
    374  to use the current runtime's separator.
    375  Returns:
    376  True if path begins with ../ or ./
    377  */
    378  static bool IsRelativePath(
    379  const wchar_t* path,
    380  const wchar_t directory_separator
    381  );
    382 
    383 
    384  /*
    385  Parameters:
    386  path - [in]
    387  path to test
    388  Returns:
    389  True if path begins with ../ or ..\ or ./ or .\
    390  */
    391  static bool IsRelativePath(
    392  const wchar_t* path
    393  );
    394  /*
    395  Description:
    396  Condenses // to /
    397  Condenses /./ to /
    398  Condenses /sfsdf/../ to /
    399  Trims left and right white space.
    400  Sets all directory separators to ON_FileSystemPath::DirectorySeparator.
    401  If the Platform is not windows, the UNC host names and volume letters are deleted.
    402  */
    403  static const ON_wString CleanPath(
    404  const wchar_t* dirty_path
    405  );
    406 
    407  /*
    408  Description:
    409  Get a the relative path from base_path to full_path.
    410  Parameters:
    411  full_path - [in]
    412  base_path - [in]
    413 
    414  Example
    415  full_path = L"c:/a/b/c/d/somefile.txt";
    416  base_path = L"C:/A/B/X/Y/Z/model.3dm";
    417  ON_wString::GetRelativePath(full_path,base_path) returns
    418  L"../../../c/d/somefile.txt"
    419 
    420  Example
    421  full_path = L"c:/a/b/somefile.txt";
    422  base_path = L"C:/A/B/model.3dm";
    423  ON_wString::GetRelativePath(full_path,base_path) returns
    424  L"./somefile.txt"
    425 
    426  Remarks:
    427  Path separators on the input can be mixed.
    428  Path separators on the returned relative path are ON_wString::FileSystemPathSeparator
    429  */
    430  static const ON_wString RelativePath(
    431  const wchar_t* full_path,
    432  bool bFullPathIncludesFileName,
    433  const wchar_t* base_path,
    434  bool bBasePathIncludesFileName
    435  );
    436 
    437  static const ON_wString FullPathFromRelativePath(
    438  const wchar_t* base_path,
    439  bool bBasePathIncludesFileName,
    440  const wchar_t* relative_path
    441  );
    442 
    443  /*
    444  Returns:
    445  true if the platform file system ignores case.
    446  Remarks:
    447  Windows and default installations of OS X 10.10.3, and default installations of the UNIX
    448  terminal interface in OS X 10.10.3 and later ignore case.
    449  In the case of OX X, a user can override the default setting.
    450  */
    451  static bool PlatformPathIgnoreCase();
    452 
    453  /*
    454  Parameters:
    455  bWithTrailingDirectorySeparator - [in]
    456  true - returned path will have a trailing directory separator.
    457  false - returned path will not have a trailing directory separator.
    458  Returns:
    459  The platform current working directory which should be the directory
    460  where ON::OpenFile("fname","r") would look for a file named "fname".
    461  */
    462  static const ON_wString CurrentDirectory(
    463  bool bWithTrailingDirectorySeparator
    464  );
    465 
    466  /*
    467  Description:
    468  Removes file name from path.
    469  Parameters:
    470  path - [in]
    471  file system path with a file name.
    472  file_name - [out]
    473  If file_name is not nullptr, the removed portion of path
    474  is returned here.
    475  Returns:
    476  path with any file name removed.
    477  Remarks:
    478  This function uses on_wsplitpath() to decide if the path ends with characters that
    479  could be a file name. It does not inspect the file system to see if the file exists.
    480  */
    481  static const ON_wString RemoveFileName(
    482  const wchar_t* path,
    483  ON_wString* file_name
    484  );
    485 
    486  /*
    487  Description:
    488  Removes Windows volume name from path.
    489  Parameters:
    490  path - [in]
    491  file system path
    492  volume_name - [out]
    493  If volume_name is not nullptr, the removed portion of path
    494  is returned here.
    495  Returns:
    496  path with any volume name removed.
    497  Remarks:
    498  This function uses on_wsplitpath() to decide if the path begins with characters that
    499  could be a volume name. It does not inspect the file system to see if the volume exists.
    500  */
    501  static const ON_wString RemoveVolumeName(
    502  const wchar_t* path,
    503  ON_wString* volume_name
    504  );
    505 
    506  /*
    507  Description:
    508  Combine paths into a single valid path name. Remove internal .. and .
    509  directory references. If necessary remove file names.
    510  Parameters:
    511  left_side - [in]
    512  bLeftSideContainsFileName - [in]
    513  true if left_side path ends in a file name and that
    514  file name is removed and discarded.
    515  right_side - [in]
    516  bRightSideContainsFileName - [in]
    517  true if right_side path ends in a file name.
    518  If bAppendTrailingDirectorySeparator is true, that file name is removed
    519  and discarded. If bAppendTrailingDirectorySeparator is false, the
    520  returned path ends in that file name.
    521  bAppendTrailingDirectorySeparator - [in]
    522  If true, any file names are removed and a directory separator
    523  is appended to the returned string.
    524  Returns:
    525  a path made left_side + right_side
    526  Remarks:
    527  This function manipulates string information.
    528  This function does not look at storage media
    529  to see if the paths currently exist.
    530  */
    531  static const ON_wString CombinePaths(
    532  const wchar_t* left_side,
    533  bool bLeftSideContainsFileName,
    534  const wchar_t* right_side,
    535  bool bRightSideContainsFileName,
    536  bool bAppendTrailingDirectorySeparator
    537  );
    538 
    539  // ids used by ON_FileSystemPath::GetPath()
    540  enum class PathId : unsigned int
    541  {
    542  Unset = 0,
    543  DesktopDirectory = 1,
    544  DocumentsDirectory = 2,
    545  DownloadsDirectory = 3
    546  };
    547 
    548  /*
    549  Parameters:
    550  path_id - [in]
    551  Specifies path to get.
    552  Returns:
    553  Requested path. If the path does not exist in the current context,
    554  the empty string is returned.
    555  */
    556  static const ON_wString PlatformPath(
    558  );
    559 
    560 
    561  ON_DEPRECATED_MSG("Use ON_FileSystem::PathExists")
    562  static bool PathExists(
    563  const char* path
    564  );
    565 
    566  ON_DEPRECATED_MSG("Use ON_FileSystem::PathExists")
    567  static bool PathExists(
    568  const wchar_t* path
    569  );
    570 
    571  ON_DEPRECATED_MSG("Use ON_FileSystem::IsDirectory")
    572  static bool IsDirectory(
    573  const char* path
    574  );
    575 
    576  ON_DEPRECATED_MSG("Use ON_FileSystem::IsDirectory")
    577  static bool IsDirectory(
    578  const wchar_t* path
    579  );
    580 
    581  ON_DEPRECATED_MSG("Use ON_FileSystem::IsFile")
    582  static bool IsFile(
    583  const char* path
    584  );
    585 
    586  ON_DEPRECATED_MSG("Use ON_FileSystem::IsFile")
    587  static bool IsFile(
    588  const wchar_t* path
    589  );
    590 };
    591 
    592 class ON_CLASS ON_FileStream
    593 {
    594 public:
    595  /*
    596  Description:
    597  Portable wrapper for C runtime fopen().
    598  Parameters:
    599  filename - [in]
    600  mode - [in]
    601  Remarks:
    602  Use the ON_FileStream static functions for reading, writing,
    603  seeking, position finding with the FILE pointer returned
    604  by this function.
    605  */
    606  static FILE* Open( const wchar_t* filename, const wchar_t* mode );
    607 
    608  /*
    609  Description:
    610  Portable wrapper for C runtime fopen().
    611  Parameters:
    612  filename - [in]
    613  mode - [in]
    614  Remarks:
    615  Use the ON_FileStream static functions for reading, writing,
    616  seeking, position finding with the FILE pointer returned
    617  by this function.
    618  */
    619  static FILE* Open( const char* filename, const char* mode );
    620 
    621  /*
    622  Description:
    623  Portable wrapper for C runtime fclose().
    624  Parameters:
    625  fp - [in]
    626  FILE pointer returned by ON_FileStream::Open().
    627  Returns:
    628  0: successful
    629  -1: null fp parameter
    630  != 0: fclose() failure code
    631  */
    632  static int Close( FILE* fp );
    633 
    634  /*
    635  Returns:
    636  True if the file is a 3dm archive.
    637  */
    638  static bool Is3dmFile(
    639  const wchar_t* file_path,
    640  bool bAllow3dmbakExtension
    641  );
    642 
    643  /*
    644  Returns:
    645  True if the file is a 3dm archive.
    646  */
    647  static bool Is3dmFile(
    648  const char* file_path,
    649  bool bAllow3dmbakExtension
    650  );
    651 
    652  /*
    653  Description:
    654  Open the file and seek to the location where the 3dm archive information begins.
    655  Returns:
    656  A file stream with the current position at the beginning of the 3dm archive.
    657  nullptr if the file is not a 3dm archive.
    658  */
    659  static FILE* Open3dmToRead(
    660  const wchar_t* file_path
    661  );
    662 
    663  /*
    664  Description:
    665  Open the file and seek to the location where the 3dm archive information begins.
    666  Returns:
    667  A file stream with the current position at the beginning of the 3dm archive.
    668  nullptr if the file is not a 3dm archive.
    669  */
    670  static FILE* Open3dmToRead(
    671  const char* file_path
    672  );
    673 
    674  /*
    675  Description:
    676  Portable wrapper for C runtime ftell().
    677  Parameters:
    678  fp - [in]
    679  FILE pointer returned by ON_FileStream::Open().
    680  Returns:
    681  >= 0: current file position
    682  -1: an error occured
    683  */
    684  static ON__INT64 CurrentPosition( FILE* fp );
    685 
    686  /*
    687  Description:
    688  Portable wrapper for C runtime fseek(fp,offset,SEEK_CUR).
    689  Parameters:
    690  fp - [in]
    691  FILE pointer returned by ON_FileStream::Open().
    692  offset - [in]
    693  */
    694  static bool SeekFromCurrentPosition( FILE* fp, ON__INT64 offset );
    695 
    696  /*
    697  Description:
    698  Portable wrapper for C runtime fseek(fp,offset,SEEK_SET).
    699  Parameters:
    700  fp - [in]
    701  FILE pointer returned by ON_FileStream::Open().
    702  offset - [in]
    703  */
    704  static bool SeekFromStart( FILE* fp, ON__INT64 offset );
    705 
    706  /*
    707  Description:
    708  Portable wrapper for C runtime fseek(fp,offset,SEEK_END).
    709  Parameters:
    710  fp - [in]
    711  FILE pointer returned by ON_FileStream::Open().
    712  offset - [in]
    713  */
    714  static bool SeekFromEnd( FILE* fp, ON__INT64 offset );
    715 
    716  /*
    717  Description:
    718  Portable wrapper for C runtime fseek(fp,offset,origin).
    719  Parameters:
    720  fp - [in]
    721  FILE pointer returned by ON_FileStream::Open().
    722  offset - [in]
    723  origin - [in]
    724  SEEK_SET (0): seek from beginning of file.
    725  SEEK_CUR (1): seek from current position of file pointer.
    726  SEEK_END (2): seek from end of file.
    727  */
    728  static bool Seek( FILE* fp, ON__INT64 offset, int orgin );
    729 
    730  /*
    731  Description:
    732  Portable wrapper for C runtime fread(buffer,1,count,fp).
    733  Parameters:
    734  fp - [in]
    735  FILE pointer returned by ON_FileStream::Open()
    736  count - [in]
    737  number of bytes to read.
    738  buffer - [out]
    739  read bytes are stored in this buffer
    740  Returns:
    741  number of bytes read
    742  */
    743  static ON__UINT64 Read( FILE* fp, ON__UINT64 count, void* buffer );
    744 
    745  /*
    746  Description:
    747  Portable wrapper for C runtime fwrite(buffer,1,count,fp).
    748  Parameters:
    749  fp - [in]
    750  FILE pointer returned by ON_FileStream::Open()
    751  count - [in]
    752  number of bytes to write
    753  buffer - [in]
    754  data to be written
    755  Returns:
    756  number of bytes written.
    757  */
    758  static ON__UINT64 Write( FILE* fp, ON__UINT64 count, const void* buffer );
    759 
    760  /*
    761  Description:
    762  Portable wrapper for C runtime fflush(fp).
    763  Parameters:
    764  fp - [in]
    765  FILE pointer returned by ON_FileStream::Open().
    766  Returns:
    767  true if flush was successful. False if an error occured.
    768  */
    769  static bool Flush( FILE* fp );
    770 
    771  /*
    772  Description:
    773  Portable wrapper for C runtime fstat().
    774  Parameters:
    775  fp - [in]
    776  FILE pointer returned by ON_FileStream::Open().
    777  file_size - [out]
    778  If file_size is not null, the the size of the file
    779  in bytes returned here
    780  file_metadata_last_modified_time - [out]
    781  If file_metadata_last_modified_time is not null, then the time the
    782  file's metadata (owner, permissions, ...) were last modified is returned
    783  here as the number of seconds since midnight January 1, 1970.
    784  file_contents_last_modified_time - [out]
    785  If file_contents_last_modified_time is not null, then the time the
    786  file's contents were last modified is returned here as the number of
    787  seconds since midnight January 1, 1970.
    788  Returns:
    789  true if the query was successful. False if an error occured.
    790  */
    791  static bool GetFileInformation(
    792  FILE* fp,
    793  ON__UINT64* file_size,
    794  ON__UINT64* file_metadata_last_modified_time,
    795  ON__UINT64* file_contents_last_modified_time
    796  );
    797  static bool GetFileInformation(
    798  const wchar_t* file_name,
    799  ON__UINT64* file_size,
    800  ON__UINT64* file_metadata_last_modified_time,
    801  ON__UINT64* file_contents_last_modified_time
    802  );
    803  static bool GetFileInformation(
    804  const char* file_name,
    805  ON__UINT64* file_size,
    806  ON__UINT64* file_metadata_last_modified_time,
    807  ON__UINT64* file_contents_last_modified_time
    808  );
    809 };
    810 
    811 class ON_CLASS ON_ContentHash
    812 {
    813 public:
    814  static const ON_ContentHash Unset;
    815 
    816 public:
    817  ON_ContentHash() = default;
    818  ~ON_ContentHash() = default;
    819  ON_ContentHash(const ON_ContentHash&) = default;
    820  ON_ContentHash& operator=(const ON_ContentHash&) = default;
    821 
    822  /*
    823  Descripton:
    824  Create an ON_ContentHash class with the specified size, hash and times.
    825  Parameters:
    826  sha1_name_hash - [in]
    827  The SHA-1 hash of the name (typically a full path file name).
    828  When the content is identified by a file name in a file system,
    829  use ON_SHA1_Hash::FileSystemPathHash() to calculate this value.
    830  byte_count - [in]
    831  number of bytes in the content.
    832  sha1_content_hash - [in]
    833  The SHA-1 hash of the content (typically a buffer or file).
    834  You may use ON_SHA1_Has::FileContentHash() or ON_SHA1_Hash::BufferContentHash()
    835  to calculate this value.
    836  hash_time - [in]
    837  The time the sha1_hash was calculated in seconds since January 1, 1970 UCT.
    838  If 0 is passed in, the current time is used.
    839  content_last_modified_time - [in]
    840  Pass 0 if not known.
    841  The time the hashed information that was last modifed in seconds since January 1, 1970 UCT.
    842  If content_last_modified_time > hash_time, then 0 is used.
    843  Returns:
    844  An ON_ContentHash with size and SHA-1 hash and times set from the parameters,
    845  */
    846  static ON_ContentHash Create(
    847  ON_SHA1_Hash sha1_name_hash,
    848  ON__UINT64 byte_count,
    849  ON_SHA1_Hash sha1_content_hash,
    850  ON__UINT64 hash_time,
    851  ON__UINT64 content_last_modified_time
    852  );
    853 
    854  /*
    855  Descripton:
    856  Create an ON_ContentHash from a memory buffer.
    857  Parameters:
    858  sha1_name_hash - [in]
    859  A SHA-1 hash of the name associated with this content.
    860  If the buffer has no name, pass ON_SHA1_Hash::ZeroDigest.
    861  If the buffer has an empty name, pass ON_SHA1_Hash::EmptyContentHash.
    862  buffer - [in]
    863  byte_count - [in]
    864  number of bytes in buffer[]
    865  Returns:
    866  An ON_ContentHash with size and SHA-1 hash calculated from the parameters,
    867  hash time = now, and content last modified time = 0.
    868  */
    869  static ON_ContentHash CreateFromBuffer(
    870  ON_SHA1_Hash sha1_name_hash,
    871  const void* buffer,
    872  size_t byte_count
    873  );
    874 
    875  /*
    876  Descripton:
    877  Create an ON_ContentHash from a file stream.
    878  Parameters:
    879  sha1_file_name_hash - [in]
    880  A SHA-1 hash of the file name associated with fp.
    881  Use ON_SHA1_Has::FileSystemPathHash() to create the value.
    882  If the name is not known, pass ON_SHA1_Hash::ZeroDigest.
    883  fp - [in] pointer to a file opened with ON:FileOpen(...,"rb")
    884  Returns:
    885  An ON_ContentHash with size and SHA-1 hash and times set from the file,
    886  hash time = now, and content last modifed time set from the file system
    887  information returned by ON_FileStream::GetFileInformation().
    888  */
    889  static ON_ContentHash CreateFromFile(
    890  ON_SHA1_Hash sha1_file_name_hash,
    891  FILE* fp
    892  );
    893 
    894  /*
    895  Descripton:
    896  Create an ON_ContentHash from a file stream.
    897  Parameters:
    898  filename - [in] name of file.
    899  Returns:
    900  An ON_ContentHash with size and SHA-1 hash and times set from the file,
    901  hash time = now, and content last modifed time set from the file system
    902  information returned by ON_FileStream::GetFileInformation().
    903  */
    904  static ON_ContentHash CreateFromFile(
    905  const wchar_t* filename
    906  );
    907 
    908  static ON_ContentHash CreateFromFile(
    909  const char* filename
    910  );
    911 
    912  /*
    913  Returns:
    914  True if the SHA-1 hash has been set.
    915  */
    916  bool IsSet() const;
    917 
    918  /*
    919  Returns:
    920  True if the SHA-1 hash is not set.
    921  */
    922  bool IsNotSet() const;
    923 
    924  /*
    925  Returns:
    926  Number of bytes in the content (typically a file or buffer).
    927  */
    928  ON__UINT64 ByteCount() const;
    929 
    930  /*
    931  Returns:
    932  Time the hash SHA-1 hash was cacluated in seconds since January 1, 1970 UCT.
    933  */
    934  ON__UINT64 HashCalculationTime() const;
    935 
    936  /*
    937  Returns:
    938  Time the hashed content was last modifed in seconds since January 1, 1970 UCT.
    939  0 is returned if this time is not known.
    940 
    941  This time should be used for important decisions as a last resort.
    942 
    943  When hash values differ, this time may be considered to
    944  which content is newer (or most recently copied).
    945 
    946  Unfortunately, in many cases this time is often unknown and incorrectly set.
    947  For example, some file systems set the last modified time of a copy of
    948  an "old" file to the time the copy was created. Thus a copy of "old" content
    949  may appear to be newer than "new" content that has not been copied.
    950  */
    951  ON__UINT64 ContentLastModifiedTime() const;
    952 
    953  /*
    954  Returns:
    955  SHA-1 hash of the name (typically a full path file name).
    956  */
    957  ON_SHA1_Hash NameHash() const;
    958 
    959  /*
    960  Returns:
    961  SHA-1 hash of the content (typically a buffer or file).
    962  */
    963  ON_SHA1_Hash ContentHash() const;
    964 
    965  /*
    966  Description:
    967  Test a buffer to see if it has a matching size and SHA-1 hash.
    968  Parameters:
    969  buffer - [in]
    970  byte_count - [in]
    971  number of bytes in buffer[]
    972  Returns:
    973  True if the buffer has a matching byte_count and SHA-1 hash.
    974  */
    975  bool IsSameBufferContent(
    976  const void* buffer,
    977  size_t byte_count
    978  ) const;
    979 
    980  /*
    981  Description:
    982  Test a file to see if it has a matching size and SHA-1 hash.
    983  Paramters:
    984  fp - [in] pointer to file opened with ON::OpenFile(...,"rb")
    985  bSkipTimeCheck - [in] if true, the time of last
    986  modification is not checked.
    987  Returns:
    988  True if the file existes, can be read, and has a matching byte_count
    989  and SHA-1 hash.
    990  */
    991  bool IsSameFileContent(
    992  FILE* fp
    993  ) const;
    994 
    995  /*
    996  Description:
    997  Test a file to see if it has a matching size and SHA-1 content hash.
    998  Paramters:
    999  filename - [in]
    1000  Returns:
    1001  True if the file exists, can be read, and has a matching byte_count
    1002  and SHA-1 content hash.
    1003  */
    1004  bool IsSameFileContent(
    1005  const wchar_t* filename
    1006  ) const;
    1007 
    1008  bool IsSameFileContent(
    1009  const char* filename
    1010  ) const;
    1011 
    1012  /// <summary>
    1013  /// ON_ContentHash::Compare are the possible results of calling ON_ContentHash::CompareFile().
    1014  /// </summary>
    1015  enum class CompareResult : unsigned char
    1016  {
    1017  /// <summary>
    1018  /// Not set. This value is never returned by ON_ContentHash::CheckFile().
    1019  /// </summary>
    1020  Unset = 0,
    1021 
    1022  /// <summary>
    1023  /// File exists and its size and content matches the information
    1024  /// used to set the content hash.
    1025  /// </summary>
    1026  EqualContent = 1,
    1027 
    1028  /// <summary>
    1029  /// File exists and its size or content differs from the information
    1030  /// used to set the content hash. Unable to reliably determine which
    1031  /// is newer.
    1032  /// </summary>
    1033  DifferentContent = 2,
    1034 
    1035  /// <summary>
    1036  /// File exists and its size or content differs from the information
    1037  /// used to set the content hash. The file's laste modified time
    1038  /// is older than ContentLastModifiedTime().
    1039  /// </summary>
    1040  DifferentContentFileIsOlder = 3,
    1041 
    1042  /// <summary>
    1043  /// File exists and its size or content differs from the information
    1044  /// used to set the content hash. The file's last modified time
    1045  /// is newer than ContentLastModifiedTime().
    1046  /// </summary>
    1047  ContentDifferentFileIsNewer = 4,
    1048 
    1049  /// <summary>
    1050  /// File does not exist.
    1051  /// </summary>
    1052  FileDoesNotExist = 5,
    1053 
    1054  /// <summary>
    1055  /// File cannot be opened, read, or some other file system issue prevents checking.
    1056  /// </summary>
    1057  FileSystemFailure = 6
    1058  };
    1059 
    1060  static ON_ContentHash::CompareResult CompareResultFromUnsigned(
    1061  unsigned int compare_result_as_unsigned
    1062  );
    1063 
    1064  /*
    1065  Description:
    1066  Compare the information used to set this content hash with
    1067  the contents of the file.
    1068  Parameters:
    1069  file_path - [in]
    1070  bFastCompare - [in]
    1071  If bFastCompare is true and the file_path, create time, last modified time, and size
    1072  exactly match the values in ON_ContentHash, then
    1073  ON_ContentHash::CompareResult::EqualContent is returned
    1074  without performing the expensive SHA1 test on the file's content.
    1075  If bFastCompare is false, the SHA-1 hash of the file's content will be
    1076  calculated and compared before ON_ContentHash::CompareResult::EqualContent
    1077  is returned.
    1078  Returns:
    1079  Result of compare test as a ON_ContentHash::CompareResult enum.
    1080  ON_ContentHash::CompareResult::DifferentContentFileIsOlder means file_path content is different and older than "this".
    1081  ON_ContentHash::CompareResult::DifferentContentFileIsNewer means file_path content is different and newer than "this".
    1082  */
    1084  const wchar_t* file_path,
    1085  bool bFastTest
    1086  ) const;
    1087 
    1088  /*
    1089  Description:
    1090  Compare the byte count and SHA-1 content hash.
    1091  Parameters:
    1092  file_content_hash - [in]
    1093  ON_ContentHash to compare against this one.
    1094  Returns:
    1095  Result of compare test as a ON_ContentHash::CompareResult enum.
    1096  ON_ContentHash::CompareResult::DifferentContentFileIsOlder means file_content_hash is different and older than "this".
    1097  ON_ContentHash::CompareResult::DifferentContentFileIsNewer means file_content_hash is different and newer than "this".
    1098  */
    1100  ON_ContentHash file_content_hash
    1101  ) const;
    1102 
    1103  /*
    1104  Returns:
    1105  true if a and b have identical ByteCount() and SHA-1 content hash values.
    1106  */
    1107  static bool EqualContent(
    1108  const ON_ContentHash& a,
    1109  const ON_ContentHash& b
    1110  );
    1111 
    1112  /*
    1113  Returns:
    1114  true if a and b have differnt ByteCount() or SHA-1 content hash values.
    1115  */
    1116  static bool DifferentContent(
    1117  const ON_ContentHash& a,
    1118  const ON_ContentHash& b
    1119  );
    1120 
    1121 
    1122  /*
    1123  Description:
    1124  Compares content byte count and content SHA-1
    1125  */
    1126  static int CompareContent(
    1127  const ON_ContentHash& a,
    1128  const ON_ContentHash& b
    1129  );
    1130 
    1131  /*
    1132  Description:
    1133  Compares all fields
    1134  */
    1135  static int Compare(
    1136  const ON_ContentHash& a,
    1137  const ON_ContentHash& b
    1138  );
    1139 
    1140  /*
    1141  Parameters:
    1142  filename - [in]
    1143  Returns:
    1144  True if the file exists, has size > 0, has the same name, same size, and same last modified time
    1145  than this content hash.
    1146  False otherwise.
    1147  Remarks:
    1148  Faster than the ON_ContentHash::EqualContent() and reliable if this content
    1149  hash was set on the same file system.
    1150  Unreliable if the file system does not correctly set last modified times
    1151  or the file was modified less than 2 seconds before the call.
    1152  */
    1153  bool EqualFileNameSizeAndTime(
    1154  const wchar_t* filename
    1155  ) const;
    1156 
    1157  bool Write(
    1158  class ON_BinaryArchive& archive
    1159  ) const;
    1160 
    1161  bool Read(
    1162  class ON_BinaryArchive& archive
    1163  );
    1164 
    1165  void Dump(
    1166  class ON_TextLog& text_log
    1167  ) const;
    1168 
    1169 private:
    1170  // Number of bytes in the buffer or file
    1171  ON__UINT64 m_byte_count = 0;
    1172 
    1173  // Time this hash was set (always > 0 if this ON_ContentHash is set).
    1174  ON__UINT64 m_hash_time = 0; // number of seconds since Jan 1, 1970, UCT
    1175 
    1176  // Time the content was last modifed.
    1177  // This time is often unknown, or set incorrectly.
    1178  ON__UINT64 m_content_time = 0; // number of seconds since Jan 1, 1970, UCT
    1179 
    1180  // SHA-1 hash of the content name (file name or other assigned name)
    1181  ON_SHA1_Hash m_sha1_name_hash = ON_SHA1_Hash::ZeroDigest;
    1182 
    1183  // SHA-1 hash of the content (buffer or file).
    1184  ON_SHA1_Hash m_sha1_content_hash = ON_SHA1_Hash::ZeroDigest;
    1185 };
    1186 
    1187 class ON_CLASS ON_FileReference
    1188 {
    1189 public:
    1190  static const ON_FileReference Unset;
    1191 
    1192 #pragma region RH_C_SHARED_ENUM [ON_FileReference::Status] [Rhino.FileIO.FileReferenceStatus] [int]
    1193  ///<summary>Enumerates a list of file statuses.</summary>
    1194  enum class Status : unsigned int
    1195  {
    1196  /// <summary>
    1197  /// Status of a the full path is not known.
    1198  /// </summary>
    1199  Unknown = 0,
    1200 
    1201  /// <summary>
    1202  /// Full path is valid.
    1203  /// </summary>
    1204  FullPathValid = 1,
    1205 
    1206  /// <summary>
    1207  /// Unable to locate file.
    1208  /// </summary>
    1209  FileNotFound = 2
    1210  };
    1211 #pragma endregion
    1212 
    1213  static int Compare(
    1214  const ON_FileReference& a,
    1215  const ON_FileReference& b
    1216  );
    1217 
    1218  static ON_FileReference::Status StatusFromUnsigned(
    1219  unsigned int full_path_status_as_unsigned
    1220  );
    1221 
    1222  ON_FileReference() = default;
    1223  ~ON_FileReference() = default;
    1224  ON_FileReference(const ON_FileReference&) = default;
    1225  ON_FileReference& operator=(const ON_FileReference&) = default;
    1226 
    1228  const wchar_t* full_path,
    1229  const wchar_t* relative_path,
    1230  ON_ContentHash content_hash,
    1231  ON_FileReference::Status full_path_status
    1232  );
    1233 
    1234  static ON_FileReference CreateFromFullPath(
    1235  const wchar_t* full_path,
    1236  bool bSetContentHash,
    1237  bool bSetFullPathStatus
    1238  );
    1239 
    1240 #pragma region RH_C_SHARED_ENUM [ON_FileReference::FindFilePreference] [Rhino.FileIO.FileFindPreference] [int]
    1241  ///<summary>Defines options for file search.</summary>
    1242  enum class FindFilePreference : unsigned char
    1243  {
    1244  ///<summary>The choice is not defined.</summary>
    1245  None = 0,
    1246 
    1247  ///<summary>File name exists in FullPath().</summary>
    1248  FullPath = 1,
    1249 
    1250  ///<summary>File name exists in base path + RelativePath().</summary>
    1251  RelativePath = 2,
    1252 
    1253  ///<summary>File name exists in base path directory.</summary>
    1254  BasePath = 3,
    1255 
    1256  ///<summary>File with mathing content exists.</summary>
    1257  ContentMatch = 4,
    1258 
    1259  ///<summary>Most recently modifed file.</summary>
    1260  MostRecent = 5
    1261  };
    1262 #pragma endregion
    1263 
    1264  /*
    1265  Description:
    1266  Uses the full path, relative path and parameter information to find a
    1267  full path to a file that exists.
    1268  Parameters:
    1269  base_path - [in]
    1270  If base_path and RelativePath() are not empty, then path base_path+RelativePath().
    1271  If base_path is not empty, then base_path + filename is considered.
    1272  bBasePathIncludesFileName - [in]
    1273  True if base_path contains a file name that must be removed to get a directory path.
    1274  first_choice - [in]
    1275  When multiple files are found in different locations, the first_choice, second_choice,
    1276  third_choice, forth_choice, and fifth_choice parameters are used to select which file
    1277  is returned.
    1278  second_choice - [in]
    1279  When multiple files are found in different locations, the first_choice, second_choice,
    1280  third_choice, forth_choice, and fifth_choice parameters are used to select which file
    1281  is returned.
    1282  third_choice - [in]
    1283  When multiple files are found in different locations, the first_choice, second_choice,
    1284  third_choice, forth_choice, and fifth_choice parameters are used to select which file
    1285  is returned.
    1286  forth_choice - [in]
    1287  When multiple files are found in different locations, the first_choice, second_choice,
    1288  third_choice, forth_choice, and fifth_choice parameters are used to select which file
    1289  is returned.
    1290  fifth_choice - [in]
    1291  When multiple files are found in different locations, the first_choice, second_choice,
    1292  third_choice, forth_choice, and fifth_choice parameters are used to select which file
    1293  is returned.
    1294  full_path - [out]
    1295  A full path to a file that exists.
    1296  If FullPath() and base_path+RelativePath() resolve to different files,
    1297  the content hash information is used to select the file.
    1298  Returns:
    1299  If the file is found, then the returned ON_FileReference::FindFilePreference enum value
    1300  indicates why it was selected.
    1301  If the file is not found, then ON_FileReference::FindFilePreference::None is returned
    1302  and full_path is empty.
    1303  Remarks:
    1304  The locations FullPath(), base_path+RelativePath(), and base_path+FileName() are tested.
    1305  If multiple files are found, first_choice, second_choice, third_choice, forth_choice,
    1306  and fifth_choice are used to select which file is returned.
    1307  */
    1309  const wchar_t* base_path,
    1310  bool bBasePathIncludesFileName,
    1316  ON_wString& found_file_full_path
    1317  ) const;
    1318 
    1319  /*
    1320  Description:
    1321  Uses the full path, relative path and parameter information to find a
    1322  full path to a file that exists.
    1323  Parameters:
    1324  base_path - [in]
    1325  If base_path and RelativePath() are not empty, then path base_path+RelativePath().
    1326  If base_path is not empty, then base_path + filename is considered.
    1327  bBasePathIncludesFileName - [in]
    1328  True if base_path contains a file name that must be removed to get a directory path.
    1329  Returns:
    1330  If the file is found, then the returned ON_FileReference::FindFilePreference enum value
    1331  indicates why it was selected.
    1332  If the file is not found, then ON_FileReference::FindFilePreference::None is returned
    1333  and full_path is empty.
    1334  Remarks:
    1335  The locations FullPath(), base_path+RelativePath(), and base_path+FileName() are tested.
    1336  If multiple files are found, the returned file is selected in the order
    1337  relative path, full path, content match, base path and most recently modified.
    1338  If you prefer a different order, use the version of ON_FileReference::FindFile
    1339  with 5 ON_FileReference::FindFilePreference parameters.
    1340  */
    1342  const wchar_t* base_path,
    1343  bool bBasePathIncludesFileName,
    1344  ON_wString& found_file_full_path
    1345  ) const;
    1346 
    1347  /*
    1348  Description:
    1349  The search for the file is identical to the one performed by find file.
    1350  If a file is found, the full path setting in this reference is updated.
    1351  */
    1352  ON_FileReference::FindFilePreference FindFileAndUpdateReference(
    1353  const wchar_t* base_path,
    1354  bool bBasePathIncludesFileName,
    1360  bool bUpdateContentHash,
    1361  ON_wString& found_file_full_path
    1362  );
    1363 
    1364  /*
    1365  Description:
    1366  The search for the file is identical to the one performed by find file.
    1367  If a file is found, the full path setting in this reference is updated.
    1368  */
    1369  ON_FileReference::FindFilePreference FindFileAndUpdateReference(
    1370  const wchar_t* base_path,
    1371  bool bBasePathIncludesFileName,
    1372  bool bUpdateContentHash,
    1373  ON_wString& found_file_full_path
    1374  );
    1375 
    1376  ON_FileReference::FindFilePreference FindFileAndUpdateReference(
    1377  const wchar_t* base_path,
    1378  bool bBasePathIncludesFileName,
    1379  bool bUpdateContentHash
    1380  );
    1381 
    1382  /*
    1383  Returns:
    1384  True if FullPath() is not empty.
    1385  */
    1386  bool IsSet() const;
    1387 
    1388  /*
    1389  Returns:
    1390  True if FullPath() is empty.
    1391  */
    1392  bool IsNotSet() const;
    1393 
    1394  /*
    1395  Parameters:
    1396  bUseArchiveBasePath - [in]
    1397  If bUseArchiveBasePath is true and a file is being written, then the
    1398  base path of the file being written use used as the base path to
    1399  calculate the relative path.
    1400  If bUseArchiveBasePath is false, then the current value of RelativePath()
    1401  is saved in the archive.
    1402  */
    1403  bool Write(
    1404  bool bUseArchiveDirectoryAsBasePath,
    1405  ON_BinaryArchive& archive
    1406  ) const;
    1407 
    1408  /*
    1409  Parameters:
    1410  base_path - [in]
    1411  If base_path is not empty, then the relative path saved
    1412  in the archive will be calculated from FullPath() and base_path.
    1413  If base_path is nullptr or empty, then RelativePath() is saved in
    1414  the archive.
    1415  */
    1416  bool Write(
    1417  const wchar_t* base_path,
    1418  bool bBasePathIncludesFileName,
    1419  ON_BinaryArchive& archive
    1420  ) const;
    1421 
    1422  /*
    1423  Remarks:
    1424  Calling Read() sets m_full_path_status = ON_FileReference::Status::Unknown,
    1425  even if that was not the status when Write() was called.
    1426  */
    1427  bool Read(
    1428  ON_BinaryArchive& archive
    1429  );
    1430 
    1431  void Dump(
    1432  class ON_TextLog& text_log
    1433  ) const;
    1434 
    1435  unsigned int SizeOf() const;
    1436 
    1437  const ON_wString& FullPath() const;
    1438  const wchar_t* FullPathAsPointer() const;
    1439  void SetFullPath(
    1440  const wchar_t* full_path,
    1441  bool bSetContentHash
    1442  );
    1443  void SetFullPath(
    1444  const char* full_path,
    1445  bool bSetContentHash
    1446  );
    1447  void ClearFullPath();
    1448 
    1449  const ON_wString& RelativePath() const;
    1450  const wchar_t* RelativePathAsPointer() const;
    1451  void SetRelativePath(
    1452  const wchar_t* relative_path
    1453  );
    1454  void SetRelativePath(
    1455  const char* relative_path
    1456  );
    1457  void SetRelativePathFromBasePath(
    1458  const wchar_t* base_path,
    1459  bool bBasePathContainsFileName
    1460  );
    1461  void SetRelativePathFromBasePath(
    1462  const char* base_path,
    1463  bool bBasePathContainsFileName
    1464  );
    1465  void ClearRelativePath();
    1466 
    1467  /*
    1468  Returns:
    1469  File content hash. This value is persistent, saved in 3dm archive,
    1470  and could have been calculated a long time ago on a different computer.
    1471  */
    1472  const ON_ContentHash& ContentHash() const;
    1473  void SetContentHash(
    1474  ON_ContentHash content_hash
    1475  );
    1476  void ClearContentHash();
    1477 
    1478  bool UpdateContentHash();
    1479 
    1480  /*
    1481  Returns:
    1482  Parameters:
    1483  recent_time - [in]
    1484  The time, in number of seconds since January 1, 1970 UTC, to use
    1485  when deciding what content hashes can be considered recent.
    1486  If recent_time is 0 or in the future, then the current value of
    1487  ON_SecondsSinceJanOne1970UTC() is used.
    1488  Typically this parameter is the value of ON_SecondsSinceJanOne1970UTC()
    1489  at the beginning of a calculation durint which any referenced files will
    1490  not be changed.
    1491  Returns:
    1492  A file content hash value calculated on or after a specified time in the current
    1493  instance of the application. This value is used to detect changed files
    1494  in the current instance of the application. It is cached for performance reasons.
    1495  This value is never saved in 3dm files.
    1496  */
    1497  const ON_ContentHash& RecentContentHash(
    1498  ON__UINT64 recent_time
    1499  ) const;
    1500 
    1501  /*
    1502  Returns:
    1503  ON_SHA1_Hash::FileSystemPathHash(FullPath());
    1504  Remarks:
    1505  The value of the hash is saved in a runtime cache so
    1506  using this function when comparing paths is efficient
    1507  when multple compares are required.
    1508  See Also:
    1509  ON_NameHash::CreateFilePathHash( ON_FileReference& file_reference );
    1510  */
    1511  const ON_SHA1_Hash& FullPathHash() const;
    1512 
    1513  ON_FileReference::Status FullPathStatus() const;
    1514  void SetFullPathStatus(
    1515  ON_FileReference::Status full_path_status
    1516  );
    1517 
    1518  ON_UUID EmbeddedFileId() const;
    1519  void SetEmbeddedFileId(
    1520  ON_UUID embedded_file_id
    1521  );
    1522 
    1523 private:
    1524  ON_wString m_full_path;
    1525  ON_wString m_relative_path;
    1526 
    1527  // If the referenced file is saved in the model as an embedded file,
    1528  // the ON_BinaryArchive read code sets m_embedded_file_id
    1529  // at read time.
    1530  mutable ON_UUID m_embedded_file_id = ON_nil_uuid;
    1531 
    1532  // file content hash. Can be calculated long ago, on a different computer,
    1533  // and is saved in 3dm archived.
    1534  ON_ContentHash m_content_hash; // File content hash.
    1535 
    1536  mutable ON_ContentHash m_recent_content_hash;
    1537 
    1538  // m_full_path_hash is chached runtime information. The value is not saved
    1539  // in .3dm archives. It is calculated on demand.
    1540  mutable ON_SHA1_Hash m_full_path_hash = ON_SHA1_Hash::EmptyContentHash; // File path hash.
    1541 
    1543 
    1544 private:
    1545  ON_FileReference::FindFilePreference Internal_FindFile(
    1546  const wchar_t* base_path,
    1547  bool bBasePathIncludesFileName,
    1548  const ON_FileReference::FindFilePreference* file_preference,
    1549  unsigned int file_preference_count,
    1550  ON_wString& found_file_full_path,
    1551  ON_ContentHash* found_file_content_hash
    1552  ) const;
    1553 };
    1554 
    1555 /*
    1556 Description:
    1557  Iterates through every item in a file system directory.
    1558 */
    1559 class ON_CLASS ON_FileIterator
    1560 {
    1561 public:
    1562  ON_FileIterator() = default;
    1563  ~ON_FileIterator();
    1564 
    1565 private:
    1566  ON_FileIterator(const ON_FileIterator&) = delete;
    1567  ON_FileIterator& operator=(const ON_FileIterator&) = delete;
    1568 
    1569 public:
    1570 
    1571  //////////////////////////////////////////////////////////////////////////////////
    1572  //
    1573  // Iteratation initialization tools
    1574  //
    1575  /*
    1576  Description:
    1577  Initialize where the search should occur.
    1578  Parameters:
    1579  directory_name - [in]
    1580  The directory to look in.
    1581  item_name_filter - [in]
    1582  If this paramter is null, then the iteration
    1583  includes all names in the directory.
    1584  The item name to search for. This parameter can
    1585  include wildcard characters, such as an
    1586  asterisk (*) or a question mark (?). For example,
    1587  "\rootdir\subdir\*.*" will iterate all files in
    1588  the \rootdir\subdir\ directory.
    1589 
    1590  Returns:
    1591  true:
    1592  The iterator is set to the first item.
    1593  false:
    1594  There are no matching items.
    1595 
    1596  Remarks:
    1597  Calling FirstItem() is eqivalent to calling Initialize() and then calling NextItem().
    1598  */
    1599  bool Initialize(
    1600  const wchar_t* directory_name
    1601  );
    1602  bool Initialize(
    1603  const wchar_t* directory_name,
    1604  const wchar_t* item_name_filter
    1605  );
    1606  bool Initialize(
    1607  const char* directory_name
    1608  );
    1609  bool Initialize(
    1610  const char* directory_name,
    1611  const char* item_name_filter
    1612  );
    1613 
    1614  //////////////////////////////////////////////////////////////////////////////////
    1615  //
    1616  // Iteratation iteration tools
    1617  //
    1618 
    1619  /*
    1620  Description:
    1621  Find the first matching item in the directory.
    1622  Example:
    1623  // Iterate through the files in a directory named "\rootdir\subdir"
    1624  ON_FileIterator fit;
    1625  fit.Initialize("\\rootdir\\subdir");
    1626  for ( bool bHaveItem = fit.FirstItem(); bHaveItem; bHaveItem = fit.NextItem() )
    1627  {
    1628  if ( fit.CurrentFileIsDirectory() )
    1629  continue;
    1630  ON_String fullpath = fit.CurrentItemFullPathName();
    1631  FILE* fp = ON_FileStream::Open(fullpath,"rb");
    1632  if ( 0 == fp )
    1633  {
    1634  continue;
    1635  }
    1636  ...
    1637  ON_FileStream::Close(fp);
    1638  fp = 0;
    1639  }
    1640  }
    1641 
    1642  Returns:
    1643  true:
    1644  The iterator is set to the first item.
    1645  false:
    1646  There are no matching items.
    1647  */
    1648  bool FirstItem();
    1649 
    1650  /*
    1651  Description:
    1652  Find the next matching item in the directory.
    1653  Returns:
    1654  true:
    1655  The iterator was advanced to the next item.
    1656  false:
    1657  There are no more matching items.
    1658  */
    1659  bool NextItem();
    1660 
    1661  /*
    1662  Description:
    1663  Reset this ON_FileIterator so it can be used again.
    1664  */
    1665  void Reset();
    1666 
    1667  //////////////////////////////////////////////////////////////////////////////////
    1668  //
    1669  // Current item query
    1670  //
    1671 
    1672  /*
    1673  Returns:
    1674  Current file or directory name in the directory being iterated.
    1675  Use CurrentFullPathItemName() to get the full path name.
    1676  */
    1677  const ON_wString CurrentItemName() const;
    1678 
    1679  /*
    1680  Returns:
    1681  The name of the directory being iterated.
    1682  */
    1683  const ON_wString DirectoryName() const;
    1684 
    1685  /*
    1686  Returns:
    1687  If the current item is a file, then the size of the file in bytes is returned.
    1688  If the current item is a directory, then 0 is returned.
    1689  */
    1690  ON__UINT64 CurrentItemSize() const;
    1691 
    1692  /*
    1693  Returns
    1694  true if the current item is a directory.
    1695  */
    1696  bool CurrentItemIsDirectory() const;
    1697 
    1698  /*
    1699  Returns
    1700  true if the current item is a file.
    1701  */
    1702  bool CurrentItemIsFile() const;
    1703 
    1704  /*
    1705  Returns
    1706  true if the current file or directory is hidden.
    1707  This means its name begins with a '.' or it's
    1708  Windows hidden attribute is true.
    1709  */
    1710  bool CurrentItemIsHidden() const;
    1711 
    1712  const ON_wString CurrentItemFullPathName() const;
    1713 
    1714  /*
    1715  Returns:
    1716  File last modified time in seconds since January 1, 1970
    1717  Remarks:
    1718  The times returned by ON_FileIterator can differ from the time
    1719  returned by ON_FileStream::GetFileInformation().
    1720  */
    1721  ON__UINT64 CurrentItemLastModifiedTime() const;
    1722 
    1723  /*
    1724  Returns:
    1725  Number of matching items iterated through.
    1726  */
    1727  ON__UINT64 CurrentItemCount() const;
    1728 
    1729 private:
    1730  ON__UINT32 m_state = 0; // 0 unset, 1=initialized, 2 = itereation in progress. 3 = iteration finished.
    1731  ON__UINT32 m_reserved = 0;
    1732 
    1733  ON_wString m_directory; // directory passed to Initialize() or FirstItem
    1734  ON_wString m_item_name_filter; // item_name_filter passed to Initialize() or FirstItem
    1735  ON_wString m_item_name; // Current item name.
    1736 
    1737  // cached full path name
    1738  // m_directory + directory separator + m_item_name
    1739  // (length = 0 if it is not set)
    1740  mutable ON_wString m_full_path_name;
    1741 
    1742  ON__UINT64 m_count = 0; // number of items iterated through so far
    1743  class ON_DirectoryIteratorImpl* m_impl = nullptr;
    1744 };
    1745 
    1746 #endif
    PathId
    ids used by ON_FileSystemPath::GetPath()
    Definition: opennurbs_file_utilities.h:540
    ON_UUID is a 16 byte universally unique identifier.
    Definition: opennurbs_uuid.h:32
    static const wchar_t DirectorySeparator
    Definition: opennurbs_file_utilities.h:134
    static const ON_SHA1_Hash EmptyContentHash
    SHA-1 hash of zero bytes.
    Definition: opennurbs_sha1.h:23
    @@ -97,9 +95,9 @@ $(function() {
    diff --git a/6/d6/da7/class_o_n___texture_mapping-members.html b/6/d6/da7/class_o_n___texture_mapping-members.html index 375d5a7b..4a07004d 100644 --- a/6/d6/da7/class_o_n___texture_mapping-members.html +++ b/6/d6/da7/class_o_n___texture_mapping-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d6/dac/class_o_n_x___model___user_data.html b/6/d6/dac/class_o_n_x___model___user_data.html index fd66b345..a3ea9975 100644 --- a/6/d6/dac/class_o_n_x___model___user_data.html +++ b/6/d6/dac/class_o_n_x___model___user_data.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ONX_Model_UserData Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/dc1/class_o_n___localizer.html b/6/d6/dc1/class_o_n___localizer.html index 80414950..608c1604 100644 --- a/6/d6/dc1/class_o_n___localizer.html +++ b/6/d6/dc1/class_o_n___localizer.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Localizer Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Descrption: Creates a cylindrical localizer. If d = distance from the point to the line, then the localizer has the following behavior:

    point distance localizer value d <= r0 < r1 or d >= r0 > r1 0 d >= r1 > r0 or d <= r1 < r0 1

    For values of d between r0 and r1, the localizer smoothly transitions between 0 to 1.

    -

    Parameters: P - [in] cylinder axis point D - [in] cylinder axis direction r0 - [in] r1 - [in] r0 and r1 are radii that control where the localizer is nonzero.
    - Both r0 and r1 must be postive and the cannot be equal.
    - If 0 < r0 < r1, then the localizer is zero for points inside the cylinder of radius r0 and one for points outside the cylinder of radius r1. If 0 < r1 < r0, then the localizer is one for points inside the cylinder of radius r1 and zero for points outside the cylinder of radius r0.
    - Returns: True if the input is value and the localizer is initialized.

    +

    Parameters: P - [in] cylinder axis point D - [in] cylinder axis direction r0 - [in] r1 - [in] r0 and r1 are radii that control where the localizer is nonzero. Both r0 and r1 must be postive and the cannot be equal. If 0 < r0 < r1, then the localizer is zero for points inside the cylinder of radius r0 and one for points outside the cylinder of radius r1. If 0 < r1 < r0, then the localizer is one for points inside the cylinder of radius r1 and zero for points outside the cylinder of radius r0.

    +

    Returns: True if the input is value and the localizer is initialized.

    @@ -338,10 +334,8 @@ Public Attributes

    Descrption: Creates a spherical localizer. If d = distance from the point to the center of the sphere, then the localizer has the following behavior:

    point distance localizer value d <= r0 < r1 or d >= r0 > r1 0 d >= r1 > r0 or d <= r1 < r0 1

    For values of d between r0 and r1, the localizer smoothly transitions between 0 to 1.

    -

    Parameters: P - [in] center of sphere r0 - [in] r1 - [in] r0 and r1 are radii that control where the localizer is nonzero.
    - Both r0 and r1 must be postive and the cannot be equal.
    - If 0 < r0 < r1, then the localizer is zero for points inside the cylinder of radius r0 and one for points outside the cylinder of radius r1. If 0 < r1 < r0, then the localizer is one for points inside the cylinder of radius r1 and zero for points outside the cylinder of radius r0.
    - Returns: True if the input is value and the localizer is initialized.

    +

    Parameters: P - [in] center of sphere r0 - [in] r1 - [in] r0 and r1 are radii that control where the localizer is nonzero. Both r0 and r1 must be postive and the cannot be equal. If 0 < r0 < r1, then the localizer is zero for points inside the cylinder of radius r0 and one for points outside the cylinder of radius r1. If 0 < r1 < r0, then the localizer is one for points inside the cylinder of radius r1 and zero for points outside the cylinder of radius r0.

    +

    Returns: True if the input is value and the localizer is initialized.

    @@ -560,9 +554,9 @@ Public Attributes diff --git a/6/d6/dc3/opennurbs__nurbscurve_8h_source.html b/6/d6/dc3/opennurbs__nurbscurve_8h_source.html index afd5400b..b02d6f2f 100644 --- a/6/d6/dc3/opennurbs__nurbscurve_8h_source.html +++ b/6/d6/dc3/opennurbs__nurbscurve_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_nurbscurve.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_nurbscurve.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/dc8/class_o_n___angle_value.html b/6/d6/dc8/class_o_n___angle_value.html index b5ccdd13..3bb4e6b7 100644 --- a/6/d6/dc8/class_o_n___angle_value.html +++ b/6/d6/dc8/class_o_n___angle_value.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_AngleValue Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    StringFormat::ExactFraction = 1, StringFormat::CleanDecimal = 2, StringFormat::CleanFraction = 3 - } - ON_AngleValue::StringFormat identifies the formatting to apply when creating a length value from a double. More...
    + } ON_AngleValue::StringFormat identifies the formatting to apply when creating a length value from a double. More...
    +   diff --git a/6/d6/dcc/struct_o_n___mesh_part.html b/6/d6/dcc/struct_o_n___mesh_part.html index abba58b4..20af4d31 100644 --- a/6/d6/dcc/struct_o_n___mesh_part.html +++ b/6/d6/dcc/struct_o_n___mesh_part.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: ON_MeshPart Struct Reference @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@

    @@ -682,9 +680,9 @@ Static Public Attributes

    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/d6/dd1/class_o_n___instance_definition-members.html b/6/d6/dd1/class_o_n___instance_definition-members.html index 7bcd3a0d..09b222b6 100644 --- a/6/d6/dd1/class_o_n___instance_definition-members.html +++ b/6/d6/dd1/class_o_n___instance_definition-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/dd5/opennurbs__quacksort__template_8h_source.html b/6/d6/dd5/opennurbs__quacksort__template_8h_source.html index 93339895..688766f7 100644 --- a/6/d6/dd5/opennurbs__quacksort__template_8h_source.html +++ b/6/d6/dd5/opennurbs__quacksort__template_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_quacksort_template.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_quacksort_template.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2011 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Assoicates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 /*
    18 See opennurbs_sort.cpp for examples showing how to use
    19 opennurbs_quacksort_template.h to define type specific
    20 sorting functions.
    21 */
    22 
    23 #if !defined(ON_QSORT_FNAME)
    24 #error Define ON_QSORT_FNAME macro before including opennurbs_quacksort_template.h
    25 #endif
    26 
    27 // ON_SORT_TEMPLATE_TYPE -> double, int, ....
    28 #if !defined(ON_SORT_TEMPLATE_TYPE)
    29 
    30 #define BASETYPE void *
    31 #define DATATYPE unsigned char
    32 #define DATAWIDTH m_width
    33 
    34 #define Swap(a,b) m_swapfunc(a,b,m_width)
    35 
    36 #if defined(ON_SORT_TEMPLATE_USE_CONTEXT)
    37 // use a compare function with context parameter
    38 #define GreaterThan(A,B) m_compare(m_context,A,B) > 0
    39 #else
    40 // use a compare function without context parameter
    41 #define GreaterThan(A,B) m_compare(A,B) > 0
    42 #endif
    43 
    44 #else
    45 
    46 #define BASETYPE ON_SORT_TEMPLATE_TYPE *
    47 #define DATATYPE ON_SORT_TEMPLATE_TYPE
    48 #define DATAWIDTH 1
    49 
    50 #if defined(ON_SORT_TEMPLATE_USE_SWAP)
    51 #define Swap(a,b) m_swapfunc(a,b,m_width)
    52 #else
    53 // use intrinsic assigment
    54 #define Swap(a,b) ON_SORT_TEMPLATE_TYPE tmp = *a; *a = *b; *b = tmp
    55 #endif
    56 
    57 #if defined(ON_SORT_TEMPLATE_COMPARE)
    58 // use a compare function like strcmp for char* strings
    59 #define GreaterThan(A,B) ON_SORT_TEMPLATE_COMPARE(A,B) > 0
    60 #else
    61 // use intrinsic type compares
    62 #define GreaterThan(A,B) *A > *B
    63 #endif
    64 
    65 #endif
    66 
    67 #if !defined(ON_QUACKSORT_SWAP_FUNCS_DEFINED)
    68 #if !defined(ON_SORT_TEMPLATE_TYPE) || defined(ON_SORT_TEMPLATE_USE_SWAP)
    69 
    70 // In some files this template is used multiple times.
    71 // The ON_QUACKSORT_SWAP_FUNCS_DEFINED define prevents
    72 // multiple definitions of the static Swap*() functions.
    73 #define ON_QUACKSORT_SWAP_FUNCS_DEFINED
    74 
    75 static void SwapChars( unsigned char* a, unsigned char* b, size_t width)
    76 {
    77  do
    78  {
    79  unsigned char x = *a;
    80  *a++ = *b;
    81  *b++ = x;
    82  }
    83  while( --width);
    84 }
    85 
    86 static void SwapInts( unsigned char* a, unsigned char* b, size_t width)
    87 {
    88  ON__UINT32* ai = (ON__UINT32*)a;
    89  ON__UINT32* bi = (ON__UINT32*)b;
    90  do
    91  {
    92  ON__UINT32 x = *ai;
    93  *ai++ = *bi;
    94  *bi++ = x;
    95  width -= sizeof(x);
    96  }
    97  while( width);
    98 }
    99 
    100 static void SwapBigInts( unsigned char* a, unsigned char* b, size_t width)
    101 {
    102  ON__UINT64* ai = (ON__UINT64*)a;
    103  ON__UINT64* bi = (ON__UINT64*)b;
    104  do
    105  {
    106  ON__UINT64 x = *ai;
    107  *ai++ = *bi;
    108  *bi++ = x;
    109  width -= sizeof(x);
    110  }
    111  while( width);
    112 }
    113 
    114 #endif
    115 #endif
    116 
    117 // implementation of quick sort with minimum swaps for partition sizes 4 and less
    118 void ON_quacksort(
    119  BASETYPE *base
    120  ,size_t nel
    121 #if !defined(ON_SORT_TEMPLATE_TYPE)
    122  ,size_t width
    123 #if defined(ON_SORT_TEMPLATE_USE_CONTEXT)
    124  ,int (*compar)(void*, const void *, const void *)
    125  ,void* context
    126 #else
    127  ,int (*compar)(const void *, const void *)
    128 #endif
    129 #endif
    130  )
    131 {
    132  class CSorter
    133  {
    134  public:
    135  DATATYPE *m_base;
    136  size_t m_nel;
    137  const size_t m_width;
    138  int (*m_compar)(const void *, const void *);
    139  void (*m_swapfunc)(unsigned char *, unsigned char *, size_t width);
    140  unsigned int m_rnd;
    141 //#if defined(ON_SORT_TEMPLATE_TYPE) && !defined(ON_SORT_TEMPLATE_USE_SWAP)
    142 // ON_SORT_TEMPLATE_TYPE m_tmp;
    143 //#endif
    144 
    145  CSorter(
    146  DATATYPE *base
    147  , size_t nel
    148  , size_t width
    149  , int (*compar)(const void *, const void *)
    150  )
    151  : m_base((DATATYPE*)base)
    152  , m_nel(nel)
    153  , m_width(width)
    154  , m_compar(compar)
    155  , m_rnd(62538161)
    156  {
    157  // When width is a multiple of 8 or 4 (with most arrays it probably is),
    158  // use faster integer swappers instead of byte swapper
    159  if ( 0 == width%sizeof(ON__UINT64))
    160  m_swapfunc = SwapBigInts;
    161  else if ( 0 == width%sizeof(ON__UINT32))
    162  m_swapfunc = SwapInts;
    163  else
    164  m_swapfunc = SwapChars;
    165  };
    166 
    167  ~CSorter() {};
    168 
    169  DATATYPE* Pivot( DATATYPE* base, size_t count)
    170  {
    171  // Uses local quick and dirty pseudorandom number generator to
    172  // give a fuzzy answer to avoid having the data be arranged in
    173  // a way that mechanically always picking the pivot the same way
    174  // affects the speed. Mostly affects chevron etc. patterns.
    175  //
    176  // Totally random pivot would guarantee O(nlogn) worst case, but
    177  // does not perform as well on sorted or nearly sorted sets.
    178 
    179  m_rnd *= 1664525;
    180  m_rnd += 1013904223;
    181  unsigned int dice = (m_rnd>>16)&7;
    182 
    183  size_t p=count>>1; // 1/2
    184 
    185  if ( dice&4)
    186  p += count>>3; // +1/8
    187  if ( dice&2)
    188  p -= count>>4; // -1/16
    189  if ( dice&1)
    190  p -= count>>5; // -1/32
    191 
    192  return base + p*DATAWIDTH;
    193  }
    194 
    195  void SortSmallRange( DATATYPE* p0, size_t count)
    196  {
    197  // use minimum compares and swaps for 2 to 4 items
    198  switch (count)
    199  {
    200  case 2:
    201  {
    202  DATATYPE* p1 = p0 + DATAWIDTH;
    203  if ( GreaterThan( p0, p1)) { Swap( p0, p1);}
    204  return;
    205  }
    206  case 3:
    207  {
    208  DATATYPE* p1 = p0 + DATAWIDTH;
    209  DATATYPE* p2 = p1 + DATAWIDTH;
    210  bool b = false;
    211  if ( GreaterThan( p0, p1)) { Swap( p0, p1); b = true;}
    212  if ( GreaterThan( p1, p2)) { Swap( p1, p2); b = true;}
    213  if ( b && GreaterThan( p0, p1)) { Swap( p0, p1);}
    214  return;
    215  }
    216  case 4:
    217  {
    218  DATATYPE* p1 = p0 + DATAWIDTH;
    219  DATATYPE* p2 = p1 + DATAWIDTH;
    220  DATATYPE* p3 = p2 + DATAWIDTH;
    221  if ( GreaterThan( p0, p3)) { Swap( p0, p3);}
    222  if ( GreaterThan( p1, p2)) { Swap( p1, p2);}
    223  bool b = false;
    224  if ( GreaterThan( p2, p3)) { Swap( p2, p3); b = true;}
    225  if ( GreaterThan( p0, p1)) { Swap( p0, p1); b = true;}
    226  if ( b && GreaterThan( p1, p2)) { Swap( p1, p2);}
    227  return;
    228  }
    229  }
    230  }
    231 
    232  void SortRange( DATATYPE* left, DATATYPE* right)
    233  {
    234  while ( left<right)
    235  {
    236  size_t count = (right-left)/DATAWIDTH+1;
    237 
    238  if ( count < 5)
    239  return SortSmallRange( left, count);
    240 
    241  DATATYPE* pivotleft;
    242  DATATYPE* pivotright;
    243 
    244  // partition range
    245  {
    246  pivotleft = Pivot( left, count);
    247 
    248  // move pivot to left end
    249  Swap( left, pivotleft);
    250 
    251  pivotleft = left;
    252  pivotright = right + DATAWIDTH;
    253 
    254  // move =< pivot to left, and > pivot to right
    255  for(;;)
    256  {
    257  // find next first item > pivot
    258  pivotleft += DATAWIDTH;
    259  if ( pivotleft >= pivotright)
    260  break;
    261  if ( !GreaterThan( pivotleft, left))
    262  continue;
    263 
    264  // find next last item =< pivot
    265  do
    266  {
    267  pivotright -= DATAWIDTH;
    268  if ( pivotleft >= pivotright)
    269  goto END; // to quickly exit a nested loop
    270  }
    271  while( GreaterThan( pivotright, left));
    272 
    273  Swap( pivotleft, pivotright);
    274  }
    275 
    276  END:
    277 
    278  pivotright -= DATAWIDTH;
    279  // move pivot to final place
    280  Swap( left, pivotright);
    281  pivotleft = pivotright;
    282 
    283  // avoid overhead when not likely that there are multiple items == pivot
    284  if ( pivotright >= right)
    285  {
    286  // the whole range is less or equal than pivot
    287  // check if there are values == pivot left of it. Speeds up sorting arrays with all or lots of equal items.
    288  for ( pivotleft -= DATAWIDTH; pivotleft > left; pivotleft -= DATAWIDTH)
    289  {
    290  if ( GreaterThan( pivotright, pivotleft))
    291  break;
    292  }
    293  pivotleft += DATAWIDTH;
    294  }
    295  }
    296 
    297  // limit max recursion depth to log(nel) by only recursing shorter part
    298  if ( pivotleft-left < right-pivotright)
    299  {
    300  // lower part is shorter
    301  SortRange( left, pivotleft-DATAWIDTH);
    302  left = pivotright+DATAWIDTH;
    303  }
    304  else
    305  {
    306  // upper part is shorter
    307  SortRange( pivotright+DATAWIDTH, right);
    308  right = pivotleft-DATAWIDTH;
    309  }
    310  }
    311  }
    312 
    313  void Sort()
    314  {
    315  SortRange( m_base, m_base + (m_nel-1)*DATAWIDTH);
    316  }
    317  };
    318 
    319  if ( !base || nel < 2 )
    320  return;
    321 #if !defined(ON_SORT_TEMPLATE_TYPE)
    322  if ( width < 1 || !compar)
    323  return;
    324 #endif
    325 
    326  CSorter sorter( base, nel, width, compar);
    327  sorter.Sort();
    328 }
    329 
    330 #undef Swap
    331 #undef GreaterThan
    332 #undef DATAWIDTH
    333 #undef DATATYPE
    diff --git a/6/d6/dd8/class_o_n___ellipse.html b/6/d6/dd8/class_o_n___ellipse.html index db05af1c..bd872c8d 100644 --- a/6/d6/dd8/class_o_n___ellipse.html +++ b/6/d6/dd8/class_o_n___ellipse.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Ellipse Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/dd8/class_o_n___mesh_cache-members.html b/6/d6/dd8/class_o_n___mesh_cache-members.html index 63d95776..48135d88 100644 --- a/6/d6/dd8/class_o_n___mesh_cache-members.html +++ b/6/d6/dd8/class_o_n___mesh_cache-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/dde/opennurbs__font_8h_source.html b/6/d6/dde/opennurbs__font_8h_source.html index 357e7840..27c71598 100644 --- a/6/d6/dde/opennurbs__font_8h_source.html +++ b/6/d6/dde/opennurbs__font_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_font.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_font.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_font.h
    -
    1 //
    2 // Copyright (c) 1993-2015 Robert McNeel & Associates. All rights reserved.
    3 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    4 // McNeel & Associates.
    5 //
    6 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    7 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    8 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    9 //
    10 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    11 //
    12 ////////////////////////////////////////////////////////////////
    13 
    14 
    15 #if !defined(OPENNURBS_FONT_INC_)
    16 #define OPENNURBS_FONT_INC_
    17 
    18 class ON_CLASS ON_FontMetrics
    19 {
    20 public:
    21  ON_FontMetrics() = default;
    22  ~ON_FontMetrics() = default;
    23  ON_FontMetrics(const ON_FontMetrics&) = default;
    24  ON_FontMetrics& operator=(const ON_FontMetrics&) = default;
    25 
    26 
    27 public:
    28  // All properties are zero.
    29  static const ON_FontMetrics Unset;
    30 
    31  /*
    32  ON_FontMetric::DefaultLineFeedRatio*ON_FontMetrics().AspectOfI()
    33  can be used to cook up a line space value when using the
    34  ON_FontMetrics.LineSpace() value defined by the font is
    35  not desired.
    36  */
    37  static const double DefaultLineFeedRatio; // 1.6
    38 
    39  // UNICODE code point of the glyph used to determine HeightOfCapital()
    40  // when no reaonable value is available from the font definition.
    41  // Currently this is the 'I' glyph. Opennurbs has used 'I' since 2005.
    42  // It is possible 'H' would work as well. All other glyphs, in
    43  // particular 'M' and 'W', do not work.
    44  static const ON__UINT32 HeightOfCapitalCodePoint; // 'I'
    45 
    46 public:
    47  /*
    48  Returns:
    49  Signed distance from the baseline to highest point on a glyph outline.
    50  Remarks:
    51  If every glyph outline in the font has (0,0) on the basline, then Ascent()
    52  is the maximum glyph bounding box Y.
    53  */
    54  int Ascent() const;
    55 
    56  /*
    57  Returns:
    58  Signed distance from the baseline to lowest point on a glyph outline.
    59  Remarks:
    60  This value is typically negative because glyphs for letters like 'j'
    61  typically have a portion of their outline below the baseline. However,
    62  some fonts have positive descent.
    63  If every glyph outline in the font has (0,0) on the basline, then Ascent()
    64  is the maximum glyph bounding box Y.
    65  */
    66  int Descent() const;
    67 
    68  /*
    69  Returns:
    70  The postive distance to move a base line when moving to a new line of text.
    71 
    72  Remarks:
    73  For almost every font used to render text, LineSpace() > (Ascent() - Descent()).
    74 
    75  This metric is sometimes called "height", but that term is often confused
    76  with (Ascent() - Descent()).
    77 
    78  For fonts designed to render horizontal lines of text, LineSpace() is a
    79  vertical distance. For fonts desingned to render vertical lines of text,
    80  LineSpace() is a horizontal distance. Depending on the context, the
    81  direction to move can be up, down, left or right.
    82  */
    83  int LineSpace() const;
    84 
    85  /*
    86  Returns:
    87  The "units per EM". This is the height and width of the square grid
    88  where the font glyphs are designed.
    89  Remarks:
    90  The width of the 'M' glyph in a font can be different from UPM.
    91  The height of the 'M' glyph in a font is typically less than UPM.
    92  In TrueType fonts, UPM is often a power of two and generally 1024 or 2048.
    93  In OpenType fonts, UPM is often 1000.
    94  In PostScript fonts, UPM is often 1000.
    95  */
    96  int UPM() const;
    97 
    98  /*
    99  Returns:
    100  The signed distance from the baseline to the highest point on the 'I' glyph.
    101  Remarks:
    102  The primary uses of AscentOfI() are:
    103  1)
    104  Calculate a scale factor to produce text with a user specified "text height".
    105  2)
    106  To calculate insertion location for ON::TextVerticalAlignment::Middle
    107  and ON::TextVerticalAlignment::Top.
    108 
    109  Since 2005, opennurbs has used
    110  (user specified text height)/AscentOfI()
    111  as the scale factor to render glyphs when user interface has provided
    112  a "text height" value. Users are more satisfied with this approach
    113  than when the scaling is base on line space or maximum font glyph ascent
    114  values. Experiments have ruled out the use of any other capital latin
    115  letter glyph except 'H' for this use. When a font does not contain an
    116  'I' glyph, a suitable value is returned that can be used for text height
    117  scaling and vertical alignment.
    118  */
    119  int AscentOfI() const;
    120 
    121  /*
    122  Description:
    123  Get the scale to apply to normalized glyph boxes and outlines to
    124  render the 'I' in the glyph's font at a height of text_height.
    125  Parameters:
    126  text_height - [in]
    127  The desired height of typical capital latin letter glyphs.
    128  Returns:
    129  text_height / AscentOfI().
    130  */
    131  double GlyphScale(double text_height) const;
    132 
    133  /*
    134  Returns:
    135  Thickness of strikeout.
    136  Remarks:
    137  The signed distance from the baseline to the bottom of the strikeout
    138  is StrikeoutPosition() - StrikeoutThickness()/2.
    139  */
    140  int StrikeoutThickness() const;
    141 
    142  /*
    143  Returns:
    144  Signed distance from baseline to center of strikeout.
    145  A positive value indicates the strikeout is above the baseline (common).
    146  Remarks:
    147  The signed distance from the baseline to the bottom of the strikeout
    148  is StrikeoutPosition() - StrikeoutThickness()/2.
    149  */
    150  int StrikeoutPosition() const;
    151 
    152 
    153  /*
    154  Returns:
    155  Thickness of underscore
    156  Remarks:
    157  The signed distance from the baseline to the bottom of the underscore
    158  is UnderscorePosition() - UnderscoreThickness()/2.
    159  */
    160  int UnderscoreThickness() const;
    161 
    162  /*
    163  Returns:
    164  Signed distance from baseline to center of underscore.
    165  A negative value indicates the underscore is below the baseline (common).
    166  Remarks:
    167  The signed distance from the baseline to the bottom of the underscore
    168  is UnderscorePosition() - UnderscoreThickness()/2.
    169  */
    170  int UnderscorePosition() const;
    171 
    172  static const ON_FontMetrics Scale(
    173  const ON_FontMetrics& font_metrics,
    174  double scale
    175  );
    176 
    177  void SetHeights(
    178  int ascent,
    179  int descent,
    180  int UPM,
    181  int line_space
    182  );
    183 
    184  bool HeightsAreValid() const;
    185 
    186  void SetAscentOfI(
    187  int ascent_of_I
    188  );
    189 
    190  void SetStrikeout(
    191  int strikeout_position,
    192  int strikeout_thickness
    193  );
    194 
    195  void SetUnderscore(
    196  int underscore_position,
    197  int underscore_thickness
    198  );
    199 
    200 private:
    201  int m_UPM = 0; // units per EM
    202  int m_ascent = 0; // max over all glyphs in font of (highest outline point - baseline point).y
    203  int m_descent = 0; // min over all glyphs in font of (lowest outline point - baseline point).y
    204  int m_line_space = 0; // distance between baselines
    205  int m_ascent_of_I = 0; // (highest 'I' outline point - I baseline point).y
    206 
    207  int m_strikeout_thickness = 0; //
    208  int m_strikeout_position = 0; //
    209 
    210  int m_underscore_thickness = 0; //
    211  int m_underscore_position = 0; //
    212 
    213 private:
    214  int m_reserved1 = 0;
    215  double m_reserved2 = 0.0;
    216  double m_reserved3 = 0.0;
    217  ON__UINT_PTR m_reserved5 = 0;
    218 };
    219 
    220 
    221 /// <summary>
    222 /// An ON_Font is a face in a font family. It corresponds to a Windows LOGFONT,
    223 /// a .NET System.Drawing.Font or a FreeType FT_Face.
    224 /// </summary>
    225 class ON_CLASS ON_Font
    226 {
    227 public:
    228 
    229 #pragma region RH_C_SHARED_ENUM [ON_Font::Weight] [Rhino.DocObjects.Font.FontWeight] [nested:byte]
    230  /// <summary>
    231  /// Weight enum values
    232  /// Avoid casting these values to int.
    233  /// Use ON_Font::WindowsLogfontWeightFromWeight() or
    234  /// ON_Font::AppleWeightOfFontFromWeight() or
    235  /// add another converter.
    236  /// </summary>
    237  enum class Weight : unsigned char
    238  {
    239  /// <summary> Not set. </summary>
    240  Unset = 0,
    241 
    242  /// <summary> IsLight = true </summary>
    243  Thin = 1,
    244 
    245  /// <summary> IsLight = true </summary>
    246  Ultralight = 2,
    247 
    248  //ExtraLight = 2,
    249 
    250  /// <summary> IsLight = true </summary>
    251  Light = 3,
    252 
    253  /// <summary> Default font weight. IsNormalWeight = true Also called Regular.</summary>
    254  Normal = 4,
    255 
    256  //Regular = 4,
    257 
    258  /// <summary> IsNormalWeight = true </summary>
    259  Medium = 5,
    260 
    261  /// <summary> IsBold = true </summary>
    262  Semibold = 6,
    263 
    264  //Demibold = 6,
    265  //Demi = 6,
    266  //Semi = 6,
    267 
    268  /// <summary> IsBold = true </summary>
    269  Bold = 7,
    270 
    271  /// <summary> IsBold = true </summary>
    272  Ultrabold = 8,
    273 
    274  //ExtraBold = 8,
    275 
    276  /// <summary> IsBold = true Also called Black</summary>
    277  Heavy = 9
    278 
    279  //Black = 9,
    280  };
    281 #pragma endregion
    282 
    283  /*
    284  Returns:
    285  -1: weight_a is lighter, weight_b is heavier
    286  +1: weight_a is heavier, weight_b is lighter
    287  0: weight_a = weight_b
    288  */
    289  static int CompareWeight(
    290  ON_Font::Weight weight_a,
    291  ON_Font::Weight weight_b
    292  );
    293 
    294  /*
    295  Description:
    296  In the rare cases when an ON_Font::Weight value must be passed
    297  as an unsigned int, use ON_Font::FontWeightFromUnsigned() to
    298  convert the unsigned value to an ON_Font::Weight value.
    299  Parameters:
    300  unsigned_font_weight - [in]
    301  */
    302  static ON_Font::Weight FontWeightFromUnsigned(
    303  unsigned int unsigned_font_weight
    304  );
    305 
    306  /*
    307  Description:
    308  The correspondence between Windows LOGFONT lfWeight values and
    309  ON_Font::Weight enum values is
    310  ON_Font::Weight::Thin = 100 LOGFONT lfWeight
    311  ON_Font::Weight::Ultralight = 200 LOGFONT lfWeight
    312  ON_Font::Weight::Light = 300 LOGFONT lfWeight
    313  ON_Font::Weight::Normal = 400 LOGFONT lfWeight
    314  ON_Font::Weight::Medium = 500 LOGFONT lfWeight
    315  ON_Font::Weight::Semibold = 600 LOGFONT lfWeight
    316  ON_Font::Weight::Bold = 700 LOGFONT lfWeight
    317  ON_Font::Weight::Ultrabold = 800 LOGFONT lfWeight
    318  ON_Font::Weight::Heavy = 900 LOGFONT lfWeight
    319  Returns:
    320  The Windows LOGFONT lfWeight value that corresponds to the ON_Font::Weight enum value.
    321  */
    322  static int WindowsLogfontWeightFromWeight(
    323  ON_Font::Weight font_weight
    324  );
    325 
    326  /*
    327  Description:
    328  The correspondence between Apple "weight of font" values and
    329  ON_Font::Weight enum values is
    330  ON_Font::Weight::Thin = 1
    331  ON_Font::Weight::Ultralight = 2
    332  ON_Font::Weight::Light = 3
    333  ON_Font::Weight::Normal = 4
    334  ON_Font::Weight::Medium = 5
    335  ON_Font::Weight::Semibold = 6
    336  ON_Font::Weight::Bold = 7
    337  ON_Font::Weight::Ultrabold = 8
    338  ON_Font::Weight::Heavy = 9
    339  Returns:
    340  The Apple "weight of font" value that corresponds to the ON_Font::Weight enum value.
    341  */
    342  static int AppleWeightOfFontFromWeight(
    343  ON_Font::Weight font_weight
    344  );
    345 
    346  /*
    347  Description:
    348  The correspondence between Apple "font weight trait" values and
    349  ON_Font::Weight enum values is
    350  ON_Font::Weight::Thin = -0.4 Apple font weight trait
    351  ON_Font::Weight::Ultralight = -0.2667 Apple font weight trait
    352  ON_Font::Weight::Light = -0.1333 Apple font weight trait
    353  ON_Font::Weight::Normal = 0.0 Apple font weight trait
    354  ON_Font::Weight::Medium = 0.1333 Apple font weight trait
    355  ON_Font::Weight::Semibold = 0.2667 Apple font weight trait
    356  ON_Font::Weight::Bold = 0.4 Apple font weight trait
    357  ON_Font::Weight::Ultrabold = 0.5333 Apple font weight trait
    358  ON_Font::Weight::Heavy = 0.6667 Apple font weight trait
    359  Returns:
    360  The Apple "NSFontWeightTrait" value that corresponds to the ON_Font::Weight enum value.
    361  */
    362  static double AppleFontWeightTraitFromWeight(
    363  ON_Font::Weight font_weight
    364  );
    365 
    366  /*
    367  Description:
    368  The correspondence between Windows LOGFONT lfWeight values and
    369  ON_Font::Weight enum values is
    370 
    371  ON_Font::Weight::Thin = 100
    372  ON_Font::Weight::Ultralight = 200
    373  ON_Font::Weight::Light = 300
    374  ON_Font::Weight::Normal = 400
    375  ON_Font::Weight::Medium = 500
    376  ON_Font::Weight::Semibold = 600
    377  ON_Font::Weight::Bold = 700
    378  ON_Font::Weight::Ultrabold = 800
    379  ON_Font::Weight::Heavy = 900
    380  Returns:
    381  The best ON_Font::Weight enum value for the Windows LOGFONT weight.
    382  */
    383 
    384  static ON_Font::Weight WeightFromWindowsLogfontWeight(
    385  int windows_logfont_weight
    386  );
    387 
    388  /*
    389  Description:
    390  The correspondence between Apple "weight of font" values and
    391  ON_Font::Weight enum values is
    392  ON_Font::Weight::Thin = 1
    393  ON_Font::Weight::Ultralight = 2
    394  ON_Font::Weight::Light = 3
    395  ON_Font::Weight::Normal = 4
    396  ON_Font::Weight::Medium = 5
    397  ON_Font::Weight::Semibold = 6
    398  ON_Font::Weight::Bold = 7
    399  ON_Font::Weight::Ultrabold = 8
    400  ON_Font::Weight::Heavy = 9
    401  Returns:
    402  The best ON_Font::Weight enum value for the Apple weight of font.
    403  */
    404  static ON_Font::Weight WeightFromAppleWeightOfFont(
    405  int apple_weight_of_font
    406  );
    407 
    408  /*
    409  Parameters:
    410  apple_font_weight_trait - [in]
    411  Apple NSFontWeightTrait
    412  The valid value range is from -1.0 to 1.0. The value of 0.0 corresponds to the regular or medium font weight.
    413  */
    414  static ON_Font::Weight WeightFromAppleFontWeightTrait(
    415  double apple_font_weight_trait
    416  );
    417 
    418  static const wchar_t* WeightToWideString(
    419  ON_Font::Weight font_weight
    420  );
    421 
    422 
    423 
    424 #pragma region RH_C_SHARED_ENUM [ON_Font::Stretch] [Rhino.DocObjects.Font.FontStretch] [nested:byte]
    425  /// <summary>
    426  /// Horizontal expansion or contraction of font
    427  /// </summary>
    428  enum class Stretch : unsigned char
    429  {
    430  /// <summary> Not set. </summary>
    431  Unset = 0,
    432  /// <summary> </summary>
    433  Ultracondensed = 1,
    434  /// <summary> </summary>
    435  Extracondensed = 2,
    436  /// <summary> </summary>
    437  Condensed = 3,
    438  /// <summary> </summary>
    439  Semicondensed = 4,
    440 
    441  /// <summary> Default font stretch. </summary>
    442  Medium = 5,
    443 
    444  //Normal = 5,
    445 
    446  /// <summary> </summary>
    447  Semiexpanded = 6,
    448  /// <summary> </summary>
    449  Expanded = 7,
    450  /// <summary> </summary>
    451  Extraexpanded = 8,
    452  /// <summary> </summary>
    453  Ultraexpanded = 9
    454  };
    455 #pragma endregion
    456 
    457  /*
    458  Description:
    459  In the rare cases when an ON_Font::Stretch value must be passed
    460  as an unsigned int, use ON_Font::FontStretchFromUnsigned() to
    461  convert the unsigned value to an ON_Font::Stretch value.
    462  Parameters:
    463  unsigned_font_stretch - [in]
    464  */
    465  static ON_Font::Stretch FontStretchFromUnsigned(
    466  unsigned int unsigned_font_stretch
    467  );
    468 
    469 
    470 #pragma region RH_C_SHARED_ENUM [ON_Font::Style] [Rhino.DocObjects.Font.FontStyle] [nested:byte]
    471  /// <summary>
    472  /// Vertical angle of font
    473  /// Upright, Italic, or Oblique
    474  /// </summary>
    475  enum class Style : unsigned char
    476  {
    477  /// <summary> Not set. </summary>
    478  Unset = 0,
    479 
    480  /// <summary> Default font style. </summary>
    481  Upright = 1,
    482 
    483  //Normal = 1,
    484  //Roman = 1,
    485 
    486  /// <summary> </summary>
    487  Italic = 2,
    488 
    489  /// <summary> </summary>
    490  Oblique = 3
    491  };
    492 #pragma endregion
    493 
    494  /*
    495  Description:
    496  In the rare cases when an ON_Font::Style value must be passed
    497  as an unsigned int, use ON_Font::FontStyleFromUnsigned() to
    498  convert the unsigned value to an ON_Font::Style value.
    499  Parameters:
    500  unsigned_font_style - [in]
    501  */
    502  static ON_Font::Style FontStyleFromUnsigned(
    503  unsigned int unsigned_font_style
    504  );
    505 
    506  static const wchar_t* StyleToWideString(
    507  ON_Font::Style font_style
    508  );
    509 
    510 
    511 public:
    512  static const ON_Font Default;
    513  static bool IsValidFaceName(
    514  const wchar_t* face_name
    515  );
    516 
    517 private:
    518  // This private constructor is used to construct ON_Font::Default and managed fonts.
    519  // Never make this constructor protected or public.
    520  ON_Font(
    521  unsigned char managed_status, // 0 = no, 1 = ON_Font::Default, 2 = managed
    522  const ON_Font& src
    523  );
    524 
    525 private:
    526  // Use ON_Font( const ON_Font& ) or ON_Font::operator= if you need to make a copy.
    527  // Never make CopyHelper protected or public.
    528  void CopyHelper(
    529  const ON_Font&
    530  );
    531 
    532 public:
    533  /*
    534  Description:
    535  Get a font managed by the application from the font characteristics.
    536  Never delete a font returned by GetManagedFont().
    537  Parameters:
    538  face_name - [in]
    539  font_weight - [in]
    540  default = ON_Font::Default.FontWeight()
    541  font_style - [in]
    542  default = ON_Font::Default.FontStyle()
    543  font_stretch - [in]
    544  default = ON_Font::Default.FontStretch()
    545  bUnderlined - [in]
    546  default = ON_Font::Default.Underlined() = false
    547  bStrikethrough - [in]
    548  default = ON_Font::Default.Strikethrough() = false
    549  linefeed_ratio - [in]
    550  default = ON_Font::Default.LinefeedRatio()
    551  windows_charset - [in]
    552  default = ON_Font::WindowsCharSet::DefaultCharSet
    553  */
    554  static const ON_Font* GetManagedFont(
    555  const wchar_t* face_name
    556  );
    557 
    558  static const ON_Font* GetManagedFont(
    559  double point_size,
    560  const wchar_t* face_name
    561  );
    562 
    563  static const ON_Font* GetManagedFont(
    564  const wchar_t* face_name,
    565  bool bBold
    566  );
    567 
    568  static const ON_Font* GetManagedFont(
    569  double point_size,
    570  const wchar_t* face_name,
    571  bool bBold
    572  );
    573 
    574  static const ON_Font* GetManagedFont(
    575  const wchar_t* face_name,
    576  bool bBold,
    577  bool bItalic
    578  );
    579 
    580  static const ON_Font* GetManagedFont(
    581  double point_size,
    582  const wchar_t* face_name,
    583  bool bBold,
    584  bool bItalic
    585  );
    586 
    587  static const ON_Font* GetManagedFont(
    588  const wchar_t* face_name,
    589  ON_Font::Weight font_weight,
    590  ON_Font::Style font_style
    591  );
    592 
    593  static const ON_Font* GetManagedFont(
    594  double point_size,
    595  const wchar_t* face_name,
    596  ON_Font::Weight font_weight,
    597  ON_Font::Style font_style
    598  );
    599 
    600  static const ON_Font* GetManagedFont(
    601  const wchar_t* face_name,
    602  ON_Font::Weight font_weight,
    603  ON_Font::Style font_style,
    604  ON_Font::Stretch font_stretch,
    605  bool bUnderlined,
    606  bool bStrikethrough,
    607  double linefeed_ratio,
    608  unsigned int logfont_charset
    609  );
    610 
    611  static const ON_Font* GetManagedFont(
    612  double point_size,
    613  const wchar_t* face_name,
    614  ON_Font::Weight font_weight,
    615  ON_Font::Style font_style,
    616  ON_Font::Stretch font_stretch,
    617  bool bUnderlined,
    618  bool bStrikethrough,
    619  double linefeed_ratio,
    620  unsigned int logfont_charset
    621  );
    622 
    623  static const ON_Font* GetManagedFontFromFontDescription(
    624  const wchar_t* font_description
    625  );
    626 
    627 #if defined(ON_OS_WINDOWS_GDI)
    628  /*
    629  Description:
    630  Get a managed font from a LOGFONT
    631  Parameters:
    632  map_mode - [in]
    633  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    634  Otherwised, map_mode must identify a Windows mapping mode
    635  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    636  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    637  hdc - [in]
    638  Windows device context.
    639  If map_mode is set and not MM_TEXT, then hdc is ignored.
    640  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    641  If the mapping mode is MM_TEXT, then the additional device context values
    642  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    643  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    644  logfont - [in]
    645  These logfont properties are used to find the managed font.
    646  lfHeight (when dc is not zero)
    647  lfWeight;
    648  lfItalic;
    649  lfUnderline;
    650  lfStrikeOut;
    651  lfCharSet;
    652  lfFaceName[LF_FACESIZE];
    653  All other LOGFONT properties is ignored.
    654  See Also:
    655  ON_Font::GetManagedFontFromWindowsLogfontComplete
    656  */
    657  static const ON_Font* GetManagedFontFromWindowsLogfont(
    658  int map_mode,
    659  HDC hdc,
    660  const LOGFONT& logfont
    661  );
    662 
    663  enum : int
    664  {
    665  MAP_MODE_ZERO_ERROR_SUPPRESS = MM_MAX + 3
    666  };
    667 
    668 #endif
    669 
    670  static const ON_Font* GetManagedFontFromAppleFontName(
    671  const char* apple_font_name
    672  );
    673 
    674  static const ON_Font* GetManagedFontFromAppleFontName(
    675  const wchar_t* apple_font_name
    676  );
    677 
    678 #if defined(ON_RUNTIME_APPLE_OBJECTIVE_C_AVAILABLE)
    679  static const ON_Font* GetManagedFontFromAppleFont(
    680  NSFont* apple_font,
    681  bool bAnnotationFont
    682  );
    683 #endif
    684 
    685  /*
    686  Returns:
    687  The managed font for this font.
    688  Remarks:
    689  If this->IsManagedFont() is true, then "this" is returned.
    690  */
    691  const ON_Font* ManagedFont() const;
    692 
    693  /*
    694  Description:
    695  Returns the glpyh informationh for used to render a specific code point
    696  Parameters:
    697  unicode_code_point
    698  UNICODE code point value
    699  Returns:
    700  Glyph rendering information.
    701 
    702  Remarks:
    703  Typically the returned glpyh uses is a single glpyh in this->ManagedFont().
    704  In this case, glyph->SubstitueCount() is 0.
    705 
    706  In some cases one or more glyphs from one or more substitute fonts are required
    707  to render the code point. In this case, glyph->SubstitueCount() is 0.
    708 
    709  Example:
    710  ON_Font* font = ...;
    711  unsigned int code_point = ...;
    712  const ON_FontGlyph* g = font->CodePointGlyph(code_point);
    713  if (nullptr != g )
    714  {
    715  if ( g->SubstituteCount() > 0 )
    716  {
    717  // complicate case - one of more substitutes must be rendered to render g
    718  for ( const ON_FontGlyph* gsub = g.NextSubstitute(); nullptr != gsub; gsub = gsub->NextSubstitute() )
    719  {
    720  ...
    721  }
    722  }
    723  else
    724  {
    725  // simple case - this computer can directly render g
    726  ...
    727  }
    728  }
    729  */
    730  const class ON_FontGlyph* CodePointGlyph(
    731  ON__UINT32 unicode_code_point
    732  ) const;
    733 
    734 private:
    735  friend class ON_FontGlyph;
    736  const class ON_FontGlyph* Internal_ManagedCodePointGlyph(
    737  ON__UINT32 unicode_code_point,
    738  bool bCreateIfMissing,
    739  bool bFindSubstitutes
    740  ) const;
    741 
    742 public:
    743 
    744  /*
    745  Description:
    746  When reading version 5 3dm achives, the font description can be
    747  a generic font description or an Apple font name. This function
    748  rejects certain descriptions like "Default" and "Arial" for
    749  use as Apple font names.
    750  */
    751  static bool IsNotAppleFontName(
    752  const wchar_t* font_description
    753  );
    754 
    755  static const ON_Font* GetManagedFont(
    756  const ON_Font& font_characteristics,
    757  bool bCreateIfNotFound
    758  );
    759 
    760  static const ON_Font* GetManagedFontFromSerialNumber(
    761  unsigned int managed_font_runtime_serial_number
    762  );
    763 
    764  static unsigned int GetManagedFontList(
    765  ON_SimpleArray< const ON_Font* >& managed_fonts
    766  );
    767 
    768  /*
    769  Returns:
    770  True if this font is a managed font returned by one of the
    771  static ON_Font::GetManagedFont(...) functions.
    772  Remarks:
    773  ON_Font::Default is managed.
    774  */
    775  bool IsManagedFont() const;
    776 
    777 public:
    778 
    779  /*
    780  Description:
    781  If opennurbs is built with FreeType support then
    782  FT_Face freetype_face = (FT_Face)ON_Font::FreeTypeFace(font)
    783  will return a FreeType face that can be used to render the font.
    784  Parameters:
    785  font - [in]
    786  Returns:
    787  A value that can be cast as a FreeType FT_Face.
    788  Example
    789  const ON_Font* font = ...;
    790  FT_Face freetype_face = (FT_Face)ON_Font::FreeTypeFace(font);
    791  Remarks:
    792  Many fonts do not have a glyph for a every UNICODE codepoint and font
    793  substitution is required. If you want to get the freetype face
    794  used for a specfic UNICODE codepoint, call ON_Font::CodepointFreeTypeFace().
    795  */
    796  static ON__UINT_PTR FreeTypeFace(
    797  const ON_Font* font
    798  );
    799 
    800 private:
    801  /*
    802  Description:
    803  Helper function used by destructor to deallocate memory used
    804  by FreeType face
    805  */
    806  static void DestroyFreeTypeFace(
    807  const ON_Font* font
    808  );
    809 
    810 public:
    811  ON_Font();
    812  ~ON_Font() = default;
    813  ON_Font(const ON_Font& src);
    814  ON_Font& operator=(const ON_Font& src);
    815 
    816 public:
    817  /*
    818  Description:
    819  Create a font with a specified facename and properties.
    820  Parameters:
    821  face_name - [in]
    822  nullptr is treated as ON_Font::Default.FaceName().
    823  bBold - [in]
    824  True for a bold version of the font.
    825  bItalic - [in]
    826  True for an italic version of the font.
    827  Returns:
    828  True if the font characteristics were valid and set on the font.
    829  */
    830  bool SetFontCharacteristics(
    831  const wchar_t* face_name,
    832  bool bBold,
    833  bool bItalic,
    834  bool bUnderlined,
    835  bool bStrikethrough
    836  );
    837 
    838  /*
    839  Description:
    840  Create a font with a specified facename and properties.
    841  Parameters:
    842  point_size - [in]
    843  If point_size > 0.0, then it specifies which size of font definition
    844  should be used. Otherwise the font size used for annotation text
    845  is used.
    846  For high quality fonts it is generally the case that
    847  different point sizes of the same font face have
    848  subtle differences in glyph design and are not
    849  simply scaled versions of a base glyph.
    850  face_name - [in]
    851  nullptr is treated as ON_Font::Default.FaceName().
    852  bBold - [in]
    853  True for a bold version of the font.
    854  bItalic - [in]
    855  True for an italic version of the font.
    856  Returns:
    857  True if the font characteristics were valid and set on the font.
    858  */
    859  bool SetFontCharacteristics(
    860  double point_size,
    861  const wchar_t* face_name,
    862  bool bBold,
    863  bool bItalic,
    864  bool bUnderlined,
    865  bool bStrikethrough
    866  );
    867 
    868  /*
    869  Description:
    870  Set the font's face name and characteristics.
    871  Parameters:
    872  face_name - [in]
    873  nullptr is not permitted.
    874  Pass ON_Font::Default.FaceName() if you don't have a face name.
    875  Returns:
    876  True if the font characteristics were valid and set on the font.
    877  */
    878  bool SetFontCharacteristics(
    879  const wchar_t* face_name,
    880  ON_Font::Weight font_weight,
    881  ON_Font::Style font_style,
    882  ON_Font::Stretch font_stretch,
    883  bool bUnderlined,
    884  bool bStrikethrough
    885  );
    886 
    887  bool SetFontCharacteristics(
    888  double point_size,
    889  const wchar_t* face_name,
    890  ON_Font::Weight font_weight,
    891  ON_Font::Style font_style,
    892  ON_Font::Stretch font_stretch,
    893  bool bUnderlined,
    894  bool bStrikethrough
    895  );
    896 
    897  bool SetFontCharacteristics(
    898  const wchar_t* face_name,
    899  ON_Font::Weight font_weight,
    900  ON_Font::Style font_style,
    901  ON_Font::Stretch font_stretch,
    902  bool bUnderlined,
    903  bool bStrikethrough,
    904  double linefeed_ratio,
    905  unsigned int logfont_charset
    906  );
    907 
    908  bool SetFontCharacteristics(
    909  double point_size,
    910  const wchar_t* face_name,
    911  ON_Font::Weight font_weight,
    912  ON_Font::Style font_style,
    913  ON_Font::Stretch font_stretch,
    914  bool bUnderlined,
    915  bool bStrikethrough,
    916  double linefeed_ratio,
    917  unsigned int logfont_charset
    918  );
    919 
    920 
    921  /*
    922  Description:
    923  The font properties weight, style, stretch, underlined,
    924  and strikethrough are encoded in the returned value.
    925  Remarks:
    926  This is a legacy value used in 3dm archive reading/writing
    927  and some sorting operations.
    928  */
    929  unsigned int FontCharacteristicsAsUnsigned() const;
    930 
    931 private:
    932  /*
    933  Description:
    934  All font characterisics defined by the input parameters are encoded
    935  in the returned value.
    936  Remarks:
    937  Used in 3dm archive reading/writing.
    938  */
    939  static unsigned int Internal_FontCharacteristicsAsUnsigned(
    940  ON_Font::Weight font_weight,
    941  ON_Font::Style font_style,
    942  ON_Font::Stretch font_stretch,
    943  bool bUnderlined,
    944  bool bStrikethrough
    945  );
    946 
    947  /*
    948  Description:
    949  All font characterisics except facename (weight, style, stretch,
    950  underlined, strikethrough, charset) are encoded in the returned
    951  value.
    952  Parameters:
    953  font_characteristics_as_unsigned - [in]
    954  Value returned from ON_Font.FontCharacteristicsAsUnsigned()
    955  Returns:
    956  True if the characterstics were set.
    957  Remarks:
    958  Used in 3dm archive reading/writing.
    959  */
    960  bool Internal_SetFontCharacteristicsFromUnsigned(
    961  unsigned int font_characteristics_as_unsigned
    962  );
    963 
    964 public:
    965  /*
    966  Description:
    967  Returns a 32-bit crc of the font weight, style, stretch, underline, strikethrough,
    968  and facename characteristics.
    969 
    970  Parameters:
    971  bIgnoreFaceNameOrdinalCase - [in]
    972  If true, ON_wString::MapStringOrdinal() is applied to the face name
    973  and the returned CRC is ordinal case independent.
    974  */
    975  ON__UINT32 CRC32(
    976  bool bIgnoreFaceNameOrdinalCase
    977  ) const;
    978 
    979 #if defined(ON_OS_WINDOWS_GDI)
    980 
    981  /*
    982  Description:
    983  Get the scale factors for converting heights beween
    984  Windows device coordinates and Windows logical coordinates.
    985 
    986  Parameters:
    987  hdc - [in]
    988  Windows device context.
    989  The device context is used to get the conversion between device
    990  and logical pixel heights. The Windows GDI functions
    991  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    992 
    993  device_to_logical_scale - [out]
    994  logical_height = device_to_logical_scale*device_height
    995 
    996  logical_to_device_scale - [out]
    997  device_height = logical_to_device_scale*logical_height
    998 
    999  Returns:
    1000  True if successful.
    1001  False otherwise. In the returned scale factors are set to 1.0.
    1002  */
    1003  static bool GetWindowsDeviceToLogicalHeightScales(
    1004  HDC hdc,
    1005  double* device_to_logical_scale,
    1006  double* logical_to_device_scale
    1007  );
    1008 
    1009  /*
    1010  Description:
    1011  Convert a character height in points to a Windows LOGFONT lfHeight value (negative number).
    1012 
    1013  The mapping mode determines the length unit system for the returned value.
    1014 
    1015 
    1016  The Windows convention is to use negative lfHeight values to specify
    1017  font character heights and postive height values to specify font cell heights.
    1018 
    1019  font cell height = font acsent + font descent.
    1020 
    1021  font character height = Cell height - internal leading.
    1022 
    1023  Parameters:
    1024  map_mode - [in]
    1025  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1026  Otherwised, map_mode must identify a Windows mapping mode
    1027  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1028  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1029 
    1030  hdc - [in]
    1031  Windows device context.
    1032  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1033  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1034  If the mapping mode is MM_TEXT, then the additional device context values
    1035  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1036  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1037 
    1038  point_size - [in]
    1039  Font character height in points (1 point = 1/72 inch = 25.4/72 millimeters).
    1040  In terms of font metrics, character height = ascent + descent - internal leading.
    1041 
    1042  Returns:
    1043  LOGFONT lfHeight value.
    1044 
    1045  This value is always negative.
    1046 
    1047  The absolute value of the returned value
    1048  = character height
    1049  = ascent + descent - internal leading
    1050  For many common fonts, the "character height" is close to the distance
    1051  from the bottom of a lower case g to the top of an upper case M.
    1052  The internal leading is space reseved for diacritical marks like the
    1053  ring above the A in the UNICODE "LATIN LETTER A WITH RING" U+00C5 glyph.
    1054  Character height is also known as the "em height".
    1055  Note that the "em height" is typically larger than the height of the
    1056  letter M because "em height" inlcude descent.
    1057  */
    1058  static int WindowsLogfontCharacterHeightFromPointSize(
    1059  int map_mode,
    1060  HDC hdc,
    1061  double point_size
    1062  );
    1063 
    1064  /*
    1065  Parameters:
    1066  map_mode - [in]
    1067  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1068  Otherwised, map_mode must identify a Windows mapping mode
    1069  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1070  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1071 
    1072  hdc - [in]
    1073  Windows device context.
    1074  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1075  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1076  If the mapping mode is MM_TEXT, then the additional device context values
    1077  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1078  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1079 
    1080  logfont_character_height - [in]
    1081  This value must be a Windows LOGFONT character height in units
    1082  determine from map_mode and hdc. If you have a LOGFONT with postive
    1083  lfHeight value, you must get the fonts TEXTMETRICS and subbr
    1084 
    1085  Returns:
    1086  Character height in points (1 point = 1/72 inch).
    1087 
    1088  font character height = font ascent + font descent - font internal leading.
    1089 
    1090  Remarks:
    1091  See ON_Font::PointSize() for information about point units,
    1092  font character height, and font cell height.
    1093  */
    1094  static double PointSizeFromWindowsLogfontCharacterHeight(
    1095  int map_mode,
    1096  HDC hdc,
    1097  int logfont_character_height
    1098  );
    1099 
    1100  /*
    1101  Description:
    1102  Get a Windows LOGFONT character height
    1103  = -(TEXTMETRIC.tmAscent + TEXTMETRIC.tmDescent - TEXTMETRIC.tmLeading )
    1104  as a negative integer.
    1105 
    1106  Parameters:
    1107  map_mode - [in]
    1108  The best results are obtained when map_mode = MM_TEXT and the hdc is
    1109  correctly set for the context where the font is being rendered. Otherwise
    1110  the loss of precision when length units system conversion scale factors
    1111  are applied and results are stored in int LOGFONT and TEXTMETRIC fields
    1112  lead to discrepancies.
    1113 
    1114  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1115  Otherwised, map_mode must identify a Windows mapping mode
    1116  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1117  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1118 
    1119  hdc - [in]
    1120  Windows device context.
    1121  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1122  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1123  If the mapping mode is MM_TEXT, then the additional device context values
    1124  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1125  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1126 
    1127  logfont - [in]
    1128  If logfont.lfHeight <= 0, then logfont.lfHeight is returned.
    1129  If logfont.lfHeight > 0, then logfont face name, map_mode and hdc are
    1130  used to calculate the font's TEXTMETRICS tmInternalLeading value
    1131  -((tm.tmAscent + tm.tmDescent) - tmInternalLeading) is returned.
    1132 
    1133  Returns:
    1134  0: failure
    1135  <0: Windows LOGFONT character height in units specified by map_mode and hdc.
    1136  */
    1137  static int WindowsLogfontCharacterHeight(
    1138  int map_mode,
    1139  HDC hdc,
    1140  const LOGFONT& logfont
    1141  );
    1142 
    1143  /*
    1144  Description:
    1145  Get a Windows LOGFONT cell height
    1146  = (TEXTMETRIC.tmAscent + TEXTMETRIC.tmDescent)
    1147  as a positive integer.
    1148 
    1149  Parameters:
    1150  map_mode - [in]
    1151  The best results are obtained when map_mode = MM_TEXT and the hdc is
    1152  correctly set for the context where the font is being rendered. Otherwise
    1153  the loss of precision when length units system conversion scale factors
    1154  are applied and results are stored in int LOGFONT and TEXTMETRIC fields
    1155  lead to discrepancies.
    1156 
    1157  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1158  Otherwised, map_mode must identify a Windows mapping mode
    1159  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1160  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1161 
    1162  hdc - [in]
    1163  Windows device context.
    1164  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1165  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1166  If the mapping mode is MM_TEXT, then the additional device context values
    1167  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1168  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1169 
    1170  logfont - [in]
    1171  If logfont.lfHeight >= 0, then logfont.lfHeight is returned.
    1172  If logfont.lfHeight < 0, then logfont face name, map_mode and hdc are
    1173  used to calculate the font's TEXTMETRIC and
    1174  (tm.tmAscent + tm.tmDescent) is returned.
    1175 
    1176  Returns:
    1177  0: failure
    1178  >0: Windows LOGFONT cell height in units specified by map_mode and hdc.
    1179  */
    1180  static int WindowsLogfontCellHeight(
    1181  int map_mode,
    1182  HDC hdc,
    1183  const LOGFONT& logfont
    1184  );
    1185 
    1186 
    1187  /*
    1188  Description:
    1189  Get a Windows text metrics.
    1190 
    1191  Parameters:
    1192  map_mode - [in]
    1193  The best results are obtained when map_mode = MM_TEXT and the hdc is
    1194  correctly set for the context where the font is being rendered. Otherwise
    1195  the loss of precision when length units system conversion scale factors
    1196  are applied and results are stored in int LOGFONT and TEXTMETRIC fields
    1197  lead to discrepancies.
    1198 
    1199  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1200  Otherwised, map_mode must identify a Windows mapping mode
    1201  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1202  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1203 
    1204  hdc - [in]
    1205  Windows device context.
    1206  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1207  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1208  If the mapping mode is MM_TEXT, then the additional device context values
    1209  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1210  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1211 
    1212  logfont - [in]
    1213  If logfont.lfHeight >= 0, then logfont.lfHeight is returned.
    1214  If logfont.lfHeight < 0, then logfont face name, map_mode and hdc are
    1215  used to calculate the font's TEXTMETRIC and
    1216  (tm.tmAscent + tm.tmDescent) is returned.
    1217 
    1218  textmetric - [out]
    1219 
    1220  Returns:
    1221  0: failure
    1222  >0: Windows LOGFONT cell height in units specified by map_mode and hdc.
    1223  */
    1224  static bool GetWindowsTextMetrics(
    1225  int map_mode,
    1226  HDC hdc,
    1227  const LOGFONT& logfont,
    1228  TEXTMETRIC& textmetric
    1229  );
    1230 
    1231 private:
    1232  static HDC Internal_CreateWindowsLogfontDeviceContext();
    1233  static void Internal_DeleteWindowsLogfontDeviceContext(
    1234  HDC hdc
    1235  );
    1236 
    1237 public:
    1238  /*
    1239  Description:
    1240  Set ON_Font properties from a subset of the LOGFONT properties.
    1241  Parameters:
    1242  map_mode - [in]
    1243  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1244  Otherwised, map_mode must identify a Windows mapping mode
    1245  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1246  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1247  hdc - [in]
    1248  Windows device context.
    1249  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1250  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1251  If the mapping mode is MM_TEXT, then the additional device context values
    1252  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1253  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1254  logfont - [in]
    1255  These logfont properties are used to set the ON_Font.
    1256  lfHeight (when dc is not zero),
    1257  lfWeight
    1258  lfItalic
    1259  lfUnderline
    1260  lfStrikeOut
    1261  lfCharSet
    1262  lfFaceName[LF_FACESIZE];
    1263  All other LOGFONT properties are ignored.
    1264  See Also:
    1265  ON_Font::SetFromWindowsLogFontPartialComplete
    1266  */
    1267  bool SetFromWindowsLogFont(
    1268  int map_mode,
    1269  HDC hdc,
    1270  const LOGFONT& logfont
    1271  );
    1272 
    1273  /*
    1274  Parameters:
    1275  map_mode - [in]
    1276  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1277  Otherwised, map_mode must identify a Windows mapping mode
    1278  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1279  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1280  hdc - [in]
    1281  Windows device context.
    1282  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1283  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1284  If the mapping mode is MM_TEXT, then the additional device context values
    1285  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1286  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1287  Returns:
    1288  A Windows LOGFONT with propeties copied from this ON_Font.
    1289  If WindowsLogFontIsComplete() is true, then all LOGFONT properties
    1290  are copied from the ON_Font.
    1291  If WindowsLogFontIsComplete() is false, then the LOGFONT lfHeight,
    1292  lfWidth, lfEscapement, lfOrientation, lfClipPrecision, lfQuality,
    1293  lfPitchAndFamily, and lfOutPrecision properties are set to ON_Font
    1294  default values.
    1295  */
    1296  const LOGFONT WindowsLogFont(
    1297  int map_mode,
    1298  HDC hdc
    1299  ) const;
    1300 
    1301  const MAT2 WindowsFontMat2() const;
    1302 
    1303 #endif
    1304 
    1305 #if defined (ON_RUNTIME_APPLE_OBJECTIVE_C_AVAILABLE)
    1306  bool SetFromAppleFont (NSFont* apple_font, bool bAnnotationFont);
    1307  NSFont* AppleFont() const;
    1308 #endif
    1309 
    1310  /*
    1311  Parameters:
    1312  apple_font_name - [in]
    1313  Remarks:
    1314  The "Apple Font Name" is sometimes called the PostScript font name in the
    1315  Mac OS "Font Book" application and in some other Apple documentation.
    1316  It is NSFont.fontName or the "fontManagerName" string in this for loop:
    1317  for (NSString* fontManagerName in[NSFontManager.sharedFontManager availableFonts])
    1318  {
    1319  ...
    1320  }
    1321  It is the best choice of a string to pass as the "fontWithName" parameter
    1322  in the following call:
    1323  NSFont* apple_font = [NSFont fontWithName : apple_font_name size : pointSize];
    1324  */
    1325  bool SetFromAppleFontName(
    1326  const wchar_t* apple_font_name
    1327  );
    1328 
    1329  /*
    1330  Parameters:
    1331  apple_font_name - [in]
    1332  point_size - [in]
    1333  Pass 0.0 for annotation fonts
    1334  Remarks:
    1335  The "Apple Font Name" is sometimes called the PostScript font name in the
    1336  Mac OS "Font Book" application and in some other Apple documentation.
    1337  It is NSFont.fontName or the "fontManagerName" string in this for loop:
    1338  for (NSString* fontManagerName in[NSFontManager.sharedFontManager availableFonts])
    1339  {
    1340  ...
    1341  }
    1342  It is the best choice of a string to pass as the "fontWithName" parameter
    1343  in the following call:
    1344  NSFont* apple_font = [NSFont fontWithName : apple_font_name size : pointSize];
    1345  */
    1346  bool SetFromAppleFontName(
    1347  const wchar_t* apple_font_name,
    1348  double point_size
    1349  );
    1350 
    1351  /*
    1352  Returns:
    1353  The Apple Font Name.
    1354  Remarks:
    1355  The "Apple Font Name" is sometimes called the PostScript font name in the
    1356  Mac OS "Font Book" application and in some other Apple documentation.
    1357  It is NSFont.fontName or the "fontManagerName" string in this for loop:
    1358  for (NSString* fontManagerName in[NSFontManager.sharedFontManager availableFonts])
    1359  {
    1360  ...
    1361  }
    1362  It is the best choice of a string to pass as the "fontWithName" parameter
    1363  in the following call:
    1364  NSFont* apple_font = [NSFont fontWithName : fontName size : pointSize];
    1365  */
    1366  const ON_wString& AppleFontName() const;
    1367 
    1368  /*
    1369  Returns:
    1370  The Apple Font Name.
    1371  Remarks:
    1372  The "Apple Font Name" is sometimes called the PostScript font name in the
    1373  Mac OS "Font Book" application and in some other Apple documentation.
    1374  It is NSFont.fontName or the "fontManagerName" string in this for loop:
    1375  for (NSString* fontManagerName in[NSFontManager.sharedFontManager availableFonts])
    1376  {
    1377  ...
    1378  }
    1379  It is the best choice of a string to pass as the "fontWithName" parameter
    1380  in the following call:
    1381  NSFont* apple_font = [NSFont fontWithName : fontName size : pointSize];
    1382  */
    1383  const wchar_t* AppleFontNameAsPointer() const;
    1384 
    1385  bool SetFromFontDescription(
    1386  const wchar_t* font_description
    1387  );
    1388 
    1389  bool SetFromFontDescription(
    1390  const wchar_t* font_description,
    1391  const wchar_t* apple_font_name
    1392  );
    1393 
    1394  /*
    1395  Description:
    1396  Tests an object to see if its data members are correctly
    1397  initialized.
    1398  Parameters:
    1399  text_log - [in] if the object is not valid and text_log
    1400  is not nullptr, then a brief englis description of the
    1401  reason the object is not valid is appened to the log.
    1402  The information appended to text_log is suitable for
    1403  low-level debugging purposes by programmers and is
    1404  not intended to be useful as a high level user
    1405  interface tool.
    1406  Returns:
    1407  @untitled table
    1408  true object is valid
    1409  false object is invalid, uninitialized, etc.
    1410  */
    1411  bool IsValid( ON_TextLog* text_log = nullptr ) const;
    1412 
    1413  void Dump( ON_TextLog& ) const; // for debugging
    1414 
    1415 
    1416  void DumpFreeType(
    1417  ON_TextLog& text_log
    1418  ) const;
    1419 
    1420  static void DumpFreeTypeFace(
    1421  ON__UINT_PTR free_type_face_ptr,
    1422  ON_TextLog& text_log
    1423  );
    1424 
    1425 #if defined(ON_OS_WINDOWS_GDI)
    1426  static void DumpLogfont(
    1427  const LOGFONT* logfont,
    1428  ON_TextLog& text_log
    1429  );
    1430 #endif
    1431 
    1432 #if defined (ON_RUNTIME_APPLE_OBJECTIVE_C_AVAILABLE)
    1433  static void DumpNSFont(
    1434  NSFont* apple_font,
    1435  ON_TextLog& text_log
    1436  );
    1437 #endif
    1438 
    1439  // serialize definition to binary archive
    1440  bool Write( ON_BinaryArchive& ) const;
    1441 
    1442  // restore definition from binary archive
    1443  bool Read( ON_BinaryArchive& );
    1444 
    1445  // V6 separated the V5 ON_Font into ON_TextStyle and ON_Font.
    1446  bool WriteV5(
    1447  int V5_font_index,
    1448  ON_UUID V5_font_id,
    1450  ) const;
    1451 
    1452  // V6 separated the V5 ON_Font into ON_TextStyle and ON_Font.
    1453  bool ReadV5(
    1454  ON_BinaryArchive&,
    1455  int* V5_font_index,
    1456  ON_UUID* V5_font_id
    1457  );
    1458 
    1459  /*
    1460  Returns:
    1461  0: This is not a managed font.
    1462  1: This is the managed font ON_Font::Default.
    1463  >= 2: This is a managed font other than ON_Font::Default.
    1464  Remark:
    1465  For managed fonts other than ON_Font::Default, the value of RuntimeSerialNumber()
    1466  typically varies between instances of the same application.
    1467  Different platforms and application versions may use different font faces for ON_Font::Default.
    1468  If an ON_Font is a managed font, then RuntimeSerialNumber() and ManagedFontSerialNumber()
    1469  are identical. If an ON_Font is not a managed font, then RuntimeSerialNumber() is zero.
    1470  */
    1471  unsigned int RuntimeSerialNumber() const;
    1472 
    1473  /*
    1474  Description:
    1475  Two ON_Font classes reference the same platform font and create identical glyphs
    1476  if and only if the have the same ManagedFontSerialNumber().
    1477  Returns:
    1478  0: This font is unset.
    1479  >= 1: Serial number of the managed font with the same characteristics.
    1480  Remark:
    1481  For managed fonts other than ON_Font::Default, the value of ManagedFontSerialNumber()
    1482  typically varies between instances of the same application.
    1483  Different platforms and application versions may use different font faces
    1484  for ON_Font::Default.
    1485  If an ON_Font is a managed font, then RuntimeSerialNumber() and ManagedFontSerialNumber()
    1486  are identical. If an ON_Font is not a managed font, then RuntimeSerialNumber() is zero.
    1487  */
    1488  unsigned int ManagedFontSerialNumber() const;
    1489 
    1490  //////////////////////////////////////////////////////////////////////
    1491  //
    1492  // Interface
    1493 
    1494  enum WindowsConstants : unsigned char
    1495  {
    1496  // Values used to set Windows LOGFONT fields.
    1497 #if defined(ON_OS_WINDOWS_GDI)
    1498  logfont_ansi_charset = ANSI_CHARSET,
    1499  logfont_default_charset = DEFAULT_CHARSET, // LOGFONT.lfCharSet
    1500  logfont_symbol_charset = SYMBOL_CHARSET, // LOGFONT.lfCharSet
    1501  logfont_out_precis = OUT_TT_ONLY_PRECIS, // LOGFONT.lfOutPrecision
    1502 
    1503  // 2017-07-27, Brian Gillespie
    1504  // Changed ON_Font::WindowsConstants::logfont_quality from ANTIALIASED_QUALITY to DEFAULT_QUALITY.
    1505  // This makes it so that ON_Font conversion to LOGFONT results in a good-looking font when rendered by MFC.
    1506  // With lfQuality set to ANTIALIASED_QUALITY, the font looks crummy - probably because all the rest of the fonts
    1507  // are being rendered today with CLEARTYPE_QUALITY. Letting Windows decide what to do is probably better.
    1508  logfont_quality = DEFAULT_QUALITY, // LOGFONT.lfQuality
    1509 
    1510  logfont_pitch_and_family = (DEFAULT_PITCH | FF_DONTCARE), // LOGFONT.lfPitchAndFamily
    1511 #else
    1512  // The values below are identical to the ones above and
    1513  // are used to insure code compiles for Apple and other
    1514  // platforms.
    1515  logfont_ansi_charset = 0,
    1516  logfont_default_charset = 1,
    1517  logfont_symbol_charset = 2,
    1518  logfont_out_precis = 7,
    1519  logfont_quality = 4,
    1520  logfont_pitch_and_family = 0
    1521 #endif
    1522  };
    1523 
    1524  /*
    1525  Parameters:
    1526  face_name - [in]
    1527  Returns:
    1528  If the code is running on Windows:
    1529  The appropriate value of LOGFONT.lfCharSet for the input facename.
    1530  If the code is not running on Windows:
    1531  ON_Font::WindowsConstants::logfont_default_charset.
    1532  */
    1533  static unsigned char WindowsLogfontCharSetFromFaceName(
    1534  const wchar_t* face_name
    1535  );
    1536 
    1537  // miscellaneous constants use to initialize Windows LOGFONT fields
    1538  enum Constants: int
    1539  {
    1540  // 1995 - 2015:
    1541  // Windows fonts have variations in glyph size, design and kerning
    1542  // for different point sizes. Text in Rhino is generally
    1543  // placed around geometry and the relative spatial
    1544  // relationships between the text and the geometry must
    1545  // remain constant on all devices and at all "zoom" levels.
    1546  // We have to choose a point size and then apply appropriate
    1547  // scaling during display, printing, and in other rendering
    1548  // calculations. After many experiments and 20 years of commercial use,
    1549  // (1995-2015) we have found 256 works best.
    1550  // This value is used on all platforms because the calculations
    1551  // it is used in occur on all platforms. These calculations must return
    1552  // consistent results so models exchanged between platforms maintain
    1553  // spatial relationships between text and geometry.
    1554  //
    1555  // 2017:
    1556  // (switching to freetype)
    1557  // The value ON_Font::Constants::AnnotationFontCellHeight is used to define
    1558  // "opennurbs normalized font coordinates". The scale
    1559  // ((double)ON_Font::Constants::AnnotationFontCellHeight)/(font definition grid height)
    1560  // is used to convert bounding information and outlines from a native
    1561  // font definition to opennurbs normalized font coordinates.
    1562  // Many TrueType fonts have font definition grid height = 2048.
    1563  // Many PostScript fonts have font definition grid height = 1000.
    1564  AnnotationFontCellHeight = 256, // Windows LOGFONT.lfHeight value (NOT A POINT SIZE)
    1565 
    1566  // This value is used on Apple platforms to get fonts used for rendering annotation.
    1567  // NSFont* apple_font = [NSFont fontWithName : <name> size : ON_Font::Constants::AnnotationFontApplePointSize]
    1568  AnnotationFontApplePointSize = 36,
    1569 
    1570  // ON_Font::Constants::metric_char is the unicode code point value
    1571  // for the glpyh used to calculate critical glyph metrics.
    1572  // It must be an 'I' or 'H', but we have not tested 'H'.
    1573  // There are problems with any other upper case latin letter in common fonts.
    1574  // In particular, the standard 'M' does not work.
    1575  // We have used 'I' for 22 years (1995 - 2017).
    1576  // This value is used on all platforms because the calculations
    1577  // it is used in occur on all platforms. These calculations must return
    1578  // consistent results so models exchanged between platforms maintain
    1579  // spatial relationships between text and geometry.
    1580  MetricsGlyphCodePoint = 'I'
    1581  };
    1582 
    1583  /*
    1584  Description:
    1585  Get a text description of the font.
    1586  Parameters:
    1587  font_description - [out]
    1588  Returns:
    1589  A pointer to the font description string stored in the font_description parameter.
    1590  */
    1591  const ON_wString& FontDescription() const;
    1592 
    1593  /*
    1594  Description:
    1595  Get a text description of the font.
    1596  Parameters:
    1597  font_description - [out]
    1598  Returns:
    1599  A pointer to the font description string stored in the font_description parameter.
    1600  */
    1601  const wchar_t* FontDescriptionAsPointer() const;
    1602 
    1603  ON_DEPRECATED_MSG("Use ON_FontMetrics::DefaultLineFeedRatio")
    1604  double LinefeedRatio() const;
    1605 
    1606  /*
    1607  Returns:
    1608  Normalized font metrics.
    1609 
    1610  Remarks:
    1611  Font metric "normalized" units are comparable between different fonts.
    1612  Normalized font metrics exist so that code that positions glyphs from
    1613  multiple fonts does not have to take the unit system and resolution used
    1614  in the design of each font.
    1615  In opennurbs, much of this code that positions glyphs is located in ON_Annotation,
    1616  ON_TextContent, and ON_TextRun member functions and is used when rendering
    1617  annotation objects.
    1618 
    1619  Fonts can be designed and defined at different resolutions and
    1620  relative scaling is necessary when text contains glyphs from
    1621  fonts desinged at different grid resolutions. For example,
    1622  TrueType font grid with and height is often 1024x1024 or
    1623  2048x2014, OpenType grids are often 1000x1000, and PostScript
    1624  grids are often 1000x1000. Opennurbs "font units" are the units
    1625  the font was designed in.
    1626 
    1627  Long ago, opennurbs and Rhino used only Windows TrueType fonts
    1628  and ran only in Microsoft Windows. During this era,
    1629  the "normalized units" were for a Windows LOGFONT created
    1630  with lfHeight = ON_Font::Constants::AnnotationFontCellHeight.
    1631 
    1632  Currently opennurbs and Rhino work on Microsoft Windows and Apple
    1633  platforms and use FreeType to access font information. When a font
    1634  is not "tricky", the "font design" units are the the units FreeType
    1635  uses when a font is loaded with FT_LOAD_NO_SCALE.
    1636 
    1637  When working with fonts and glyhphs in opennurbs and Rhino,
    1638  SDK users almost always want to use normalized font and glyph metrics.
    1639  */
    1640  const ON_FontMetrics& FontMetrics() const;
    1641 
    1642  /*
    1643  Description:
    1644  This function is for expert users doing something complicated.
    1645  Returns:
    1646  Font metrics read directly from the font definition with no or minimal
    1647  scaling.
    1648  Remarks:
    1649  See ON_Font.FontMetrics() documentation for important information
    1650  about the differnce bewteen normalized and font unit metrics.
    1651  */
    1652  const ON_FontMetrics& FontUnitFontMetrics() const;
    1653 
    1654  /*
    1655  Returns:
    1656  scale to apply when converting from a FT_LOAD_NO_SCALE FreeType
    1657  glyph metric or outline to normalized opennurbs font coordinates.
    1658  */
    1659  double FontUnitToNormalizedScale() const;
    1660 
    1661  /*
    1662  Returns:
    1663  scale to apply when converting from a FT_LOAD_NO_SCALE FreeType
    1664  glyph metric or outline to normalized opennurbs font coordinates.
    1665  */
    1666  double NormalizedToFontUnitScale() const;
    1667 
    1668  /*
    1669  Returns:
    1670  Font character height in points (1 point = 1/72 inch).
    1671 
    1672  See the remarks for a defintion of "character height".
    1673 
    1674  Remarks:
    1675  A "point" is a length unit system.
    1676  1 point = 1/72 inch = 25.4/72 millimeters.
    1677 
    1678  Typically, fonts are designed for maximum clarity when the rendered
    1679  character height is close to PointSize().
    1680 
    1681  font cell height = font ascent + font descent.
    1682 
    1683  font character height = font cell height - font internal leading.
    1684 
    1685  For fonts designed for languages that use latin letters, it is common for
    1686  the character height to be equal to or a little larger than the distance
    1687  from the bottom of a lower case g to the top of an upper case M.
    1688  The character height is also called the "em hieght".
    1689 
    1690  Font internal leading is the space above typical capital latin letters
    1691  that is reseved for diacritical marks like the ring above the A in
    1692  the UNICODE "LATIN LETTER A WITH RING" U+00C5 glyph (Angstrom symbol).
    1693  */
    1694  double PointSize() const;
    1695 
    1696  /*
    1697  Parameters:
    1698  point_size - [in]
    1699  font character height in point units.
    1700 
    1701  Remarks:
    1702  See the remarks section ON_Font::PointSize() for more information
    1703  about point units and character height.
    1704  */
    1705  bool SetPointSize(
    1706  double point_size
    1707  );
    1708 
    1709  bool SetFontFaceName(
    1710  const wchar_t* face_name
    1711  );
    1712  const wchar_t* FontFaceName() const;
    1713 
    1714  ON_Font::Weight FontWeight() const;
    1715 
    1716  int WindowsLogfontWeight() const;
    1717  int AppleWeightOfFont() const;
    1718  double AppleFontWeightTrait() const;
    1719 
    1720  bool SetFontWeight(
    1721  ON_Font::Weight font_weight
    1722  );
    1723 
    1724  bool SetWindowsLogfontWeight(
    1725  int windows_logfont_weight
    1726  );
    1727 
    1728  bool SetAppleWeightOfFont(
    1729  int apple_weight_of_font
    1730  );
    1731 
    1732  bool SetAppleFontWeightTrait(
    1733  double apple_font_weight_trait
    1734  );
    1735 
    1736 private:
    1737  bool Internal_SetFontWeightTrio(
    1738  ON_Font::Weight font_weight,
    1739  int windows_logfont_weight,
    1740  double apple_font_weight_trait,
    1741  bool bUpdateFontDescription
    1742  );
    1743 
    1744 public:
    1745  /*
    1746  Description:
    1747  User interfaces that want to behave as if there are 3 font weights,
    1748  light < normal < < bold, can use the functions
    1749  ON_Font.IsLight(),
    1750  ON_Font.IsNormalWeight(),
    1751  ON_Font.IsBold(),
    1752  to query font weight ranges.
    1753  Returns:
    1754  True if FontWeight() is lighter than ON_Font::Weight::Normal
    1755  */
    1756  bool IsLight() const;
    1757 
    1758  /*
    1759  Description:
    1760  User interfaces that want to behave as if there are 3 font weights,
    1761  light < normal < < bold, can use the functions
    1762  ON_Font.IsLight(),
    1763  ON_Font.IsNormalWeight(),
    1764  ON_Font.IsBold(),
    1765  to query font weight ranges.
    1766  Returns:
    1767  True if FontWeight() is ON_Font::Normal or ON_Font::Weight::Medium
    1768  */
    1769  bool IsNormalWeight() const;
    1770 
    1771  /*
    1772  Description:
    1773  User interfaces that want to behave as if there are 3 font weights,
    1774  light < normal < < bold, can use the functions
    1775  ON_Font.IsLight(),
    1776  ON_Font.IsNormalWeight(),
    1777  ON_Font.IsBold(),
    1778  to query font weight ranges.
    1779  Returns:
    1780  True if heavier than ON_Font::Weight::Medium.
    1781  */
    1782  bool IsBold() const;
    1783 
    1784  ON_Font::Style FontStyle() const;
    1785 
    1786  bool SetFontStyle(
    1787  ON_Font::Style font_style
    1788  );
    1789 
    1790  /*
    1791  Returns:
    1792  true if FontStyle() is ON_Font::Style::Italic.
    1793  false if FontStyle() is ON_Font::Style::Upright or .ON_Font::Style::Oblique.
    1794  */
    1795  bool IsItalic() const;
    1796 
    1797  /*
    1798  Returns:
    1799  true if FontStyle() is ON_Font::Style::Upright.
    1800  false if FontStyle() is ON_Font::Style::Italic or .ON_Font::Style::Oblique.
    1801  */
    1802  bool IsUpright() const;
    1803 
    1804  /*
    1805  Returns:
    1806  true if FontStyle() is ON_Font::Style::Oblique.
    1807  false if FontStyle() is ON_Font::Style::Upright or .ON_Font::Style::Italic.
    1808  */
    1809  bool IsOblique();
    1810 
    1811 
    1812  ON_Font::Stretch FontStretch() const;
    1813 
    1814  bool SetFontStretch(
    1815  ON_Font::Stretch font_stretch
    1816  );
    1817 
    1818  bool IsUnderlined() const;
    1819  bool SetUnderlined(
    1820  bool bUnderlined
    1821  );
    1822 
    1823  bool IsStrikethrough() const;
    1824  bool SetStrikethrough(
    1825  bool bStrikethrough
    1826  );
    1827 
    1828  unsigned char LogfontCharSet() const;
    1829 
    1830  bool SetLogfontCharSet(
    1831  unsigned char logfont_charset
    1832  );
    1833 
    1834  ON_DEPRECATED_MSG("Use FontMetrics().AscentOfI()")
    1835  int HeightOfI() const;
    1836 
    1837  ON_DEPRECATED_MSG("Use FontMetrics().LineSpace()")
    1838  int HeightOfLinefeed() const;
    1839 
    1840  ON_DEPRECATED_MSG("Use FontMetrics().GlyphScale()")
    1841  double HeightScale(double text_height) const;
    1842 
    1843  ON_DEPRECATED_MSG("Use FontMetrics().StrikeoutThickness()")
    1844  int GetStrikeoutSize() const;
    1845 
    1846  ON_DEPRECATED_MSG("Use FontMetrics().StrikeoutPosition()")
    1847  int GetStrikeoutPosition() const;
    1848 
    1849  ON_DEPRECATED_MSG("Use FontMetrics().UnderscoreThickness()")
    1850  int GetUnderscoreSize() const;
    1851 
    1852 
    1853  ON_DEPRECATED_MSG("Use FontMetrics().UnderscorePosition()")
    1854  int GetUnderscorePosition() const;
    1855 
    1856  /*
    1857  Returns:
    1858  A SHA-1 hash of all font characteristics, including platform specific settings.
    1859  Two fonts have identical font characteristics, if and only if they have identical
    1860  FontCharacteristicsHash() values.
    1861 
    1862  Example:
    1863  ON_Font f1 = ...
    1864  ON_Font f2 = ...
    1865  if ( f1.FontCharacteristicsHash() == f2.FontCharacteristicsHash() )
    1866  {
    1867  // f1 and f2 have identical font characteristics
    1868  }
    1869  else
    1870  {
    1871  // f1 and f2 have different font characteristics
    1872  }
    1873  */
    1874  const class ON_SHA1_Hash& FontCharacteristicsHash() const;
    1875 
    1876 private:
    1877 
    1878 public:
    1879 
    1880  /*
    1881  Description:
    1882  Compares the font weight, style, stretch, underline, strikethrough, linefeed_ratio,
    1883  facename, point size, and platform specific characteristics.
    1884  Returns:
    1885  -1: a characteristics < b characteristics
    1886  0: a characteristics = b characteristics
    1887  +1: a characteristics > b characteristics
    1888  Remarks:
    1889  This is a legacy function and to preserve past behavior, some platform specific
    1890  characteristics are not checked.
    1891  Use FontCharacteristicsHash() when every characteristic needs to be compared.
    1892  */
    1893  static int CompareFontCharacteristics(
    1894  const ON_Font& a,
    1895  const ON_Font& b
    1896  );
    1897 
    1898  /*
    1899  Description:
    1900  Compares the font weight, style, stretch, underline, strikethrough, linefeed_ratio,
    1901  facename, and point size characteristics.
    1902 
    1903  Does not compare platform specific characteristics like m_logfont_charset or m_apple_font_name.
    1904  Returns:
    1905  -1: a characteristics < b characteristics
    1906  0: a characteristics = b characteristics
    1907  +1: a characteristics > b characteristics
    1908  Remarks:
    1909  This is a legacy function and to preserve past behavior, some platform specific
    1910  characteristics are not checked.
    1911  Use FontCharacteristicsHash() when every characteristic needs to be compared.
    1912  */
    1913  static int ComparePlatformIndependentFontCharacteristics(
    1914  const ON_Font& a,
    1915  const ON_Font& b
    1916  );
    1917 
    1918  /*
    1919  Description:
    1920  Compares the font weight, style, stretch, underline, strikethrough, linefeed_ratio
    1921  and facename characteristics.
    1922  Returns:
    1923  0 == ON_Font::CompareFontCharacteristics(a,b).
    1924  Remarks:
    1925  This is a legacy function and to preserve past behavior, some platform specific
    1926  characteristics are not checked.
    1927  Use FontCharacteristicsHash() when every characteristic needs to be compared.
    1928  */
    1929  static bool EqualFontCharacteristics(
    1930  const ON_Font& a,
    1931  const ON_Font& b
    1932  );
    1933 
    1934 private:
    1935  friend class ON_ManagedFonts;
    1936 
    1937  //////////////////////////////////////////////////////////////////////////////////
    1938  //
    1939  // The "font glpyh definition" parameters completely determine the appearance
    1940  // of font glyphs.
    1941  //
    1942  // If all "font glpyh definition" parameters have identical values,
    1943  // text rendered using those fonts will look identical.
    1944  //
    1945  // If two fonts have a "font glpyh definition" parameter with different values,
    1946  // text rendered using those fonts will not look identical.
    1947  //
    1948  // BEGIN "font glpyh definition" parameters:
    1949  //
    1950 
    1951  // The font ON_Font::Default has m_runtime_serial_number = 1.
    1952  // Managed fonts have m_runtime_serial_number >= 1.
    1953  // Unmanaged fonts have m_runtime_serial_number = 0;
    1954  static unsigned int __runtime_serial_number_generator;
    1955  const unsigned int m_runtime_serial_number = 0;
    1956 
    1957  int m_windows_logfont_weight = 400; // 100 <= m_windows_logfont_weight <= 1000
    1958  double m_point_size = 0.0;
    1959  double m_apple_font_weight_trait = 0.0; // = Apple NSFontWeightTrait value -1.0 <= m_apple_font_weight < 1.0, 0.0 = "normal"
    1960  ON_Font::Weight m_font_weight = ON_Font::Weight::Normal;
    1961 
    1962  ON_Font::Style m_font_style = ON_Font::Style::Upright; // m_font_style corresponds to Windows LOGFONT.lfItalic field
    1963  ON_Font::Stretch m_font_stretch = ON_Font::Stretch::Medium;
    1964  bool m_font_bUnderlined = false; // Same as Windows LOGFONT.lfUnderlined
    1965  bool m_font_bStrikethrough = false; // Same as Windows LOGFONT.lfStrikeOut
    1966  unsigned char m_logfont_charset = ON_Font::WindowsConstants::logfont_default_charset;
    1967 
    1968 private:
    1969  unsigned char m_reserved_char1 = 0;
    1970 
    1971 private:
    1972  // If m_bCompleteLOGFONT is true, then the m_LOGFONT_* values are set.
    1973  // If m_bCompleteLOGFONT is false, then the m_LOGFONT_* values are undefined and must be ignored.
    1974  /*
    1975  unsigned char m_bCompleteLOGFONT = 0;
    1976  unsigned char m_LOGFONT_lfClipPrecision = 0;
    1977  unsigned char m_LOGFONT_lfQuality = 0;
    1978  unsigned char m_LOGFONT_lfPitchAndFamily = 0;
    1979  unsigned char m_LOGFONT_lfOutPrecision = 0;
    1980  int m_LOGFONT_lfHeight = 0;
    1981  int m_LOGFONT_lfWidth = 0;
    1982  int m_LOGFONT_lfEscapement = 0;
    1983  int m_LOGFONT_lfOrientation = 0;
    1984  */
    1985 
    1986 private:
    1987  enum : int
    1988  {
    1989  face_name_capacity = 32
    1990  };
    1991  // https://en.wikipedia.org/wiki/List_of_typefaces_included_with_Microsoft_Windows
    1992  wchar_t m_face_name[ON_Font::face_name_capacity+2]; // same as Windows LOGFONT.lfFaceName
    1993 
    1994  // If m_linefeed_ratio needs to become a variable or variables are required for tracking or stretch,
    1995  // these fields will be used.
    1996  double m_reserved_double_0 = 0.0;
    1997  double m_reserved_double_1 = 0.0;
    1998  //
    1999  // END "font glpyh definition" parameters:
    2000  //
    2001  //////////////////////////////////////////////////////////////////////////////////
    2002 
    2003 private:
    2004  // https://support.apple.com/en-us/HT201375
    2005  // https://en.wikipedia.org/wiki/List_of_typefaces_included_with_OS_X
    2006  ON_wString m_apple_font_name;
    2007 
    2008 private:
    2009  ON_wString m_font_description;
    2010 
    2011 private:
    2012  // A sha1 hash of all font characteristics.
    2013  // This value is set using lazy evaluation.
    2014  // A zero digest indicates it is not set.
    2015  mutable ON_SHA1_Hash m_font_characteristics_hash;
    2016 
    2017 private:
    2018  bool ModificationPermitted(
    2019  const char* function_name,
    2020  const char* file_name,
    2021  int line_number
    2022  ) const;
    2023 
    2024 private:
    2025  void Internal_SetFontDescription();
    2026 
    2027 
    2028 private:
    2029  //////////////////////////////////////////////////////////////////////////////////
    2030  //
    2031  // BEGIN global font glyph cache interface
    2032  //
    2033  // There is a single font glyph cache for each managed font.
    2034  // Fonts that are not managed use a glyph cache from a managed font.
    2035  // This make functions like ON_Font.FindGlyph() efficient and reliable.
    2036  //
    2037  void DestroyFontGlyphCache();
    2038  class ON_FontGlyphCache* FontGlyphCache(
    2039  bool bCreateIfMissing
    2040  ) const;
    2041 #pragma ON_PRAGMA_WARNING_PUSH
    2042 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    2043  // C4251: '...std::shared_ptr<class ON_FontGlyphCache>...'
    2044  // needs to have dll-interface to be used by clients of class 'ON_Font'
    2045  // m_font_glyph_cache is private and all code that manages m_font_glyph_cache is explicitly implemented in the DLL.
    2046 private:
    2047  mutable std::shared_ptr<class ON_FontGlyphCache> m_font_glyph_cache;
    2048 #pragma ON_PRAGMA_WARNING_POP
    2049  //
    2050  // END global font cache interface
    2051  //
    2052  //////////////////////////////////////////////////////////////////////////////////
    2053 
    2054 private:
    2055  // Only managed fonts have a non-null m_free_type_face face.
    2056  mutable class ON_FreeTypeFace* m_free_type_face = nullptr;
    2057 
    2058 private:
    2059  ON__UINT_PTR m_reserved_ptr = 0;
    2060 
    2061 public:
    2062  // Returns free type glyph index (or nonzero equivalent) if glyph is defined fo the glyph.CodePoint() in glyph.Font()
    2063  // and glyph_box is set.
    2064  typedef ON__UINT_PTR (*ON_GetGlyphMetricsFuncType)(
    2065  const class ON_Font* font,
    2066  ON__UINT32 unicode_code_point,
    2067  class ON_TextBox& font_unit_glyph_box
    2068  );
    2069 
    2070  typedef void (*ON_GetFontMetricsFuncType)(
    2071  const ON_Font* font,
    2072  ON_FontMetrics& font_unit_font_metrics
    2073  );
    2074 
    2075  static void SetCustomMeasurementFunctions(
    2076  ON_GetGlyphMetricsFuncType measureGlyphFunc,
    2077  ON_GetFontMetricsFuncType metricsFunction
    2078  );
    2079 
    2080 private:
    2081  static ON_GetGlyphMetricsFuncType Internal_CustomGetGlyphMetricsFunc;
    2082  static ON_GetFontMetricsFuncType Internal_CustomGetFontMetricsFunc;
    2083 
    2084 public:
    2085  static void GetRunBounds(
    2086  const ON_Font& font,
    2087  const wchar_t* text,
    2088  double fontSizePixels,
    2089  ON::TextHorizontalAlignment horizontalAlignment,
    2090  ON::TextVerticalAlignment verticalAlignment,
    2091  ON_2dPoint& boundsMin,
    2092  ON_2dPoint& boundsMax,
    2093  int& lineCount
    2094  );
    2095 };
    2096 
    2097 class ON_CLASS ON_TextBox
    2098 {
    2099 public:
    2100  ON_TextBox() = default;
    2101  ~ON_TextBox() = default;
    2102  ON_TextBox(const ON_TextBox&) = default;
    2103  ON_TextBox& operator=(const ON_TextBox&) = default;
    2104 
    2105  ON_TextBox(
    2106  ON_2dPoint bbmin,
    2107  ON_2dPoint bbmax
    2108  );
    2109 
    2110  /*
    2111  Returns:
    2112  true if bounding box is set.
    2113  */
    2114  bool IsSet() const;
    2115 
    2116  static const ON_TextBox Scale(
    2117  const ON_TextBox& text_box,
    2118  double scale
    2119  );
    2120 
    2121  /*
    2122  Returns:
    2123  A text box with m_bbmin, m_bbmax, m_max_basepoint are translated by delta.
    2124  m_advance is not changed.
    2125  */
    2126  static const ON_TextBox Translate(
    2127  const ON_TextBox& text_box,
    2128  const ON_2dVector& delta
    2129  );
    2130 
    2131  static const ON_TextBox Translate(
    2132  const ON_TextBox& text_box,
    2133  const ON_2dex& delta
    2134  );
    2135 
    2136  /*
    2137  Parameters:
    2138  lhs - [in]
    2139  lhs.m_advance is ignored
    2140  rhs - [in]
    2141  rhs.m_advance is ignored
    2142  Returns:
    2143  Returned m_bbmin, m_bbmax, m_max_basepoint are the union of the lhs and rhs bounding box.
    2144  Returned m_advance = (0,0)
    2145  */
    2146  static const ON_TextBox Union(
    2147  const ON_TextBox& lhs,
    2148  const ON_TextBox& rhs
    2149  );
    2150 
    2151 public:
    2152  static const ON_TextBox Unset;
    2153 
    2154 public:
    2155  // Default units are with respect to a LOGFONT height = ON_Font::Constants::AnnotationFontCellHeight.
    2156  // and (0,0) is the font glyph base point.
    2157  //
    2158  // Application of a Scale or Translate will change distance units and base point.
    2159  //
    2160 
    2161  // Tight bounding box of the rendered glyphs.
    2162  ON_2dex m_bbmin = ON_2dex::Unset;
    2163  ON_2dex m_bbmax = ON_2dex::Unset;
    2164 
    2165  // m_max_basepoint.i = maximum horizontal delta in any line. Increases to the right, decreases to the left.
    2166  // m_max_basepoint.i = vertical delta to basline of bottom line. Increases upward, decreases downward.
    2167  ON_2dex m_max_basepoint = ON_2dex::Zero;
    2168 
    2169  // m_advance is a vector that specifies where the basepoint should be moved
    2170  // to after the text is rendered. m_advance.i and m_advance.j are is always >= 0.
    2171  // When glyphs are rendered right to left (Arabic and Hebrew being examples)
    2172  // or bottom to top, the rendering code must apply the correct sign. One reason
    2173  // is that Arabic and Hebrew text can be mixed with latin and Cyrillic text
    2174  // and text rendering is much more complicated than a signed advance can handle.
    2175  // Another is that the sign of y associated with "up" is sometimes positive and sometimes negative.
    2176  // ON_TextBox::Translate does not modify the vector m_advance.
    2177  // ON_TextBox::Union ignored input advance values and returns a box with advance = (0,0).
    2178  // 0 <= m_advance.i will be <= m_max_basepoint.i.
    2179  ON_2dex m_advance = ON_2dex::Zero;
    2180 };
    2181 
    2183 {
    2184 public:
    2185  ON_FontGlyphOutlinePoint() = default;
    2186  ~ON_FontGlyphOutlinePoint() = default;
    2188  ON_FontGlyphOutlinePoint& operator= (const ON_FontGlyphOutlinePoint&) = default;
    2189 public:
    2190  enum class ContourPointType : ON__UINT8
    2191  {
    2192  Unset = 0,
    2193  MoveTo = 1,
    2194  LineTo = 2,
    2195 
    2196  // quadratic bezier (degree=2, order=3) control point.
    2197  QuadraticBezierPoint = 3,
    2198 
    2199  // cubic bezier (degree=3, order=4) control point.
    2200  CubicBezierPoint = 4,
    2201 
    2202  // a line segment added to close an open contour.
    2203  // This is common. It does not indicate the glyph is a single stroke glyph.
    2204  LineToCloseContour = 5
    2205  };
    2206 
    2207  static ON_FontGlyphOutlinePoint::ContourPointType ContourPointTypeFromUnsigned(unsigned contour_point_type_as_unsigned);
    2208 
    2210 
    2211 public:
    2212  ON_FontGlyphOutlinePoint::ContourPointType m_point_type = ContourPointType::Unset;
    2213  ON__UINT8 m_bToPoint = 0; // 1 if the point is a move to, line to, or the start or end of a bezier segment.
    2214  // 0 otherwise
    2215  ON__UINT16 m_contour_index = 0; // 0 = unset. The first contour has m_contour_index = 1.
    2217 };
    2218 
    2219 
    2220 /*
    2221  The best way to get a useful ON_FontGlyph is to call
    2222  ON_Font.CodePointGlyph(unicode_code_point)
    2223 */
    2224 class ON_CLASS ON_FontGlyph
    2225 {
    2226 public:
    2227  /*
    2228  The best way to get a useful ON_FontGlyph is to call
    2229  ON_Font.CodePointGlyph(unicode_code_point)
    2230  */
    2231  ON_FontGlyph() = default;
    2232  ~ON_FontGlyph() = default;
    2233  ON_FontGlyph(const ON_FontGlyph& src);
    2234  ON_FontGlyph& operator=(const ON_FontGlyph& src);
    2235 
    2236 
    2237  /*
    2238  If the font and code point are valid, constructs an unmanaged
    2239  glyph with the specified font and code point.
    2240  The glyph box is not set.
    2241  */
    2242  ON_FontGlyph(
    2243  const ON_Font* font,
    2244  ON__UINT32 code_point
    2245  );
    2246 
    2247 public:
    2248  static const ON_FontGlyph Unset;
    2249 
    2250  const ON_Font* Font() const;
    2251 
    2252  const ON__UINT32 CodePoint() const;
    2253 
    2254  bool IsEndOfLineCodePoint() const;
    2255 
    2256  static bool IsEndOfLineCodePoint(
    2257  ON__UINT32 unicode_code_point
    2258  );
    2259 
    2260  static bool IsCarriageReturnAndLineFeed(
    2261  ON__UINT32 unicode_code_point,
    2262  ON__UINT32 next_unicode_code_point
    2263  );
    2264 
    2265  /*
    2266  Returns:
    2267  Glyph box in opennurbs normalized font coordinates.
    2268  */
    2269  const ON_TextBox& GlyphBox() const;
    2270 
    2271  /*
    2272  Returns:
    2273  Font unit glyph box.
    2274  Remarks:
    2275  Must be used with ON_Font::FontUnitFontMetrics() and a single font to obtain useful results.
    2276  You are probably better of using normalized font coordinates in a ON_FontGlyph.GlyphBox().
    2277  */
    2278  const ON_TextBox& FontUnitGlyphBox() const;
    2279 
    2280  static int CompareCodePointAndFont(
    2281  const ON_FontGlyph& lhs,
    2282  const ON_FontGlyph& rhs
    2283  );
    2284 
    2285  /*
    2286  Parameters:
    2287  text - [in]
    2288  Null terminated wchar_t string.
    2289  font - [in]
    2290  The font used to render the glyphs.
    2291  unicode_CRLF_code_point - [in]
    2292  If unicode_CRLF_code_point is a valid unicode code point,
    2293  then consecutive carriage return line feed pairs are converted
    2294  to a single glyph with code point = unicode_CRLF_code_point.
    2295 
    2296  ON_UnicodeCodePoint::ON_LineSeparator is a good choice when you want to
    2297  condense carriage return line feed pairs to a single unambiguous code point.
    2298 
    2299  ON_UnicodeCodePoint::ON_InvalidCodePoint is a good choice when you want to
    2300  preserve carriage return line feed pairs as two separate glyphs.
    2301 
    2302  glyph_list - [out]
    2303  Note that glyph_list.Count() is often different than the
    2304  length of the text string or the number of unicode codepoints
    2305  in the decoded text.
    2306  Adjacent carriage return and line feed codepoints are
    2307  converted to single a hard end of line.
    2308  All trailing end of line code points are removed from text.
    2309  Invalid unicode encoding sequences are replaced with
    2310  ON_UnicodeCodePoint::ReplacementCharacter glyphs.
    2311 
    2312  text_box - [out]
    2313  tight bounding boxt of text extents.
    2314  text_box.m_advance.i = maximum of all line horizontal advance values..
    2315  text_box.m_advance.j = vertical advance to baseline of last line
    2316  If if the font height
    2317  is ON_Font::Constants::AnnotationFontCellHeight. If you will render the font
    2318  at a different height from ON_Font::Constants::AnnotationFontCellHeight, then
    2319  use ON_TextBox::Scale as follows:
    2320  ON_TextBox scaled_box
    2321  = ON_TextBox::Scale(
    2322  text_box,
    2323  (font render height)/((double)ON_Font::Constants::AnnotationFontCellHeight)
    2324  );
    2325  Return:
    2326  number of lines of text or 0 if input is not valid or text is empty.
    2327  */
    2328  static int GetGlyphList
    2329  (
    2330  const wchar_t* text,
    2331  const ON_Font* font,
    2332  ON__UINT32 unicode_CRLF_code_point,
    2334  ON_TextBox& text_box
    2335  );
    2336 
    2337  static int GetGlyphList
    2338  (
    2339  size_t code_point_count,
    2340  ON__UINT32* code_points,
    2341  const ON_Font* font,
    2342  ON__UINT32 unicode_CRLF_code_point,
    2344  ON_TextBox& text_box
    2345  );
    2346 
    2347  /*
    2348  Parameters:
    2349  font - [in]
    2350  The font used to render the glyphs.
    2351  text_box - [out]
    2352  tight bounding boxt of text extents.
    2353  text_box.m_advance.i = maximum of all line horizontal advance values..
    2354  text_box.m_advance.j = vertical advance to baseline of last line
    2355  If if the font height
    2356  is ON_Font::Constants::AnnotationFontCellHeight. If you will render the font
    2357  at a different height from ON_Font::Constants::AnnotationFontCellHeight, then
    2358  use ON_TextBox::Scale as follows:
    2359  ON_TextBox scaled_box
    2360  = ON_TextBox::Scale(
    2361  text_box,
    2362  (font render height)/((double)ON_Font::Constants::AnnotationFontCellHeight)
    2363  );
    2364  Return:
    2365  number of lines of text or 0 if input is not valid or text is empty.
    2366  */
    2367  static int GetGlyphListBoundingBox
    2368  (
    2369  const wchar_t* text,
    2370  const ON_Font* font,
    2371  ON_TextBox& text_box
    2372  );
    2373 
    2374  static int GetGlyphListBoundingBox
    2375  (
    2376  size_t code_point_count,
    2377  ON__UINT32* code_points,
    2378  const ON_Font* font,
    2379  ON_TextBox& text_box
    2380  );
    2381 
    2382  /*
    2383  Description:
    2384  Sets the font and code point and unsets every other property including the
    2385  glyph box and substitute information.
    2386  Parameters:
    2387  font - [in]
    2388  code_point - [in]
    2389  */
    2390  bool SetCodePoint(
    2391  const ON_Font* font,
    2392  ON__UINT32 code_point
    2393  );
    2394 
    2395  /*
    2396  Returns:
    2397  True if the unicode code point and font are set
    2398  */
    2399  bool CodePointIsSet() const;
    2400 
    2401  /*
    2402  Returns:
    2403  true if this is a managed instance.
    2404  Managed instances persist for the lifetime of the application
    2405  and the pointer can be safely saved and referenced at any time.
    2406  */
    2407  bool IsManaged() const;
    2408 
    2409  /*
    2410  Returns:
    2411  If this->CodePointIsSet() is true, then a persistent pointer
    2412  to a managed glyph with the same code point and font is returned.
    2413  Otherwise nullptr is returned.
    2414  */
    2415  const ON_FontGlyph* ManagedGlyph() const;
    2416 
    2417  /*
    2418  Parameters:
    2419  bUseReplacementCharacter - [in]
    2420  When this->CodePointIsSet() is true,
    2421  and bUseReplacementCharacter is true,
    2422  and no reasonable glyph definition exists,
    2423  and no substitued is available,
    2424  then the replacement character glyph for UNICODE code point
    2425  ON_UnicodeCodePoint::ON_ReplacementCharacter (U+FFFD) will be returned.
    2426 
    2427  Returns:
    2428  A managed glyph that can be used to render "this".
    2429  If this->CodePointIsSet() is false, nullptr is returned.
    2430  If this->CodePointIsSet() is true, the returned glyph may
    2431  have a different font and code point when the current
    2432  computer requires font or glyph substitution to draw
    2433  the glyph. When the current platform cannot render this,
    2434  nullptr or the replacement glyph is returned depending on
    2435  the value of bUseReplacementCharacter.
    2436 
    2437  See Also:
    2438  ON_FontGlyph.SubstituteGlyph().
    2439  */
    2440  const ON_FontGlyph* RenderGlyph(
    2441  bool bUseReplacementCharacter
    2442  ) const;
    2443 
    2444  /*
    2445  Returns:
    2446  If this is a managed glyph or a copy of a managed glyph,
    2447  and a substitute font or code point is used to render the glyph,
    2448  then the substitue is returned.
    2449  In all other cases, nullptr is returned.
    2450  See Also:
    2451  ON_FontGlyph.RenderGlyph().
    2452  */
    2453  const ON_FontGlyph* SubstituteGlyph() const;
    2454 
    2455  /*
    2456  Parameters:
    2457  bIncludeCharMaps - [in]
    2458  If true, then char information is printed.
    2459  */
    2460  void Dump(
    2461  bool bIncludeCharMaps,
    2462  ON_TextLog& text_log
    2463  ) const;
    2464 
    2465  /*
    2466  Description:
    2467  This is a debugging tool to test the code that starts with a font and
    2468  Unicode code point and and finds a glyph in the font definition for
    2469  that code point.
    2470  Parameters:
    2471  text_log - [in]
    2472  If text_log is not nullptr, then diagnostic messages are sent to this log.
    2473  Returns:
    2474  True:
    2475  No errors were found. Every available charmap either returned the same glyph id
    2476  that FontGlyphId() function returns or had no glyph id for this code point.
    2477  False:
    2478  Inconsistent results were returned from different charmaps.
    2479  Remarks:
    2480  If a font or charmap is known to contain a bug and that bug is
    2481  handled by opennurbs, then true is returned and a message is printed
    2482  to the log.
    2483  */
    2484  bool TestFaceCharMaps(
    2485  ON_TextLog* text_log
    2486  ) const;
    2487 
    2488 public:
    2489 
    2490  const ON__UINT_PTR FreeTypeFace() const;
    2491 
    2492  /*
    2493  Returns:
    2494  Font glyph id.
    2495  Remarks:
    2496  The glyph id depends on the font and is assigned by the font designer.
    2497  In particular the font glyph id for the same Unicode code point
    2498  often varies from font to font. In a font, it is often the case that
    2499  multiple Unicode code points map to the same glyph. For example,
    2500  space an non-breaking space typically map to the same font glyph id.
    2501  */
    2502  const ON__UINT_PTR FontGlyphId() const;
    2503 
    2504  /*
    2505  Description:
    2506  Get glyph contours as NURBS curves.
    2507  Parameters:
    2508  bSingleStrokeFont - [in]
    2509  If true, open contours will not be closed by adding a line segment.
    2510  text_height - [in]
    2511  If > 0, ouptut curves, bounding box, and advance vector are scaled
    2512  so that a capital latin letter I would have a height of text_height.
    2513  Otherwise, no scaling is applied to the output curves, bounding box,
    2514  and advance vector.
    2515  Pass 0.0 or in this->Font()->HeightOfI() to get the contours to be in opennurbs
    2516  normalized font coordinates.
    2517  Pass ON_UNSET_VALUE to get the contours to be in native font definition units.
    2518  All other values < 0 are treated as 0.0.
    2519  glyph_contours - [out]
    2520  glyph_bbox - [out]
    2521  glyph bounding box.
    2522  glyph_advance - [out]
    2523  glyph_advance->x = horizontal advance to apply when rendering glyphs horizontally.
    2524  A positive horizontal advance indicates advance to the right.
    2525  glyph_advance->y = vertical advance to apply when rendering glyphs vertically.
    2526  A positive vertical advance indicates advance downwards.
    2527  */
    2528  bool GetGlyphContours(
    2529  bool bSingleStrokeFont,
    2530  double text_height,
    2531  ON_ClassArray< ON_SimpleArray< ON_Curve* > >& glyph_contours,
    2532  ON_BoundingBox* glyph_bbox,
    2533  ON_3dVector* glyph_advance
    2534  ) const;
    2535 
    2536  static bool GetStringContours(
    2537  const wchar_t* text_string,
    2538  const ON_Font* font,
    2539  bool bSingleStrokeFont,
    2540  double text_height,
    2541  double small_caps_scale,
    2543  );
    2544 
    2545 
    2546 private:
    2547  friend class ON_GlyphMap;
    2548  friend class ON_Font;
    2549 
    2550  // NOTE WELL:
    2551  // The offset of m_codepoint in ON_FontGlyph must be >= 8 bytes.
    2552  // so the ON_FixeSizePool that manages memory for the glyph cache
    2553  // can efficiently iteratate all active managed glyphs.
    2554  //
    2555  ON_TextBox m_font_unit_glyph_bbox; // values in the native font definition units (freetype FT_LOAD_NO_SCALE units)
    2556  ON_TextBox m_normalized_glyph_bbox; // bounding box in opennurbs normalized font coordinates
    2557 
    2558  // This box is for the platform native glyph. It can be different than m_glyph_box.
    2559  // Example:
    2560  // Start with a Windows LOGFONT with face = Arial, height = ON_Font::Constants::AnnotationFontCellHeight (256)
    2561  // Native Windows height of Arial I = 165, height of LF = ...
    2562  // FreeType made from the same LOGFONT on the same has height of Arial I = 184, height of LF = ...
    2563 
    2564  // When font does not contain a glyph to render a specified unicode codepoint,
    2565  // then one or more glyphs from one or more subsitution fonts are used to
    2566  // render the codepoint. In this case, m_substitutes points to a linked
    2567  // list of substitute used to render the glyph.
    2568  //
    2569  ON__UINT32 m_code_point = ON_UnicodeCodePoint::ON_InvalidCodePoint;
    2570 
    2571  ON__UINT8 m_is_managed = 0; // 1 = managed glyph
    2572  ON__UINT8 m_reserved1 = 0;
    2573  ON__UINT16 m_reserved2 = 0;
    2574  ON__UINT_PTR m_font_glyph_id = 0;
    2575  const class ON_Font* m_managed_font = nullptr;
    2576  const class ON_FontGlyph* m_substitute = nullptr;
    2577 
    2578 
    2579 private:
    2580  void Internal_SetFontGlyphId(ON__UINT_PTR font_glyph_id);
    2581  void Internal_CopyFrom(const ON_FontGlyph& src);
    2582  static ON_FontGlyph* Internal_AllocateManagedGlyph(const ON_FontGlyph& src);
    2583  bool Internal_GetPlatformSubstitute(
    2584  ON_FontGlyph& substitue
    2585  ) const;
    2586 };
    2587 
    2588 
    2589 #if defined(ON_RUNTIME_WIN)
    2590 
    2591 /*
    2592 Remarks:
    2593  Windows GDI functions used by ON_WindowsMeasureGlyph fail when the
    2594  UTF-16 encoding of unicode_code_point requires a surrogate pair.
    2595 */
    2596 ON_DECL
    2597 bool ON_WindowsGetGlyphMetrics(
    2598  const ON_Font* font,
    2599  ON__UINT32 unicode_code_point,
    2600  class ON_TextBox& font_unit_glyph_box
    2601 );
    2602 
    2603 
    2604 
    2605 #endif
    2606 
    2607 
    2608 #if defined(ON_DLL_TEMPLATE)
    2609 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Font*>;
    2610 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_Font*>;
    2611 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Font>;
    2612 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_FontGlyph*>;
    2613 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_FontGlyph*>;
    2614 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_FontGlyph>;
    2615 #endif
    2616 
    2617 #endif
    2618 
    2619 
    Constants
    miscellaneous constants use to initialize Windows LOGFONT fields
    Definition: opennurbs_font.h:1538
    -
    friend class ON_Font
    Definition: opennurbs_font.h:2548
    +
    1 //
    2 // Copyright (c) 1993-2015 Robert McNeel & Associates. All rights reserved.
    3 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    4 // McNeel & Associates.
    5 //
    6 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    7 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    8 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    9 //
    10 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    11 //
    12 ////////////////////////////////////////////////////////////////
    13 
    14 
    15 #if !defined(OPENNURBS_FONT_INC_)
    16 #define OPENNURBS_FONT_INC_
    17 
    18 class ON_CLASS ON_FontMetrics
    19 {
    20 public:
    21  ON_FontMetrics() = default;
    22  ~ON_FontMetrics() = default;
    23  ON_FontMetrics(const ON_FontMetrics&) = default;
    24  ON_FontMetrics& operator=(const ON_FontMetrics&) = default;
    25 
    26 
    27 public:
    28  // All properties are zero.
    29  static const ON_FontMetrics Unset;
    30 
    31  /*
    32  ON_FontMetric::DefaultLineFeedRatio*ON_FontMetrics().AspectOfI()
    33  can be used to cook up a line space value when using the
    34  ON_FontMetrics.LineSpace() value defined by the font is
    35  not desired.
    36  */
    37  static const double DefaultLineFeedRatio; // 1.6
    38 
    39  // UNICODE code point of the glyph used to determine HeightOfCapital()
    40  // when no reaonable value is available from the font definition.
    41  // Currently this is the 'I' glyph. Opennurbs has used 'I' since 2005.
    42  // It is possible 'H' would work as well. All other glyphs, in
    43  // particular 'M' and 'W', do not work.
    44  static const ON__UINT32 HeightOfCapitalCodePoint; // 'I'
    45 
    46 public:
    47  /*
    48  Returns:
    49  Signed distance from the baseline to highest point on a glyph outline.
    50  Remarks:
    51  If every glyph outline in the font has (0,0) on the basline, then Ascent()
    52  is the maximum glyph bounding box Y.
    53  */
    54  int Ascent() const;
    55 
    56  /*
    57  Returns:
    58  Signed distance from the baseline to lowest point on a glyph outline.
    59  Remarks:
    60  This value is typically negative because glyphs for letters like 'j'
    61  typically have a portion of their outline below the baseline. However,
    62  some fonts have positive descent.
    63  If every glyph outline in the font has (0,0) on the basline, then Ascent()
    64  is the maximum glyph bounding box Y.
    65  */
    66  int Descent() const;
    67 
    68  /*
    69  Returns:
    70  The postive distance to move a base line when moving to a new line of text.
    71 
    72  Remarks:
    73  For almost every font used to render text, LineSpace() > (Ascent() - Descent()).
    74 
    75  This metric is sometimes called "height", but that term is often confused
    76  with (Ascent() - Descent()).
    77 
    78  For fonts designed to render horizontal lines of text, LineSpace() is a
    79  vertical distance. For fonts desingned to render vertical lines of text,
    80  LineSpace() is a horizontal distance. Depending on the context, the
    81  direction to move can be up, down, left or right.
    82  */
    83  int LineSpace() const;
    84 
    85  /*
    86  Returns:
    87  The "units per EM". This is the height and width of the square grid
    88  where the font glyphs are designed.
    89  Remarks:
    90  The width of the 'M' glyph in a font can be different from UPM.
    91  The height of the 'M' glyph in a font is typically less than UPM.
    92  In TrueType fonts, UPM is often a power of two and generally 1024 or 2048.
    93  In OpenType fonts, UPM is often 1000.
    94  In PostScript fonts, UPM is often 1000.
    95  */
    96  int UPM() const;
    97 
    98  /*
    99  Returns:
    100  The signed distance from the baseline to the highest point on the 'I' glyph.
    101  Remarks:
    102  The primary uses of AscentOfI() are:
    103  1)
    104  Calculate a scale factor to produce text with a user specified "text height".
    105  2)
    106  To calculate insertion location for ON::TextVerticalAlignment::Middle
    107  and ON::TextVerticalAlignment::Top.
    108 
    109  Since 2005, opennurbs has used
    110  (user specified text height)/AscentOfI()
    111  as the scale factor to render glyphs when user interface has provided
    112  a "text height" value. Users are more satisfied with this approach
    113  than when the scaling is base on line space or maximum font glyph ascent
    114  values. Experiments have ruled out the use of any other capital latin
    115  letter glyph except 'H' for this use. When a font does not contain an
    116  'I' glyph, a suitable value is returned that can be used for text height
    117  scaling and vertical alignment.
    118  */
    119  int AscentOfI() const;
    120 
    121  /*
    122  Description:
    123  Get the scale to apply to normalized glyph boxes and outlines to
    124  render the 'I' in the glyph's font at a height of text_height.
    125  Parameters:
    126  text_height - [in]
    127  The desired height of typical capital latin letter glyphs.
    128  Returns:
    129  text_height / AscentOfI().
    130  */
    131  double GlyphScale(double text_height) const;
    132 
    133  /*
    134  Returns:
    135  Thickness of strikeout.
    136  Remarks:
    137  The signed distance from the baseline to the bottom of the strikeout
    138  is StrikeoutPosition() - StrikeoutThickness()/2.
    139  */
    140  int StrikeoutThickness() const;
    141 
    142  /*
    143  Returns:
    144  Signed distance from baseline to center of strikeout.
    145  A positive value indicates the strikeout is above the baseline (common).
    146  Remarks:
    147  The signed distance from the baseline to the bottom of the strikeout
    148  is StrikeoutPosition() - StrikeoutThickness()/2.
    149  */
    150  int StrikeoutPosition() const;
    151 
    152 
    153  /*
    154  Returns:
    155  Thickness of underscore
    156  Remarks:
    157  The signed distance from the baseline to the bottom of the underscore
    158  is UnderscorePosition() - UnderscoreThickness()/2.
    159  */
    160  int UnderscoreThickness() const;
    161 
    162  /*
    163  Returns:
    164  Signed distance from baseline to center of underscore.
    165  A negative value indicates the underscore is below the baseline (common).
    166  Remarks:
    167  The signed distance from the baseline to the bottom of the underscore
    168  is UnderscorePosition() - UnderscoreThickness()/2.
    169  */
    170  int UnderscorePosition() const;
    171 
    172  static const ON_FontMetrics Scale(
    173  const ON_FontMetrics& font_metrics,
    174  double scale
    175  );
    176 
    177  void SetHeights(
    178  int ascent,
    179  int descent,
    180  int UPM,
    181  int line_space
    182  );
    183 
    184  bool HeightsAreValid() const;
    185 
    186  void SetAscentOfI(
    187  int ascent_of_I
    188  );
    189 
    190  void SetStrikeout(
    191  int strikeout_position,
    192  int strikeout_thickness
    193  );
    194 
    195  void SetUnderscore(
    196  int underscore_position,
    197  int underscore_thickness
    198  );
    199 
    200 private:
    201  int m_UPM = 0; // units per EM
    202  int m_ascent = 0; // max over all glyphs in font of (highest outline point - baseline point).y
    203  int m_descent = 0; // min over all glyphs in font of (lowest outline point - baseline point).y
    204  int m_line_space = 0; // distance between baselines
    205  int m_ascent_of_I = 0; // (highest 'I' outline point - I baseline point).y
    206 
    207  int m_strikeout_thickness = 0; //
    208  int m_strikeout_position = 0; //
    209 
    210  int m_underscore_thickness = 0; //
    211  int m_underscore_position = 0; //
    212 
    213 private:
    214  int m_reserved1 = 0;
    215  double m_reserved2 = 0.0;
    216  double m_reserved3 = 0.0;
    217  ON__UINT_PTR m_reserved5 = 0;
    218 };
    219 
    220 
    221 /// <summary>
    222 /// An ON_Font is a face in a font family. It corresponds to a Windows LOGFONT,
    223 /// a .NET System.Drawing.Font or a FreeType FT_Face.
    224 /// </summary>
    225 class ON_CLASS ON_Font
    226 {
    227 public:
    228 
    229 #pragma region RH_C_SHARED_ENUM [ON_Font::Weight] [Rhino.DocObjects.Font.FontWeight] [nested:byte]
    230  /// <summary>
    231  /// Weight enum values
    232  /// Avoid casting these values to int.
    233  /// Use ON_Font::WindowsLogfontWeightFromWeight() or
    234  /// ON_Font::AppleWeightOfFontFromWeight() or
    235  /// add another converter.
    236  /// </summary>
    237  enum class Weight : unsigned char
    238  {
    239  /// <summary> Not set. </summary>
    240  Unset = 0,
    241 
    242  /// <summary> IsLight = true </summary>
    243  Thin = 1,
    244 
    245  /// <summary> IsLight = true </summary>
    246  Ultralight = 2,
    247 
    248  //ExtraLight = 2,
    249 
    250  /// <summary> IsLight = true </summary>
    251  Light = 3,
    252 
    253  /// <summary> Default font weight. IsNormalWeight = true Also called Regular.</summary>
    254  Normal = 4,
    255 
    256  //Regular = 4,
    257 
    258  /// <summary> IsNormalWeight = true </summary>
    259  Medium = 5,
    260 
    261  /// <summary> IsBold = true </summary>
    262  Semibold = 6,
    263 
    264  //Demibold = 6,
    265  //Demi = 6,
    266  //Semi = 6,
    267 
    268  /// <summary> IsBold = true </summary>
    269  Bold = 7,
    270 
    271  /// <summary> IsBold = true </summary>
    272  Ultrabold = 8,
    273 
    274  //ExtraBold = 8,
    275 
    276  /// <summary> IsBold = true Also called Black</summary>
    277  Heavy = 9
    278 
    279  //Black = 9,
    280  };
    281 #pragma endregion
    282 
    283  /*
    284  Returns:
    285  -1: weight_a is lighter, weight_b is heavier
    286  +1: weight_a is heavier, weight_b is lighter
    287  0: weight_a = weight_b
    288  */
    289  static int CompareWeight(
    290  ON_Font::Weight weight_a,
    291  ON_Font::Weight weight_b
    292  );
    293 
    294  /*
    295  Description:
    296  In the rare cases when an ON_Font::Weight value must be passed
    297  as an unsigned int, use ON_Font::FontWeightFromUnsigned() to
    298  convert the unsigned value to an ON_Font::Weight value.
    299  Parameters:
    300  unsigned_font_weight - [in]
    301  */
    302  static ON_Font::Weight FontWeightFromUnsigned(
    303  unsigned int unsigned_font_weight
    304  );
    305 
    306  /*
    307  Description:
    308  The correspondence between Windows LOGFONT lfWeight values and
    309  ON_Font::Weight enum values is
    310  ON_Font::Weight::Thin = 100 LOGFONT lfWeight
    311  ON_Font::Weight::Ultralight = 200 LOGFONT lfWeight
    312  ON_Font::Weight::Light = 300 LOGFONT lfWeight
    313  ON_Font::Weight::Normal = 400 LOGFONT lfWeight
    314  ON_Font::Weight::Medium = 500 LOGFONT lfWeight
    315  ON_Font::Weight::Semibold = 600 LOGFONT lfWeight
    316  ON_Font::Weight::Bold = 700 LOGFONT lfWeight
    317  ON_Font::Weight::Ultrabold = 800 LOGFONT lfWeight
    318  ON_Font::Weight::Heavy = 900 LOGFONT lfWeight
    319  Returns:
    320  The Windows LOGFONT lfWeight value that corresponds to the ON_Font::Weight enum value.
    321  */
    322  static int WindowsLogfontWeightFromWeight(
    323  ON_Font::Weight font_weight
    324  );
    325 
    326  /*
    327  Description:
    328  The correspondence between Apple "weight of font" values and
    329  ON_Font::Weight enum values is
    330  ON_Font::Weight::Thin = 1
    331  ON_Font::Weight::Ultralight = 2
    332  ON_Font::Weight::Light = 3
    333  ON_Font::Weight::Normal = 4
    334  ON_Font::Weight::Medium = 5
    335  ON_Font::Weight::Semibold = 6
    336  ON_Font::Weight::Bold = 7
    337  ON_Font::Weight::Ultrabold = 8
    338  ON_Font::Weight::Heavy = 9
    339  Returns:
    340  The Apple "weight of font" value that corresponds to the ON_Font::Weight enum value.
    341  */
    342  static int AppleWeightOfFontFromWeight(
    343  ON_Font::Weight font_weight
    344  );
    345 
    346  /*
    347  Description:
    348  The correspondence between Apple "font weight trait" values and
    349  ON_Font::Weight enum values is
    350  ON_Font::Weight::Thin = -0.4 Apple font weight trait
    351  ON_Font::Weight::Ultralight = -0.2667 Apple font weight trait
    352  ON_Font::Weight::Light = -0.1333 Apple font weight trait
    353  ON_Font::Weight::Normal = 0.0 Apple font weight trait
    354  ON_Font::Weight::Medium = 0.1333 Apple font weight trait
    355  ON_Font::Weight::Semibold = 0.2667 Apple font weight trait
    356  ON_Font::Weight::Bold = 0.4 Apple font weight trait
    357  ON_Font::Weight::Ultrabold = 0.5333 Apple font weight trait
    358  ON_Font::Weight::Heavy = 0.6667 Apple font weight trait
    359  Returns:
    360  The Apple "NSFontWeightTrait" value that corresponds to the ON_Font::Weight enum value.
    361  */
    362  static double AppleFontWeightTraitFromWeight(
    363  ON_Font::Weight font_weight
    364  );
    365 
    366  /*
    367  Description:
    368  The correspondence between Windows LOGFONT lfWeight values and
    369  ON_Font::Weight enum values is
    370 
    371  ON_Font::Weight::Thin = 100
    372  ON_Font::Weight::Ultralight = 200
    373  ON_Font::Weight::Light = 300
    374  ON_Font::Weight::Normal = 400
    375  ON_Font::Weight::Medium = 500
    376  ON_Font::Weight::Semibold = 600
    377  ON_Font::Weight::Bold = 700
    378  ON_Font::Weight::Ultrabold = 800
    379  ON_Font::Weight::Heavy = 900
    380  Returns:
    381  The best ON_Font::Weight enum value for the Windows LOGFONT weight.
    382  */
    383 
    384  static ON_Font::Weight WeightFromWindowsLogfontWeight(
    385  int windows_logfont_weight
    386  );
    387 
    388  /*
    389  Description:
    390  The correspondence between Apple "weight of font" values and
    391  ON_Font::Weight enum values is
    392  ON_Font::Weight::Thin = 1
    393  ON_Font::Weight::Ultralight = 2
    394  ON_Font::Weight::Light = 3
    395  ON_Font::Weight::Normal = 4
    396  ON_Font::Weight::Medium = 5
    397  ON_Font::Weight::Semibold = 6
    398  ON_Font::Weight::Bold = 7
    399  ON_Font::Weight::Ultrabold = 8
    400  ON_Font::Weight::Heavy = 9
    401  Returns:
    402  The best ON_Font::Weight enum value for the Apple weight of font.
    403  */
    404  static ON_Font::Weight WeightFromAppleWeightOfFont(
    405  int apple_weight_of_font
    406  );
    407 
    408  /*
    409  Parameters:
    410  apple_font_weight_trait - [in]
    411  Apple NSFontWeightTrait
    412  The valid value range is from -1.0 to 1.0. The value of 0.0 corresponds to the regular or medium font weight.
    413  */
    414  static ON_Font::Weight WeightFromAppleFontWeightTrait(
    415  double apple_font_weight_trait
    416  );
    417 
    418  static const wchar_t* WeightToWideString(
    419  ON_Font::Weight font_weight
    420  );
    421 
    422 
    423 
    424 #pragma region RH_C_SHARED_ENUM [ON_Font::Stretch] [Rhino.DocObjects.Font.FontStretch] [nested:byte]
    425  /// <summary>
    426  /// Horizontal expansion or contraction of font
    427  /// </summary>
    428  enum class Stretch : unsigned char
    429  {
    430  /// <summary> Not set. </summary>
    431  Unset = 0,
    432  /// <summary> </summary>
    433  Ultracondensed = 1,
    434  /// <summary> </summary>
    435  Extracondensed = 2,
    436  /// <summary> </summary>
    437  Condensed = 3,
    438  /// <summary> </summary>
    439  Semicondensed = 4,
    440 
    441  /// <summary> Default font stretch. </summary>
    442  Medium = 5,
    443 
    444  //Normal = 5,
    445 
    446  /// <summary> </summary>
    447  Semiexpanded = 6,
    448  /// <summary> </summary>
    449  Expanded = 7,
    450  /// <summary> </summary>
    451  Extraexpanded = 8,
    452  /// <summary> </summary>
    453  Ultraexpanded = 9
    454  };
    455 #pragma endregion
    456 
    457  /*
    458  Description:
    459  In the rare cases when an ON_Font::Stretch value must be passed
    460  as an unsigned int, use ON_Font::FontStretchFromUnsigned() to
    461  convert the unsigned value to an ON_Font::Stretch value.
    462  Parameters:
    463  unsigned_font_stretch - [in]
    464  */
    465  static ON_Font::Stretch FontStretchFromUnsigned(
    466  unsigned int unsigned_font_stretch
    467  );
    468 
    469 
    470 #pragma region RH_C_SHARED_ENUM [ON_Font::Style] [Rhino.DocObjects.Font.FontStyle] [nested:byte]
    471  /// <summary>
    472  /// Vertical angle of font
    473  /// Upright, Italic, or Oblique
    474  /// </summary>
    475  enum class Style : unsigned char
    476  {
    477  /// <summary> Not set. </summary>
    478  Unset = 0,
    479 
    480  /// <summary> Default font style. </summary>
    481  Upright = 1,
    482 
    483  //Normal = 1,
    484  //Roman = 1,
    485 
    486  /// <summary> </summary>
    487  Italic = 2,
    488 
    489  /// <summary> </summary>
    490  Oblique = 3
    491  };
    492 #pragma endregion
    493 
    494  /*
    495  Description:
    496  In the rare cases when an ON_Font::Style value must be passed
    497  as an unsigned int, use ON_Font::FontStyleFromUnsigned() to
    498  convert the unsigned value to an ON_Font::Style value.
    499  Parameters:
    500  unsigned_font_style - [in]
    501  */
    502  static ON_Font::Style FontStyleFromUnsigned(
    503  unsigned int unsigned_font_style
    504  );
    505 
    506  static const wchar_t* StyleToWideString(
    507  ON_Font::Style font_style
    508  );
    509 
    510 
    511 public:
    512  static const ON_Font Default;
    513  static bool IsValidFaceName(
    514  const wchar_t* face_name
    515  );
    516 
    517 private:
    518  // This private constructor is used to construct ON_Font::Default and managed fonts.
    519  // Never make this constructor protected or public.
    520  ON_Font(
    521  unsigned char managed_status, // 0 = no, 1 = ON_Font::Default, 2 = managed
    522  const ON_Font& src
    523  );
    524 
    525 private:
    526  // Use ON_Font( const ON_Font& ) or ON_Font::operator= if you need to make a copy.
    527  // Never make CopyHelper protected or public.
    528  void CopyHelper(
    529  const ON_Font&
    530  );
    531 
    532 public:
    533  /*
    534  Description:
    535  Get a font managed by the application from the font characteristics.
    536  Never delete a font returned by GetManagedFont().
    537  Parameters:
    538  face_name - [in]
    539  font_weight - [in]
    540  default = ON_Font::Default.FontWeight()
    541  font_style - [in]
    542  default = ON_Font::Default.FontStyle()
    543  font_stretch - [in]
    544  default = ON_Font::Default.FontStretch()
    545  bUnderlined - [in]
    546  default = ON_Font::Default.Underlined() = false
    547  bStrikethrough - [in]
    548  default = ON_Font::Default.Strikethrough() = false
    549  linefeed_ratio - [in]
    550  default = ON_Font::Default.LinefeedRatio()
    551  windows_charset - [in]
    552  default = ON_Font::WindowsCharSet::DefaultCharSet
    553  */
    554  static const ON_Font* GetManagedFont(
    555  const wchar_t* face_name
    556  );
    557 
    558  static const ON_Font* GetManagedFont(
    559  double point_size,
    560  const wchar_t* face_name
    561  );
    562 
    563  static const ON_Font* GetManagedFont(
    564  const wchar_t* face_name,
    565  bool bBold
    566  );
    567 
    568  static const ON_Font* GetManagedFont(
    569  double point_size,
    570  const wchar_t* face_name,
    571  bool bBold
    572  );
    573 
    574  static const ON_Font* GetManagedFont(
    575  const wchar_t* face_name,
    576  bool bBold,
    577  bool bItalic
    578  );
    579 
    580  static const ON_Font* GetManagedFont(
    581  double point_size,
    582  const wchar_t* face_name,
    583  bool bBold,
    584  bool bItalic
    585  );
    586 
    587  static const ON_Font* GetManagedFont(
    588  const wchar_t* face_name,
    589  ON_Font::Weight font_weight,
    590  ON_Font::Style font_style
    591  );
    592 
    593  static const ON_Font* GetManagedFont(
    594  double point_size,
    595  const wchar_t* face_name,
    596  ON_Font::Weight font_weight,
    597  ON_Font::Style font_style
    598  );
    599 
    600  static const ON_Font* GetManagedFont(
    601  const wchar_t* face_name,
    602  ON_Font::Weight font_weight,
    603  ON_Font::Style font_style,
    604  ON_Font::Stretch font_stretch,
    605  bool bUnderlined,
    606  bool bStrikethrough,
    607  double linefeed_ratio,
    608  unsigned int logfont_charset
    609  );
    610 
    611  static const ON_Font* GetManagedFont(
    612  double point_size,
    613  const wchar_t* face_name,
    614  ON_Font::Weight font_weight,
    615  ON_Font::Style font_style,
    616  ON_Font::Stretch font_stretch,
    617  bool bUnderlined,
    618  bool bStrikethrough,
    619  double linefeed_ratio,
    620  unsigned int logfont_charset
    621  );
    622 
    623  static const ON_Font* GetManagedFontFromFontDescription(
    624  const wchar_t* font_description
    625  );
    626 
    627 #if defined(ON_OS_WINDOWS_GDI)
    628  /*
    629  Description:
    630  Get a managed font from a LOGFONT
    631  Parameters:
    632  map_mode - [in]
    633  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    634  Otherwised, map_mode must identify a Windows mapping mode
    635  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    636  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    637  hdc - [in]
    638  Windows device context.
    639  If map_mode is set and not MM_TEXT, then hdc is ignored.
    640  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    641  If the mapping mode is MM_TEXT, then the additional device context values
    642  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    643  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    644  logfont - [in]
    645  These logfont properties are used to find the managed font.
    646  lfHeight (when dc is not zero)
    647  lfWeight;
    648  lfItalic;
    649  lfUnderline;
    650  lfStrikeOut;
    651  lfCharSet;
    652  lfFaceName[LF_FACESIZE];
    653  All other LOGFONT properties is ignored.
    654  See Also:
    655  ON_Font::GetManagedFontFromWindowsLogfontComplete
    656  */
    657  static const ON_Font* GetManagedFontFromWindowsLogfont(
    658  int map_mode,
    659  HDC hdc,
    660  const LOGFONT& logfont
    661  );
    662 
    663  enum : int
    664  {
    665  MAP_MODE_ZERO_ERROR_SUPPRESS = MM_MAX + 3
    666  };
    667 
    668 #endif
    669 
    670  static const ON_Font* GetManagedFontFromAppleFontName(
    671  const wchar_t* apple_font_name
    672  );
    673 
    674  /*
    675  Returns:
    676  The managed font for this font.
    677  Remarks:
    678  If this->IsManagedFont() is true, then "this" is returned.
    679  */
    680  const ON_Font* ManagedFont() const;
    681 
    682  /*
    683  Description:
    684  Returns the glpyh informationh for used to render a specific code point
    685  Parameters:
    686  unicode_code_point
    687  UNICODE code point value
    688  Returns:
    689  Glyph rendering information.
    690 
    691  Remarks:
    692  Typically the returned glpyh uses is a single glpyh in this->ManagedFont().
    693  In this case, glyph->SubstitueCount() is 0.
    694 
    695  In some cases one or more glyphs from one or more substitute fonts are required
    696  to render the code point. In this case, glyph->SubstitueCount() is 0.
    697 
    698  Example:
    699  ON_Font* font = ...;
    700  unsigned int code_point = ...;
    701  const ON_FontGlyph* g = font->CodePointGlyph(code_point);
    702  if (nullptr != g )
    703  {
    704  if ( g->SubstituteCount() > 0 )
    705  {
    706  // complicate case - one of more substitutes must be rendered to render g
    707  for ( const ON_FontGlyph* gsub = g.NextSubstitute(); nullptr != gsub; gsub = gsub->NextSubstitute() )
    708  {
    709  ...
    710  }
    711  }
    712  else
    713  {
    714  // simple case - this computer can directly render g
    715  ...
    716  }
    717  }
    718  */
    719  const class ON_FontGlyph* CodePointGlyph(
    720  ON__UINT32 unicode_code_point
    721  ) const;
    722 
    723 private:
    724  friend class ON_FontGlyph;
    725  const class ON_FontGlyph* Internal_ManagedCodePointGlyph(
    726  ON__UINT32 unicode_code_point,
    727  bool bCreateIfMissing,
    728  bool bFindSubstitutes
    729  ) const;
    730 
    731 public:
    732 
    733  /*
    734  Description:
    735  When reading version 5 3dm achives, the font description can be
    736  a generic font description or an Apple font name. This function
    737  rejects certain descriptions like "Default" and "Arial" for
    738  use as Apple font names.
    739  */
    740  static bool IsNotAppleFontName(
    741  const wchar_t* font_description
    742  );
    743 
    744  static const ON_Font* GetManagedFont(
    745  const ON_Font& font_characteristics,
    746  bool bCreateIfNotFound
    747  );
    748 
    749  static const ON_Font* GetManagedFontFromSerialNumber(
    750  unsigned int managed_font_runtime_serial_number
    751  );
    752 
    753  static unsigned int GetManagedFontList(
    754  ON_SimpleArray< const ON_Font* >& managed_fonts
    755  );
    756 
    757  /*
    758  Returns:
    759  True if this font is a managed font returned by one of the
    760  static ON_Font::GetManagedFont(...) functions.
    761  Remarks:
    762  ON_Font::Default is managed.
    763  */
    764  bool IsManagedFont() const;
    765 
    766 public:
    767 
    768  /*
    769  Description:
    770  If opennurbs is built with FreeType support then
    771  FT_Face freetype_face = (FT_Face)ON_Font::FreeTypeFace(font)
    772  will return a FreeType face that can be used to render the font.
    773  Parameters:
    774  font - [in]
    775  Returns:
    776  A value that can be cast as a FreeType FT_Face.
    777  Example
    778  const ON_Font* font = ...;
    779  FT_Face freetype_face = (FT_Face)ON_Font::FreeTypeFace(font);
    780  Remarks:
    781  Many fonts do not have a glyph for a every UNICODE codepoint and font
    782  substitution is required. If you want to get the freetype face
    783  used for a specfic UNICODE codepoint, call ON_Font::CodepointFreeTypeFace().
    784  */
    785  static ON__UINT_PTR FreeTypeFace(
    786  const ON_Font* font
    787  );
    788 
    789 private:
    790  /*
    791  Description:
    792  Helper function used by destructor to deallocate memory used
    793  by FreeType face
    794  */
    795  static void DestroyFreeTypeFace(
    796  const ON_Font* font
    797  );
    798 
    799 public:
    800  ON_Font();
    801  ~ON_Font() = default;
    802  ON_Font(const ON_Font& src);
    803  ON_Font& operator=(const ON_Font& src);
    804 
    805 public:
    806  /*
    807  Description:
    808  Create a font with a specified facename and properties.
    809  Parameters:
    810  face_name - [in]
    811  nullptr is treated as ON_Font::Default.FaceName().
    812  bBold - [in]
    813  True for a bold version of the font.
    814  bItalic - [in]
    815  True for an italic version of the font.
    816  Returns:
    817  True if the font characteristics were valid and set on the font.
    818  */
    819  bool SetFontCharacteristics(
    820  const wchar_t* face_name,
    821  bool bBold,
    822  bool bItalic,
    823  bool bUnderlined,
    824  bool bStrikethrough
    825  );
    826 
    827  /*
    828  Description:
    829  Create a font with a specified facename and properties.
    830  Parameters:
    831  point_size - [in]
    832  If point_size > 0.0, then it specifies which size of font definition
    833  should be used. Otherwise the font size used for annotation text
    834  is used.
    835  For high quality fonts it is generally the case that
    836  different point sizes of the same font face have
    837  subtle differences in glyph design and are not
    838  simply scaled versions of a base glyph.
    839  face_name - [in]
    840  nullptr is treated as ON_Font::Default.FaceName().
    841  bBold - [in]
    842  True for a bold version of the font.
    843  bItalic - [in]
    844  True for an italic version of the font.
    845  Returns:
    846  True if the font characteristics were valid and set on the font.
    847  */
    848  bool SetFontCharacteristics(
    849  double point_size,
    850  const wchar_t* face_name,
    851  bool bBold,
    852  bool bItalic,
    853  bool bUnderlined,
    854  bool bStrikethrough
    855  );
    856 
    857  /*
    858  Description:
    859  Set the font's face name and characteristics.
    860  Parameters:
    861  face_name - [in]
    862  nullptr is not permitted.
    863  Pass ON_Font::Default.FaceName() if you don't have a face name.
    864  Returns:
    865  True if the font characteristics were valid and set on the font.
    866  */
    867  bool SetFontCharacteristics(
    868  const wchar_t* face_name,
    869  ON_Font::Weight font_weight,
    870  ON_Font::Style font_style,
    871  ON_Font::Stretch font_stretch,
    872  bool bUnderlined,
    873  bool bStrikethrough
    874  );
    875 
    876  bool SetFontCharacteristics(
    877  double point_size,
    878  const wchar_t* face_name,
    879  ON_Font::Weight font_weight,
    880  ON_Font::Style font_style,
    881  ON_Font::Stretch font_stretch,
    882  bool bUnderlined,
    883  bool bStrikethrough
    884  );
    885 
    886  bool SetFontCharacteristics(
    887  const wchar_t* face_name,
    888  ON_Font::Weight font_weight,
    889  ON_Font::Style font_style,
    890  ON_Font::Stretch font_stretch,
    891  bool bUnderlined,
    892  bool bStrikethrough,
    893  double linefeed_ratio,
    894  unsigned int logfont_charset
    895  );
    896 
    897  bool SetFontCharacteristics(
    898  double point_size,
    899  const wchar_t* face_name,
    900  ON_Font::Weight font_weight,
    901  ON_Font::Style font_style,
    902  ON_Font::Stretch font_stretch,
    903  bool bUnderlined,
    904  bool bStrikethrough,
    905  double linefeed_ratio,
    906  unsigned int logfont_charset
    907  );
    908 
    909 
    910  /*
    911  Description:
    912  The font properties weight, style, stretch, underlined,
    913  and strikethrough are encoded in the returned value.
    914  Remarks:
    915  This is a legacy value used in 3dm archive reading/writing
    916  and some sorting operations.
    917  */
    918  unsigned int FontCharacteristicsAsUnsigned() const;
    919 
    920 private:
    921  /*
    922  Description:
    923  All font characterisics defined by the input parameters are encoded
    924  in the returned value.
    925  Remarks:
    926  Used in 3dm archive reading/writing.
    927  */
    928  static unsigned int Internal_FontCharacteristicsAsUnsigned(
    929  ON_Font::Weight font_weight,
    930  ON_Font::Style font_style,
    931  ON_Font::Stretch font_stretch,
    932  bool bUnderlined,
    933  bool bStrikethrough
    934  );
    935 
    936  /*
    937  Description:
    938  All font characterisics except facename (weight, style, stretch,
    939  underlined, strikethrough, charset) are encoded in the returned
    940  value.
    941  Parameters:
    942  font_characteristics_as_unsigned - [in]
    943  Value returned from ON_Font.FontCharacteristicsAsUnsigned()
    944  Returns:
    945  True if the characterstics were set.
    946  Remarks:
    947  Used in 3dm archive reading/writing.
    948  */
    949  bool Internal_SetFontCharacteristicsFromUnsigned(
    950  unsigned int font_characteristics_as_unsigned
    951  );
    952 
    953 public:
    954  /*
    955  Description:
    956  Returns a 32-bit crc of the font weight, style, stretch, underline, strikethrough,
    957  and facename characteristics.
    958 
    959  Parameters:
    960  bIgnoreFaceNameOrdinalCase - [in]
    961  If true, ON_wString::MapStringOrdinal() is applied to the face name
    962  and the returned CRC is ordinal case independent.
    963  */
    964  ON__UINT32 CRC32(
    965  bool bIgnoreFaceNameOrdinalCase
    966  ) const;
    967 
    968 #if defined(ON_OS_WINDOWS_GDI)
    969 
    970  /*
    971  Description:
    972  Get the scale factors for converting heights beween
    973  Windows device coordinates and Windows logical coordinates.
    974 
    975  Parameters:
    976  hdc - [in]
    977  Windows device context.
    978  The device context is used to get the conversion between device
    979  and logical pixel heights. The Windows GDI functions
    980  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    981 
    982  device_to_logical_scale - [out]
    983  logical_height = device_to_logical_scale*device_height
    984 
    985  logical_to_device_scale - [out]
    986  device_height = logical_to_device_scale*logical_height
    987 
    988  Returns:
    989  True if successful.
    990  False otherwise. In the returned scale factors are set to 1.0.
    991  */
    992  static bool GetWindowsDeviceToLogicalHeightScales(
    993  HDC hdc,
    994  double* device_to_logical_scale,
    995  double* logical_to_device_scale
    996  );
    997 
    998  /*
    999  Description:
    1000  Convert a character height in points to a Windows LOGFONT lfHeight value (negative number).
    1001 
    1002  The mapping mode determines the length unit system for the returned value.
    1003 
    1004 
    1005  The Windows convention is to use negative lfHeight values to specify
    1006  font character heights and postive height values to specify font cell heights.
    1007 
    1008  font cell height = font acsent + font descent.
    1009 
    1010  font character height = Cell height - internal leading.
    1011 
    1012  Parameters:
    1013  map_mode - [in]
    1014  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1015  Otherwised, map_mode must identify a Windows mapping mode
    1016  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1017  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1018 
    1019  hdc - [in]
    1020  Windows device context.
    1021  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1022  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1023  If the mapping mode is MM_TEXT, then the additional device context values
    1024  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1025  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1026 
    1027  point_size - [in]
    1028  Font character height in points (1 point = 1/72 inch = 25.4/72 millimeters).
    1029  In terms of font metrics, character height = ascent + descent - internal leading.
    1030 
    1031  Returns:
    1032  LOGFONT lfHeight value.
    1033 
    1034  This value is always negative.
    1035 
    1036  The absolute value of the returned value
    1037  = character height
    1038  = ascent + descent - internal leading
    1039  For many common fonts, the "character height" is close to the distance
    1040  from the bottom of a lower case g to the top of an upper case M.
    1041  The internal leading is space reseved for diacritical marks like the
    1042  ring above the A in the UNICODE "LATIN LETTER A WITH RING" U+00C5 glyph.
    1043  Character height is also known as the "em height".
    1044  Note that the "em height" is typically larger than the height of the
    1045  letter M because "em height" inlcude descent.
    1046  */
    1047  static int WindowsLogfontCharacterHeightFromPointSize(
    1048  int map_mode,
    1049  HDC hdc,
    1050  double point_size
    1051  );
    1052 
    1053  /*
    1054  Parameters:
    1055  map_mode - [in]
    1056  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1057  Otherwised, map_mode must identify a Windows mapping mode
    1058  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1059  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1060 
    1061  hdc - [in]
    1062  Windows device context.
    1063  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1064  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1065  If the mapping mode is MM_TEXT, then the additional device context values
    1066  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1067  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1068 
    1069  logfont_character_height - [in]
    1070  This value must be a Windows LOGFONT character height in units
    1071  determine from map_mode and hdc. If you have a LOGFONT with postive
    1072  lfHeight value, you must get the fonts TEXTMETRICS and subbr
    1073 
    1074  Returns:
    1075  Character height in points (1 point = 1/72 inch).
    1076 
    1077  font character height = font ascent + font descent - font internal leading.
    1078 
    1079  Remarks:
    1080  See ON_Font::PointSize() for information about point units,
    1081  font character height, and font cell height.
    1082  */
    1083  static double PointSizeFromWindowsLogfontCharacterHeight(
    1084  int map_mode,
    1085  HDC hdc,
    1086  int logfont_character_height
    1087  );
    1088 
    1089  /*
    1090  Description:
    1091  Get a Windows LOGFONT character height
    1092  = -(TEXTMETRIC.tmAscent + TEXTMETRIC.tmDescent - TEXTMETRIC.tmLeading )
    1093  as a negative integer.
    1094 
    1095  Parameters:
    1096  map_mode - [in]
    1097  The best results are obtained when map_mode = MM_TEXT and the hdc is
    1098  correctly set for the context where the font is being rendered. Otherwise
    1099  the loss of precision when length units system conversion scale factors
    1100  are applied and results are stored in int LOGFONT and TEXTMETRIC fields
    1101  lead to discrepancies.
    1102 
    1103  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1104  Otherwised, map_mode must identify a Windows mapping mode
    1105  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1106  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1107 
    1108  hdc - [in]
    1109  Windows device context.
    1110  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1111  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1112  If the mapping mode is MM_TEXT, then the additional device context values
    1113  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1114  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1115 
    1116  logfont - [in]
    1117  If logfont.lfHeight <= 0, then logfont.lfHeight is returned.
    1118  If logfont.lfHeight > 0, then logfont face name, map_mode and hdc are
    1119  used to calculate the font's TEXTMETRICS tmInternalLeading value
    1120  -((tm.tmAscent + tm.tmDescent) - tmInternalLeading) is returned.
    1121 
    1122  Returns:
    1123  0: failure
    1124  <0: Windows LOGFONT character height in units specified by map_mode and hdc.
    1125  */
    1126  static int WindowsLogfontCharacterHeight(
    1127  int map_mode,
    1128  HDC hdc,
    1129  const LOGFONT& logfont
    1130  );
    1131 
    1132  /*
    1133  Description:
    1134  Get a Windows LOGFONT cell height
    1135  = (TEXTMETRIC.tmAscent + TEXTMETRIC.tmDescent)
    1136  as a positive integer.
    1137 
    1138  Parameters:
    1139  map_mode - [in]
    1140  The best results are obtained when map_mode = MM_TEXT and the hdc is
    1141  correctly set for the context where the font is being rendered. Otherwise
    1142  the loss of precision when length units system conversion scale factors
    1143  are applied and results are stored in int LOGFONT and TEXTMETRIC fields
    1144  lead to discrepancies.
    1145 
    1146  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1147  Otherwised, map_mode must identify a Windows mapping mode
    1148  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1149  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1150 
    1151  hdc - [in]
    1152  Windows device context.
    1153  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1154  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1155  If the mapping mode is MM_TEXT, then the additional device context values
    1156  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1157  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1158 
    1159  logfont - [in]
    1160  If logfont.lfHeight >= 0, then logfont.lfHeight is returned.
    1161  If logfont.lfHeight < 0, then logfont face name, map_mode and hdc are
    1162  used to calculate the font's TEXTMETRIC and
    1163  (tm.tmAscent + tm.tmDescent) is returned.
    1164 
    1165  Returns:
    1166  0: failure
    1167  >0: Windows LOGFONT cell height in units specified by map_mode and hdc.
    1168  */
    1169  static int WindowsLogfontCellHeight(
    1170  int map_mode,
    1171  HDC hdc,
    1172  const LOGFONT& logfont
    1173  );
    1174 
    1175 
    1176  /*
    1177  Description:
    1178  Get a Windows text metrics.
    1179 
    1180  Parameters:
    1181  map_mode - [in]
    1182  The best results are obtained when map_mode = MM_TEXT and the hdc is
    1183  correctly set for the context where the font is being rendered. Otherwise
    1184  the loss of precision when length units system conversion scale factors
    1185  are applied and results are stored in int LOGFONT and TEXTMETRIC fields
    1186  lead to discrepancies.
    1187 
    1188  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1189  Otherwised, map_mode must identify a Windows mapping mode
    1190  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1191  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1192 
    1193  hdc - [in]
    1194  Windows device context.
    1195  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1196  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1197  If the mapping mode is MM_TEXT, then the additional device context values
    1198  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1199  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1200 
    1201  logfont - [in]
    1202  If logfont.lfHeight >= 0, then logfont.lfHeight is returned.
    1203  If logfont.lfHeight < 0, then logfont face name, map_mode and hdc are
    1204  used to calculate the font's TEXTMETRIC and
    1205  (tm.tmAscent + tm.tmDescent) is returned.
    1206 
    1207  textmetric - [out]
    1208 
    1209  Returns:
    1210  0: failure
    1211  >0: Windows LOGFONT cell height in units specified by map_mode and hdc.
    1212  */
    1213  static bool GetWindowsTextMetrics(
    1214  int map_mode,
    1215  HDC hdc,
    1216  const LOGFONT& logfont,
    1217  TEXTMETRIC& textmetric
    1218  );
    1219 
    1220 private:
    1221  static HDC Internal_CreateWindowsLogfontDeviceContext();
    1222  static void Internal_DeleteWindowsLogfontDeviceContext(
    1223  HDC hdc
    1224  );
    1225 
    1226 public:
    1227  /*
    1228  Description:
    1229  Set ON_Font properties from a subset of the LOGFONT properties.
    1230  Parameters:
    1231  map_mode - [in]
    1232  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1233  Otherwised, map_mode must identify a Windows mapping mode
    1234  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1235  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1236  hdc - [in]
    1237  Windows device context.
    1238  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1239  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1240  If the mapping mode is MM_TEXT, then the additional device context values
    1241  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1242  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1243  logfont - [in]
    1244  These logfont properties are used to set the ON_Font.
    1245  lfHeight (when dc is not zero),
    1246  lfWeight
    1247  lfItalic
    1248  lfUnderline
    1249  lfStrikeOut
    1250  lfCharSet
    1251  lfFaceName[LF_FACESIZE];
    1252  All other LOGFONT properties are ignored.
    1253  See Also:
    1254  ON_Font::SetFromWindowsLogFontPartialComplete
    1255  */
    1256  bool SetFromWindowsLogFont(
    1257  int map_mode,
    1258  HDC hdc,
    1259  const LOGFONT& logfont
    1260  );
    1261 
    1262  /*
    1263  Parameters:
    1264  map_mode - [in]
    1265  If map_mode is 0, then ::GetMapMode(hdc) is called to get the mapping mode.
    1266  Otherwised, map_mode must identify a Windows mapping mode
    1267  (MM_TEXT, MM_LOMETRIC, MM_HIMETRIC, MM_LOENGLISH, MM_HIENGLISH, M_TWIPS).
    1268  If map_mode = MM_TEXT (1), then hdc is used as described in the hdc parameter.
    1269  hdc - [in]
    1270  Windows device context.
    1271  If map_mode is set and not MM_TEXT, then hdc is ignored.
    1272  Otherwise the device context is used to get the mapping mode ( GetMapMode(hdc) ).
    1273  If the mapping mode is MM_TEXT, then the additional device context values
    1274  GetDeviceCaps(hdc, LOGPIXELSY) and conversion between device and logical pixel heights
    1275  DPtoLP(hdc,...) and LPtoDP(hdc,...) are used.
    1276  Returns:
    1277  A Windows LOGFONT with propeties copied from this ON_Font.
    1278  If WindowsLogFontIsComplete() is true, then all LOGFONT properties
    1279  are copied from the ON_Font.
    1280  If WindowsLogFontIsComplete() is false, then the LOGFONT lfHeight,
    1281  lfWidth, lfEscapement, lfOrientation, lfClipPrecision, lfQuality,
    1282  lfPitchAndFamily, and lfOutPrecision properties are set to ON_Font
    1283  default values.
    1284  */
    1285  const LOGFONT WindowsLogFont(
    1286  int map_mode,
    1287  HDC hdc
    1288  ) const;
    1289 
    1290  const MAT2 WindowsFontMat2() const;
    1291 
    1292 #endif
    1293 
    1294 #if defined (ON_RUNTIME_APPLE_OBJECTIVE_C_AVAILABLE)
    1295  bool SetFromAppleFont (NSFont* apple_font);
    1296  NSFont* AppleFont() const;
    1297 #endif
    1298 
    1299  bool SetFromAppleFontName(
    1300  const wchar_t* apple_font_name
    1301  );
    1302 
    1303  const ON_wString& AppleFontName() const;
    1304 
    1305  const wchar_t* AppleFontNameAsPointer() const;
    1306 
    1307  bool SetFromFontDescription(
    1308  const wchar_t* font_description
    1309  );
    1310 
    1311  bool SetFromFontDescription(
    1312  const wchar_t* font_description,
    1313  const wchar_t* apple_font_name
    1314  );
    1315 
    1316  /*
    1317  Description:
    1318  Tests an object to see if its data members are correctly
    1319  initialized.
    1320  Parameters:
    1321  text_log - [in] if the object is not valid and text_log
    1322  is not nullptr, then a brief englis description of the
    1323  reason the object is not valid is appened to the log.
    1324  The information appended to text_log is suitable for
    1325  low-level debugging purposes by programmers and is
    1326  not intended to be useful as a high level user
    1327  interface tool.
    1328  Returns:
    1329  @untitled table
    1330  true object is valid
    1331  false object is invalid, uninitialized, etc.
    1332  */
    1333  bool IsValid( ON_TextLog* text_log = nullptr ) const;
    1334 
    1335  void Dump( ON_TextLog& ) const; // for debugging
    1336 
    1337 
    1338  void DumpFreeType(
    1339  ON_TextLog& text_log
    1340  ) const;
    1341 
    1342  static void DumpFreeTypeFace(
    1343  ON__UINT_PTR free_type_face_ptr,
    1344  ON_TextLog& text_log
    1345  );
    1346 
    1347 #if defined(ON_OS_WINDOWS_GDI)
    1348  static void DumpLogfont(
    1349  const LOGFONT* logfont,
    1350  ON_TextLog& text_log
    1351  );
    1352 #endif
    1353 
    1354  // serialize definition to binary archive
    1355  bool Write( ON_BinaryArchive& ) const;
    1356 
    1357  // restore definition from binary archive
    1358  bool Read( ON_BinaryArchive& );
    1359 
    1360  // V6 separated the V5 ON_Font into ON_TextStyle and ON_Font.
    1361  bool WriteV5(
    1362  int V5_font_index,
    1363  ON_UUID V5_font_id,
    1365  ) const;
    1366 
    1367  // V6 separated the V5 ON_Font into ON_TextStyle and ON_Font.
    1368  bool ReadV5(
    1369  ON_BinaryArchive&,
    1370  int* V5_font_index,
    1371  ON_UUID* V5_font_id
    1372  );
    1373 
    1374  /*
    1375  Returns:
    1376  0: This is not a managed font.
    1377  1: This is the managed font ON_Font::Default.
    1378  >= 2: This is a managed font other than ON_Font::Default.
    1379  Remark:
    1380  For managed fonts other than ON_Font::Default, the value of RuntimeSerialNumber()
    1381  typically varies between instances of the same application.
    1382  Different platforms and application versions may use different font faces for ON_Font::Default.
    1383  If an ON_Font is a managed font, then RuntimeSerialNumber() and ManagedFontSerialNumber()
    1384  are identical. If an ON_Font is not a managed font, then RuntimeSerialNumber() is zero.
    1385  */
    1386  unsigned int RuntimeSerialNumber() const;
    1387 
    1388  /*
    1389  Description:
    1390  Two ON_Font classes reference the same platform font and create identical glyphs
    1391  if and only if the have the same ManagedFontSerialNumber().
    1392  Returns:
    1393  0: This font is unset.
    1394  >= 1: Serial number of the managed font with the same characteristics.
    1395  Remark:
    1396  For managed fonts other than ON_Font::Default, the value of ManagedFontSerialNumber()
    1397  typically varies between instances of the same application.
    1398  Different platforms and application versions may use different font faces
    1399  for ON_Font::Default.
    1400  If an ON_Font is a managed font, then RuntimeSerialNumber() and ManagedFontSerialNumber()
    1401  are identical. If an ON_Font is not a managed font, then RuntimeSerialNumber() is zero.
    1402  */
    1403  unsigned int ManagedFontSerialNumber() const;
    1404 
    1405  //////////////////////////////////////////////////////////////////////
    1406  //
    1407  // Interface
    1408 
    1409  enum WindowsConstants : unsigned char
    1410  {
    1411  // Values used to set Windows LOGFONT fields.
    1412 #if defined(ON_OS_WINDOWS_GDI)
    1413  logfont_ansi_charset = ANSI_CHARSET,
    1414  logfont_default_charset = DEFAULT_CHARSET, // LOGFONT.lfCharSet
    1415  logfont_symbol_charset = SYMBOL_CHARSET, // LOGFONT.lfCharSet
    1416  logfont_out_precis = OUT_TT_ONLY_PRECIS, // LOGFONT.lfOutPrecision
    1417 
    1418  // 2017-07-27, Brian Gillespie
    1419  // Changed ON_Font::WindowsConstants::logfont_quality from ANTIALIASED_QUALITY to DEFAULT_QUALITY.
    1420  // This makes it so that ON_Font conversion to LOGFONT results in a good-looking font when rendered by MFC.
    1421  // With lfQuality set to ANTIALIASED_QUALITY, the font looks crummy - probably because all the rest of the fonts
    1422  // are being rendered today with CLEARTYPE_QUALITY. Letting Windows decide what to do is probably better.
    1423  logfont_quality = DEFAULT_QUALITY, // LOGFONT.lfQuality
    1424 
    1425  logfont_pitch_and_family = (DEFAULT_PITCH | FF_DONTCARE), // LOGFONT.lfPitchAndFamily
    1426 #else
    1427  // The values below are identical to the ones above and
    1428  // are used to insure code compiles for Apple and other
    1429  // platforms.
    1430  logfont_ansi_charset = 0,
    1431  logfont_default_charset = 1,
    1432  logfont_symbol_charset = 2,
    1433  logfont_out_precis = 7,
    1434  logfont_quality = 4,
    1435  logfont_pitch_and_family = 0
    1436 #endif
    1437  };
    1438 
    1439  /*
    1440  Parameters:
    1441  face_name - [in]
    1442  Returns:
    1443  If the code is running on Windows:
    1444  The appropriate value of LOGFONT.lfCharSet for the input facename.
    1445  If the code is not running on Windows:
    1446  ON_Font::WindowsConstants::logfont_default_charset.
    1447  */
    1448  static unsigned char WindowsLogfontCharSetFromFaceName(
    1449  const wchar_t* face_name
    1450  );
    1451 
    1452  // miscellaneous constants use to initialize Windows LOGFONT fields
    1453  enum Constants: int
    1454  {
    1455  // 1995 - 2015:
    1456  // Windows fonts have variations in glyph size, design and kerning
    1457  // for different point sizes. Text in Rhino is generally
    1458  // placed around geometry and the relative spatial
    1459  // relationships between the text and the geometry must
    1460  // remain constant on all devices and at all "zoom" levels.
    1461  // We have to choose a point size and then apply appropriate
    1462  // scaling during display, printing, and in other rendering
    1463  // calculations. After many experiments and 20 years of commercial use,
    1464  // (1995-2015) we have found 256 works best.
    1465  // This value is used on all platforms because the calculations
    1466  // it is used in occur on all platforms. These calculations must return
    1467  // consistent results so models exchanged between platforms maintain
    1468  // spatial relationships between text and geometry.
    1469  //
    1470  // 2017:
    1471  // (switching to freetype)
    1472  // The value ON_Font::Constants::AnnotationFontCellHeight is used to define
    1473  // "opennurbs normalized font coordinates". The scale
    1474  // ((double)ON_Font::Constants::AnnotationFontCellHeight)/(font definition grid height)
    1475  // is used to convert bounding information and outlines from a native
    1476  // font definition to opennurbs normalized font coordinates.
    1477  // Many TrueType fonts have font definition grid height = 2048.
    1478  // Many PostScript fonts have font definition grid height = 1000.
    1479  AnnotationFontCellHeight = 256, // LOGFONT.lfHeight value
    1480 
    1481  // ON_Font::Constants::metric_char is the unicode code point value
    1482  // for the glpyh used to calculate critical glyph metrics.
    1483  // It must be an 'I' or 'H', but we have not tested 'H'.
    1484  // There are problems with any other upper case latin letter in common fonts.
    1485  // In particular, the standard 'M' does not work.
    1486  // We have used 'I' for 22 years (1995 - 2017).
    1487  // This value is used on all platforms because the calculations
    1488  // it is used in occur on all platforms. These calculations must return
    1489  // consistent results so models exchanged between platforms maintain
    1490  // spatial relationships between text and geometry.
    1491  MetricsGlyphCodePoint = 'I'
    1492  };
    1493 
    1494  /*
    1495  Description:
    1496  Get a text description of the font.
    1497  Parameters:
    1498  font_description - [out]
    1499  Returns:
    1500  A pointer to the font description string stored in the font_description parameter.
    1501  */
    1502  const ON_wString& FontDescription() const;
    1503 
    1504  /*
    1505  Description:
    1506  Get a text description of the font.
    1507  Parameters:
    1508  font_description - [out]
    1509  Returns:
    1510  A pointer to the font description string stored in the font_description parameter.
    1511  */
    1512  const wchar_t* FontDescriptionAsPointer() const;
    1513 
    1514  ON_DEPRECATED_MSG("Use ON_FontMetrics::DefaultLineFeedRatio")
    1515  double LinefeedRatio() const;
    1516 
    1517  /*
    1518  Returns:
    1519  Normalized font metrics.
    1520 
    1521  Remarks:
    1522  Font metric "normalized" units are comparable between different fonts.
    1523  Normalized font metrics exist so that code that positions glyphs from
    1524  multiple fonts does not have to take the unit system and resolution used
    1525  in the design of each font.
    1526  In opennurbs, much of this code that positions glyphs is located in ON_Annotation,
    1527  ON_TextContent, and ON_TextRun member functions and is used when rendering
    1528  annotation objects.
    1529 
    1530  Fonts can be designed and defined at different resolutions and
    1531  relative scaling is necessary when text contains glyphs from
    1532  fonts desinged at different grid resolutions. For example,
    1533  TrueType font grid with and height is often 1024x1024 or
    1534  2048x2014, OpenType grids are often 1000x1000, and PostScript
    1535  grids are often 1000x1000. Opennurbs "font units" are the units
    1536  the font was designed in.
    1537 
    1538  Long ago, opennurbs and Rhino used only Windows TrueType fonts
    1539  and ran only in Microsoft Windows. During this era,
    1540  the "normalized units" were for a Windows LOGFONT created
    1541  with lfHeight = ON_Font::Constants::AnnotationFontCellHeight.
    1542 
    1543  Currently opennurbs and Rhino work on Microsoft Windows and Apple
    1544  platforms and use FreeType to access font information. When a font
    1545  is not "tricky", the "font design" units are the the units FreeType
    1546  uses when a font is loaded with FT_LOAD_NO_SCALE.
    1547 
    1548  When working with fonts and glyhphs in opennurbs and Rhino,
    1549  SDK users almost always want to use normalized font and glyph metrics.
    1550  */
    1551  const ON_FontMetrics& FontMetrics() const;
    1552 
    1553  /*
    1554  Description:
    1555  This function is for expert users doing something complicated.
    1556  Returns:
    1557  Font metrics read directly from the font definition with no or minimal
    1558  scaling.
    1559  Remarks:
    1560  See ON_Font.FontMetrics() documentation for important information
    1561  about the differnce bewteen normalized and font unit metrics.
    1562  */
    1563  const ON_FontMetrics& FontUnitFontMetrics() const;
    1564 
    1565  /*
    1566  Returns:
    1567  scale to apply when converting from a FT_LOAD_NO_SCALE FreeType
    1568  glyph metric or outline to normalized opennurbs font coordinates.
    1569  */
    1570  double FontUnitToNormalizedScale() const;
    1571 
    1572  /*
    1573  Returns:
    1574  scale to apply when converting from a FT_LOAD_NO_SCALE FreeType
    1575  glyph metric or outline to normalized opennurbs font coordinates.
    1576  */
    1577  double NormalizedToFontUnitScale() const;
    1578 
    1579  /*
    1580  Returns:
    1581  Font character height in points (1 point = 1/72 inch).
    1582 
    1583  See the remarks for a defintion of "character height".
    1584 
    1585  Remarks:
    1586  A "point" is a length unit system.
    1587  1 point = 1/72 inch = 25.4/72 millimeters.
    1588 
    1589  Typically, fonts are designed for maximum clarity when the rendered
    1590  character height is close to PointSize().
    1591 
    1592  font cell height = font ascent + font descent.
    1593 
    1594  font character height = font cell height - font internal leading.
    1595 
    1596  For fonts designed for languages that use latin letters, it is common for
    1597  the character height to be equal to or a little larger than the distance
    1598  from the bottom of a lower case g to the top of an upper case M.
    1599  The character height is also called the "em hieght".
    1600 
    1601  Font internal leading is the space above typical capital latin letters
    1602  that is reseved for diacritical marks like the ring above the A in
    1603  the UNICODE "LATIN LETTER A WITH RING" U+00C5 glyph (Angstrom symbol).
    1604  */
    1605  double PointSize() const;
    1606 
    1607  /*
    1608  Parameters:
    1609  point_size - [in]
    1610  font character height in point units.
    1611 
    1612  Remarks:
    1613  See the remarks section ON_Font::PointSize() for more information
    1614  about point units and character height.
    1615  */
    1616  bool SetPointSize(
    1617  double point_size
    1618  );
    1619 
    1620  bool SetFontFaceName(
    1621  const wchar_t* face_name
    1622  );
    1623  const wchar_t* FontFaceName() const;
    1624 
    1625  ON_Font::Weight FontWeight() const;
    1626 
    1627  int WindowsLogfontWeight() const;
    1628  int AppleWeightOfFont() const;
    1629  double AppleFontWeightTrait() const;
    1630 
    1631  bool SetFontWeight(
    1632  ON_Font::Weight font_weight
    1633  );
    1634 
    1635  bool SetWindowsLogfontWeight(
    1636  int windows_logfont_weight
    1637  );
    1638 
    1639  bool SetAppleWeightOfFont(
    1640  int apple_weight_of_font
    1641  );
    1642 
    1643  bool SetAppleFontWeightTrait(
    1644  double apple_font_weight_trait
    1645  );
    1646 
    1647 private:
    1648  bool Internal_SetFontWeightTrio(
    1649  ON_Font::Weight font_weight,
    1650  int windows_logfont_weight,
    1651  double apple_font_weight_trait,
    1652  bool bUpdateFontDescription
    1653  );
    1654 
    1655 public:
    1656  /*
    1657  Description:
    1658  User interfaces that want to behave as if there are 3 font weights,
    1659  light < normal < < bold, can use the functions
    1660  ON_Font.IsLight(),
    1661  ON_Font.IsNormalWeight(),
    1662  ON_Font.IsBold(),
    1663  to query font weight ranges.
    1664  Returns:
    1665  True if FontWeight() is lighter than ON_Font::Weight::Normal
    1666  */
    1667  bool IsLight() const;
    1668 
    1669  /*
    1670  Description:
    1671  User interfaces that want to behave as if there are 3 font weights,
    1672  light < normal < < bold, can use the functions
    1673  ON_Font.IsLight(),
    1674  ON_Font.IsNormalWeight(),
    1675  ON_Font.IsBold(),
    1676  to query font weight ranges.
    1677  Returns:
    1678  True if FontWeight() is ON_Font::Normal or ON_Font::Weight::Medium
    1679  */
    1680  bool IsNormalWeight() const;
    1681 
    1682  /*
    1683  Description:
    1684  User interfaces that want to behave as if there are 3 font weights,
    1685  light < normal < < bold, can use the functions
    1686  ON_Font.IsLight(),
    1687  ON_Font.IsNormalWeight(),
    1688  ON_Font.IsBold(),
    1689  to query font weight ranges.
    1690  Returns:
    1691  True if heavier than ON_Font::Weight::Medium.
    1692  */
    1693  bool IsBold() const;
    1694 
    1695  ON_Font::Style FontStyle() const;
    1696 
    1697  bool SetFontStyle(
    1698  ON_Font::Style font_style
    1699  );
    1700 
    1701  /*
    1702  Returns:
    1703  true if FontStyle() is ON_Font::Style::Italic.
    1704  false if FontStyle() is ON_Font::Style::Upright or .ON_Font::Style::Oblique.
    1705  */
    1706  bool IsItalic() const;
    1707 
    1708  /*
    1709  Returns:
    1710  true if FontStyle() is ON_Font::Style::Upright.
    1711  false if FontStyle() is ON_Font::Style::Italic or .ON_Font::Style::Oblique.
    1712  */
    1713  bool IsUpright() const;
    1714 
    1715  /*
    1716  Returns:
    1717  true if FontStyle() is ON_Font::Style::Oblique.
    1718  false if FontStyle() is ON_Font::Style::Upright or .ON_Font::Style::Italic.
    1719  */
    1720  bool IsOblique();
    1721 
    1722 
    1723  ON_Font::Stretch FontStretch() const;
    1724 
    1725  bool SetFontStretch(
    1726  ON_Font::Stretch font_stretch
    1727  );
    1728 
    1729  bool IsUnderlined() const;
    1730  bool SetUnderlined(
    1731  bool bUnderlined
    1732  );
    1733 
    1734  bool IsStrikethrough() const;
    1735  bool SetStrikethrough(
    1736  bool bStrikethrough
    1737  );
    1738 
    1739  unsigned char LogfontCharSet() const;
    1740 
    1741  bool SetLogfontCharSet(
    1742  unsigned char logfont_charset
    1743  );
    1744 
    1745  ON_DEPRECATED_MSG("Use FontMetrics().AscentOfI()")
    1746  int HeightOfI() const;
    1747 
    1748  ON_DEPRECATED_MSG("Use FontMetrics().LineSpace()")
    1749  int HeightOfLinefeed() const;
    1750 
    1751  ON_DEPRECATED_MSG("Use FontMetrics().GlyphScale()")
    1752  double HeightScale(double text_height) const;
    1753 
    1754  ON_DEPRECATED_MSG("Use FontMetrics().StrikeoutThickness()")
    1755  int GetStrikeoutSize() const;
    1756 
    1757  ON_DEPRECATED_MSG("Use FontMetrics().StrikeoutPosition()")
    1758  int GetStrikeoutPosition() const;
    1759 
    1760  ON_DEPRECATED_MSG("Use FontMetrics().UnderscoreThickness()")
    1761  int GetUnderscoreSize() const;
    1762 
    1763 
    1764  ON_DEPRECATED_MSG("Use FontMetrics().UnderscorePosition()")
    1765  int GetUnderscorePosition() const;
    1766 
    1767  /*
    1768  Returns:
    1769  A SHA-1 hash of all font characteristics, including platform specific settings.
    1770  Two fonts have identical font characteristics, if and only if they have identical
    1771  FontCharacteristicsHash() values.
    1772 
    1773  Example:
    1774  ON_Font f1 = ...
    1775  ON_Font f2 = ...
    1776  if ( f1.FontCharacteristicsHash() == f2.FontCharacteristicsHash() )
    1777  {
    1778  // f1 and f2 have identical font characteristics
    1779  }
    1780  else
    1781  {
    1782  // f1 and f2 have different font characteristics
    1783  }
    1784  */
    1785  const class ON_SHA1_Hash& FontCharacteristicsHash() const;
    1786 
    1787 private:
    1788 
    1789 public:
    1790 
    1791  /*
    1792  Description:
    1793  Compares the font weight, style, stretch, underline, strikethrough, linefeed_ratio
    1794  and facename characteristics.
    1795  Returns:
    1796  -1: a characteristics < b characteristics
    1797  0: a characteristics = b characteristics
    1798  +1: a characteristics > b characteristics
    1799  Remarks:
    1800  This is a legacy function and to preserve past behavior, some platform specific
    1801  characteristics are not checked.
    1802  Use FontCharacteristicsHash() when every characteristic needs to be compared.
    1803  */
    1804  static int CompareFontCharacteristics(
    1805  const ON_Font& a,
    1806  const ON_Font& b
    1807  );
    1808 
    1809  /*
    1810  Description:
    1811  Compares the font weight, style, stretch, underline, strikethrough, linefeed_ratio
    1812  and facename characteristics.
    1813  Returns:
    1814  0 == ON_Font::CompareFontCharacteristics(a,b).
    1815  Remarks:
    1816  This is a legacy function and to preserve past behavior, some platform specific
    1817  characteristics are not checked.
    1818  Use FontCharacteristicsHash() when every characteristic needs to be compared.
    1819  */
    1820  static bool EqualFontCharacteristics(
    1821  const ON_Font& a,
    1822  const ON_Font& b
    1823  );
    1824 
    1825 private:
    1826  friend class ON_ManagedFonts;
    1827 
    1828  //////////////////////////////////////////////////////////////////////////////////
    1829  //
    1830  // The "font glpyh definition" parameters completely determine the appearance
    1831  // of font glyphs.
    1832  //
    1833  // If all "font glpyh definition" parameters have identical values,
    1834  // text rendered using those fonts will look identical.
    1835  //
    1836  // If two fonts have a "font glpyh definition" parameter with different values,
    1837  // text rendered using those fonts will not look identical.
    1838  //
    1839  // BEGIN "font glpyh definition" parameters:
    1840  //
    1841 
    1842  // The font ON_Font::Default has m_runtime_serial_number = 1.
    1843  // Managed fonts have m_runtime_serial_number >= 1.
    1844  // Unmanaged fonts have m_runtime_serial_number = 0;
    1845  static unsigned int __runtime_serial_number_generator;
    1846  const unsigned int m_runtime_serial_number = 0;
    1847 
    1848  int m_windows_logfont_weight = 400; // 100 <= m_windows_logfont_weight <= 1000
    1849  double m_point_size = 0.0;
    1850  double m_apple_font_weight_trait = 0.0; // = Apple NSFontWeightTrait value -1.0 <= m_apple_font_weight < 1.0, 0.0 = "normal"
    1851  ON_Font::Weight m_font_weight = ON_Font::Weight::Normal;
    1852 
    1853  ON_Font::Style m_font_style = ON_Font::Style::Upright; // m_font_style corresponds to Windows LOGFONT.lfItalic field
    1854  ON_Font::Stretch m_font_stretch = ON_Font::Stretch::Medium;
    1855  bool m_font_bUnderlined = false; // Same as Windows LOGFONT.lfUnderlined
    1856  bool m_font_bStrikethrough = false; // Same as Windows LOGFONT.lfStrikeOut
    1857  unsigned char m_logfont_charset = ON_Font::WindowsConstants::logfont_default_charset;
    1858 
    1859 private:
    1860  unsigned char m_reserved_char1 = 0;
    1861 
    1862 private:
    1863  // If m_bCompleteLOGFONT is true, then the m_LOGFONT_* values are set.
    1864  // If m_bCompleteLOGFONT is false, then the m_LOGFONT_* values are undefined and must be ignored.
    1865  /*
    1866  unsigned char m_bCompleteLOGFONT = 0;
    1867  unsigned char m_LOGFONT_lfClipPrecision = 0;
    1868  unsigned char m_LOGFONT_lfQuality = 0;
    1869  unsigned char m_LOGFONT_lfPitchAndFamily = 0;
    1870  unsigned char m_LOGFONT_lfOutPrecision = 0;
    1871  int m_LOGFONT_lfHeight = 0;
    1872  int m_LOGFONT_lfWidth = 0;
    1873  int m_LOGFONT_lfEscapement = 0;
    1874  int m_LOGFONT_lfOrientation = 0;
    1875  */
    1876 
    1877 private:
    1878  enum : int
    1879  {
    1880  face_name_capacity = 32
    1881  };
    1882  // https://en.wikipedia.org/wiki/List_of_typefaces_included_with_Microsoft_Windows
    1883  wchar_t m_face_name[ON_Font::face_name_capacity+2]; // same as Windows LOGFONT.lfFaceName
    1884 
    1885  // If m_linefeed_ratio needs to become a variable or variables are required for tracking or stretch,
    1886  // these fields will be used.
    1887  double m_reserved_double_0 = 0.0;
    1888  double m_reserved_double_1 = 0.0;
    1889  //
    1890  // END "font glpyh definition" parameters:
    1891  //
    1892  //////////////////////////////////////////////////////////////////////////////////
    1893 
    1894 private:
    1895  // https://support.apple.com/en-us/HT201375
    1896  // https://en.wikipedia.org/wiki/List_of_typefaces_included_with_OS_X
    1897  ON_wString m_apple_font_name;
    1898 
    1899 private:
    1900  ON_wString m_font_description;
    1901 
    1902 private:
    1903  // A sha1 hash of all font characteristics.
    1904  // This value is set using lazy evaluation.
    1905  // A zero digest indicates it is not set.
    1906  mutable ON_SHA1_Hash m_font_characteristics_hash;
    1907 
    1908 private:
    1909  bool ModificationPermitted(
    1910  const char* function_name,
    1911  const char* file_name,
    1912  int line_number
    1913  ) const;
    1914 
    1915 private:
    1916  void Internal_SetFontDescription();
    1917 
    1918 
    1919 private:
    1920  //////////////////////////////////////////////////////////////////////////////////
    1921  //
    1922  // BEGIN global font glyph cache interface
    1923  //
    1924  // There is a single font glyph cache for each managed font.
    1925  // Fonts that are not managed use a glyph cache from a managed font.
    1926  // This make functions like ON_Font.FindGlyph() efficient and reliable.
    1927  //
    1928  void DestroyFontGlyphCache();
    1929  class ON_FontGlyphCache* FontGlyphCache(
    1930  bool bCreateIfMissing
    1931  ) const;
    1932 #pragma ON_PRAGMA_WARNING_PUSH
    1933 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    1934  // C4251: '...std::shared_ptr<class ON_FontGlyphCache>...'
    1935  // needs to have dll-interface to be used by clients of class 'ON_Font'
    1936  // m_font_glyph_cache is private and all code that manages m_font_glyph_cache is explicitly implemented in the DLL.
    1937 private:
    1938  mutable std::shared_ptr<class ON_FontGlyphCache> m_font_glyph_cache;
    1939 #pragma ON_PRAGMA_WARNING_POP
    1940  //
    1941  // END global font cache interface
    1942  //
    1943  //////////////////////////////////////////////////////////////////////////////////
    1944 
    1945 private:
    1946  // Only managed fonts have a non-null m_free_type_face face.
    1947  mutable class ON_FreeTypeFace* m_free_type_face = nullptr;
    1948 
    1949 private:
    1950  ON__UINT_PTR m_reserved_ptr = 0;
    1951 
    1952 public:
    1953  // Returns free type glyph index (or nonzero equivalent) if glyph is defined fo the glyph.CodePoint() in glyph.Font()
    1954  // and glyph_box is set.
    1955  typedef ON__UINT_PTR (*ON_GetGlyphMetricsFuncType)(
    1956  const class ON_Font* font,
    1957  ON__UINT32 unicode_code_point,
    1958  class ON_TextBox& font_unit_glyph_box
    1959  );
    1960 
    1961  typedef void (*ON_GetFontMetricsFuncType)(
    1962  const ON_Font* font,
    1963  ON_FontMetrics& font_unit_font_metrics
    1964  );
    1965 
    1966  static void SetCustomMeasurementFunctions(
    1967  ON_GetGlyphMetricsFuncType measureGlyphFunc,
    1968  ON_GetFontMetricsFuncType metricsFunction
    1969  );
    1970 
    1971 private:
    1972  static ON_GetGlyphMetricsFuncType Internal_CustomGetGlyphMetricsFunc;
    1973  static ON_GetFontMetricsFuncType Internal_CustomGetFontMetricsFunc;
    1974 
    1975 public:
    1976  static void GetRunBounds(
    1977  const ON_Font& font,
    1978  const wchar_t* text,
    1979  double fontSizePixels,
    1980  ON::TextHorizontalAlignment horizontalAlignment,
    1981  ON::TextVerticalAlignment verticalAlignment,
    1982  ON_2dPoint& boundsMin,
    1983  ON_2dPoint& boundsMax,
    1984  int& lineCount
    1985  );
    1986 };
    1987 
    1988 class ON_CLASS ON_TextBox
    1989 {
    1990 public:
    1991  ON_TextBox() = default;
    1992  ~ON_TextBox() = default;
    1993  ON_TextBox(const ON_TextBox&) = default;
    1994  ON_TextBox& operator=(const ON_TextBox&) = default;
    1995 
    1996  ON_TextBox(
    1997  ON_2dPoint bbmin,
    1998  ON_2dPoint bbmax
    1999  );
    2000 
    2001  /*
    2002  Returns:
    2003  true if bounding box is set.
    2004  */
    2005  bool IsSet() const;
    2006 
    2007  static const ON_TextBox Scale(
    2008  const ON_TextBox& text_box,
    2009  double scale
    2010  );
    2011 
    2012  /*
    2013  Returns:
    2014  A text box with m_bbmin, m_bbmax, m_max_basepoint are translated by delta.
    2015  m_advance is not changed.
    2016  */
    2017  static const ON_TextBox Translate(
    2018  const ON_TextBox& text_box,
    2019  const ON_2dVector& delta
    2020  );
    2021 
    2022  static const ON_TextBox Translate(
    2023  const ON_TextBox& text_box,
    2024  const ON_2dex& delta
    2025  );
    2026 
    2027  /*
    2028  Parameters:
    2029  lhs - [in]
    2030  lhs.m_advance is ignored
    2031  rhs - [in]
    2032  rhs.m_advance is ignored
    2033  Returns:
    2034  Returned m_bbmin, m_bbmax, m_max_basepoint are the union of the lhs and rhs bounding box.
    2035  Returned m_advance = (0,0)
    2036  */
    2037  static const ON_TextBox Union(
    2038  const ON_TextBox& lhs,
    2039  const ON_TextBox& rhs
    2040  );
    2041 
    2042 public:
    2043  static const ON_TextBox Unset;
    2044 
    2045 public:
    2046  // Default units are with respect to a LOGFONT height = ON_Font::Constants::AnnotationFontCellHeight.
    2047  // and (0,0) is the font glyph base point.
    2048  //
    2049  // Application of a Scale or Translate will change distance units and base point.
    2050  //
    2051 
    2052  // Tight bounding box of the rendered glyphs.
    2053  ON_2dex m_bbmin = ON_2dex::Unset;
    2054  ON_2dex m_bbmax = ON_2dex::Unset;
    2055 
    2056  // m_max_basepoint.i = maximum horizontal delta in any line. Increases to the right, decreases to the left.
    2057  // m_max_basepoint.i = vertical delta to basline of bottom line. Increases upward, decreases downward.
    2058  ON_2dex m_max_basepoint = ON_2dex::Zero;
    2059 
    2060  // m_advance is a vector that specifies where the basepoint should be moved
    2061  // to after the text is rendered. m_advance.i and m_advance.j are is always >= 0.
    2062  // When glyphs are rendered right to left (Arabic and Hebrew being examples)
    2063  // or bottom to top, the rendering code must apply the correct sign. One reason
    2064  // is that Arabic and Hebrew text can be mixed with latin and Cyrillic text
    2065  // and text rendering is much more complicated than a signed advance can handle.
    2066  // Another is that the sign of y associated with "up" is sometimes positive and sometimes negative.
    2067  // ON_TextBox::Translate does not modify the vector m_advance.
    2068  // ON_TextBox::Union ignored input advance values and returns a box with advance = (0,0).
    2069  // 0 <= m_advance.i will be <= m_max_basepoint.i.
    2070  ON_2dex m_advance = ON_2dex::Zero;
    2071 };
    2072 
    2074 {
    2075 public:
    2076  ON_FontGlyphOutlinePoint() = default;
    2077  ~ON_FontGlyphOutlinePoint() = default;
    2079  ON_FontGlyphOutlinePoint& operator= (const ON_FontGlyphOutlinePoint&) = default;
    2080 public:
    2081  enum class ContourPointType : ON__UINT8
    2082  {
    2083  Unset = 0,
    2084  MoveTo = 1,
    2085  LineTo = 2,
    2086 
    2087  // quadratic bezier (degree=2, order=3) control point.
    2088  QuadraticBezierPoint = 3,
    2089 
    2090  // cubic bezier (degree=3, order=4) control point.
    2091  CubicBezierPoint = 4,
    2092 
    2093  // a line segment added to close an open contour.
    2094  // This is common. It does not indicate the glyph is a single stroke glyph.
    2095  LineToCloseContour = 5
    2096  };
    2097 
    2098  static ON_FontGlyphOutlinePoint::ContourPointType ContourPointTypeFromUnsigned(unsigned contour_point_type_as_unsigned);
    2099 
    2101 
    2102 public:
    2103  ON_FontGlyphOutlinePoint::ContourPointType m_point_type = ContourPointType::Unset;
    2104  ON__UINT8 m_bToPoint = 0; // 1 if the point is a move to, line to, or the start or end of a bezier segment.
    2105  // 0 otherwise
    2106  ON__UINT16 m_contour_index = 0; // 0 = unset. The first contour has m_contour_index = 1.
    2108 };
    2109 
    2110 
    2111 /*
    2112  The best way to get a useful ON_FontGlyph is to call
    2113  ON_Font.CodePointGlyph(unicode_code_point)
    2114 */
    2115 class ON_CLASS ON_FontGlyph
    2116 {
    2117 public:
    2118  /*
    2119  The best way to get a useful ON_FontGlyph is to call
    2120  ON_Font.CodePointGlyph(unicode_code_point)
    2121  */
    2122  ON_FontGlyph() = default;
    2123  ~ON_FontGlyph() = default;
    2124  ON_FontGlyph(const ON_FontGlyph& src);
    2125  ON_FontGlyph& operator=(const ON_FontGlyph& src);
    2126 
    2127 
    2128  /*
    2129  If the font and code point are valid, constructs an unmanaged
    2130  glyph with the specified font and code point.
    2131  The glyph box is not set.
    2132  */
    2133  ON_FontGlyph(
    2134  const ON_Font* font,
    2135  ON__UINT32 code_point
    2136  );
    2137 
    2138 public:
    2139  static const ON_FontGlyph Unset;
    2140 
    2141  const ON_Font* Font() const;
    2142 
    2143  const ON__UINT32 CodePoint() const;
    2144 
    2145  bool IsEndOfLineCodePoint() const;
    2146 
    2147  static bool IsEndOfLineCodePoint(
    2148  ON__UINT32 unicode_code_point
    2149  );
    2150 
    2151  static bool IsCarriageReturnAndLineFeed(
    2152  ON__UINT32 unicode_code_point,
    2153  ON__UINT32 next_unicode_code_point
    2154  );
    2155 
    2156  /*
    2157  Returns:
    2158  Glyph box in opennurbs normalized font coordinates.
    2159  */
    2160  const ON_TextBox& GlyphBox() const;
    2161 
    2162  /*
    2163  Returns:
    2164  Font unit glyph box.
    2165  Remarks:
    2166  Must be used with ON_Font::FontUnitFontMetrics() and a single font to obtain useful results.
    2167  You are probably better of using normalized font coordinates in a ON_FontGlyph.GlyphBox().
    2168  */
    2169  const ON_TextBox& FontUnitGlyphBox() const;
    2170 
    2171  static int CompareCodePointAndFont(
    2172  ON_FontGlyph& lhs,
    2173  ON_FontGlyph& rhs
    2174  );
    2175 
    2176  /*
    2177  Parameters:
    2178  text - [in]
    2179  Null terminated wchar_t string.
    2180  font - [in]
    2181  The font used to render the glyphs.
    2182  unicode_CRLF_code_point - [in]
    2183  If unicode_CRLF_code_point is a valid unicode code point,
    2184  then consecutive carriage return line feed pairs are converted
    2185  to a single glyph with code point = unicode_CRLF_code_point.
    2186 
    2187  ON_UnicodeCodePoint::ON_LineSeparator is a good choice when you want to
    2188  condense carriage return line feed pairs to a single unambiguous code point.
    2189 
    2190  ON_UnicodeCodePoint::ON_InvalidCodePoint is a good choice when you want to
    2191  preserve carriage return line feed pairs as two separate glyphs.
    2192 
    2193  glyph_list - [out]
    2194  Note that glyph_list.Count() is often different than the
    2195  length of the text string or the number of unicode codepoints
    2196  in the decoded text.
    2197  Adjacent carriage return and line feed codepoints are
    2198  converted to single a hard end of line.
    2199  All trailing end of line code points are removed from text.
    2200  Invalid unicode encoding sequences are replaced with
    2201  ON_UnicodeCodePoint::ReplacementCharacter glyphs.
    2202 
    2203  text_box - [out]
    2204  tight bounding boxt of text extents.
    2205  text_box.m_advance.i = maximum of all line horizontal advance values..
    2206  text_box.m_advance.j = vertical advance to baseline of last line
    2207  If if the font height
    2208  is ON_Font::Constants::AnnotationFontCellHeight. If you will render the font
    2209  at a different height from ON_Font::Constants::AnnotationFontCellHeight, then
    2210  use ON_TextBox::Scale as follows:
    2211  ON_TextBox scaled_box
    2212  = ON_TextBox::Scale(
    2213  text_box,
    2214  (font render height)/((double)ON_Font::Constants::AnnotationFontCellHeight)
    2215  );
    2216  Return:
    2217  number of lines of text or 0 if input is not valid or text is empty.
    2218  */
    2219  static int GetGlyphList
    2220  (
    2221  const wchar_t* text,
    2222  const ON_Font* font,
    2223  ON__UINT32 unicode_CRLF_code_point,
    2225  ON_TextBox& text_box
    2226  );
    2227 
    2228  static int GetGlyphList
    2229  (
    2230  size_t code_point_count,
    2231  ON__UINT32* code_points,
    2232  const ON_Font* font,
    2233  ON__UINT32 unicode_CRLF_code_point,
    2235  ON_TextBox& text_box
    2236  );
    2237 
    2238  /*
    2239  Parameters:
    2240  font - [in]
    2241  The font used to render the glyphs.
    2242  text_box - [out]
    2243  tight bounding boxt of text extents.
    2244  text_box.m_advance.i = maximum of all line horizontal advance values..
    2245  text_box.m_advance.j = vertical advance to baseline of last line
    2246  If if the font height
    2247  is ON_Font::Constants::AnnotationFontCellHeight. If you will render the font
    2248  at a different height from ON_Font::Constants::AnnotationFontCellHeight, then
    2249  use ON_TextBox::Scale as follows:
    2250  ON_TextBox scaled_box
    2251  = ON_TextBox::Scale(
    2252  text_box,
    2253  (font render height)/((double)ON_Font::Constants::AnnotationFontCellHeight)
    2254  );
    2255  Return:
    2256  number of lines of text or 0 if input is not valid or text is empty.
    2257  */
    2258  static int GetGlyphListBoundingBox
    2259  (
    2260  const wchar_t* text,
    2261  const ON_Font* font,
    2262  ON_TextBox& text_box
    2263  );
    2264 
    2265  static int GetGlyphListBoundingBox
    2266  (
    2267  size_t code_point_count,
    2268  ON__UINT32* code_points,
    2269  const ON_Font* font,
    2270  ON_TextBox& text_box
    2271  );
    2272 
    2273  /*
    2274  Description:
    2275  Sets the font and code point and unsets every other property including the
    2276  glyph box and substitute information.
    2277  Parameters:
    2278  font - [in]
    2279  code_point - [in]
    2280  */
    2281  bool SetCodePoint(
    2282  const ON_Font* font,
    2283  ON__UINT32 code_point
    2284  );
    2285 
    2286  /*
    2287  Returns:
    2288  True if the unicode code point and font are set
    2289  */
    2290  bool CodePointIsSet() const;
    2291 
    2292  /*
    2293  Returns:
    2294  true if this is a managed instance.
    2295  Managed instances persist for the lifetime of the application
    2296  and the pointer can be safely saved and referenced at any time.
    2297  */
    2298  bool IsManaged() const;
    2299 
    2300  /*
    2301  Returns:
    2302  If this->CodePointIsSet() is true, then a persistent pointer
    2303  to a managed glyph with the same code point and font is returned.
    2304  Otherwise nullptr is returned.
    2305  */
    2306  const ON_FontGlyph* ManagedGlyph() const;
    2307 
    2308  /*
    2309  Parameters:
    2310  bUseReplacementCharacter - [in]
    2311  When this->CodePointIsSet() is true,
    2312  and bUseReplacementCharacter is true,
    2313  and no reasonable glyph definition exists,
    2314  and no substitued is available,
    2315  then the replacement character glyph for UNICODE code point
    2316  ON_UnicodeCodePoint::ON_ReplacementCharacter (U+FFFD) will be returned.
    2317 
    2318  Returns:
    2319  A managed glyph that can be used to render "this".
    2320  If this->CodePointIsSet() is false, nullptr is returned.
    2321  If this->CodePointIsSet() is true, the returned glyph may
    2322  have a different font and code point when the current
    2323  computer requires font or glyph substitution to draw
    2324  the glyph. When the current platform cannot render this,
    2325  nullptr or the replacement glyph is returned depending on
    2326  the value of bUseReplacementCharacter.
    2327 
    2328  See Also:
    2329  ON_FontGlyph.SubstituteGlyph().
    2330  */
    2331  const ON_FontGlyph* RenderGlyph(
    2332  bool bUseReplacementCharacter
    2333  ) const;
    2334 
    2335  /*
    2336  Returns:
    2337  If this is a managed glyph or a copy of a managed glyph,
    2338  and a substitute font or code point is used to render the glyph,
    2339  then the substitue is returned.
    2340  In all other cases, nullptr is returned.
    2341  See Also:
    2342  ON_FontGlyph.RenderGlyph().
    2343  */
    2344  const ON_FontGlyph* SubstituteGlyph() const;
    2345 
    2346  /*
    2347  Parameters:
    2348  bIncludeCharMaps - [in]
    2349  If true, then char information is printed.
    2350  */
    2351  void Dump(
    2352  bool bIncludeCharMaps,
    2353  ON_TextLog& text_log
    2354  ) const;
    2355 
    2356  /*
    2357  Description:
    2358  This is a debugging tool to test the code that starts with a font and
    2359  Unicode code point and and finds a glyph in the font definition for
    2360  that code point.
    2361  Parameters:
    2362  text_log - [in]
    2363  If text_log is not nullptr, then diagnostic messages are sent to this log.
    2364  Returns:
    2365  True:
    2366  No errors were found. Every available charmap either returned the same glyph id
    2367  that FontGlyphId() function returns or had no glyph id for this code point.
    2368  False:
    2369  Inconsistent results were returned from different charmaps.
    2370  Remarks:
    2371  If a font or charmap is known to contain a bug and that bug is
    2372  handled by opennurbs, then true is returned and a message is printed
    2373  to the log.
    2374  */
    2375  bool TestFaceCharMaps(
    2376  ON_TextLog* text_log
    2377  ) const;
    2378 
    2379 public:
    2380 
    2381  const ON__UINT_PTR FreeTypeFace() const;
    2382 
    2383  /*
    2384  Returns:
    2385  Font glyph id.
    2386  Remarks:
    2387  The glyph id depends on the font and is assigned by the font designer.
    2388  In particular the font glyph id for the same Unicode code point
    2389  often varies from font to font. In a font, it is often the case that
    2390  multiple Unicode code points map to the same glyph. For example,
    2391  space an non-breaking space typically map to the same font glyph id.
    2392  */
    2393  const ON__UINT_PTR FontGlyphId() const;
    2394 
    2395  /*
    2396  Description:
    2397  Get glyph contours as NURBS curves.
    2398  Parameters:
    2399  bSingleStrokeFont - [in]
    2400  If true, open contours will not be closed by adding a line segment.
    2401  text_height - [in]
    2402  If > 0, ouptut curves, bounding box, and advance vector are scaled
    2403  so that a capital latin letter I would have a height of text_height.
    2404  Otherwise, no scaling is applied to the output curves, bounding box,
    2405  and advance vector.
    2406  Pass 0.0 or in this->Font()->HeightOfI() to get the contours to be in opennurbs
    2407  normalized font coordinates.
    2408  Pass ON_UNSET_VALUE to get the contours to be in native font definition units.
    2409  All other values < 0 are treated as 0.0.
    2410  glyph_contours - [out]
    2411  glyph_bbox - [out]
    2412  glyph bounding box.
    2413  glyph_advance - [out]
    2414  glyph_advance->x = horizontal advance to apply when rendering glyphs horizontally.
    2415  A positive horizontal advance indicates advance to the right.
    2416  glyph_advance->y = vertical advance to apply when rendering glyphs vertically.
    2417  A positive vertical advance indicates advance downwards.
    2418  */
    2419  bool GetGlyphContours(
    2420  bool bSingleStrokeFont,
    2421  double text_height,
    2422  ON_ClassArray< ON_SimpleArray< ON_Curve* > >& glyph_contours,
    2423  ON_BoundingBox* glyph_bbox,
    2424  ON_3dVector* glyph_advance
    2425  ) const;
    2426 
    2427  static bool GetStringContours(
    2428  const wchar_t* text_string,
    2429  const ON_Font* font,
    2430  bool bSingleStrokeFont,
    2431  double text_height,
    2432  double small_caps_scale,
    2434  );
    2435 
    2436 
    2437 private:
    2438  friend class ON_GlyphMap;
    2439  friend class ON_Font;
    2440 
    2441  // NOTE WELL:
    2442  // The offset of m_codepoint in ON_FontGlyph must be >= 8 bytes.
    2443  // so the ON_FixeSizePool that manages memory for the glyph cache
    2444  // can efficiently iteratate all active managed glyphs.
    2445  //
    2446  ON_TextBox m_font_unit_glyph_bbox; // values in the native font definition units (freetype FT_LOAD_NO_SCALE units)
    2447  ON_TextBox m_normalized_glyph_bbox; // bounding box in opennurbs normalized font coordinates
    2448 
    2449  // This box is for the platform native glyph. It can be different than m_glyph_box.
    2450  // Example:
    2451  // Start with a Windows LOGFONT with face = Arial, height = ON_Font::Constants::AnnotationFontCellHeight (256)
    2452  // Native Windows height of Arial I = 165, height of LF = ...
    2453  // FreeType made from the same LOGFONT on the same has height of Arial I = 184, height of LF = ...
    2454 
    2455  // When font does not contain a glyph to render a specified unicode codepoint,
    2456  // then one or more glyphs from one or more subsitution fonts are used to
    2457  // render the codepoint. In this case, m_substitutes points to a linked
    2458  // list of substitute used to render the glyph.
    2459  //
    2460  ON__UINT32 m_code_point = ON_UnicodeCodePoint::ON_InvalidCodePoint;
    2461 
    2462  ON__UINT8 m_is_managed = 0; // 1 = managed glyph
    2463  ON__UINT8 m_reserved1 = 0;
    2464  ON__UINT16 m_reserved2 = 0;
    2465  ON__UINT_PTR m_font_glyph_id = 0;
    2466  const class ON_Font* m_managed_font = nullptr;
    2467  const class ON_FontGlyph* m_substitute = nullptr;
    2468 
    2469 
    2470 private:
    2471  void Internal_SetFontGlyphId(ON__UINT_PTR font_glyph_id);
    2472  void Internal_CopyFrom(const ON_FontGlyph& src);
    2473  static ON_FontGlyph* Internal_AllocateManagedGlyph(const ON_FontGlyph& src);
    2474  bool Internal_GetPlatformSubstitute(
    2475  ON_FontGlyph& substitue
    2476  ) const;
    2477 };
    2478 
    2479 
    2480 #if defined(ON_RUNTIME_WIN)
    2481 
    2482 /*
    2483 Remarks:
    2484  Windows GDI functions used by ON_WindowsMeasureGlyph fail when the
    2485  UTF-16 encoding of unicode_code_point requires a surrogate pair.
    2486 */
    2487 ON_DECL
    2488 bool ON_WindowsGetGlyphMetrics(
    2489  const ON_Font* font,
    2490  ON__UINT32 unicode_code_point,
    2491  class ON_TextBox& font_unit_glyph_box
    2492 );
    2493 
    2494 
    2495 
    2496 #endif
    2497 
    2498 
    2499 #if defined(ON_DLL_TEMPLATE)
    2500 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Font*>;
    2501 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_Font*>;
    2502 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Font>;
    2503 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_FontGlyph*>;
    2504 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_FontGlyph*>;
    2505 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_FontGlyph>;
    2506 #endif
    2507 
    2508 #endif
    2509 
    2510 
    Constants
    miscellaneous constants use to initialize Windows LOGFONT fields
    Definition: opennurbs_font.h:1453
    +
    friend class ON_Font
    Definition: opennurbs_font.h:2439
    Definition: opennurbs_ipoint.h:24
    ON_UUID is a 16 byte universally unique identifier.
    Definition: opennurbs_uuid.h:32
    Weight
    Weight enum values Avoid casting these values to int. Use ON_Font::WindowsLogfontWeightFromWeight() o...
    Definition: opennurbs_font.h:237
    -
    Definition: opennurbs_font.h:2097
    -
    WindowsConstants
    Definition: opennurbs_font.h:1494
    +
    Definition: opennurbs_font.h:1988
    +
    WindowsConstants
    Definition: opennurbs_font.h:1409
    static const ON_2iPoint Unset
    (ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX)
    Definition: opennurbs_ipoint.h:46
    Definition: opennurbs_array.h:36
    Stretch
    Horizontal expansion or contraction of font
    Definition: opennurbs_font.h:428
    @@ -87,17 +85,17 @@ $(function() {
    const ON__UINT_PTR FreeTypeFace() const
    Definition: opennurbs_point.h:292
    static const double DefaultLineFeedRatio
    1.6
    Definition: opennurbs_font.h:37
    -
    Definition: opennurbs_font.h:2224
    +
    Definition: opennurbs_font.h:2115
    Definition: opennurbs_font.h:18
    Definition: opennurbs_bounding_box.h:25
    -
    Definition: opennurbs_font.h:2182
    -
    Definition: opennurbs_internal_glyph.h:80
    +
    Definition: opennurbs_font.h:2073
    +
    Definition: opennurbs_internal_glyph.h:85
    An ON_Font is a face in a font family. It corresponds to a Windows LOGFONT, a .NET System...
    Definition: opennurbs_font.h:225
    -
    static const ON_FontGlyphOutlinePoint Unset
    Definition: opennurbs_font.h:2209
    -
    static const ON_TextBox Unset
    Definition: opennurbs_font.h:2152
    +
    static const ON_FontGlyphOutlinePoint Unset
    Definition: opennurbs_font.h:2100
    +
    static const ON_TextBox Unset
    Definition: opennurbs_font.h:2043
    void Dump(bool bIncludeCharMaps, ON_TextLog &text_log) const
    static const ON_FontMetrics Unset
    All properties are zero.
    Definition: opennurbs_font.h:29
    -
    static const ON_FontGlyph Unset
    Definition: opennurbs_font.h:2248
    +
    static const ON_FontGlyph Unset
    Definition: opennurbs_font.h:2139
    Definition: opennurbs_array.h:412
    Definition: opennurbs_textlog.h:20
    < use for generic serialization of binary data
    Definition: opennurbs_archive.h:1866
    @@ -105,13 +103,13 @@ $(function() {
    Style
    Vertical angle of font Upright, Italic, or Oblique
    Definition: opennurbs_font.h:475
    Definition: opennurbs_point.h:868
    Definition: opennurbs_point.h:1182
    -
    ContourPointType
    Definition: opennurbs_font.h:2190
    +
    ContourPointType
    Definition: opennurbs_font.h:2081
    diff --git a/6/d6/de3/opennurbs__text__style_8h_source.html b/6/d6/de3/opennurbs__text__style_8h_source.html index 9b10801f..46222088 100644 --- a/6/d6/de3/opennurbs__text__style_8h_source.html +++ b/6/d6/de3/opennurbs__text__style_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_text_style.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_text_style.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d6/de7/class_o_n___obsolete_user_data-members.html b/6/d6/de7/class_o_n___obsolete_user_data-members.html index 94dbdcc0..156f1081 100644 --- a/6/d6/de7/class_o_n___obsolete_user_data-members.html +++ b/6/d6/de7/class_o_n___obsolete_user_data-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/de8/class_o_n___clipping_plane.html b/6/d6/de8/class_o_n___clipping_plane.html index c31bee25..a8d9aec5 100644 --- a/6/d6/de8/class_o_n___clipping_plane.html +++ b/6/d6/de8/class_o_n___clipping_plane.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ClippingPlane Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/df2/class_o_n___offset_surface_value.html b/6/d6/df2/class_o_n___offset_surface_value.html index 4220b9eb..978e2169 100644 --- a/6/d6/df2/class_o_n___offset_surface_value.html +++ b/6/d6/df2/class_o_n___offset_surface_value.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_OffsetSurfaceValue Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/df5/class_o_n___plane_equation-members.html b/6/d6/df5/class_o_n___plane_equation-members.html index 44a2b168..5539f232 100644 --- a/6/d6/df5/class_o_n___plane_equation-members.html +++ b/6/d6/df5/class_o_n___plane_equation-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d6/df6/struct_o_n___r_tree_branch.html b/6/d6/df6/struct_o_n___r_tree_branch.html index 818e505b..8e743ef0 100644 --- a/6/d6/df6/struct_o_n___r_tree_branch.html +++ b/6/d6/df6/struct_o_n___r_tree_branch.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RTreeBranch Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d08/opennurbs__date_8h_source.html b/6/d7/d08/opennurbs__date_8h_source.html index be2a9085..4b74e61d 100644 --- a/6/d7/d08/opennurbs__date_8h_source.html +++ b/6/d7/d08/opennurbs__date_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_date.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_date.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_DATE_INC_)
    18 #define OPENNURBS_DATE_INC_
    19 
    20 /*
    21 Description:
    22  Get the day of the year from the year, month and day_of_month.
    23 Parameters:
    24  year - [in]
    25  >= 1582
    26  month - [in]
    27  >= 1 and <= 12
    28  day_of_month - [in]
    29  >= 1 and <= last valid day_of_month of the month
    30 Returns:
    31  0: Invalid input
    32  1 to 366: Day of Gregorian year.
    33 */
    34 ON_DECL
    35 unsigned int ON_DayOfGregorianYear(
    36  unsigned int year,
    37  unsigned int month,
    38  unsigned int day_of_month
    39  );
    40 
    41 /*
    42 Parameters:
    43  year - [in]
    44  >= 1582
    45 Returns:
    46  0: Invalid input
    47  365: If the year is a common year in the Gregorian calendar
    48  366: If the year is a leap year in the Gregorian calendar
    49 */
    50 ON_DECL
    51 unsigned int ON_DaysInGregorianYear(
    52  unsigned int year
    53  );
    54 /*
    55 Description:
    56  Get the number of days in a Gregorian month.
    57 Parameters:
    58  year - [in]
    59  >= 1582
    60  month - [in]
    61  >= 1 and <= 12
    62 Returns:
    63  0: Invalid input
    64  28, 29, 30 or 31: number of days in the specified month.
    65 */
    66 ON_DECL
    67 unsigned int ON_DaysInMonthOfGregorianYear(
    68  unsigned int year,
    69  unsigned int month
    70  );
    71 
    72 /*
    73 Description:
    74  Get the month and day_of_month from the year and day of year.
    75 Parameters:
    76  year - [in]
    77  >= 1582
    78  day_of_year
    79  >= 1 and <= (ON_IsGregorianLeapYear(year) ? 366 : 365)
    80  month - [out]
    81  >= 1 and <= 12, when input parameters are valid, otherwise 0.
    82  day_of_month - [out]
    83  >= 1 and <= ON_DaysInMonthOfGregorianYear(year,month),
    84  when input parameters are valid, otherwise 0.
    85 Returns:
    86  true: month and day_of_month returned.
    87  false: invalid input. Output values are zero.
    88 */
    89 ON_DECL
    90 bool ON_GetGregorianMonthAndDayOfMonth(
    91  unsigned int year,
    92  unsigned int day_of_year,
    93  unsigned int* month,
    94  unsigned int* day_of_month
    95  );
    96 
    97 /*
    98 Parameters:
    99  year - [in]
    100 Returns:
    101  true if the year is a leap year in the Gregorian calendar.
    102 */
    103 ON_DECL
    104 bool ON_IsGregorianLeapYear(
    105  unsigned int year
    106  );
    107 
    108 #endif
    diff --git a/6/d7/d10/class_o_n___r_tree_mem_pool.html b/6/d7/d10/class_o_n___r_tree_mem_pool.html index 460649df..ab33d7da 100644 --- a/6/d7/d10/class_o_n___r_tree_mem_pool.html +++ b/6/d7/d10/class_o_n___r_tree_mem_pool.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RTreeMemPool Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d14/class_o_n___uuid_pair.html b/6/d7/d14/class_o_n___uuid_pair.html index 2cf2dbe4..b5e8ed2a 100644 --- a/6/d7/d14/class_o_n___uuid_pair.html +++ b/6/d7/d14/class_o_n___uuid_pair.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UuidPair Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d15/class_o_n___text_iterator-members.html b/6/d7/d15/class_o_n___text_iterator-members.html index d999c49a..cf8de06d 100644 --- a/6/d7/d15/class_o_n___text_iterator-members.html +++ b/6/d7/d15/class_o_n___text_iterator-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d16/class_o_n___uuid_ptr_list.html b/6/d7/d16/class_o_n___uuid_ptr_list.html index c79a1a33..17c67203 100644 --- a/6/d7/d16/class_o_n___uuid_ptr_list.html +++ b/6/d7/d16/class_o_n___uuid_ptr_list.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UuidPtrList Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Adds a uuid-index pair to the list. Parameters: uuid - [in] id to add.
    - This uuid cannot be ON_max_uuid because ON_max_uuid is bCheckForDupicates - [in] if true, then the uuid is not added if it is already in the list. If you are certain that the uuid is not in the list and you have a have a large collection of uuids, then setting bCheckForDupicates=false will speed up the addition of uuids. Returns: True if uuid was added. False if uuid was not added because it is already in the collection.

    +

    Description: Adds a uuid-index pair to the list. Parameters: uuid - [in] id to add. This uuid cannot be ON_max_uuid because ON_max_uuid is bCheckForDupicates - [in] if true, then the uuid is not added if it is already in the list. If you are certain that the uuid is not in the list and you have a have a large collection of uuids, then setting bCheckForDupicates=false will speed up the addition of uuids. Returns: True if uuid was added. False if uuid was not added because it is already in the collection.

    @@ -446,9 +443,9 @@ Public Member Functions diff --git a/6/d7/d1d/class_o_n___terminator-members.html b/6/d7/d1d/class_o_n___terminator-members.html index da5407f0..bad76e72 100644 --- a/6/d7/d1d/class_o_n___terminator-members.html +++ b/6/d7/d1d/class_o_n___terminator-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d20/class_o_n___matrix.html b/6/d7/d20/class_o_n___matrix.html index fb60e4cd..824a9aa1 100644 --- a/6/d7/d20/class_o_n___matrix.html +++ b/6/d7/d20/class_o_n___matrix.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Matrix Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d26/class_o_n___nurbs_cage.html b/6/d7/d26/class_o_n___nurbs_cage.html index 3484b624..5c372fc9 100644 --- a/6/d7/d26/class_o_n___nurbs_cage.html +++ b/6/d7/d26/class_o_n___nurbs_cage.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_NurbsCage Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    P = v[0],...,v[m_dim-1] Dr = v[v_stride],... Ds = v[2*v_stride],... Dt = v[3*v_stride],...

    In general, Dr^i Ds^j Dt^k is returned in v[n],...,v[n+m_dim-1], where

    d = (i+j+k) n = v_stride*( d*(d+1)*(d+2)/6 + (j+k)*(j+k+1)/2 + k)

    -

    side - [in] specifies the span to use for the evaluation when r, s, or t is at a knot value. 0 = default 1 = from upper NE quadrant 2 = from upper NW quadrant 3 = from upper SW quadrant 4 = from upper SE quadrant 5 = from lower NE quadrant 6 = from lower NW quadrant 7 = from lower SW quadrant 8 = from lower SE quadrant
    - hint - [in/out] If a bunch of evaluations will be performed that tend to occur in the same region, then hint[3] can be used to speed the search for the evaluation span. The input value is used as a search hint and the output value records the span used for that evaluation. Example:

        int der_count = 2;
    +

    side - [in] specifies the span to use for the evaluation when r, s, or t is at a knot value. 0 = default 1 = from upper NE quadrant 2 = from upper NW quadrant 3 = from upper SW quadrant 4 = from upper SE quadrant 5 = from lower NE quadrant 6 = from lower NW quadrant 7 = from lower SW quadrant 8 = from lower SE quadrant hint - [in/out] If a bunch of evaluations will be performed that tend to occur in the same region, then hint[3] can be used to speed the search for the evaluation span. The input value is used as a search hint and the output value records the span used for that evaluation. Example:

        int der_count = 2;
         int v_stride = dim;
         double v[v_stride*(der_count+1)*(der_count+2)*(der_count+3)/6];
         int side = 0;
    @@ -2802,9 +2799,9 @@ Additional Inherited Members
     
    diff --git a/6/d7/d29/class_o_n___font_glyph.html b/6/d7/d29/class_o_n___font_glyph.html index b6de8c62..5fc4251d 100644 --- a/6/d7/d29/class_o_n___font_glyph.html +++ b/6/d7/d29/class_o_n___font_glyph.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_FontGlyph Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    - - + + @@ -287,8 +285,8 @@ Friends - -

    ◆ CompareCodePointAndFont()

    + +

    ◆ CompareCodePointAndFont()

    @@ -299,13 +297,13 @@ Friends
    - + - + @@ -521,8 +519,7 @@ Friends

    Static Public Member Functions

    static int CompareCodePointAndFont (const ON_FontGlyph &lhs, const ON_FontGlyph &rhs)
     
    static int CompareCodePointAndFont (ON_FontGlyph &lhs, ON_FontGlyph &rhs)
     
    static int GetGlyphList (const wchar_t *text, const ON_Font *font, ON__UINT32 unicode_CRLF_code_point, ON_SimpleArray< const ON_FontGlyph *> &glyph_list, ON_TextBox &text_box)
     
    static int GetGlyphList (size_t code_point_count, ON__UINT32 *code_points, const ON_Font *font, ON__UINT32 unicode_CRLF_code_point, ON_SimpleArray< const ON_FontGlyph *> &glyph_list, ON_TextBox &text_box)
    static int ON_FontGlyph::CompareCodePointAndFont (const ON_FontGlyphON_FontGlyph lhs,
    const ON_FontGlyphON_FontGlyph rhs 

    Parameters: text - [in] Null terminated wchar_t string. font - [in] The font used to render the glyphs. unicode_CRLF_code_point - [in] If unicode_CRLF_code_point is a valid unicode code point, then consecutive carriage return line feed pairs are converted to a single glyph with code point = unicode_CRLF_code_point.

    -

    ON_UnicodeCodePoint::ON_LineSeparator is a good choice when you want to
    - condense carriage return line feed pairs to a single unambiguous code point.

    +

    ON_UnicodeCodePoint::ON_LineSeparator is a good choice when you want to condense carriage return line feed pairs to a single unambiguous code point.

    ON_UnicodeCodePoint::ON_InvalidCodePoint is a good choice when you want to preserve carriage return line feed pairs as two separate glyphs.

    glyph_list - [out] Note that glyph_list.Count() is often different than the length of the text string or the number of unicode codepoints in the decoded text. Adjacent carriage return and line feed codepoints are converted to single a hard end of line. All trailing end of line code points are removed from text. Invalid unicode encoding sequences are replaced with ON_UnicodeCodePoint::ReplacementCharacter glyphs.

    text_box - [out] tight bounding boxt of text extents. text_box.m_advance.i = maximum of all line horizontal advance values.. text_box.m_advance.j = vertical advance to baseline of last line If if the font height is ON_Font::Constants::AnnotationFontCellHeight. If you will render the font at a different height from ON_Font::Constants::AnnotationFontCellHeight, then use ON_TextBox::Scale as follows: ON_TextBox scaled_box = ON_TextBox::Scale( text_box, (font render height)/((double)ON_Font::Constants::AnnotationFontCellHeight) ); Return: number of lines of text or 0 if input is not valid or text is empty.

    @@ -1049,9 +1046,9 @@ Friends
    diff --git a/6/d7/d2a/class_o_n___user_data-members.html b/6/d7/d2a/class_o_n___user_data-members.html index c6441c4a..7b2b86d1 100644 --- a/6/d7/d2a/class_o_n___user_data-members.html +++ b/6/d7/d2a/class_o_n___user_data-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d2c/class_o_n__3d_vector_array.html b/6/d7/d2c/class_o_n__3d_vector_array.html index 5a3dcf9c..4e54d86e 100644 --- a/6/d7/d2c/class_o_n__3d_vector_array.html +++ b/6/d7/d2c/class_o_n__3d_vector_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dVectorArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d2d/class_o_n___brep_trim-members.html b/6/d7/d2d/class_o_n___brep_trim-members.html index 8a216c0f..f815c4e2 100644 --- a/6/d7/d2d/class_o_n___brep_trim-members.html +++ b/6/d7/d2d/class_o_n___brep_trim-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d31/class_o_n___viewport-members.html b/6/d7/d31/class_o_n___viewport-members.html index 75cb23b3..94877d58 100644 --- a/6/d7/d31/class_o_n___viewport-members.html +++ b/6/d7/d31/class_o_n___viewport-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d36/class_o_n___poly_edge_curve-members.html b/6/d7/d36/class_o_n___poly_edge_curve-members.html index 35d65da2..ac07b3f2 100644 --- a/6/d7/d36/class_o_n___poly_edge_curve-members.html +++ b/6/d7/d36/class_o_n___poly_edge_curve-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d42/opennurbs__objref_8h_source.html b/6/d7/d42/opennurbs__objref_8h_source.html index 9029f630..dffdffb3 100644 --- a/6/d7/d42/opennurbs__objref_8h_source.html +++ b/6/d7/d42/opennurbs__objref_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_objref.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_objref.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d43/class_o_n___clipping_plane_surface-members.html b/6/d7/d43/class_o_n___clipping_plane_surface-members.html index 85e6958b..7ae43ef1 100644 --- a/6/d7/d43/class_o_n___clipping_plane_surface-members.html +++ b/6/d7/d43/class_o_n___clipping_plane_surface-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d46/class_o_n__3dm_settings-members.html b/6/d7/d46/class_o_n__3dm_settings-members.html index f9cb97f6..73db182b 100644 --- a/6/d7/d46/class_o_n__3dm_settings-members.html +++ b/6/d7/d46/class_o_n__3dm_settings-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d4a/opennurbs__parse_8h_source.html b/6/d7/d4a/opennurbs__parse_8h_source.html index 9c868bfa..0dc336a5 100644 --- a/6/d7/d4a/opennurbs__parse_8h_source.html +++ b/6/d7/d4a/opennurbs__parse_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_parse.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_parse.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_parse.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(ON_PARSE_INC_)
    18 #define ON_PARSE_INC_
    19 
    21 {
    22 public:
    28 
    29  ////////////////////////////////////////////////////////////
    30  //
    31  // Configuration Settings
    32  //
    33  bool ImpliedMultiplication() const;
    34  void SetImpliedMultiplication(
    35  bool bEnable
    36  );
    37 
    38 
    39  ////////////////////////////////////////////////////////////
    40  //
    41  // Current Status
    42  //
    44  {
    45  no_error = 0,
    46 
    47  program_error = 1,
    48  // The part of the computer running the ON_ArithmeticCalculator
    49  // code is corrupt or damaged or there is a bug in the
    50  // ON_ArithmeticCalculator code.
    51 
    52  invalid_expression_error = 2,
    53  // The input expression does not make sense.
    54 
    55  divide_by_zero_error = 3,
    56  // A calculation requested division by zero.
    57 
    58  overflow_error = 4,
    59  // A calculation produced a number the computer cannot represent
    60  };
    61 
    62  ERROR_CONDITION ErrorCondition() const;
    63 
    64  /*
    65  Returns:
    66  True if a unary plus is pending and will be applied
    67  to the next number or parenthetical expression.
    68  */
    69  bool PendingUnaryPlus() const;
    70 
    71  /*
    72  Returns:
    73  True if a unary minus is pending and will be applied
    74  to the next number or parenthetical expression.
    75  */
    76  bool PendingUnaryMinus() const;
    77 
    78  /*
    79  Returns:
    80  True if a unary plus or unary minus is pending
    81  */
    82  bool PendingUnaryOperation() const;
    83 
    84  /*
    85  Returns:
    86  True if an implied multiplication will be applied
    87  to the next number or parenthetical expression.
    88  */
    89  bool PendingImpliedMultiplication() const;
    90 
    91  /*
    92  Returns:
    93  The current number of parenthetic expressions that
    94  are not completed.
    95  */
    96  unsigned int ParenthesesDepth() const;
    97 
    98  ////////////////////////////////////////////////////////////
    99  //
    100  // Calculator keys
    101  //
    102 
    103  /*
    104  Description:
    105  Enter a number that can be used as an implied multiplication
    106  operand when implied multiplication is enabled and appropriate.
    107  */
    108  bool Number(double x);
    109 
    110  /*
    111  Description:
    112  Enter a number that will never use implied multiplication.
    113  */
    114  bool SimpleNumber(double x);
    115 
    116  /*
    117  Description:
    118  Enter an explicit multiplication operator whose operands
    119  are the previous value and the next value, where a value
    120  is a number, simple number, or parenthetic expression.
    121  */
    122  bool Multiply();
    123 
    124  /*
    125  Description:
    126  Enter an explicit division operator whose operands
    127  are the previous value and the next value, where a value
    128  is a number, simple number, or parenthetic expression.
    129  If the second value is zero, the calculator state
    130  is set to error.
    131  */
    132  bool Divide();
    133 
    134  /*
    135  Description:
    136  Enter an explicit addition operator whose operands
    137  are the previous value and the next value, where a value
    138  is a number, simple number, or parenthetic expression.
    139  */
    140  bool Add();
    141 
    142  /*
    143  Description:
    144  Enter an explicit subtraction operator whose operands
    145  are the previous value and the next value, where a value
    146  is a number, simple number, or parenthetic expression.
    147  */
    148  bool Subtract();
    149 
    150  /*
    151  Description:
    152  Enter an unary plus operator whose operand is the next
    153  number, simple number, or parenthetic expression.
    154  */
    155  bool UnaryPlus();
    156 
    157  /*
    158  Description:
    159  Enter an unary minus operator whose operand is the next
    160  number, simple number, or parenthetic expression.
    161  */
    162  bool UnaryMinus();
    163 
    164  /*
    165  Description:
    166  Begin a parenthetic expression.
    167  */
    168  bool LeftParenthesis();
    169 
    170  /*
    171  Description:
    172  End a parenthetic expression.
    173  */
    174  bool RightParenthesis();
    175 
    176  /*
    177  Description:
    178  Calculate the current value.
    179  */
    180  bool Evaluate(double* value);
    181 
    182  /*
    183  Description:
    184  Clear all status, values and expressions.
    185  */
    186  void ClearAll();
    187 
    188 private:
    189  class ON_ArithmeticCalculatorImplementation* m_pCalc;
    190  double m_inplace_buffer[127]; // used for in-place construction of pCalc.
    191 };
    192 
    193 class ON_CLASS ON_LengthUnitName
    194 {
    195 public:
    196  ON_LengthUnitName() = default;
    197  ~ON_LengthUnitName() = default;
    198  ON_LengthUnitName(const ON_LengthUnitName&) = default;
    199  ON_LengthUnitName& operator=(const ON_LengthUnitName&) = default;
    200 
    201  static const ON_LengthUnitName None;
    202 
    203  /*
    204  Description:
    205  Get list of length unit names and abbreviations and their corresponding
    206  unit systems that are recognized by ON_ParseLengthUnitSystemName().
    207 
    208  Parameters:
    209  length_unit_list_capacity - [in]
    210  number of available elements in length_unit_list[]
    211  If length_unit_list_capacity is zero and length_unit_list is null,
    212  then the number of length unit names is returned.
    213  length_unit_list - [out]
    214  The list of length unit names is returned here.
    215 
    216  Returns:
    217  Number of length unit names and abbreviations.
    218 
    219  Example:
    220  unsigned int count = ON_GetLengthUnitNameList(0,0);
    221  ON_UnitName* length_unit_list = new (std::nothrow) ON_UnitName[capacity];
    222  count = ON_GetLengthUnitNameList(count,length_unit_list);
    223  ...
    224  delete[] length_unit_list;
    225  Remarks:
    226  If length_unit_list_capacity is zero and length_unit_list is null,
    227  then the number of length unit names is returned.
    228  */
    229  static unsigned int GetLengthUnitNameList(
    230  size_t length_unit_list_capacity,
    231  class ON_LengthUnitName* length_unit_list
    232  );
    233 
    234  static ON_LengthUnitName Create(
    235  unsigned int locale_id,
    236  ON::LengthUnitSystem length_unit_system,
    237  bool bPlural
    238  );
    239 
    240  /*
    241  Description:
    242  Dictionary compare of all ON_LengthUnitName information in the order
    243  unit system, locale id, name, singular, plural
    244  */
    245  static int CompareUnitSystemLocaleIdName(
    246  const ON_LengthUnitName& a,
    247  const ON_LengthUnitName& b
    248  );
    249 
    250  /*
    251  Description:
    252  Dictionary compare of all ON_LengthUnitName information in the order
    253  locale id, unit system, name, singular, plural
    254  */
    255  static int CompareLocaleIdUnitSystemName(
    256  const ON_LengthUnitName& a,
    257  const ON_LengthUnitName& b
    258  );
    259 
    260  unsigned int LocaleId() const;
    261 
    262  ON::LengthUnitSystem LengthUnit() const;
    263 
    264  /*
    265  Returns:
    266  True if the length unit system is set.
    267  False if length unit system is ON::LengthUnitSystem::None or ON::LengthUnitSystem::Unset.
    268  */
    269  bool LengthUnitIsSet() const;
    270 
    271  /*
    272  Returns:
    273  True if the length unit system is set or is ON::LengthUnitSystem::None
    274  */
    275  bool LengthUnitIsSetOrNone() const;
    276 
    277  /*
    278  Returns:
    279  True if the length unit system is set and the name is not empty.
    280  False if length unit system is ON::LengthUnitSystem::None or ON::LengthUnitSystem::Unset or the name is empty.
    281  */
    282  bool LengthUnitAndNameAreSet() const;
    283 
    284  /*
    285  Returns:
    286  A pointer to a localized length unit name or a pointer to an empty string.
    287  Remarks:
    288  Never returns nullptr.
    289  */
    290  const wchar_t* LengthUnitName() const;
    291 
    292  bool LengthUnitNameIsEmpty() const;
    293 
    294  bool LengthUnitNameIsNotEmpty() const;
    295 
    296  /*
    297  Remarks:
    298  True if the length unit name is singular in languages where that question
    299  has a meaningful answer.
    300  Remarks:
    301  Some names and name abbreviations are both singular and plural.
    302  */
    303  bool LengthUnitNameIsSingular() const;
    304 
    305  /*
    306  Remarks:
    307  True if the length unit name is plural in languages where that question
    308  has a meaningful answer.
    309  Remarks:
    310  Some names and name abbreviations are both singular and plural.
    311  */
    312  bool LengthUnitNameIsPlural() const;
    313 
    314 private:
    315  // Microsoft locale id // http://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).aspx
    316  unsigned int m_locale_id = 0;
    317  ON::LengthUnitSystem m_length_unit_system = ON::LengthUnitSystem::None;
    318  bool m_bNameIsSingular = false;
    319  bool m_bNameIsPlural = false;
    320  const wchar_t* m_name = nullptr;
    321 
    322 private:
    323  static int Internal_Compare(
    324  unsigned int order_selector,
    325  const ON_LengthUnitName& a,
    326  const ON_LengthUnitName& b
    327  );
    328 };
    329 
    330 ON_DECL
    331 bool operator==(
    332  const ON_LengthUnitName& a,
    333  const ON_LengthUnitName& b
    334  );
    335 
    336 ON_DECL
    337 bool operator!=(
    338  const ON_LengthUnitName& a,
    339  const ON_LengthUnitName& b
    340  );
    341 
    342 class ON_CLASS ON_AngleUnitName
    343 {
    344 public:
    345  ON_AngleUnitName() = default;
    346  ~ON_AngleUnitName() = default;
    347  ON_AngleUnitName(const ON_AngleUnitName&) = default;
    348  ON_AngleUnitName& operator=(const ON_AngleUnitName&) = default;
    349 
    350  static const ON_AngleUnitName None;
    351 
    352  /*
    353  Description:
    354  Get list of angle unit names and abbreviations and their corresponding
    355  unit systems that are recognized by ON_ParseAngleUnitName().
    356 
    357  Parameters:
    358  angle_unit_list_capacity - [in]
    359  number of available elements in angle_unit_list[]
    360  If angle_unit_list_capacity is zero and angle_unit_list is null,
    361  then the number of angle unit names is returned.
    362  angle_unit_list - [out]
    363  The list of angle unit names is returned here.
    364 
    365  Returns:
    366  Number of angle unit names and abbreviations.
    367 
    368  Example:
    369  unsigned int count = ON_GetAngleUnitNameList(0,0);
    370  ON_UnitName* angle_unit_list = new (std::nothrow) ON_UnitName[capacity];
    371  count = ON_GetAngleUnitNameList(count,angle_unit_list);
    372  ...
    373  delete[] angle_unit_list;
    374  Remarks:
    375  If angle_unit_list_capacity is zero and angle_unit_list is null,
    376  then the number of angle unit names is returned.
    377  */
    378  static unsigned int GetAngleUnitNameList(
    379  size_t angle_unit_list_capacity,
    380  class ON_AngleUnitName* angle_unit_list
    381  );
    382 
    383  static ON_AngleUnitName Create(
    384  unsigned int locale_id,
    385  ON::AngleUnitSystem angle_unit_system,
    386  bool bPlural
    387  );
    388 
    389  /*
    390  Description:
    391  Dictionary compare of all ON_LengthUnitName information in the order
    392  unit system, locale id, name, singular, plural
    393  */
    394  static int CompareUnitSystemLocaleIdName(
    395  const ON_AngleUnitName& a,
    396  const ON_AngleUnitName& b
    397  );
    398 
    399  /*
    400  Description:
    401  Dictionary compare of all ON_LengthUnitName information in the order
    402  locale id, unit system, name, singular, plural
    403  */
    404  static int CompareLocaleIdUnitSystemName(
    405  const ON_AngleUnitName& a,
    406  const ON_AngleUnitName& b
    407  );
    408 
    409  unsigned int LocaleId() const;
    410 
    411  ON::AngleUnitSystem AngleUnit() const;
    412 
    413  /*
    414  Returns:
    415  True if the angle unit system is set.
    416  False if angle unit system is ON::AngleUnitSystem::None or ON::AngleUnitSystem::Unset.
    417  */
    418  bool AngleUnitIsSet() const;
    419 
    420  /*
    421  Returns:
    422  True if the angle unit system is set or is ON::AngleUnitSystem::None
    423  */
    424  bool AngleUnitIsSetOrNone() const;
    425 
    426  /*
    427  Returns:
    428  True if the angle unit system is set and the name is not empty.
    429  False if length unit system is ON::AngleUnitSystem::None or ON::AngleUnitSystem::Unset or the name is empty.
    430  */
    431  bool AngleUnitAndNameAreSet() const;
    432 
    433 
    434  /*
    435  Returns:
    436  A pointer to a localized angle unit name or a pointer to an empty string.
    437  Remarks:
    438  Never returns nullptr.
    439  */
    440  const wchar_t* AngleUnitName() const;
    441 
    442  bool AngleUnitNameIsEmpty() const;
    443 
    444  bool AngleUnitNameIsNotEmpty() const;
    445 
    446  /*
    447  Remarks:
    448  True if the angle unit name is singular in languages where that question
    449  has a meaningful answer.
    450  Remarks:
    451  Some names and name abbreviations are both singular and plural.
    452  */
    453  bool AngleUnitNameIsSingular() const;
    454 
    455  /*
    456  Remarks:
    457  True if the angle unit name is plural in languages where that question
    458  has a meaningful answer.
    459  Remarks:
    460  Some names and name abbreviations are both singular and plural.
    461  */
    462  bool AngleUnitNameIsPlural() const;
    463 
    464 private:
    465  // Microsoft locale id // http://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).aspx
    466  unsigned int m_locale_id = 0;
    467  ON::AngleUnitSystem m_angle_unit_system = ON::AngleUnitSystem::None;
    468  bool m_bNameIsSingular = false;
    469  bool m_bNameIsPlural = false;
    470  const wchar_t* m_name = nullptr;
    471 
    472 private:
    473  static int Internal_Compare(
    474  unsigned int order_selector,
    475  const ON_AngleUnitName& a,
    476  const ON_AngleUnitName& b
    477  );
    478 };
    479 
    480 ON_DECL
    481 bool operator==(
    482  const ON_AngleUnitName& a,
    483  const ON_AngleUnitName& b
    484  );
    485 
    486 ON_DECL
    487 bool operator!=(
    488  const ON_AngleUnitName& a,
    489  const ON_AngleUnitName& b
    490  );
    491 
    492 class ON_CLASS ON_ParseSettings
    493 {
    494 public:
    495  enum
    496  {
    497  // maximum number of wchar_t elements in a number
    498  max_number_str_count = 2000,
    499 
    500  // maximum number of wchar_t elements in an expression
    501  max_expression_str_count = 2147483645,
    502  };
    503 
    504  /*
    505  Description:
    506  The default constuctor uses the default settings.
    507  */
    509 
    510  /*
    511  Description:
    512  Default settings constructor sets the context information.
    513  */
    515  const class ON_UnitSystem& context_length_unit_system,
    516  ON::AngleUnitSystem context_angle_unit_system,
    517  unsigned int context_locale_id
    518  );
    520  ON::LengthUnitSystem context_length_unit_system,
    521  ON::AngleUnitSystem context_angle_unit_system,
    522  unsigned int context_locale_id
    523  );
    524 
    525  /*
    526  Description:
    527  - The default settings parse just about everything in
    528  a reasonable way.
    529  - Any angle values with unspecified units will be
    530  treated as radians. Angles without units can be
    531  encountered while parsing formulas, lengths and
    532  points and need to be thoughtfully considered in
    533  most parsing situations.
    534  */
    536 
    537  /*
    538  Description:
    539  - The default settings parse just about everything in
    540  a reasonable way.
    541  - Any angle values with unspecified units will be
    542  treated as radians. Angles without units can be
    543  encountered while parsing formulas, lengths and
    544  points and need to be thoughtfully considered in
    545  most parsing situations.
    546  */
    548 
    549  /*
    550  Description:
    551  - The default settings parse just about everything in
    552  a reasonable way.
    553  - Any angle values with unspecified units will be
    554  treated as degrees. Angles without units can be
    555  encountered while parsing formulas, lengths and
    556  points and need to be thoughtfully considered in
    557  most parsing situations.
    558  */
    560 
    561  /*
    562  Description:
    563  The integer settings parse and optional unary + or unary - and
    564  then parses one or more digits. Parsing stops after the last
    565  digit.
    566  */
    568 
    569  /*
    570  Description:
    571  The rational number settings parse and optional unary + or unary -
    572  and then parse one or more digits. If a rational number fraction
    573  bar follows the last digit in the numerator, then it is parsed
    574  and an integer denominator is parsed. The denominator cannot
    575  have a unary + or - preceding the digits. Parsing stops after
    576  the last digit in the denominator.
    577  */
    579 
    580  /*
    581  Description:
    582  The double number settings parse and optional unary + or unary -
    583  and then parse a number that can be integer, decimal, or
    584  scientific e notation.
    585  */
    587 
    588  /*
    589  Description:
    590  The real number settings parse and optional unary + or unary -
    591  and then parse a number that can be integer, decimal,
    592  scientific e notation or pi.
    593  */
    595 
    596  /*
    597  Description:
    598  ON_ParseSetting::FalseSettings has all parsing options
    599  set to false.
    600  Remarks:
    601  A common use of ON_ParseSettings FalseSettings is to intialize
    602  ON_ParseSettings classes that are used to report what happened
    603  during parsing. Any parsing results value set to true after
    604  parsing indicates that type of parsing occured.
    605  */
    607 
    608  static const int Compare(
    609  const ON_ParseSettings* a,
    610  const ON_ParseSettings* b
    611  );
    612 
    613  ON_ParseSettings& operator|=(const ON_ParseSettings& other);
    614  ON_ParseSettings& operator&=(const ON_ParseSettings& other);
    615 
    616 
    617  /*
    618  Remarks:
    619  The default value is true.
    620  */
    621  bool ParseSpaceAsWhiteSpace() const;
    622 
    623  /*
    624  Remarks:
    625  The default value is true.
    626  */
    627  bool ParseNoBreakSpaceAsWhiteSpace() const;
    628 
    629  /*
    630  Remarks:
    631  The default value is true.
    632  */
    633  bool ParseHorizontalTabAsWhiteSpace() const;
    634 
    635  /*
    636  Remarks:
    637  The default value is true.
    638  */
    639  bool ParseThinSpaceAsWhiteSpace() const;
    640 
    641  /*
    642  Remarks:
    643  The default value is true.
    644  */
    645  bool ParseNoBreakThinSpaceAsWhiteSpace() const;
    646 
    647  /*
    648  Remarks:
    649  The default value is true.
    650  */
    651  bool ParseLineFeedAsLeadingWhiteSpace() const;
    652 
    653  /*
    654  Remarks:
    655  The default value is true.
    656  */
    657  bool ParseFormFeedAsLeadingWhiteSpace() const;
    658 
    659  /*
    660  Remarks:
    661  The default value is true.
    662  */
    663  bool ParseCarriageReturnAsLeadingWhiteSpace() const;
    664 
    665  /*
    666  Remarks:
    667  The default value is true.
    668  */
    669  bool ParseVerticalTabAsLeadingWhiteSpace() const;
    670 
    671  /*
    672  Remarks:
    673  The default value is true.
    674  */
    675  bool ParseLineFeedAsTrailingWhiteSpace() const;
    676 
    677  /*
    678  Remarks:
    679  The default value is true.
    680  */
    681  bool ParseFormFeedAsTrailingWhiteSpace() const;
    682 
    683  /*
    684  Remarks:
    685  The default value is true.
    686  */
    687  bool ParseCarriageReturnAsTrailingWhiteSpace() const;
    688 
    689  /*
    690  Remarks:
    691  The default value is true.
    692  */
    693  bool ParseVerticalTabAsTrailingWhiteSpace() const;
    694 
    695 
    696  /*
    697  Remarks:
    698  The default value is true.
    699  */
    700  void SetParseSpaceAsWhiteSpace(
    701  bool bParseSpaceAsWhiteSpace );
    702 
    703  /*
    704  Remarks:
    705  The default value is true.
    706  */
    707  void SetParseNoBreakSpaceAsWhiteSpace(
    708  bool bParseNoBreakSpaceAsWhiteSpace );
    709 
    710  /*
    711  Remarks:
    712  The default value is true.
    713  */
    714  void SetParseHorizontalTabAsWhiteSpace(
    715  bool bParseHorizontalTabAsWhiteSpace );
    716 
    717  /*
    718  Remarks:
    719  The default value is true.
    720  */
    721  void SetParseThinSpaceAsWhiteSpace(
    722  bool bParseThinSpaceAsWhiteSpace );
    723 
    724  /*
    725  Remarks:
    726  The default value is true.
    727  */
    728  void SetParseNoBreakThinSpaceAsWhiteSpace(
    729  bool bParseNoBreakThinSpaceAsWhiteSpace );
    730 
    731  /*
    732  Remarks:
    733  The default value is true.
    734  */
    735  void SetParseLineFeedAsLeadingWhiteSpace(
    736  bool bParseLineFeedAsLeadingWhiteSpace );
    737 
    738  /*
    739  Remarks:
    740  The default value is true.
    741  */
    742  void SetParseFormFeedAsLeadingWhiteSpace(
    743  bool bParseFormFeedAsLeadingWhiteSpace );
    744 
    745  /*
    746  Remarks:
    747  The default value is true.
    748  */
    749  void SetParseCarriageReturnAsLeadingWhiteSpace(
    750  bool bParseCarriageReturnAsLeadingWhiteSpace );
    751 
    752  /*
    753  Remarks:
    754  The default value is true.
    755  */
    756  void SetParseVerticalTabAsLeadingWhiteSpace(
    757  bool bParseVerticalTabAsLeadingWhiteSpace );
    758 
    759  /*
    760  Remarks:
    761  The default value is true.
    762  */
    763  void SetParseLineFeedAsTrailingWhiteSpace(
    764  bool bParseLineFeedAsTrailingWhiteSpacee );
    765 
    766  /*
    767  Remarks:
    768  The default value is true.
    769  */
    770  void SetParseFormFeedAsTrailingWhiteSpace(
    771  bool bParseParseFormFeedAsTrailingWhiteSpace );
    772 
    773  /*
    774  Remarks:
    775  The default value is true.
    776  */
    777  void SetParseCarriageReturnAsTrailingWhiteSpace(
    778  bool bParseParseCarriageReturnAsTrailingWhiteSpace );
    779 
    780  /*
    781  Remarks:
    782  The default value is true.
    783  */
    784  void SetParseVerticalTabAsTrailingWhiteSpace(
    785  bool bParseParseVerticalTabAsTrailingWhiteSpace );
    786 
    787 
    788  /*
    789  Returns:
    790  True if leading white space should be parsed.
    791  Remarks:
    792  The default value is true.
    793  */
    794  bool ParseLeadingWhiteSpace() const;
    795 
    796  /*
    797  Returns:
    798  True if a aritimetic should be parsed in expressions.
    799  Example:
    800  If parsing expression arithmetic is enabled, then the
    801  string "3/0.25" will return a value of 12.
    802  Remarks:
    803  - The default value is true.
    804  - Currently multiplication and division are supported.
    805  - When parsing pi is enabled, strings like "2pi" will
    806  return 6.2831853071795865 even when parsing expression
    807  arithmetic is disabled.
    808  - When rational number or integer-dash-fraction parsing
    809  is enabled, strings like 3/4 will return 0.75 even when
    810  parsing expression arithmetic is disabled.
    811  - Parsing functions with the word "Expression" in their name,
    812  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    813  and ON_ParseAngleExpression, support arithmetic parsing.
    814  */
    815  bool ParseArithmeticExpression() const;
    816 
    817 
    818  /*
    819  Returns:
    820  True if the math functions
    821  sin, cos, tan
    822  asin, acos, atan, atan2,
    823  sinh, cosh, tanh,
    824  ln, exp, log10, pow,
    825  should be parsed in expressions.
    826  Remarks:
    827  - The default value is true.
    828  - In functions that take 2 or more parameter values,
    829  a comma is used to separate parameter values.
    830  - Parentheses are used to delimit math function parameters;
    831  for example sin(pi/4).
    832  - The angle parameters to trigonometry functions may have angle
    833  units specified. For example, sin(30degrees). If no angle
    834  unit is specified, the nubmer is assumed to be in radians.
    835  */
    836  bool ParseMathFunctions() const;
    837 
    838  /*
    839  Returns:
    840  True if a formulae contained bracketed on the left by
    841  =( and on the right by ) should be parsed in expressions.
    842  Example:
    843  If parsing expression formulae is enabled, then the string
    844  "=((1+sqrt(5))/2)" will return a value of 1.6180339887498948.
    845  Remarks:
    846  - The default value is true.
    847  - A formula is delimited at the start by =( and
    848  terminated by a matching ).
    849  - Parsing functions with the word "Expression" in their name,
    850  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    851  and ON_ParseAngleExpression, support formula parsing.
    852  */
    853  bool ParseExplicitFormulaExpression() const;
    854 
    855  /*
    856  Returns:
    857  True if a number may begin with a unary minus.
    858  Remarks:
    859  The default value is true.
    860  */
    861  bool ParseUnaryMinus() const;
    862 
    863  /*
    864  Returns:
    865  True if a number may begin with a unary plus.
    866  Remarks:
    867  The default value is true.
    868  */
    869  bool ParseUnaryPlus() const;
    870 
    871  /*
    872  Returns:
    873  True if digits before a decimal point should be parsed
    874  in a decimal number or scientific E notation number.
    875  Remarks:
    876  The default value is true.
    877  */
    878  bool ParseSignificandIntegerPart() const;
    879 
    880  /*
    881  Returns:
    882  True if the decimal points should be parsed
    883  in a decimal number or scientific E notation number.
    884  Remarks:
    885  The default is true.
    886  */
    887  bool ParseSignificandDecimalPoint() const;
    888 
    889  /*
    890  Returns:
    891  True if digits after a decimal point should be parsed
    892  in a decimal number or scientific E notation number.
    893  Remarks:
    894  The default is true.
    895  */
    896  bool ParseSignificandFractionalPart() const;
    897 
    898  /*
    899  Returns:
    900  True if digit separators should be parsed in a
    901  decimal number or scientific E notation number.
    902  Remarks:
    903  The default value is true.
    904  */
    905  bool ParseSignificandDigitSeparators() const;
    906 
    907  /*
    908  Returns:
    909  True if a number may use scientific E notation to specify
    910  mulitiplication by a power of 10.
    911  Example:
    912  If parsing scientific E notation is enables, then the string
    913  "2.99792458e8" will be parsed as 2999792458.
    914  Remarks:
    915  - The default value is true.
    916  - The "E" may be 'e', 'E', unicode decimal exponent symbol
    917  (code point 0x23E8).
    918  See Also:
    919  ON_ParseSettings::ParseScientificDNotation.
    920  */
    921  bool ParseScientificENotation() const;
    922 
    923  /*
    924  Returns:
    925  True if a number may use scientific E notation may use
    926  'D' or 'E' to specify mulitiplication by a power of 10.
    927  Example:
    928  If parsing 'D' as 'E' in scientific E notation is enabled,
    929  then the string "2.99792458D8" will be parsed as 2999792458.
    930  Remarks:
    931  - The default value is false.
    932  - The "D" may be 'd', 'D'.
    933  - This feature is added to parse values in IGES files and
    934  text generated by FORTRAN programs.
    935  See Also:
    936  ON_ParseSettings::ParseScientificENotation.
    937  */
    938  bool ParseDAsExponentInScientificENotation() const;
    939 
    940  /*
    941  Returns:
    942  True if a full stop (period) should be parsed as a decimal point.
    943  Remarks:
    944  - The default value is true.
    945  See Also:
    946  ON_ParseSettings::ParseCommaAsDecimalPoint()
    947  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    948  ON_ParseSettings::ParseCommaAsDigitSeparator()
    949  */
    950  bool ParseFullStopAsDecimalPoint() const;
    951 
    952  /*
    953  Returns:
    954  True if a full stop (period) should be parsed as a digit separator.
    955  Remarks:
    956  - The default value is false.
    957  See Also:
    958  ON_ParseSettings::ParseFullStopAsDecimalPoint()
    959  ON_ParseSettings::ParseCommaAsDecimalPoint()
    960  ON_ParseSettings::ParseCommaAsDigitSeparator()
    961  ON_ParseSettings::ParseSpaceAsDigitSeparator()
    962  ON_ParseSettings::ParseThinSpaceAsDigitSeparator()
    963  ON_ParseSettings::ParseNoBreakSpaceAsDigitSeparator()
    964  ON_ParseSettings::ParseNoBreakThinSpaceAsDigitSeparator()
    965  */
    966  bool ParseFullStopAsDigitSeparator() const;
    967 
    968  /*
    969  Returns:
    970  True if a comma should be parsed as a decimal point.
    971  Remarks:
    972  - The default value is false.
    973  See Also:
    974  ON_ParseSettings::ParseFullStopAsDecimalPoint()
    975  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    976  ON_ParseSettings::ParseCommaAsDigitSeparator()
    977  */
    978  bool ParseCommaAsDecimalPoint() const;
    979 
    980  /*
    981  Returns:
    982  True if a comma should be parsed as a digit separator.
    983  Remarks:
    984  - The default value is false.
    985  See Also:
    986  ON_ParseSettings::ParseFullStopAsDecimalPoint()
    987  ON_ParseSettings::ParseCommaAsDecimalPoint()
    988  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    989  ON_ParseSettings::ParseSpaceAsDigitSeparator()
    990  ON_ParseSettings::ParseThinSpaceAsDigitSeparator()
    991  ON_ParseSettings::ParseNoBreakSpaceAsDigitSeparator()
    992  ON_ParseSettings::ParseNoBreakThinSpaceAsDigitSeparator()
    993  */
    994  bool ParseCommaAsDigitSeparator() const;
    995 
    996  /*
    997  Returns:
    998  True if a comma should be parsed as a digit separator.
    999  Remarks:
    1000  - The default value is false.
    1001  See Also:
    1002  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    1003  ON_ParseSettings::ParseCommaAsDigitSeparator()
    1004  ON_ParseSettings::ParseSpaceAsDigitSeparator()
    1005  ON_ParseSettings::ParseThinSpaceAsDigitSeparator()
    1006  ON_ParseSettings::ParseNoBreakSpaceAsDigitSeparator()
    1007  ON_ParseSettings::ParseNoBreakThinSpaceAsDigitSeparator()
    1008  */
    1009  bool ParseSpaceAsDigitSeparator() const;
    1010 
    1011  /*
    1012  Returns:
    1013  True if a comma should be parsed as a digit separator.
    1014  Remarks:
    1015  - The default value is false.
    1016  See Also:
    1017  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    1018  ON_ParseSettings::ParseCommaAsDigitSeparator()
    1019  ON_ParseSettings::ParseSpaceAsDigitSeparator()
    1020  ON_ParseSettings::ParseThinSpaceAsDigitSeparator()
    1021  ON_ParseSettings::ParseNoBreakSpaceAsDigitSeparator()
    1022  ON_ParseSettings::ParseNoBreakThinSpaceAsDigitSeparator()
    1023  */
    1024  bool ParseThinSpaceAsDigitSeparator() const;
    1025 
    1026  /*
    1027  Returns:
    1028  True if a comma should be parsed as a digit separator.
    1029  Remarks:
    1030  - The default value is false.
    1031  See Also:
    1032  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    1033  ON_ParseSettings::ParseCommaAsDigitSeparator()
    1034  ON_ParseSettings::ParseSpaceAsDigitSeparator()
    1035  ON_ParseSettings::ParseThinSpaceAsDigitSeparator()
    1036  ON_ParseSettings::ParseNoBreakSpaceAsDigitSeparator()
    1037  ON_ParseSettings::ParseNoBreakThinSpaceAsDigitSeparator()
    1038  */
    1039  bool ParseNoBreakSpaceAsDigitSeparator() const;
    1040 
    1041  /*
    1042  Returns:
    1043  True if a comma should be parsed as a digit separator.
    1044  Remarks:
    1045  - The default value is true.
    1046  See Also:
    1047  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    1048  ON_ParseSettings::ParseCommaAsDigitSeparator()
    1049  ON_ParseSettings::ParseSpaceAsDigitSeparator()
    1050  ON_ParseSettings::ParseThinSpaceAsDigitSeparator()
    1051  ON_ParseSettings::ParseNoBreakSpaceAsDigitSeparator()
    1052  ON_ParseSettings::ParseNoBreakThinSpaceAsDigitSeparator()
    1053  */
    1054  bool ParseNoBreakThinSpaceAsDigitSeparator() const;
    1055 
    1056  /*
    1057  Returns:
    1058  True if a unicode hyphen-minus (code point 0x002D) should be parsed
    1059  as a number dash during integer-dash-fraction parsing.
    1060  Remarks:
    1061  - The default value is true. This is because the hyphen-minus
    1062  character is the easiest to type.
    1063  - For robust parsing, use the unicode figure dash (code point 0x2012)
    1064  to specify a number dash.
    1065  See Also:
    1066  ON_ParseSettings::ParseIntegerDashFraction()
    1067  ON_ParseSettings::ParseHyphenMinusAsNumberDash()
    1068  ON_ParseSettings::ParseHyphenAsNumberDash()
    1069  ON_ParseSettings::ParseNoBreakHyphenAsNumberDash()
    1070  */
    1071  bool ParseHyphenMinusAsNumberDash() const;
    1072 
    1073  /*
    1074  Returns:
    1075  True if a unicode hyphen (code point 0x2010) should be parsed
    1076  as a number dash during integer-dash-fraction parsing.
    1077  Remarks:
    1078  - The default value is false.
    1079  - For robust parsing, use the unicode figure dash (code point 0x2012)
    1080  to specify a number dash.
    1081  See Also:
    1082  ON_ParseSettings::ParseIntegerDashFraction()
    1083  ON_ParseSettings::ParseHyphenMinusAsNumberDash()
    1084  ON_ParseSettings::ParseHyphenAsNumberDash()
    1085  ON_ParseSettings::ParseNoBreakHyphenAsNumberDash()
    1086  */
    1087  bool ParseHyphenAsNumberDash() const;
    1088 
    1089  /*
    1090  Returns:
    1091  True if a unicode non-breaking hyphen (code point 0x2011)
    1092  should be parsed as a number dash during integer-dash-fraction
    1093  parsing.
    1094  Remarks:
    1095  - The default value is false.
    1096  - For robust parsing, use the unicode figure dash (code point 0x2012)
    1097  to specify a number dash.
    1098  See Also:
    1099  ON_ParseSettings::ParseIntegerDashFraction()
    1100  ON_ParseSettings::ParseHyphenMinusAsNumberDash()
    1101  ON_ParseSettings::ParseHyphenAsNumberDash()
    1102  ON_ParseSettings::ParseNoBreakHyphenAsNumberDash()
    1103  */
    1104  bool ParseNoBreakHyphenAsNumberDash() const;
    1105 
    1106  /*
    1107  Returns:
    1108  True if rational numbers should be parsed.
    1109  Example:
    1110  If this property is true, then strings "3/4" and "8/5"
    1111  will be parsed. The numerator and denominator must
    1112  parse as integers. If you: decimal points and scientific notation
    1113  cannot appear
    1114  Remarks:
    1115  - The default value is true.
    1116  - The numerator and denominator must be integers.
    1117  - Strings like "1.0/3.0", "3.5/2" or "pi/2" are not parsed
    1118  as rational numbers. Use ON_ParseSettings::ParseDivision
    1119  to constrol parsing of these types of strings.
    1120  */
    1121  bool ParseRationalNumber() const;
    1122 
    1123  /*
    1124  Returns:
    1125  True if the value of pi may be specified as "pi", "PI",
    1126  "Pi", "pI", unicode Greek capital letter pi (code point 0x03A0),
    1127  or unicode Greek small letter pi (code point 0x03C0).
    1128  Example:
    1129  If this property is true, then strings "pi", "PI", "Pi", "pI",
    1130  L"\x03A0" (unicode greek capital letter pi) and
    1131  L"\x03C0" (unicode greek small letter pi)
    1132  will be parsed as if they were "3.141592653589793238462643".
    1133  In addition, if the pi strings appear next to something that
    1134  is parsed as a number, the result will be mulitplied by pi.
    1135  For example,
    1136  "3pi" and pi3.0 will return 3.0*ON_PI.
    1137  If division parsing is enabled, then "3pi/4" and 3/4pi" will
    1138  return 0.75*ON_PI.
    1139  Remarks:
    1140  The default value is true.
    1141  */
    1142  bool ParsePi() const;
    1143 
    1144  /*
    1145  Returns:
    1146  True if muliplication signs that appear between numbers will be
    1147  parsed.
    1148  Example:
    1149  If this property is true, then strings like 2*3 will be parsed
    1150  as 6.0
    1151  Remarks:
    1152  - The default value is true.
    1153  - Parsing functions with the word "Expression" in their name,
    1154  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    1155  and ON_ParseAngleExpression, support mulitplication parsing.
    1156  */
    1157  bool ParseMultiplication() const;
    1158 
    1159  /*
    1160  Returns:
    1161  True if division signs that appear between numbers will be
    1162  parsed.
    1163  Example:
    1164  If this property is true, then strings like 1/4 will be parsed
    1165  as 0.25.
    1166  Remarks:
    1167  - The default value is true.
    1168  - Parsing functions with the word "Expression" in their name,
    1169  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    1170  and ON_ParseAngleExpression, support division parsing.
    1171  */
    1172  bool ParseDivision() const;
    1173 
    1174  /*
    1175  Returns:
    1176  True if addition signs that appear between numbers will be
    1177  parsed.
    1178  Example:
    1179  If this property is true, then strings like 1+2 will be parsed
    1180  as 3.
    1181  Remarks:
    1182  - The default value is true.
    1183  - Parsing functions with the word "Expression" in their name,
    1184  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    1185  and ON_ParseAngleExpression, support division parsing.
    1186  */
    1187  bool ParseAddition() const;
    1188 
    1189  /*
    1190  Returns:
    1191  True if subtraction signs that appear between numbers will be
    1192  parsed.
    1193  Example:
    1194  If this property is true, then strings like 2-1 will be parsed
    1195  as 1.
    1196  Remarks:
    1197  - The default value is true.
    1198  - Parsing functions with the word "Expression" in their name,
    1199  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    1200  and ON_ParseAngleExpression, support division parsing.
    1201  */
    1202  bool ParseSubtraction() const;
    1203 
    1204 
    1205  /*
    1206  Returns:
    1207  True if paired arentheses symbols that are encountered during
    1208  number parsing will be parsed.
    1209  Example:
    1210  If this property is true, then strings like 2(3+4) will be parsed
    1211  as 14.
    1212  Remarks:
    1213  - The default value is true.
    1214  - Parsing functions with the word "Expression" in their name,
    1215  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    1216  and ON_ParseAngleExpression, support division parsing.
    1217  */
    1218  bool ParsePairedParentheses() const;
    1219 
    1220  /*
    1221  Returns:
    1222  True if a number may be specified as an integer followed by
    1223  a dash and a fraction.
    1224  Example:
    1225  If this property is true, then the string "4-3/8" will return
    1226  a value of 4.375.
    1227  Remarks:
    1228  - The default value is true.
    1229  - The numerator must be an integer > 0.
    1230  - The denominator must be greater than the numerator.
    1231  - ON_ParseSettings::IsNumberDash() controls what characters
    1232  are interpreted as number dashes.
    1233  See Also:
    1234  ON_ParseSettings::ParseRationalNumber()
    1235  */
    1236  bool ParseIntegerDashFraction() const;
    1237 
    1238  /*
    1239  Returns:
    1240  True if a length value may be specified as combination
    1241  of US customary feet and inch lengths.
    1242  Example:
    1243  If this property is true, then strings like these
    1244  1'-4-3/8"
    1245  1ft-3-3/8in
    1246  1'4.375"
    1247  1.0feet4.375inches
    1248  will be parsed as 16.375 inches.
    1249  Remarks:
    1250  The default value is true.
    1251  */
    1252  bool ParseFeetInches() const;
    1253 
    1254  /*
    1255  Returns:
    1256  True if an angle value may be specified as a combination of
    1257  arc degrees, arc minutes and arc seconds.
    1258  Example:
    1259  If this property is true, then strings like these
    1260  2degrees30minutes
    1261  2deg30'
    1262  will be parsed as 2.0*60.0 + 30.0 arc minutes
    1263  2degrees14minutes15seconds
    1264  2deg14'15"
    1265  will be parsed as (2*60.0 + 14.0)*60.0 + 15.0 arc seconds.
    1266  Remarks:
    1267  The default value is true.
    1268  */
    1269  bool ParseArcDegreesMinutesSeconds() const;
    1270 
    1271 
    1272  /*
    1273  Returns:
    1274  True if whitespace between a value and unit system will
    1275  is permitted.
    1276  Example:
    1277  If this property is true, then strings like these
    1278  2 meters
    1279  2meters
    1280  2 m
    1281  2m
    1282  will be parsed as 2 meters
    1283  Remarks:
    1284  The default value is true.
    1285  */
    1286  bool ParseWhiteSpaceBetweenValueAndUnitSystem() const;
    1287 
    1288  /*
    1289  Returns:
    1290  True if whitespace between a length in feet and a length in inches
    1291  will is permitted.
    1292  Example:
    1293  If this property is true, then strings like these
    1294  1'3"
    1295  1' 3"
    1296  1ft3in
    1297  1ft 3in
    1298  will be parsed as 15 inches
    1299  Remarks:
    1300  The default value is true.
    1301  */
    1302  bool ParseWhiteSpaceBetweenFeetAndInches() const;
    1303 
    1304 
    1305  /*
    1306  Returns:
    1307  True if an angle values may be specified using surveyor's notation.
    1308  Example:
    1309  If this property is true, then strings like these
    1310  N30W
    1311  S12<degree symbol>15'22"W
    1312  N45.7899E
    1313  S47'E
    1314  will be parsed as angles.
    1315  Remarks:
    1316  The first character must be N, n, S or s.
    1317  The angle must be a spcified as a combination of arc degrees,
    1318  arc minutes and arc seconds.
    1319  The last character must be E, e, W or w.
    1320  */
    1321  bool ParseSurveyorsNotation() const;
    1322 
    1323  /*
    1324  Returns:
    1325  The Microsoft locale id that identifies the locale that should
    1326  be used to resolve ambiguous parsing situtations. The default
    1327  value is zero, which means ambiguous situations are not parsed.
    1328  Example:
    1329  When parsing angles, the string "Grad" is ambiguous.
    1330  In German "Grad" identifies arc degree angle units and in
    1331  English "Grad" identifies gradian angle units. If angle parsing
    1332  encounters "Grad", it uses the value of ContextLocaleId()
    1333  to determine what arc unit system is being identified.
    1334  */
    1335  unsigned int ContextLocaleId() const;
    1336 
    1337  /*
    1338  Returns:
    1339  The default angle unit system that is used when a value must be
    1340  parsed as an angle and no angle unit system is explicitly or
    1341  implicitly specified.
    1342  */
    1343  ON::LengthUnitSystem ContextLengthUnitSystem() const;
    1344 
    1345  /*
    1346  Returns:
    1347  The default angle unit system that is used when a value must be
    1348  parsed as an angle and no angle unit system is explicitly or
    1349  implicitly specified.
    1350  */
    1351  ON::AngleUnitSystem ContextAngleUnitSystem() const;
    1352 
    1353  /*
    1354  Description:
    1355  Deprecated. Use ContextLocaleId().
    1356  */
    1357  // ON_DEPRECTATED
    1358  unsigned int PreferedLocaleId() const;
    1359 
    1360  /*
    1361  Description:
    1362  Deprecated. Use ContextAngleUnitSystem().
    1363  */
    1364  // ON_DEPRECTATED
    1365  ON::AngleUnitSystem DefaultAngleUnitSystem() const;
    1366 
    1367  /*
    1368  Parameters:
    1369  c - [in]
    1370  Returns:
    1371  True if c should be parsed as leading white space
    1372  */
    1373  bool IsLeadingWhiteSpace(ON__UINT32 c) const;
    1374 
    1375  /*
    1376  Parameters:
    1377  c - [in]
    1378  Returns:
    1379  True if c should be parsed as trailing white space
    1380  */
    1381  bool IsTrailingWhiteSpace(ON__UINT32 c) const;
    1382 
    1383  /*
    1384  Parameters:
    1385  c - [in]
    1386  Returns:
    1387  True if c should be parsed as interior white space.
    1388  */
    1389  bool IsInteriorWhiteSpace(ON__UINT32 c) const;
    1390 
    1391  /*
    1392  Parameters:
    1393  c - [in]
    1394  Returns:
    1395  True if c should be parsed as unary minus
    1396  */
    1397  bool IsUnaryMinus(ON__UINT32 c) const;
    1398 
    1399  /*
    1400  Parameters:
    1401  c - [in]
    1402  Returns:
    1403  True if c should be parsed as unary plus
    1404  */
    1405  bool IsUnaryPlus(ON__UINT32 c) const;
    1406 
    1407  /*
    1408  Parameters:
    1409  c - [in]
    1410  Returns:
    1411  Returns '0' throught '9' if c is a digit, otherwise returns 0.
    1412  */
    1413  char IsDigit(ON__UINT32 c) const;
    1414 
    1415  /*
    1416  Parameters:
    1417  c - [in]
    1418  Returns:
    1419  True if c should be parsed as a digit separator
    1420  */
    1421  bool IsDigitSeparator(ON__UINT32 c) const;
    1422 
    1423  /*
    1424  Parameters:
    1425  c - [in]
    1426  Returns:
    1427  True if c should be parsed as a decimal point
    1428  */
    1429  bool IsDecimalPoint(ON__UINT32 c) const;
    1430 
    1431  /*
    1432  Parameters:
    1433  c - [in]
    1434  Returns:
    1435  True if c should be parsed as decimal exponent symbol
    1436  */
    1437  bool IsDecimalExponentSymbol(ON__UINT32 c) const; // e E (optionally d and/or D)
    1438 
    1439  /*
    1440  Parameters:
    1441  c - [in]
    1442  Returns:
    1443  True if c is 0x03A or 0x03C
    1444  */
    1445  bool IsGreekPi(ON__UINT32 c) const;
    1446 
    1447  /*
    1448  Parameters:
    1449  c - [in]
    1450  Returns:
    1451  True if c should be parsed as a multiplication operator
    1452  */
    1453  bool IsMultiplicationSymbol(ON__UINT32 c) const;
    1454 
    1455  /*
    1456  Parameters:
    1457  c - [in]
    1458  Returns:
    1459  True if c should be parsed as a division operator
    1460  */
    1461  bool IsDivisionSymbol(ON__UINT32 c) const;
    1462 
    1463  /*
    1464  Parameters:
    1465  c - [in]
    1466  Returns:
    1467  True if c should be parsed as an addition operator
    1468  */
    1469  bool IsAdditionSymbol(ON__UINT32 c) const;
    1470 
    1471  /*
    1472  Parameters:
    1473  c - [in]
    1474  Returns:
    1475  True if c should be parsed as a subtraction operator
    1476  */
    1477  bool IsSubtractionSymbol(ON__UINT32 c) const;
    1478 
    1479  /*
    1480  Parameters:
    1481  c - [in]
    1482  Returns:
    1483  True if c should be parsed as a left parenthesis symbol
    1484  */
    1485  bool IsLeftParenthesisSymbol(ON__UINT32 c) const;
    1486 
    1487  /*
    1488  Parameters:
    1489  c - [in]
    1490  Returns:
    1491  True if c should be parsed as a right parenthesis symbol
    1492  */
    1493  bool IsRightParenthesisSymbol(ON__UINT32 c) const;
    1494 
    1495  /*
    1496  Parameters:
    1497  c - [in]
    1498  Returns:
    1499  True if c should be parsed as a rational number fraction bar
    1500  */
    1501  bool IsRationalNumberFractionBar(ON__UINT32 c) const;
    1502 
    1503  /*
    1504  Parameters:
    1505  c - [in]
    1506  Returns:
    1507  True if c should be parsed as number dash when parsing
    1508  strings like "1-3/4".
    1509  */
    1510  bool IsNumberDash(ON__UINT32 c) const;
    1511 
    1512  /*
    1513  Parameters:
    1514  bParseLeadingWhiteSpace - [in]
    1515  True if leading white space should be parsed.
    1516  Remarks:
    1517  See ON_ParseSettings::ParseLeadingWhiteSpace()
    1518  for details about this property.
    1519  */
    1520  void SetParseLeadingWhiteSpace(
    1521  bool bParseLeadingWhiteSpace
    1522  );
    1523 
    1524  /*
    1525  Parameters:
    1526  bParseArithmeticExpression - [in]
    1527  True if formulae should be parsed.
    1528  Remarks:
    1529  See ON_ParseSettings::ParseArithmeticExpression()
    1530  for details about this property.
    1531  */
    1532  void SetParseArithmeticExpression(
    1533  bool bParseArithmeticExpression
    1534  );
    1535 
    1536  /*
    1537  Parameters:
    1538  bParseMathFunctions - [in]
    1539  True if math functions should be parsed in expressions.
    1540  Remarks:
    1541  See ON_ParseSettings::ParseMathFunctions()
    1542  for details about this property.
    1543  */
    1544  void SetParseMathFunctions(
    1545  bool bParseMathFunctions
    1546  );
    1547 
    1548  /*
    1549  Parameters:
    1550  bParseExplicitFormulaExpression - [in]
    1551  True if explicity formulae should be parsed.
    1552  Remarks:
    1553  See ON_ParseSettings::ParseExplicitFormulaExpression()
    1554  for details about this property.
    1555  */
    1556  void SetParseExplicitFormulaExpression(
    1557  bool bParseExplicitFormulaExpression
    1558  );
    1559 
    1560  /*
    1561  Parameters:
    1562  bParseUnaryMinus - [in]
    1563  True if unary minus should be parsed.
    1564  Remarks:
    1565  See ON_ParseSettings::ParseUnaryMinus()
    1566  for details about this property.
    1567  */
    1568  void SetParseUnaryMinus(
    1569  bool bParseUnaryMinus
    1570  );
    1571 
    1572  /*
    1573  Parameters:
    1574  bParseUnaryPlus - [in]
    1575  True if unary plus should be parsed.
    1576  Remarks:
    1577  See ON_ParseSettings::ParseUnaryPlus()
    1578  for details about this property.
    1579  */
    1580  void SetParseUnaryPlus(
    1581  bool bParseUnaryPlus
    1582  );
    1583 
    1584  /*
    1585  Parameters:
    1586  bParseSignificandIntegerPart - [in]
    1587  True if digits before a decimal point in a decimal
    1588  number or the significand of a scientific E notation
    1589  number should be parsed.
    1590  Remarks:
    1591  See ON_ParseSettings::ParseSignificandIntegerPart()
    1592  for details about this property.
    1593  */
    1594  void SetParseSignificandIntegerPart(
    1595  bool bParseSignificandIntegerPart
    1596  );
    1597 
    1598  /*
    1599  Parameters:
    1600  bParseSignificandDecimalPoint - [in]
    1601  True if a decimal point in a decimal point in a decimal
    1602  number or the significand of a scientific E notation
    1603  number should be parsed.
    1604  Remarks:
    1605  See ON_ParseSettings::ParseSignificandDecimalPoint()
    1606  for details about this property.
    1607  */
    1608  void SetParseSignificandDecimalPoint(
    1609  bool bParseSignificandDecimalPoint
    1610  );
    1611 
    1612  /*
    1613  Parameters:
    1614  bParseSignificandFractionalPart - [in]
    1615  True if digits after the decimal point in a decimal
    1616  number or the significand of a scientific E notation
    1617  number should be parsed.
    1618  Remarks:
    1619  See ON_ParseSettings::ParseSignificandFractionalPart()
    1620  for details about this property.
    1621  */
    1622  void SetParseSignificandFractionalPart(
    1623  bool bParseSignificandFractionalPart
    1624  );
    1625 
    1626  /*
    1627  Parameters:
    1628  bParseSignificandDigitSeparators - [in]
    1629  True if digit separators in a decimal number or a significand
    1630  of a scientific E notation number should be parsed.
    1631  Remarks:
    1632  See ON_ParseSettings::ParseSignificandDigitSeparators()
    1633  for details about this property.
    1634  */
    1635  void SetParseSignificandDigitSeparators(
    1636  bool bParseSignificandDigitSeparators
    1637  );
    1638 
    1639  /*
    1640  Parameters:
    1641  bDecimalPoint - [in]
    1642  True if a decimal point should be parsed.
    1643  Remarks:
    1644  See ON_ParseSettings::ParseDecimalPoint()
    1645  for details about this property.
    1646  */
    1647  void SetParseDecimalPoint(
    1648  bool bParseDecimalPoint
    1649  );
    1650 
    1651  /*
    1652  Parameters:
    1653  bParseDAsExponentInScientificENotation - [in]
    1654  True if both 'D' and 'E' can mark the beginning
    1655  of the exponent in scientific E notation.
    1656  Remarks:
    1657  See ON_ParseSettings::ParseDAsExponentInScientificENotation()
    1658  for details about this property.
    1659  */
    1660  void SetParseDAsExponentInScientificENotation(
    1661  bool bParseDAsExponentInScientificENotation
    1662  );
    1663 
    1664  /*
    1665  Parameters:
    1666  bParseScientificENotation - [in]
    1667  True if scientific E notation should be parsed.
    1668  Remarks:
    1669  See ON_ParseSettings::ParseScientificENotation()
    1670  for details about this property.
    1671  */
    1672  void SetParseScientificENotation(
    1673  bool bParseScientificENotation
    1674  );
    1675 
    1676  void SetParseFullStopAsDecimalPoint( bool bParse );
    1677  void SetParseFullStopAsDigitSeparator( bool bParse );
    1678  void SetParseCommaAsDecimalPoint( bool bParse );
    1679  void SetParseCommaAsDigitSeparator( bool bParse );
    1680  void SetParseSpaceAsDigitSeparator( bool bParse );
    1681  void SetParseThinSpaceAsDigitSeparator( bool bParse );
    1682  void SetParseNoBreakSpaceAsDigitSeparator( bool bParse );
    1683  void SetParseNoBreakThinSpaceAsDigitSeparator( bool bParse );
    1684  void SetParseHyphenMinusAsNumberDash( bool bParse );
    1685  void SetParseHyphenAsNumberDash( bool bParse );
    1686  void SetParseNoBreakHyphenAsNumberDash( bool bParse );
    1687 
    1688  /*
    1689  Parameters:
    1690  bParseRationalNumber - [in]
    1691  True if rational numbers like 3/4 and 8/5
    1692  should be parsed.
    1693  Remarks:
    1694  See ON_ParseSettings::ParseRationalNumber()
    1695  for details about this property.
    1696  */
    1697  void SetParseRationalNumber(
    1698  bool bParseRationalNumber
    1699  );
    1700 
    1701  /*
    1702  Parameters:
    1703  bParsePi - [in]
    1704  True if number parsing should treat "PI", "Pi" "pi",
    1705  and unicode code points 0x03A0 and 0x03C0 as
    1706  3.141592653589793238462643.
    1707  Remarks:
    1708  See ON_ParseSettings::ParsePi()
    1709  for details about this property.
    1710  */
    1711  void SetParsePi(
    1712  bool bParsePi
    1713  );
    1714 
    1715  /*
    1716  Parameters:
    1717  bParseMultiplication - [in]
    1718  True if muiltiplication should be permitted in number parsing.
    1719  Remarks:
    1720  See ON_ParseSettings::ParseMultiplication()
    1721  for details about this property.
    1722  */
    1723  void SetParseMultiplication(
    1724  bool bParseMultiplication
    1725  );
    1726 
    1727  /*
    1728  Parameters:
    1729  bParseDivision - [in]
    1730  True if division should be permitted in number parsing.
    1731  Remarks:
    1732  See ON_ParseSettings::ParseDivision()
    1733  for details about this property.
    1734  */
    1735  void SetParseDivision(
    1736  bool bParseDivision
    1737  );
    1738 
    1739  /*
    1740  Parameters:
    1741  bParseDivision - [in]
    1742  True if addition should be permitted in number parsing.
    1743  Remarks:
    1744  See ON_ParseSettings::ParseAddition()
    1745  for details about this property.
    1746  */
    1747  void SetParseAddition(
    1748  bool bParseAddition
    1749  );
    1750 
    1751  /*
    1752  Parameters:
    1753  bParseDivision - [in]
    1754  True if subtraction should be permitted in number parsing.
    1755  Remarks:
    1756  See ON_ParseSettings::ParseSubtraction()
    1757  for details about this property.
    1758  */
    1759  void SetParseSubtraction(
    1760  bool bParseSubtraction
    1761  );
    1762 
    1763  /*
    1764  Parameters:
    1765  bParseDivision - [in]
    1766  True if paired parentheses should be permitted in number parsing.
    1767  Remarks:
    1768  See ON_ParseSettings::PairedParentheses()
    1769  for details about this property.
    1770  */
    1771  void SetParsePairedParentheses(
    1772  bool bParsePairedParentheses
    1773  );
    1774 
    1775  /*
    1776  Parameters:
    1777  bParseIntegerDashFraction - [in]
    1778  True if strings like "5-3/8" should be parsed as
    1779  a single number
    1780  Remarks:
    1781  See ON_ParseSettings::ParseIntegerDashFraction()
    1782  for details about this property.
    1783  */
    1784  void SetParseIntegerDashFraction(
    1785  bool bParseIntegerDashFraction
    1786  );
    1787 
    1788  /*
    1789  Parameters:
    1790  bParseFeetInches - [in]
    1791  True if length value parsing should parse strings
    1792  like 1'4-3/8" and return a length value of 16.375 inches.
    1793  Remarks:
    1794  See ON_ParseSettings::ParseFeetInches()
    1795  for details about this property.
    1796  */
    1797  void SetParseFeetInches(
    1798  bool bParseFeetInches
    1799  );
    1800 
    1801  /*
    1802  Parameters:
    1803  bParseArcDegreesMinutesSeconds - [in]
    1804  True if angle value parsing should parse strings
    1805  like 2deg17'15" and return a length value of
    1806  ((2.0*60.0 + 17..0)*60.0 + 15.0) arc seconds
    1807  Remarks:
    1808  See ON_ParseSettings::ParseArcDegreesMinutesSeconds()
    1809  for details about this property.
    1810  */
    1811  void SetParseArcDegreesMinutesSeconds(
    1812  bool bParseArcDegreesMinutesSeconds
    1813  );
    1814 
    1815  /*
    1816  Parameters:
    1817  bParseWhiteSpaceBetweenValueAndUnitSystem - [in]
    1818  True if then strings like these
    1819  2 meters
    1820  2meters
    1821  2 m
    1822  2m
    1823  should be parsed as 2 meters.
    1824  Remarks:
    1825  See ON_ParseSettings::ParseWhiteSpaceBetweenValueAndUnitSystem()
    1826  for details about this property.
    1827  */
    1828  void SetParseWhiteSpaceBetweenValueAndUnitSystem(
    1829  bool bParseWhiteSpaceBetweenValueAndUnitSystem
    1830  );
    1831 
    1832  /*
    1833  Parameters:
    1834  bParseWhiteSpaceBetweenFeetAndInches - [in]
    1835  True if strings like these
    1836  1' 3"
    1837  1ft 3in
    1838  will be parsed as 15 inches
    1839  Remarks:
    1840  See ON_ParseSettings::ParseWhiteSpaceBetweenFeetAndInches()
    1841  for details about this property.
    1842  */
    1843  void SetParseWhiteSpaceBetweenFeetAndInches(
    1844  bool bParseWhiteSpaceBetweenFeetAndInches
    1845  );
    1846 
    1847  /*
    1848  Parameters:
    1849  bParseSurveyorsNotation - [in]
    1850  True if angle value parsing should parse
    1851  surveyor's notation like N30W.
    1852  Remarks:
    1853  See ON_ParseSettings::ParseSurveyorsNotation()
    1854  for details about this property.
    1855  */
    1856  void SetParseSurveyorsNotation(
    1857  bool bParseSurveyorsNotation
    1858  );
    1859 
    1860  /*
    1861  Description:
    1862  Set the prefered locale id for parsing unit names. This local
    1863  id is used to resolve ambiguous unit names.
    1864 
    1865  Parameters:
    1866  prefered_locale_id - [in]
    1867  The Microsoft locale id that identifies the locale that should
    1868  be used to resolve ambiguous parsing situtations. The default
    1869  value is zero, which means ambiguous situations are not parsed.
    1870 
    1871  Example:
    1872  When parsing angles, the string "Grad" is ambiguous.
    1873  In German "Grad" identifies arc degree angle units and in
    1874  English "Grad" identifies gradian angle units. If angle parsing
    1875  encounters "Grad" and the prefered locale id is 1031 (de-de),
    1876  then parsing reports the angle value as arc degree units.
    1877  If angle parsing encounters "Grad" and the prefered locale id
    1878  is 1033 (en-us), then parsing reports the angle values as
    1879  gradian units.
    1880  */
    1881  void SetContextLocaleId(
    1882  unsigned int context_locale_id
    1883  );
    1884 
    1885  /*
    1886  Description:
    1887  The context angle unit system determines what length unit system
    1888  is used when a value must be parsed as a length with units and no
    1889  length unit system is explicitly or implicitly specified. The default
    1890  is ON::LengthUnitSystem::None.
    1891 
    1892  Parameters:
    1893  context_length_unit_system - [in]
    1894  ON::LengthUnitSystem::Custom and ON::LengthUnitSystem::Unset
    1895  select ON::LengthUnitSystem::None.
    1896  */
    1897  void SetContextLengthUnitSystem(
    1898  ON::LengthUnitSystem context_length_unit_system
    1899  );
    1900 
    1901  /*
    1902  Description:
    1903  The context angle unit system determines what angle unit system
    1904  is used when a value must be parsed as an angle and no angle
    1905  unit system is explicitly or implicitly specified. The default
    1906  is ON::LengthUnitSystem::Radians.
    1907 
    1908  Parameters:
    1909  default_angle_unit_system - [in]
    1910  ON::AngleUnitSystem::None and ON::AngleUnitSystem::Unset
    1911  select ON::LengthUnitSystem::Radians.
    1912  */
    1913  void SetContextAngleUnitSystem(
    1914  ON::AngleUnitSystem context_angle_unit_system
    1915  );
    1916 
    1917  /*
    1918  Description:
    1919  Deprecated. Use SetConextLocaleId().
    1920  */
    1921  // ON_DEPRECTATED
    1922  void SetPreferedLocaleId(
    1923  unsigned int context_locale_id
    1924  );
    1925  /*
    1926  Description:
    1927  Deprecated. Use SetContextAngleUnitSystem().
    1928  */
    1929  // ON_DEPRECTATED
    1930  void SetDefaultAngleUnitSystem(
    1931  ON::AngleUnitSystem context_angle_unit_system
    1932  );
    1933 
    1934  /*
    1935  Description:
    1936  Set every possible setting to false or zero.
    1937  */
    1938  void SetAllToFalse();
    1939 
    1940 
    1941  /*
    1942  Description:
    1943  Set every possible expression parsing setting to false.
    1944  Remarks:
    1945  This is a simple way to disable all possible parsing of
    1946  expressions. This function calls
    1947  this->SetParseExplicitFormulaExpression(false);
    1948  this->SetParseArithmeticExpression(false);
    1949  this->SetParseMultiplication(false);
    1950  this->SetParseDivision(false);
    1951  this->SetParseAddition(false);
    1952  this->SetParseSubtraction(false);
    1953  this->SetParseMathFunctions(false);
    1954  this->SetParseMathFunctions(false);
    1955  this->SetParsePairedParentheses(false);
    1956  */
    1957  void SetAllExpressionSettingsToFalse();
    1958 
    1959 
    1960  /*
    1961  Returns:
    1962  True if any of the following are true.
    1963  ParseInvalidExpressionError()
    1964  ParseDivideByZeroError()
    1965  ParseOverflowError()
    1966  */
    1967  bool ParseError() const;
    1968 
    1969  /*
    1970  Returns:
    1971  True if parsing and expression resulted in a divide by zero.
    1972  */
    1973  bool ParseDivideByZeroError() const;
    1974 
    1975  /*
    1976  Returns:
    1977  True if parsing and expression created a number that a double
    1978  cannot represent.
    1979  */
    1980  bool ParseOverflowError() const;
    1981 
    1982  /*
    1983  Returns:
    1984  True if parsing and expression failed because the expression
    1985  did not make sense.
    1986  */
    1987  bool ParseInvalidExpressionError() const;
    1988 
    1989  void SetParseDivideByZeroError(
    1990  bool bParseDivideByZeroError
    1991  );
    1992 
    1993  void SetParseOverflowError(
    1994  bool bParseOverflowError
    1995  );
    1996 
    1997  void SetParseInvalidExpressionError(
    1998  bool bParseInvalidExpressionError
    1999  );
    2000 
    2001 private:
    2002  // default constructor sets all elements to zero.
    2003  ON__UINT32 m_true_default_bits[2]; // a "0" bit is true - used for defaults that are true
    2004  ON__UINT32 m_false_default_bits[2]; // a "0" bit is false - used for defaults that are false
    2005 
    2006  ON__UINT32 m_reserved_bits = 0;
    2007 
    2008  // The value of m_context_locale_id is used to resolve
    2009  // ambiguities that occur when parsing unit system names.
    2010  // In German "Grad" identifies arc degree angle units and in
    2011  // English "Grad" identifies gradian angle units. If angle parsing
    2012  // encounters "Grad", it uses the value of m_context_locale_id
    2013  // to determine what arc unit system is being identified.
    2014  ON__UINT16 m_context_locale_id = 0;
    2015 
    2016  // The value of m_context_angle_unit_system determines the
    2017  // angle unit system that is used when a value must be parsed
    2018  // as an angle and no angle unit system is explicitly or
    2019  // implicitly specified.
    2020  // If m_default_angle_unit_system is 0, then radians are used.
    2021  // If m_default_angle_unit_system is not 0 and is equal to an
    2022  // ON::AngleUnitSystem value, that angle unit system is used.
    2023  // In all other cases, radians are used.
    2024  ON__UINT8 m_context_angle_unit_system = 0;
    2025 
    2026  // The value of m_context_length_unit_system determines the
    2027  // length unit system that is used when a value must be parsed
    2028  // as a length and no length unit system is explicitly or
    2029  // implicitly specified.
    2030  // If m_context_length_unit_system is 0, then it is ignored.
    2031  // If m_context_length_unit_system is not 0 and is equal to an
    2032  // ON::LengthUnitSystem value, that length unit system is used.
    2033  // Presently this value is not relavent to internal parsing code,
    2034  // but may be passed along in parse settings to code that
    2035  // use parsing.
    2036  ON__UINT8 m_context_length_unit_system = 0;
    2037 
    2038  ON__UINT64 m_reserved = 0;
    2039 
    2040 private:
    2041  void Internal_DefaultCtor();
    2042 };
    2043 
    2044 /*
    2045 Descriptions:
    2046  result true if a and b are identical.
    2047 */
    2048 ON_DECL
    2049 bool operator==(
    2050  const class ON_ParseSettings& a,
    2051  const class ON_ParseSettings& b
    2052  );
    2053 
    2054 /*
    2055 Descriptions:
    2056  result true if a and b are not identical.
    2057 */
    2058 ON_DECL
    2059 bool operator!=(
    2060  const class ON_ParseSettings& a,
    2061  const class ON_ParseSettings& b
    2062  );
    2063 
    2064 /*
    2065 Descriptions:
    2066  result setting value = a setting value OR b setting value
    2067 Returns:
    2068  Logical OR of the parse settings in a and b.
    2069 */
    2070 ON_DECL
    2071 ON_ParseSettings operator&&(
    2072  const class ON_ParseSettings& a,
    2073  const class ON_ParseSettings& b
    2074  );
    2075 
    2076 /*
    2077 Descriptions:
    2078  result setting value = a setting value AND b setting value
    2079 Returns:
    2080  Logical AND of the parse settings in a and b.
    2081 */
    2082 ON_DECL
    2083 ON_ParseSettings operator||(
    2084  const class ON_ParseSettings& a,
    2085  const class ON_ParseSettings& b
    2086  );
    2087 
    2088 /*
    2089 Description:
    2090  Parses str to determine if it specifies a number.
    2091 
    2092 Parameters:
    2093  str - [in]
    2094 
    2095  str_count - [in]
    2096  str[] and str_count specify the string to parse.
    2097  If str_count >= 0. it specifies the maximum number of elements in str[]
    2098  that may be parsed. If str_count = -1, then the string must contain a
    2099  character that terminates number parsing. This character can
    2100  be a null, arithmetic operator, or a unicode
    2101  code point <= 0x0020 (0x0020 = space = 32 decimal).
    2102 
    2103  parse_settings - [in]
    2104  The value of parse_settings controls what input may be parsed.
    2105  Use one of the predefined
    2106  ON_ParseSettings::DefaultSettings
    2107  ON_ParseSettings::IntegerNumberSettings
    2108  ON_ParseSettings::RationalNumberSettings
    2109  ON_ParseSettings::RealNumberSettings
    2110  for common parsing tasks.
    2111 
    2112  parse_results - [out]
    2113  The value of parse_results reports what was parsed.
    2114 
    2115  value - [out]
    2116  The value of the parsed number.
    2117 
    2118 Returns:
    2119  Number of elments of str[] that were parsed.
    2120  A return value of 0 indicates that str[] could not be
    2121  parsed as a number.
    2122 
    2123 See Also:
    2124  ON_ParseNumberExpression
    2125  ON_ParseLengthExpression
    2126  ON_ParseAngleExpression
    2127 */
    2128 ON_DECL
    2129 int ON_ParseNumber(
    2130  const wchar_t* str,
    2131  int str_count,
    2132  ON_ParseSettings parse_settings,
    2133  ON_ParseSettings* parse_results,
    2134  double* value
    2135  );
    2136 
    2137 /*
    2138 Description:
    2139  Parses str to determine if it specifies a number.
    2140  Expression parsing includes support for parsing in-line multiplication,
    2141  in-line division, automatic multiplication by pi, and formula parsing.
    2142 
    2143 Parameters:
    2144  str - [in]
    2145 
    2146  str_count - [in]
    2147  str[] and str_count specify the string to parse.
    2148  If str_count >= 0. it specifies the maximum number of elements in str[]
    2149  that may be parsed. If str_count = -1, then the string must contain a
    2150  character that terminates number parsing. This character can
    2151  be a null, arithmetic operator, or a unicode
    2152  code point <= 0x0020 (0x0020 = space = 32 decimal).
    2153 
    2154  parse_settings - [in]
    2155  The value of parse_settings controls what input may be parsed.
    2156  Use one of the predefined
    2157  ON_ParseSettings::DefaultSettings
    2158  ON_ParseSettings::IntegerNumberSettings
    2159  ON_ParseSettings::RationalNumberSettings
    2160  ON_ParseSettings::RealNumberSettings
    2161  for common parsing tasks.
    2162 
    2163  parse_results - [out]
    2164  The value of parse_results reports what was parsed.
    2165 
    2166  value - [out]
    2167  The value of the parsed number.
    2168 
    2169 Returns:
    2170  Number of elments of str[] that were parsed.
    2171  A return value of 0 indicates that str[] could not be
    2172  parsed as a number.
    2173 
    2174 See Also:
    2175  ON_ParseNumber
    2176  ON_ParseLengthExpression
    2177  ON_ParseAngleExpression
    2178 */
    2179 ON_DECL
    2180 int ON_ParseNumberExpression(
    2181  const wchar_t* str,
    2182  int str_count,
    2183  ON_ParseSettings parse_settings,
    2184  ON_ParseSettings* parse_results,
    2185  double* value
    2186  );
    2187 
    2188 /*
    2189 Description:
    2190  Parses str if it is a recognized length unit system name or abbreviation.
    2191 
    2192 Parameters:
    2193  str - [in]
    2194 
    2195  str_count - [in]
    2196  str[] and str_count specify the string to parse.
    2197  If str_count >= 0. it specifies the maximum number of elements in str[]
    2198  that may be parsed. If str_count = -1, then the string must contain a
    2199  character that terminates unit system name parsing. This character can
    2200  be a null, digit, punctuation, aritmetic operator, or a unicode
    2201  code point <= 0x0020 (0x0020 = space = 32 decimal).
    2202 
    2203  prefered_locale_id - [in]
    2204  If the parsed length unit name identifies different length unit systems
    2205  in different locales, then this value is used to resolve the
    2206  ambiguity. A list of Microsoft locale id values can be found at
    2207  http://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).
    2208 
    2209  bParseLeadingWhitespace - [in]
    2210  If true, leading white space will be parsed.
    2211  If false, the unit name must begin with element str[0].
    2212 
    2213  length_unit_system - [out] (can be null)
    2214  If length_unit_system is not null, it is set to identify the unit
    2215  system specified by str. If str does not identify a known unit
    2216  system, then *length_unit_system is set to ON::LengthUnitSystem::None.
    2217 
    2218 
    2219 Returns:
    2220  Number of elments of str that were parsed. A return value of
    2221  0 indicates that str did not match know unit system names or
    2222  abbreviations.
    2223 
    2224 Remarks:
    2225  Currently common names and abbreviations for millimeters, centimeters,
    2226  meters and kilometers are supported in Czech (cs-*), English (en-*),
    2227  French (fr-*), German (de-*), Portuguese (pt-*) and Spanish (es-*).
    2228 
    2229  Common names and abreviations for the following United States customary
    2230  length units are supported in United States English (en-US).
    2231  If the first element of str is quotation mark (double quote), unicode
    2232  code point 0x0022, the string is parsed as United Sates customary inch.
    2233  If the first element of str is apostrophe, unicode code point 0x0027,
    2234  the string is parsed as United Sates customary foot.
    2235  All conversions to meters are exact.
    2236  microinch = 2.54e-8 meters (1.0e-6 inches)
    2237  mil = 2.54e-5 meters (0.001 inches)
    2238  inch = 0.0254 meters (1/12 foot)
    2239  foot = 0.3048 meters (12 inches)
    2240  yard = 0.9144 meters (36 inches)
    2241  mile = 1609.344 meters (5280 feet) (US statue or land mile)
    2242 */
    2243 ON_DECL
    2244 int ON_ParseLengthUnitName(
    2245  const wchar_t* str,
    2246  int str_count,
    2247  int prefered_locale_id,
    2248  ON::LengthUnitSystem* length_unit_system
    2249  );
    2250 
    2251 ON_DECL
    2252 int ON_ParseLengthUnitName(
    2253  const wchar_t* str,
    2254  int str_count,
    2255  ON_ParseSettings parse_settings,
    2256  ON::LengthUnitSystem* length_unit_system
    2257  );
    2258 
    2259 /*
    2260 Description:
    2261  Parses str to determine if it specifies a length value.
    2262 
    2263 Parameters:
    2264  str - [in]
    2265 
    2266  str_count - [in]
    2267  str[] and str_count specify the string to parse.
    2268  If str_count >= 0, it specifies the maximum number of elements in str[]
    2269  that may be parsed. If str_count = -1, then the string must contain a
    2270  character that terminates length parsing.
    2271 
    2272  parse_settings - [in]
    2273  The input parse_settings parameter controls what input may be
    2274  parsed and how it is parsed.
    2275  Use ON_ParseSettings::DefaultSettings for common parsing tasks.
    2276 
    2277  length_value_unit_system - [in]
    2278  Length unit system for the returned value.
    2279  For example, if you want the returned value to be in meters,
    2280  you would specify ON::LengthUnitSystem::Meters here. If you want to use custom
    2281  units, you must use the override with the ON_UnitSystem
    2282  parameter.
    2283 
    2284  length_value - [out]
    2285  The value of the parsed length.
    2286 
    2287  parse_results - [out] (input pointer can be null)
    2288  The output parse_results parameter reports what was parsed.
    2289 
    2290  str_length_unit_system - [out] (input pointer can be null)
    2291  length unit in the parsed string. When the
    2292  length_value_unit_system specifies a unit system and a
    2293  a different length unit system is parsed, the number returned
    2294  in length_value is always converted to the unit system
    2295  specified by the length_value_unit_system parameter.
    2296  If needed, you can inspect str_length_unit_system to determine
    2297  if the length unit system scaling was applied.
    2298 
    2299 Returns:
    2300  Number of elements of str that were parsed. A return value of
    2301  0 indicates that str could not be parsed as a length value.
    2302 */
    2303 ON_DECL
    2304 int ON_ParseLengthExpression(
    2305  const wchar_t* str,
    2306  int str_count,
    2307  ON_ParseSettings parse_settings,
    2308  double* length_value,
    2309  ON_ParseSettings* parse_results,
    2310  ON::LengthUnitSystem* str_length_unit_system
    2311  );
    2312 
    2313 ON_DECL
    2314 int ON_ParseLengthExpression(
    2315  const wchar_t* str,
    2316  int str_count,
    2317  ON_ParseSettings parse_settings,
    2318  ON::LengthUnitSystem length_value_unit_system,
    2319  double* length_value,
    2320  ON_ParseSettings* parse_results,
    2321  ON::LengthUnitSystem* str_length_unit_system
    2322  );
    2323 
    2324 ON_DECL
    2325 int ON_ParseLengthExpression(
    2326  const wchar_t* str,
    2327  int str_count,
    2328  ON_ParseSettings parse_settings,
    2329  const ON_UnitSystem& length_value_unit_system,
    2330  double* length_value,
    2331  ON_ParseSettings* parse_results,
    2332  ON::LengthUnitSystem* str_length_unit_system
    2333  );
    2334 
    2335 ON_DECL
    2336 int ON_ParseLengthExpression(
    2337  const wchar_t* str,
    2338  int str_count,
    2339  ON::AngleUnitSystem default_str_angle_unit_system,
    2340  ON::LengthUnitSystem length_value_unit_system,
    2341  double* length_value
    2342  );
    2343 
    2344 ON_DECL
    2345 int ON_ParseLengthExpression(
    2346  const wchar_t* str,
    2347  int str_count,
    2348  ON::AngleUnitSystem default_str_angle_unit_system,
    2349  const ON_UnitSystem& length_value_unit_system,
    2350  double* length_value
    2351  );
    2352 
    2353 
    2354 
    2355 /*
    2356 Description:
    2357  Parses str if it is a recognized angle unit system name or abbreviation.
    2358 
    2359 Parameters:
    2360  str - [in]
    2361 
    2362  str_count - [in]
    2363  str[] and str_count specify the string to parse.
    2364  If str_count >= 0. it specifies the maximum number of elements in str[]
    2365  that may be parsed. If str_count = -1, then the string must contain a
    2366  character that terminates angle unit system name parsing.
    2367  This character can be a null, digit, punctuation, aritmetic operator,
    2368  or a unicode code point <= 0x0020 (0x0020 = space = 32 decimal).
    2369 
    2370  prefered_locale_id - [in]
    2371  If the parsed angle unit name identifies different angle unit systems
    2372  in different locales, then this value is used to resolve the
    2373  ambiguity. A list of Microsoft locale id values can be found at
    2374  http://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).
    2375  For example, "Grad" identifies ON::degrees in German and ON::gradians
    2376  in US English.
    2377 
    2378  bParseLeadingWhitespace - [in]
    2379  If true, leading white space will be parsed.
    2380  If false, the unit name must begin with element str[0].
    2381 
    2382  angle_unit_system - [out] (can be null)
    2383  If angle_unit_system is not null, it is set to the identify the
    2384  angle unit system specified by str. If str does not identify a
    2385  known angle unit system, then *angle_unit_system is set to
    2386  ON::AngleUnitSystem::None.
    2387 
    2388 Returns:
    2389  Number of elments of str that were parsed. A return value of
    2390  0 indicates that str did not match know unit system names or
    2391  abbreviations.
    2392 
    2393 Remarks:
    2394  Currently common names and abbreviations for radians, turns,
    2395  gradians, arc degrees, arc minutes and arc seconds are supported
    2396  in Czech (cs-*), English (en-*), French (fr-*), German (de-*),
    2397  Portuguese (pt-*) and Spanish (es-*).
    2398 
    2399  If the first element of str is quotation mark (double quote), unicode
    2400  code point 0x0022, the string is parsed as arc seconds.
    2401  If the first element of str is apostrophe, unicode code point 0x0027,
    2402  the string is parsed as arc minutes.
    2403 */
    2404 ON_DECL
    2405 int ON_ParseAngleUnitName(
    2406  const wchar_t* str,
    2407  int str_count,
    2408  int prefered_locale_id,
    2409  ON::AngleUnitSystem* angle_unit_system
    2410  );
    2411 
    2412 ON_DECL
    2413 int ON_ParseAngleUnitName(
    2414  const wchar_t* str,
    2415  int str_count,
    2416  ON_ParseSettings parse_settings,
    2417  ON::AngleUnitSystem* angle_unit_system
    2418  );
    2419 
    2420 
    2421 /*
    2422 Description:
    2423  Parses str to determine if it specifies a angle value.
    2424 
    2425 Parameters:
    2426  str - [in]
    2427 
    2428  str_count - [in]
    2429  str[] and str_count specify the string to parse.
    2430  If str_count >= 0. it specifies the maximum number of elements in str[]
    2431  that may be parsed. If str_count = -1, then the string must contain a
    2432  character that terminates angle parsing.
    2433 
    2434  parse_settings - [in]
    2435  The input parse_settings parameter controls what input may be
    2436  parsed and how it is parsed.
    2437  Use ON_ParseSettings::DefaultSettings for common parsing tasks.
    2438 
    2439  angle_value_unit_system - [in]
    2440  Angle unit system for the returned value.
    2441  For example, if you want the returned value to be in degrees,
    2442  you would specify ON::AngleUnitSystem::Degrees here.
    2443 
    2444  angle_value - [out]
    2445  The value of the parsed angle.
    2446 
    2447  parse_results - [out] (input pointer can be null)
    2448  The output parse_results parameter reports what was parsed.
    2449 
    2450  str_angle_unit_system - [out] (input pointer can be null)
    2451  angle unit in the parsed string. When the
    2452  angle_value_unit_system specifies an angle unit system and a
    2453  a different angle unit system is parsed, the number returned
    2454  in angle_value is always converted to the angle unit system
    2455  specified by the angle_value_unit_system parameter.
    2456  If needed, you can inspect str_angle_unit_system to determine
    2457  if the angle unit system scaling was applied.
    2458 
    2459 Returns:
    2460  Number of elements of str that were parsed. A return value of
    2461  0 indicates that str could not be parsed as a angle value.
    2462 */
    2463 ON_DECL
    2464 int ON_ParseAngleExpression(
    2465  const wchar_t* str,
    2466  int str_count,
    2467  ON_ParseSettings parse_settings,
    2468  double* angle_value,
    2469  ON_ParseSettings* parse_results,
    2470  ON::AngleUnitSystem* str_angle_unit_system
    2471  );
    2472 
    2473 ON_DECL
    2474 int ON_ParseAngleExpression(
    2475  const wchar_t* str,
    2476  int str_count,
    2477  ON_ParseSettings parse_settings,
    2478  const ON::AngleUnitSystem angle_value_unit_system,
    2479  double* angle_value,
    2480  ON_ParseSettings* parse_results,
    2481  ON::AngleUnitSystem* str_angle_unit_system
    2482  );
    2483 
    2484 /*
    2485 Description:
    2486  Parses str to determine if it specifies a angle value.
    2487 
    2488 Parameters:
    2489  str - [in]
    2490 
    2491  str_count - [in]
    2492  str[] and str_count specify the string to parse.
    2493  If str_count >= 0. it specifies the maximum number of elements in str[]
    2494  that may be parsed. If str_count = -1, then the string must contain a
    2495  character that terminates angle parsing.
    2496 
    2497  default_str_angle_unit_system - [in]
    2498  If an angle unit system is not specified in the parsed string,
    2499  then default_str_angle_units determines what unit system will
    2500  be used. If default_str_angle_units is ON::AngleUnitSystem::None,
    2501  then ON::radians will be used.
    2502 
    2503  angle_value_in_radians - [out]
    2504  The value of the parsed angle, converted to radians, is returned here.
    2505 
    2506 Returns:
    2507  Number of elements of str that were parsed. A return value of
    2508  0 indicates that str could not be parsed as a angle value.
    2509 
    2510 Remarks:
    2511  This function uses ON_ParseAngleExpression() with the
    2512  angle_value_unit_system parameter set to ON::radians
    2513  to parse the string. If you need more control over parsing
    2514  options, then use ON_ParseAngleExpression().
    2515 */
    2516 ON_DECL
    2517 int ON_ParseAngleRadiansExpression(
    2518  const wchar_t* str,
    2519  int str_count,
    2520  ON::AngleUnitSystem default_str_angle_unit_system,
    2521  double* angle_value_in_radians
    2522  );
    2523 
    2524 /*
    2525 Description:
    2526  Parses str to determine if it specifies a angle value.
    2527 
    2528 Parameters:
    2529  str - [in]
    2530 
    2531  str_count - [in]
    2532  str[] and str_count specify the string to parse.
    2533  If str_count >= 0. it specifies the maximum number of elements in str[]
    2534  that may be parsed. If str_count = -1, then the string must contain a
    2535  character that terminates angle parsing.
    2536 
    2537  default_str_angle_unit_system - [in]
    2538  If an angle unit system is not specified in the parsed string,
    2539  then default_str_angle_units determines what unit system will
    2540  be used. If default_str_angle_units is ON::AngleUnitSystem::None,
    2541  then ON::radians will be used.
    2542 
    2543  angle_value_in_radians - [out]
    2544  The value of the parsed angle, converted to arc degrees,
    2545  is returned here.
    2546 
    2547 Returns:
    2548  Number of elements of str that were parsed. A return value of
    2549  0 indicates that str could not be parsed as a angle value.
    2550 
    2551 Remarks:
    2552  This function uses ON_ParseAngleExpression() with the
    2553  angle_value_unit_system parameter set to ON::AngleUnitSystem::Degrees
    2554  to parse the string. If you need more control over parsing
    2555  options, then use ON_ParseAngleExpression().
    2556 */
    2557 ON_DECL
    2558 int ON_ParseAngleArcDegreesExpression(
    2559  const wchar_t* str,
    2560  int str_count,
    2561  ON::AngleUnitSystem default_str_angle_unit_system,
    2562  double* angle_value_in_arc_degrees
    2563  );
    2564 
    2565 /*
    2566 Description:
    2567  Parses str to determine if it specifies a point value.
    2568 
    2569 Parameters:
    2570  str - [in]
    2571 
    2572  str_count - [in]
    2573  str[] and str_count specify the string to parse.
    2574  If str_count >= 0. it specifies the maximum number of elements in str[]
    2575  that may be parsed. If str_count = -1, then the string must contain a
    2576  character that terminates length parsing.
    2577 
    2578  default_str_angle_unit_system - [in]
    2579  If an angle unit system is not specified in the parsed string,
    2580  then default_str_angle_units determines what unit system will
    2581  be used. If default_str_angle_units is ON::AngleUnitSystem::None,
    2582  then ON::radians will be used.
    2583 
    2584  parse_settings - [in]
    2585  The input parse_settings parameter controls what input may be
    2586  parsed and how it is parsed.
    2587  Use ON_ParseSettings::DefaultSettings for common parsing tasks.
    2588 
    2589  point_value_unit_system - [in]
    2590  Coordinate unit system for the returned point value.
    2591  For example, if you want the returned point coordinates to
    2592  be in meters, you would specify ON::LengthUnitSystem::Meters here.
    2593  If you want to use custom units, you must use the
    2594  override with the ON_UnitSystem parameter.
    2595 
    2596  point_value - [out]
    2597  The value of the parsed point.
    2598 
    2599  parse_results - [out] (input pointer can be null)
    2600  The output parse_results parameter reports what was parsed.
    2601 
    2602 Returns:
    2603  Number of elements of str that were parsed. A return value of
    2604  0 indicates that str could not be parsed as a length value.
    2605 */
    2606 ON_DECL
    2607 int ON_ParsePointExpression(
    2608  const wchar_t* str,
    2609  int str_count,
    2610  ON::AngleUnitSystem default_str_angle_unit_system,
    2611  ON::LengthUnitSystem point_value_unit_system,
    2612  ON_3dPoint* point_value
    2613  );
    2614 
    2615 ON_DECL
    2616 int ON_ParsePointExpression(
    2617  const wchar_t* str,
    2618  int str_count,
    2619  ON::AngleUnitSystem default_str_angle_unit_system,
    2620  const ON_UnitSystem& point_value_unit_system,
    2621  ON_3dPoint* point_value
    2622  );
    2623 
    2624 ON_DECL
    2625 int ON_ParsePointExpression(
    2626  const wchar_t* str,
    2627  int str_count,
    2628  ON_ParseSettings parse_settings,
    2629  ON::LengthUnitSystem point_value_unit_system,
    2630  ON_3dPoint* point_value,
    2631  ON_ParseSettings* parse_results
    2632  );
    2633 
    2634 ON_DECL
    2635 int ON_ParsePointExpression(
    2636  const wchar_t* str,
    2637  int str_count,
    2638  ON_ParseSettings parse_settings,
    2639  const ON_UnitSystem& point_value_unit_system,
    2640  ON_3dPoint* point_value,
    2641  ON_ParseSettings* parse_results
    2642  );
    2643 
    2644 
    2645 
    2646 
    2647 #endif
    2648 
    static const ON_LengthUnitName None
    Definition: opennurbs_parse.h:201
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(ON_PARSE_INC_)
    18 #define ON_PARSE_INC_
    19 
    21 {
    22 public:
    28 
    29  ////////////////////////////////////////////////////////////
    30  //
    31  // Configuration Settings
    32  //
    33  bool ImpliedMultiplication() const;
    34  void SetImpliedMultiplication(
    35  bool bEnable
    36  );
    37 
    38 
    39  ////////////////////////////////////////////////////////////
    40  //
    41  // Current Status
    42  //
    44  {
    45  no_error = 0,
    46 
    47  program_error = 1,
    48  // The part of the computer running the ON_ArithmeticCalculator
    49  // code is corrupt or damaged or there is a bug in the
    50  // ON_ArithmeticCalculator code.
    51 
    52  invalid_expression_error = 2,
    53  // The input expression does not make sense.
    54 
    55  divide_by_zero_error = 3,
    56  // A calculation requested division by zero.
    57 
    58  overflow_error = 4,
    59  // A calculation produced a number the computer cannot represent
    60  };
    61 
    62  ERROR_CONDITION ErrorCondition() const;
    63 
    64  /*
    65  Returns:
    66  True if a unary plus is pending and will be applied
    67  to the next number or parenthetical expression.
    68  */
    69  bool PendingUnaryPlus() const;
    70 
    71  /*
    72  Returns:
    73  True if a unary minus is pending and will be applied
    74  to the next number or parenthetical expression.
    75  */
    76  bool PendingUnaryMinus() const;
    77 
    78  /*
    79  Returns:
    80  True if a unary plus or unary minus is pending
    81  */
    82  bool PendingUnaryOperation() const;
    83 
    84  /*
    85  Returns:
    86  True if an implied multiplication will be applied
    87  to the next number or parenthetical expression.
    88  */
    89  bool PendingImpliedMultiplication() const;
    90 
    91  /*
    92  Returns:
    93  The current number of parenthetic expressions that
    94  are not completed.
    95  */
    96  unsigned int ParenthesesDepth() const;
    97 
    98  ////////////////////////////////////////////////////////////
    99  //
    100  // Calculator keys
    101  //
    102 
    103  /*
    104  Description:
    105  Enter a number that can be used as an implied multiplication
    106  operand when implied multiplication is enabled and appropriate.
    107  */
    108  bool Number(double x);
    109 
    110  /*
    111  Description:
    112  Enter a number that will never use implied multiplication.
    113  */
    114  bool SimpleNumber(double x);
    115 
    116  /*
    117  Description:
    118  Enter an explicit multiplication operator whose operands
    119  are the previous value and the next value, where a value
    120  is a number, simple number, or parenthetic expression.
    121  */
    122  bool Multiply();
    123 
    124  /*
    125  Description:
    126  Enter an explicit division operator whose operands
    127  are the previous value and the next value, where a value
    128  is a number, simple number, or parenthetic expression.
    129  If the second value is zero, the calculator state
    130  is set to error.
    131  */
    132  bool Divide();
    133 
    134  /*
    135  Description:
    136  Enter an explicit addition operator whose operands
    137  are the previous value and the next value, where a value
    138  is a number, simple number, or parenthetic expression.
    139  */
    140  bool Add();
    141 
    142  /*
    143  Description:
    144  Enter an explicit subtraction operator whose operands
    145  are the previous value and the next value, where a value
    146  is a number, simple number, or parenthetic expression.
    147  */
    148  bool Subtract();
    149 
    150  /*
    151  Description:
    152  Enter an unary plus operator whose operand is the next
    153  number, simple number, or parenthetic expression.
    154  */
    155  bool UnaryPlus();
    156 
    157  /*
    158  Description:
    159  Enter an unary minus operator whose operand is the next
    160  number, simple number, or parenthetic expression.
    161  */
    162  bool UnaryMinus();
    163 
    164  /*
    165  Description:
    166  Begin a parenthetic expression.
    167  */
    168  bool LeftParenthesis();
    169 
    170  /*
    171  Description:
    172  End a parenthetic expression.
    173  */
    174  bool RightParenthesis();
    175 
    176  /*
    177  Description:
    178  Calculate the current value.
    179  */
    180  bool Evaluate(double* value);
    181 
    182  /*
    183  Description:
    184  Clear all status, values and expressions.
    185  */
    186  void ClearAll();
    187 
    188 private:
    189  class ON_ArithmeticCalculatorImplementation* m_pCalc;
    190  double m_inplace_buffer[127]; // used for in-place construction of pCalc.
    191 };
    192 
    193 class ON_CLASS ON_LengthUnitName
    194 {
    195 public:
    196  ON_LengthUnitName() = default;
    197  ~ON_LengthUnitName() = default;
    198  ON_LengthUnitName(const ON_LengthUnitName&) = default;
    199  ON_LengthUnitName& operator=(const ON_LengthUnitName&) = default;
    200 
    201  static const ON_LengthUnitName None;
    202 
    203  /*
    204  Description:
    205  Get list of length unit names and abbreviations and their corresponding
    206  unit systems that are recognized by ON_ParseLengthUnitSystemName().
    207 
    208  Parameters:
    209  length_unit_list_capacity - [in]
    210  number of available elements in length_unit_list[]
    211  If length_unit_list_capacity is zero and length_unit_list is null,
    212  then the number of length unit names is returned.
    213  length_unit_list - [out]
    214  The list of length unit names is returned here.
    215 
    216  Returns:
    217  Number of length unit names and abbreviations.
    218 
    219  Example:
    220  unsigned int count = ON_GetLengthUnitNameList(0,0);
    221  ON_UnitName* length_unit_list = new (std::nothrow) ON_UnitName[capacity];
    222  count = ON_GetLengthUnitNameList(count,length_unit_list);
    223  ...
    224  delete[] length_unit_list;
    225  Remarks:
    226  If length_unit_list_capacity is zero and length_unit_list is null,
    227  then the number of length unit names is returned.
    228  */
    229  static unsigned int GetLengthUnitNameList(
    230  size_t length_unit_list_capacity,
    231  class ON_LengthUnitName* length_unit_list
    232  );
    233 
    234  static ON_LengthUnitName Create(
    235  unsigned int locale_id,
    236  ON::LengthUnitSystem length_unit_system,
    237  bool bPlural
    238  );
    239 
    240  /*
    241  Description:
    242  Dictionary compare of all ON_LengthUnitName information in the order
    243  unit system, locale id, name, singular, plural
    244  */
    245  static int CompareUnitSystemLocaleIdName(
    246  const ON_LengthUnitName& a,
    247  const ON_LengthUnitName& b
    248  );
    249 
    250  /*
    251  Description:
    252  Dictionary compare of all ON_LengthUnitName information in the order
    253  locale id, unit system, name, singular, plural
    254  */
    255  static int CompareLocaleIdUnitSystemName(
    256  const ON_LengthUnitName& a,
    257  const ON_LengthUnitName& b
    258  );
    259 
    260  unsigned int LocaleId() const;
    261 
    262  ON::LengthUnitSystem LengthUnit() const;
    263 
    264  /*
    265  Returns:
    266  True if the length unit system is set.
    267  False if length unit system is ON::LengthUnitSystem::None or ON::LengthUnitSystem::Unset.
    268  */
    269  bool LengthUnitIsSet() const;
    270 
    271  /*
    272  Returns:
    273  True if the length unit system is set or is ON::LengthUnitSystem::None
    274  */
    275  bool LengthUnitIsSetOrNone() const;
    276 
    277  /*
    278  Returns:
    279  True if the length unit system is set and the name is not empty.
    280  False if length unit system is ON::LengthUnitSystem::None or ON::LengthUnitSystem::Unset or the name is empty.
    281  */
    282  bool LengthUnitAndNameAreSet() const;
    283 
    284  /*
    285  Returns:
    286  A pointer to a localized length unit name or a pointer to an empty string.
    287  Remarks:
    288  Never returns nullptr.
    289  */
    290  const wchar_t* LengthUnitName() const;
    291 
    292  bool LengthUnitNameIsEmpty() const;
    293 
    294  bool LengthUnitNameIsNotEmpty() const;
    295 
    296  /*
    297  Remarks:
    298  True if the length unit name is singular in languages where that question
    299  has a meaningful answer.
    300  Remarks:
    301  Some names and name abbreviations are both singular and plural.
    302  */
    303  bool LengthUnitNameIsSingular() const;
    304 
    305  /*
    306  Remarks:
    307  True if the length unit name is plural in languages where that question
    308  has a meaningful answer.
    309  Remarks:
    310  Some names and name abbreviations are both singular and plural.
    311  */
    312  bool LengthUnitNameIsPlural() const;
    313 
    314 private:
    315  // Microsoft locale id // http://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).aspx
    316  unsigned int m_locale_id = 0;
    317  ON::LengthUnitSystem m_length_unit_system = ON::LengthUnitSystem::None;
    318  bool m_bNameIsSingular = false;
    319  bool m_bNameIsPlural = false;
    320  const wchar_t* m_name = nullptr;
    321 
    322 private:
    323  static int Internal_Compare(
    324  unsigned int order_selector,
    325  const ON_LengthUnitName& a,
    326  const ON_LengthUnitName& b
    327  );
    328 };
    329 
    330 ON_DECL
    331 bool operator==(
    332  const ON_LengthUnitName& a,
    333  const ON_LengthUnitName& b
    334  );
    335 
    336 ON_DECL
    337 bool operator!=(
    338  const ON_LengthUnitName& a,
    339  const ON_LengthUnitName& b
    340  );
    341 
    342 class ON_CLASS ON_AngleUnitName
    343 {
    344 public:
    345  ON_AngleUnitName() = default;
    346  ~ON_AngleUnitName() = default;
    347  ON_AngleUnitName(const ON_AngleUnitName&) = default;
    348  ON_AngleUnitName& operator=(const ON_AngleUnitName&) = default;
    349 
    350  static const ON_AngleUnitName None;
    351 
    352  /*
    353  Description:
    354  Get list of angle unit names and abbreviations and their corresponding
    355  unit systems that are recognized by ON_ParseAngleUnitName().
    356 
    357  Parameters:
    358  angle_unit_list_capacity - [in]
    359  number of available elements in angle_unit_list[]
    360  If angle_unit_list_capacity is zero and angle_unit_list is null,
    361  then the number of angle unit names is returned.
    362  angle_unit_list - [out]
    363  The list of angle unit names is returned here.
    364 
    365  Returns:
    366  Number of angle unit names and abbreviations.
    367 
    368  Example:
    369  unsigned int count = ON_GetAngleUnitNameList(0,0);
    370  ON_UnitName* angle_unit_list = new (std::nothrow) ON_UnitName[capacity];
    371  count = ON_GetAngleUnitNameList(count,angle_unit_list);
    372  ...
    373  delete[] angle_unit_list;
    374  Remarks:
    375  If angle_unit_list_capacity is zero and angle_unit_list is null,
    376  then the number of angle unit names is returned.
    377  */
    378  static unsigned int GetAngleUnitNameList(
    379  size_t angle_unit_list_capacity,
    380  class ON_AngleUnitName* angle_unit_list
    381  );
    382 
    383  static ON_AngleUnitName Create(
    384  unsigned int locale_id,
    385  ON::AngleUnitSystem angle_unit_system,
    386  bool bPlural
    387  );
    388 
    389  /*
    390  Description:
    391  Dictionary compare of all ON_LengthUnitName information in the order
    392  unit system, locale id, name, singular, plural
    393  */
    394  static int CompareUnitSystemLocaleIdName(
    395  const ON_AngleUnitName& a,
    396  const ON_AngleUnitName& b
    397  );
    398 
    399  /*
    400  Description:
    401  Dictionary compare of all ON_LengthUnitName information in the order
    402  locale id, unit system, name, singular, plural
    403  */
    404  static int CompareLocaleIdUnitSystemName(
    405  const ON_AngleUnitName& a,
    406  const ON_AngleUnitName& b
    407  );
    408 
    409  unsigned int LocaleId() const;
    410 
    411  ON::AngleUnitSystem AngleUnit() const;
    412 
    413  /*
    414  Returns:
    415  True if the angle unit system is set.
    416  False if angle unit system is ON::AngleUnitSystem::None or ON::AngleUnitSystem::Unset.
    417  */
    418  bool AngleUnitIsSet() const;
    419 
    420  /*
    421  Returns:
    422  True if the angle unit system is set or is ON::AngleUnitSystem::None
    423  */
    424  bool AngleUnitIsSetOrNone() const;
    425 
    426  /*
    427  Returns:
    428  True if the angle unit system is set and the name is not empty.
    429  False if length unit system is ON::AngleUnitSystem::None or ON::AngleUnitSystem::Unset or the name is empty.
    430  */
    431  bool AngleUnitAndNameAreSet() const;
    432 
    433 
    434  /*
    435  Returns:
    436  A pointer to a localized angle unit name or a pointer to an empty string.
    437  Remarks:
    438  Never returns nullptr.
    439  */
    440  const wchar_t* AngleUnitName() const;
    441 
    442  bool AngleUnitNameIsEmpty() const;
    443 
    444  bool AngleUnitNameIsNotEmpty() const;
    445 
    446  /*
    447  Remarks:
    448  True if the angle unit name is singular in languages where that question
    449  has a meaningful answer.
    450  Remarks:
    451  Some names and name abbreviations are both singular and plural.
    452  */
    453  bool AngleUnitNameIsSingular() const;
    454 
    455  /*
    456  Remarks:
    457  True if the angle unit name is plural in languages where that question
    458  has a meaningful answer.
    459  Remarks:
    460  Some names and name abbreviations are both singular and plural.
    461  */
    462  bool AngleUnitNameIsPlural() const;
    463 
    464 private:
    465  // Microsoft locale id // http://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).aspx
    466  unsigned int m_locale_id = 0;
    467  ON::AngleUnitSystem m_angle_unit_system = ON::AngleUnitSystem::None;
    468  bool m_bNameIsSingular = false;
    469  bool m_bNameIsPlural = false;
    470  const wchar_t* m_name = nullptr;
    471 
    472 private:
    473  static int Internal_Compare(
    474  unsigned int order_selector,
    475  const ON_AngleUnitName& a,
    476  const ON_AngleUnitName& b
    477  );
    478 };
    479 
    480 ON_DECL
    481 bool operator==(
    482  const ON_AngleUnitName& a,
    483  const ON_AngleUnitName& b
    484  );
    485 
    486 ON_DECL
    487 bool operator!=(
    488  const ON_AngleUnitName& a,
    489  const ON_AngleUnitName& b
    490  );
    491 
    492 class ON_CLASS ON_ParseSettings
    493 {
    494 public:
    495  enum
    496  {
    497  // maximum number of wchar_t elements in a number
    498  max_number_str_count = 2000,
    499 
    500  // maximum number of wchar_t elements in an expression
    501  max_expression_str_count = 2147483645,
    502  };
    503 
    504  /*
    505  Description:
    506  The default constuctor uses the default settings.
    507  */
    509 
    510  /*
    511  Description:
    512  Default settings constructor sets the context information.
    513  */
    515  const class ON_UnitSystem& context_length_unit_system,
    516  ON::AngleUnitSystem context_angle_unit_system,
    517  unsigned int context_locale_id
    518  );
    520  ON::LengthUnitSystem context_length_unit_system,
    521  ON::AngleUnitSystem context_angle_unit_system,
    522  unsigned int context_locale_id
    523  );
    524 
    525  /*
    526  Description:
    527  - The default settings parse just about everything in
    528  a reasonable way.
    529  - Any angle values with unspecified units will be
    530  treated as radians. Angles without units can be
    531  encountered while parsing formulas, lengths and
    532  points and need to be thoughtfully considered in
    533  most parsing situations.
    534  */
    536 
    537  /*
    538  Description:
    539  - The default settings parse just about everything in
    540  a reasonable way.
    541  - Any angle values with unspecified units will be
    542  treated as radians. Angles without units can be
    543  encountered while parsing formulas, lengths and
    544  points and need to be thoughtfully considered in
    545  most parsing situations.
    546  */
    548 
    549  /*
    550  Description:
    551  - The default settings parse just about everything in
    552  a reasonable way.
    553  - Any angle values with unspecified units will be
    554  treated as degrees. Angles without units can be
    555  encountered while parsing formulas, lengths and
    556  points and need to be thoughtfully considered in
    557  most parsing situations.
    558  */
    560 
    561  /*
    562  Description:
    563  The integer settings parse and optional unary + or unary - and
    564  then parses one or more digits. Parsing stops after the last
    565  digit.
    566  */
    568 
    569  /*
    570  Description:
    571  The rational number settings parse and optional unary + or unary -
    572  and then parse one or more digits. If a rational number fraction
    573  bar follows the last digit in the numerator, then it is parsed
    574  and an integer denominator is parsed. The denominator cannot
    575  have a unary + or - preceding the digits. Parsing stops after
    576  the last digit in the denominator.
    577  */
    579 
    580  /*
    581  Description:
    582  The double number settings parse and optional unary + or unary -
    583  and then parse a number that can be integer, decimal, or
    584  scientific e notation.
    585  */
    587 
    588  /*
    589  Description:
    590  The real number settings parse and optional unary + or unary -
    591  and then parse a number that can be integer, decimal,
    592  scientific e notation or pi.
    593  */
    595 
    596  /*
    597  Description:
    598  ON_ParseSetting::FalseSettings has all parsing options
    599  set to false.
    600  Remarks:
    601  A common use of ON_ParseSettings FalseSettings is to intialize
    602  ON_ParseSettings classes that are used to report what happened
    603  during parsing. Any parsing results value set to true after
    604  parsing indicates that type of parsing occured.
    605  */
    607 
    608  static const int Compare(
    609  const ON_ParseSettings* a,
    610  const ON_ParseSettings* b
    611  );
    612 
    613  ON_ParseSettings& operator|=(const ON_ParseSettings& other);
    614  ON_ParseSettings& operator&=(const ON_ParseSettings& other);
    615 
    616 
    617  /*
    618  Remarks:
    619  The default value is true.
    620  */
    621  bool ParseSpaceAsWhiteSpace() const;
    622 
    623  /*
    624  Remarks:
    625  The default value is true.
    626  */
    627  bool ParseNoBreakSpaceAsWhiteSpace() const;
    628 
    629  /*
    630  Remarks:
    631  The default value is true.
    632  */
    633  bool ParseHorizontalTabAsWhiteSpace() const;
    634 
    635  /*
    636  Remarks:
    637  The default value is true.
    638  */
    639  bool ParseThinSpaceAsWhiteSpace() const;
    640 
    641  /*
    642  Remarks:
    643  The default value is true.
    644  */
    645  bool ParseNoBreakThinSpaceAsWhiteSpace() const;
    646 
    647  /*
    648  Remarks:
    649  The default value is true.
    650  */
    651  bool ParseLineFeedAsLeadingWhiteSpace() const;
    652 
    653  /*
    654  Remarks:
    655  The default value is true.
    656  */
    657  bool ParseFormFeedAsLeadingWhiteSpace() const;
    658 
    659  /*
    660  Remarks:
    661  The default value is true.
    662  */
    663  bool ParseCarriageReturnAsLeadingWhiteSpace() const;
    664 
    665  /*
    666  Remarks:
    667  The default value is true.
    668  */
    669  bool ParseVerticalTabAsLeadingWhiteSpace() const;
    670 
    671  /*
    672  Remarks:
    673  The default value is true.
    674  */
    675  bool ParseLineFeedAsTrailingWhiteSpace() const;
    676 
    677  /*
    678  Remarks:
    679  The default value is true.
    680  */
    681  bool ParseFormFeedAsTrailingWhiteSpace() const;
    682 
    683  /*
    684  Remarks:
    685  The default value is true.
    686  */
    687  bool ParseCarriageReturnAsTrailingWhiteSpace() const;
    688 
    689  /*
    690  Remarks:
    691  The default value is true.
    692  */
    693  bool ParseVerticalTabAsTrailingWhiteSpace() const;
    694 
    695 
    696  /*
    697  Remarks:
    698  The default value is true.
    699  */
    700  void SetParseSpaceAsWhiteSpace(
    701  bool bParseSpaceAsWhiteSpace );
    702 
    703  /*
    704  Remarks:
    705  The default value is true.
    706  */
    707  void SetParseNoBreakSpaceAsWhiteSpace(
    708  bool bParseNoBreakSpaceAsWhiteSpace );
    709 
    710  /*
    711  Remarks:
    712  The default value is true.
    713  */
    714  void SetParseHorizontalTabAsWhiteSpace(
    715  bool bParseHorizontalTabAsWhiteSpace );
    716 
    717  /*
    718  Remarks:
    719  The default value is true.
    720  */
    721  void SetParseThinSpaceAsWhiteSpace(
    722  bool bParseThinSpaceAsWhiteSpace );
    723 
    724  /*
    725  Remarks:
    726  The default value is true.
    727  */
    728  void SetParseNoBreakThinSpaceAsWhiteSpace(
    729  bool bParseNoBreakThinSpaceAsWhiteSpace );
    730 
    731  /*
    732  Remarks:
    733  The default value is true.
    734  */
    735  void SetParseLineFeedAsLeadingWhiteSpace(
    736  bool bParseLineFeedAsLeadingWhiteSpace );
    737 
    738  /*
    739  Remarks:
    740  The default value is true.
    741  */
    742  void SetParseFormFeedAsLeadingWhiteSpace(
    743  bool bParseFormFeedAsLeadingWhiteSpace );
    744 
    745  /*
    746  Remarks:
    747  The default value is true.
    748  */
    749  void SetParseCarriageReturnAsLeadingWhiteSpace(
    750  bool bParseCarriageReturnAsLeadingWhiteSpace );
    751 
    752  /*
    753  Remarks:
    754  The default value is true.
    755  */
    756  void SetParseVerticalTabAsLeadingWhiteSpace(
    757  bool bParseVerticalTabAsLeadingWhiteSpace );
    758 
    759  /*
    760  Remarks:
    761  The default value is true.
    762  */
    763  void SetParseLineFeedAsTrailingWhiteSpace(
    764  bool bParseLineFeedAsTrailingWhiteSpacee );
    765 
    766  /*
    767  Remarks:
    768  The default value is true.
    769  */
    770  void SetParseFormFeedAsTrailingWhiteSpace(
    771  bool bParseParseFormFeedAsTrailingWhiteSpace );
    772 
    773  /*
    774  Remarks:
    775  The default value is true.
    776  */
    777  void SetParseCarriageReturnAsTrailingWhiteSpace(
    778  bool bParseParseCarriageReturnAsTrailingWhiteSpace );
    779 
    780  /*
    781  Remarks:
    782  The default value is true.
    783  */
    784  void SetParseVerticalTabAsTrailingWhiteSpace(
    785  bool bParseParseVerticalTabAsTrailingWhiteSpace );
    786 
    787 
    788  /*
    789  Returns:
    790  True if leading white space should be parsed.
    791  Remarks:
    792  The default value is true.
    793  */
    794  bool ParseLeadingWhiteSpace() const;
    795 
    796  /*
    797  Returns:
    798  True if a aritimetic should be parsed in expressions.
    799  Example:
    800  If parsing expression arithmetic is enabled, then the
    801  string "3/0.25" will return a value of 12.
    802  Remarks:
    803  - The default value is true.
    804  - Currently multiplication and division are supported.
    805  - When parsing pi is enabled, strings like "2pi" will
    806  return 6.2831853071795865 even when parsing expression
    807  arithmetic is disabled.
    808  - When rational number or integer-dash-fraction parsing
    809  is enabled, strings like 3/4 will return 0.75 even when
    810  parsing expression arithmetic is disabled.
    811  - Parsing functions with the word "Expression" in their name,
    812  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    813  and ON_ParseAngleExpression, support arithmetic parsing.
    814  */
    815  bool ParseArithmeticExpression() const;
    816 
    817 
    818  /*
    819  Returns:
    820  True if the math functions
    821  sin, cos, tan
    822  asin, acos, atan, atan2,
    823  sinh, cosh, tanh,
    824  ln, exp, log10, pow,
    825  should be parsed in expressions.
    826  Remarks:
    827  - The default value is true.
    828  - In functions that take 2 or more parameter values,
    829  a comma is used to separate parameter values.
    830  - Parentheses are used to delimit math function parameters;
    831  for example sin(pi/4).
    832  - The angle parameters to trigonometry functions may have angle
    833  units specified. For example, sin(30degrees). If no angle
    834  unit is specified, the nubmer is assumed to be in radians.
    835  */
    836  bool ParseMathFunctions() const;
    837 
    838  /*
    839  Returns:
    840  True if a formulae contained bracketed on the left by
    841  =( and on the right by ) should be parsed in expressions.
    842  Example:
    843  If parsing expression formulae is enabled, then the string
    844  "=((1+sqrt(5))/2)" will return a value of 1.6180339887498948.
    845  Remarks:
    846  - The default value is true.
    847  - A formula is delimited at the start by =( and
    848  terminated by a matching ).
    849  - Parsing functions with the word "Expression" in their name,
    850  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    851  and ON_ParseAngleExpression, support formula parsing.
    852  */
    853  bool ParseExplicitFormulaExpression() const;
    854 
    855  /*
    856  Returns:
    857  True if a number may begin with a unary minus.
    858  Remarks:
    859  The default value is true.
    860  */
    861  bool ParseUnaryMinus() const;
    862 
    863  /*
    864  Returns:
    865  True if a number may begin with a unary plus.
    866  Remarks:
    867  The default value is true.
    868  */
    869  bool ParseUnaryPlus() const;
    870 
    871  /*
    872  Returns:
    873  True if digits before a decimal point should be parsed
    874  in a decimal number or scientific E notation number.
    875  Remarks:
    876  The default value is true.
    877  */
    878  bool ParseSignificandIntegerPart() const;
    879 
    880  /*
    881  Returns:
    882  True if the decimal points should be parsed
    883  in a decimal number or scientific E notation number.
    884  Remarks:
    885  The default is true.
    886  */
    887  bool ParseSignificandDecimalPoint() const;
    888 
    889  /*
    890  Returns:
    891  True if digits after a decimal point should be parsed
    892  in a decimal number or scientific E notation number.
    893  Remarks:
    894  The default is true.
    895  */
    896  bool ParseSignificandFractionalPart() const;
    897 
    898  /*
    899  Returns:
    900  True if digit separators should be parsed in a
    901  decimal number or scientific E notation number.
    902  Remarks:
    903  The default value is true.
    904  */
    905  bool ParseSignificandDigitSeparators() const;
    906 
    907  /*
    908  Returns:
    909  True if a number may use scientific E notation to specify
    910  mulitiplication by a power of 10.
    911  Example:
    912  If parsing scientific E notation is enables, then the string
    913  "2.99792458e8" will be parsed as 2999792458.
    914  Remarks:
    915  - The default value is true.
    916  - The "E" may be 'e', 'E', unicode decimal exponent symbol
    917  (code point 0x23E8).
    918  See Also:
    919  ON_ParseSettings::ParseScientificDNotation.
    920  */
    921  bool ParseScientificENotation() const;
    922 
    923  /*
    924  Returns:
    925  True if a number may use scientific E notation may use
    926  'D' or 'E' to specify mulitiplication by a power of 10.
    927  Example:
    928  If parsing 'D' as 'E' in scientific E notation is enabled,
    929  then the string "2.99792458D8" will be parsed as 2999792458.
    930  Remarks:
    931  - The default value is false.
    932  - The "D" may be 'd', 'D'.
    933  - This feature is added to parse values in IGES files and
    934  text generated by FORTRAN programs.
    935  See Also:
    936  ON_ParseSettings::ParseScientificENotation.
    937  */
    938  bool ParseDAsExponentInScientificENotation() const;
    939 
    940  /*
    941  Returns:
    942  True if a full stop (period) should be parsed as a decimal point.
    943  Remarks:
    944  - The default value is true.
    945  See Also:
    946  ON_ParseSettings::ParseCommaAsDecimalPoint()
    947  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    948  ON_ParseSettings::ParseCommaAsDigitSeparator()
    949  */
    950  bool ParseFullStopAsDecimalPoint() const;
    951 
    952  /*
    953  Returns:
    954  True if a full stop (period) should be parsed as a digit separator.
    955  Remarks:
    956  - The default value is false.
    957  See Also:
    958  ON_ParseSettings::ParseFullStopAsDecimalPoint()
    959  ON_ParseSettings::ParseCommaAsDecimalPoint()
    960  ON_ParseSettings::ParseCommaAsDigitSeparator()
    961  ON_ParseSettings::ParseSpaceAsDigitSeparator()
    962  ON_ParseSettings::ParseThinSpaceAsDigitSeparator()
    963  ON_ParseSettings::ParseNoBreakSpaceAsDigitSeparator()
    964  ON_ParseSettings::ParseNoBreakThinSpaceAsDigitSeparator()
    965  */
    966  bool ParseFullStopAsDigitSeparator() const;
    967 
    968  /*
    969  Returns:
    970  True if a comma should be parsed as a decimal point.
    971  Remarks:
    972  - The default value is false.
    973  See Also:
    974  ON_ParseSettings::ParseFullStopAsDecimalPoint()
    975  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    976  ON_ParseSettings::ParseCommaAsDigitSeparator()
    977  */
    978  bool ParseCommaAsDecimalPoint() const;
    979 
    980  /*
    981  Returns:
    982  True if a comma should be parsed as a digit separator.
    983  Remarks:
    984  - The default value is false.
    985  See Also:
    986  ON_ParseSettings::ParseFullStopAsDecimalPoint()
    987  ON_ParseSettings::ParseCommaAsDecimalPoint()
    988  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    989  ON_ParseSettings::ParseSpaceAsDigitSeparator()
    990  ON_ParseSettings::ParseThinSpaceAsDigitSeparator()
    991  ON_ParseSettings::ParseNoBreakSpaceAsDigitSeparator()
    992  ON_ParseSettings::ParseNoBreakThinSpaceAsDigitSeparator()
    993  */
    994  bool ParseCommaAsDigitSeparator() const;
    995 
    996  /*
    997  Returns:
    998  True if a comma should be parsed as a digit separator.
    999  Remarks:
    1000  - The default value is false.
    1001  See Also:
    1002  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    1003  ON_ParseSettings::ParseCommaAsDigitSeparator()
    1004  ON_ParseSettings::ParseSpaceAsDigitSeparator()
    1005  ON_ParseSettings::ParseThinSpaceAsDigitSeparator()
    1006  ON_ParseSettings::ParseNoBreakSpaceAsDigitSeparator()
    1007  ON_ParseSettings::ParseNoBreakThinSpaceAsDigitSeparator()
    1008  */
    1009  bool ParseSpaceAsDigitSeparator() const;
    1010 
    1011  /*
    1012  Returns:
    1013  True if a comma should be parsed as a digit separator.
    1014  Remarks:
    1015  - The default value is false.
    1016  See Also:
    1017  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    1018  ON_ParseSettings::ParseCommaAsDigitSeparator()
    1019  ON_ParseSettings::ParseSpaceAsDigitSeparator()
    1020  ON_ParseSettings::ParseThinSpaceAsDigitSeparator()
    1021  ON_ParseSettings::ParseNoBreakSpaceAsDigitSeparator()
    1022  ON_ParseSettings::ParseNoBreakThinSpaceAsDigitSeparator()
    1023  */
    1024  bool ParseThinSpaceAsDigitSeparator() const;
    1025 
    1026  /*
    1027  Returns:
    1028  True if a comma should be parsed as a digit separator.
    1029  Remarks:
    1030  - The default value is false.
    1031  See Also:
    1032  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    1033  ON_ParseSettings::ParseCommaAsDigitSeparator()
    1034  ON_ParseSettings::ParseSpaceAsDigitSeparator()
    1035  ON_ParseSettings::ParseThinSpaceAsDigitSeparator()
    1036  ON_ParseSettings::ParseNoBreakSpaceAsDigitSeparator()
    1037  ON_ParseSettings::ParseNoBreakThinSpaceAsDigitSeparator()
    1038  */
    1039  bool ParseNoBreakSpaceAsDigitSeparator() const;
    1040 
    1041  /*
    1042  Returns:
    1043  True if a comma should be parsed as a digit separator.
    1044  Remarks:
    1045  - The default value is true.
    1046  See Also:
    1047  ON_ParseSettings::ParseFullStopAsDigitSeparator()
    1048  ON_ParseSettings::ParseCommaAsDigitSeparator()
    1049  ON_ParseSettings::ParseSpaceAsDigitSeparator()
    1050  ON_ParseSettings::ParseThinSpaceAsDigitSeparator()
    1051  ON_ParseSettings::ParseNoBreakSpaceAsDigitSeparator()
    1052  ON_ParseSettings::ParseNoBreakThinSpaceAsDigitSeparator()
    1053  */
    1054  bool ParseNoBreakThinSpaceAsDigitSeparator() const;
    1055 
    1056  /*
    1057  Returns:
    1058  True if a unicode hyphen-minus (code point 0x002D) should be parsed
    1059  as a number dash during integer-dash-fraction parsing.
    1060  Remarks:
    1061  - The default value is true. This is because the hyphen-minus
    1062  character is the easiest to type.
    1063  - For robust parsing, use the unicode figure dash (code point 0x2012)
    1064  to specify a number dash.
    1065  See Also:
    1066  ON_ParseSettings::ParseIntegerDashFraction()
    1067  ON_ParseSettings::ParseHyphenMinusAsNumberDash()
    1068  ON_ParseSettings::ParseHyphenAsNumberDash()
    1069  ON_ParseSettings::ParseNoBreakHyphenAsNumberDash()
    1070  */
    1071  bool ParseHyphenMinusAsNumberDash() const;
    1072 
    1073  /*
    1074  Returns:
    1075  True if a unicode hyphen (code point 0x2010) should be parsed
    1076  as a number dash during integer-dash-fraction parsing.
    1077  Remarks:
    1078  - The default value is false.
    1079  - For robust parsing, use the unicode figure dash (code point 0x2012)
    1080  to specify a number dash.
    1081  See Also:
    1082  ON_ParseSettings::ParseIntegerDashFraction()
    1083  ON_ParseSettings::ParseHyphenMinusAsNumberDash()
    1084  ON_ParseSettings::ParseHyphenAsNumberDash()
    1085  ON_ParseSettings::ParseNoBreakHyphenAsNumberDash()
    1086  */
    1087  bool ParseHyphenAsNumberDash() const;
    1088 
    1089  /*
    1090  Returns:
    1091  True if a unicode non-breaking hyphen (code point 0x2011)
    1092  should be parsed as a number dash during integer-dash-fraction
    1093  parsing.
    1094  Remarks:
    1095  - The default value is false.
    1096  - For robust parsing, use the unicode figure dash (code point 0x2012)
    1097  to specify a number dash.
    1098  See Also:
    1099  ON_ParseSettings::ParseIntegerDashFraction()
    1100  ON_ParseSettings::ParseHyphenMinusAsNumberDash()
    1101  ON_ParseSettings::ParseHyphenAsNumberDash()
    1102  ON_ParseSettings::ParseNoBreakHyphenAsNumberDash()
    1103  */
    1104  bool ParseNoBreakHyphenAsNumberDash() const;
    1105 
    1106  /*
    1107  Returns:
    1108  True if rational numbers should be parsed.
    1109  Example:
    1110  If this property is true, then strings "3/4" and "8/5"
    1111  will be parsed. The numerator and denominator must
    1112  parse as integers. If you: decimal points and scientific notation
    1113  cannot appear
    1114  Remarks:
    1115  - The default value is true.
    1116  - The numerator and denominator must be integers.
    1117  - Strings like "1.0/3.0", "3.5/2" or "pi/2" are not parsed
    1118  as rational numbers. Use ON_ParseSettings::ParseDivision
    1119  to constrol parsing of these types of strings.
    1120  */
    1121  bool ParseRationalNumber() const;
    1122 
    1123  /*
    1124  Returns:
    1125  True if the value of pi may be specified as "pi", "PI",
    1126  "Pi", "pI", unicode Greek capital letter pi (code point 0x03A0),
    1127  or unicode Greek small letter pi (code point 0x03C0).
    1128  Example:
    1129  If this property is true, then strings "pi", "PI", "Pi", "pI",
    1130  L"\x03A0" (unicode greek capital letter pi) and
    1131  L"\x03C0" (unicode greek small letter pi)
    1132  will be parsed as if they were "3.141592653589793238462643".
    1133  In addition, if the pi strings appear next to something that
    1134  is parsed as a number, the result will be mulitplied by pi.
    1135  For example,
    1136  "3pi" and pi3.0 will return 3.0*ON_PI.
    1137  If division parsing is enabled, then "3pi/4" and 3/4pi" will
    1138  return 0.75*ON_PI.
    1139  Remarks:
    1140  The default value is true.
    1141  */
    1142  bool ParsePi() const;
    1143 
    1144  /*
    1145  Returns:
    1146  True if muliplication signs that appear between numbers will be
    1147  parsed.
    1148  Example:
    1149  If this property is true, then strings like 2*3 will be parsed
    1150  as 6.0
    1151  Remarks:
    1152  - The default value is true.
    1153  - Parsing functions with the word "Expression" in their name,
    1154  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    1155  and ON_ParseAngleExpression, support mulitplication parsing.
    1156  */
    1157  bool ParseMultiplication() const;
    1158 
    1159  /*
    1160  Returns:
    1161  True if division signs that appear between numbers will be
    1162  parsed.
    1163  Example:
    1164  If this property is true, then strings like 1/4 will be parsed
    1165  as 0.25.
    1166  Remarks:
    1167  - The default value is true.
    1168  - Parsing functions with the word "Expression" in their name,
    1169  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    1170  and ON_ParseAngleExpression, support division parsing.
    1171  */
    1172  bool ParseDivision() const;
    1173 
    1174  /*
    1175  Returns:
    1176  True if addition signs that appear between numbers will be
    1177  parsed.
    1178  Example:
    1179  If this property is true, then strings like 1+2 will be parsed
    1180  as 3.
    1181  Remarks:
    1182  - The default value is true.
    1183  - Parsing functions with the word "Expression" in their name,
    1184  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    1185  and ON_ParseAngleExpression, support division parsing.
    1186  */
    1187  bool ParseAddition() const;
    1188 
    1189  /*
    1190  Returns:
    1191  True if subtraction signs that appear between numbers will be
    1192  parsed.
    1193  Example:
    1194  If this property is true, then strings like 2-1 will be parsed
    1195  as 1.
    1196  Remarks:
    1197  - The default value is true.
    1198  - Parsing functions with the word "Expression" in their name,
    1199  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    1200  and ON_ParseAngleExpression, support division parsing.
    1201  */
    1202  bool ParseSubtraction() const;
    1203 
    1204 
    1205  /*
    1206  Returns:
    1207  True if paired arentheses symbols that are encountered during
    1208  number parsing will be parsed.
    1209  Example:
    1210  If this property is true, then strings like 2(3+4) will be parsed
    1211  as 14.
    1212  Remarks:
    1213  - The default value is true.
    1214  - Parsing functions with the word "Expression" in their name,
    1215  like ON_ParseNumberExpression, ON_ParseLengthExpression,
    1216  and ON_ParseAngleExpression, support division parsing.
    1217  */
    1218  bool ParsePairedParentheses() const;
    1219 
    1220  /*
    1221  Returns:
    1222  True if a number may be specified as an integer followed by
    1223  a dash and a fraction.
    1224  Example:
    1225  If this property is true, then the string "4-3/8" will return
    1226  a value of 4.375.
    1227  Remarks:
    1228  - The default value is true.
    1229  - The numerator must be an integer > 0.
    1230  - The denominator must be greater than the numerator.
    1231  - ON_ParseSettings::IsNumberDash() controls what characters
    1232  are interpreted as number dashes.
    1233  See Also:
    1234  ON_ParseSettings::ParseRationalNumber()
    1235  */
    1236  bool ParseIntegerDashFraction() const;
    1237 
    1238  /*
    1239  Returns:
    1240  True if a length value may be specified as combination
    1241  of US customary feet and inch lengths.
    1242  Example:
    1243  If this property is true, then strings like these
    1244  1'-4-3/8"
    1245  1ft-3-3/8in
    1246  1'4.375"
    1247  1.0feet4.375inches
    1248  will be parsed as 16.375 inches.
    1249  Remarks:
    1250  The default value is true.
    1251  */
    1252  bool ParseFeetInches() const;
    1253 
    1254  /*
    1255  Returns:
    1256  True if an angle value may be specified as a combination of
    1257  arc degrees, arc minutes and arc seconds.
    1258  Example:
    1259  If this property is true, then strings like these
    1260  2degrees30minutes
    1261  2deg30'
    1262  will be parsed as 2.0*60.0 + 30.0 arc minutes
    1263  2degrees14minutes15seconds
    1264  2deg14'15"
    1265  will be parsed as (2*60.0 + 14.0)*60.0 + 15.0 arc seconds.
    1266  Remarks:
    1267  The default value is true.
    1268  */
    1269  bool ParseArcDegreesMinutesSeconds() const;
    1270 
    1271 
    1272  /*
    1273  Returns:
    1274  True if whitespace between a value and unit system will
    1275  is permitted.
    1276  Example:
    1277  If this property is true, then strings like these
    1278  2 meters
    1279  2meters
    1280  2 m
    1281  2m
    1282  will be parsed as 2 meters
    1283  Remarks:
    1284  The default value is true.
    1285  */
    1286  bool ParseWhiteSpaceBetweenValueAndUnitSystem() const;
    1287 
    1288  /*
    1289  Returns:
    1290  True if whitespace between a length in feet and a length in inches
    1291  will is permitted.
    1292  Example:
    1293  If this property is true, then strings like these
    1294  1'3"
    1295  1' 3"
    1296  1ft3in
    1297  1ft 3in
    1298  will be parsed as 15 inches
    1299  Remarks:
    1300  The default value is true.
    1301  */
    1302  bool ParseWhiteSpaceBetweenFeetAndInches() const;
    1303 
    1304 
    1305  /*
    1306  Returns:
    1307  True if an angle values may be specified using surveyor's notation.
    1308  Example:
    1309  If this property is true, then strings like these
    1310  N30W
    1311  S12<degree symbol>15'22"W
    1312  N45.7899E
    1313  S47'E
    1314  will be parsed as angles.
    1315  Remarks:
    1316  The first character must be N, n, S or s.
    1317  The angle must be a spcified as a combination of arc degrees,
    1318  arc minutes and arc seconds.
    1319  The last character must be E, e, W or w.
    1320  */
    1321  bool ParseSurveyorsNotation() const;
    1322 
    1323  /*
    1324  Returns:
    1325  The Microsoft locale id that identifies the locale that should
    1326  be used to resolve ambiguous parsing situtations. The default
    1327  value is zero, which means ambiguous situations are not parsed.
    1328  Example:
    1329  When parsing angles, the string "Grad" is ambiguous.
    1330  In German "Grad" identifies arc degree angle units and in
    1331  English "Grad" identifies gradian angle units. If angle parsing
    1332  encounters "Grad", it uses the value of ContextLocaleId()
    1333  to determine what arc unit system is being identified.
    1334  */
    1335  unsigned int ContextLocaleId() const;
    1336 
    1337  /*
    1338  Returns:
    1339  The default angle unit system that is used when a value must be
    1340  parsed as an angle and no angle unit system is explicitly or
    1341  implicitly specified.
    1342  */
    1343  ON::LengthUnitSystem ContextLengthUnitSystem() const;
    1344 
    1345  /*
    1346  Returns:
    1347  The default angle unit system that is used when a value must be
    1348  parsed as an angle and no angle unit system is explicitly or
    1349  implicitly specified.
    1350  */
    1351  ON::AngleUnitSystem ContextAngleUnitSystem() const;
    1352 
    1353  /*
    1354  Description:
    1355  Deprecated. Use ContextLocaleId().
    1356  */
    1357  // ON_DEPRECTATED
    1358  unsigned int PreferedLocaleId() const;
    1359 
    1360  /*
    1361  Description:
    1362  Deprecated. Use ContextAngleUnitSystem().
    1363  */
    1364  // ON_DEPRECTATED
    1365  ON::AngleUnitSystem DefaultAngleUnitSystem() const;
    1366 
    1367  /*
    1368  Parameters:
    1369  c - [in]
    1370  Returns:
    1371  True if c should be parsed as leading white space
    1372  */
    1373  bool IsLeadingWhiteSpace(ON__UINT32 c) const;
    1374 
    1375  /*
    1376  Parameters:
    1377  c - [in]
    1378  Returns:
    1379  True if c should be parsed as trailing white space
    1380  */
    1381  bool IsTrailingWhiteSpace(ON__UINT32 c) const;
    1382 
    1383  /*
    1384  Parameters:
    1385  c - [in]
    1386  Returns:
    1387  True if c should be parsed as interior white space.
    1388  */
    1389  bool IsInteriorWhiteSpace(ON__UINT32 c) const;
    1390 
    1391  /*
    1392  Parameters:
    1393  c - [in]
    1394  Returns:
    1395  True if c should be parsed as unary minus
    1396  */
    1397  bool IsUnaryMinus(ON__UINT32 c) const;
    1398 
    1399  /*
    1400  Parameters:
    1401  c - [in]
    1402  Returns:
    1403  True if c should be parsed as unary plus
    1404  */
    1405  bool IsUnaryPlus(ON__UINT32 c) const;
    1406 
    1407  /*
    1408  Parameters:
    1409  c - [in]
    1410  Returns:
    1411  Returns '0' throught '9' if c is a digit, otherwise returns 0.
    1412  */
    1413  char IsDigit(ON__UINT32 c) const;
    1414 
    1415  /*
    1416  Parameters:
    1417  c - [in]
    1418  Returns:
    1419  True if c should be parsed as a digit separator
    1420  */
    1421  bool IsDigitSeparator(ON__UINT32 c) const;
    1422 
    1423  /*
    1424  Parameters:
    1425  c - [in]
    1426  Returns:
    1427  True if c should be parsed as a decimal point
    1428  */
    1429  bool IsDecimalPoint(ON__UINT32 c) const;
    1430 
    1431  /*
    1432  Parameters:
    1433  c - [in]
    1434  Returns:
    1435  True if c should be parsed as decimal exponent symbol
    1436  */
    1437  bool IsDecimalExponentSymbol(ON__UINT32 c) const; // e E (optionally d and/or D)
    1438 
    1439  /*
    1440  Parameters:
    1441  c - [in]
    1442  Returns:
    1443  True if c is 0x03A or 0x03C
    1444  */
    1445  bool IsGreekPi(ON__UINT32 c) const;
    1446 
    1447  /*
    1448  Parameters:
    1449  c - [in]
    1450  Returns:
    1451  True if c should be parsed as a multiplication operator
    1452  */
    1453  bool IsMultiplicationSymbol(ON__UINT32 c) const;
    1454 
    1455  /*
    1456  Parameters:
    1457  c - [in]
    1458  Returns:
    1459  True if c should be parsed as a division operator
    1460  */
    1461  bool IsDivisionSymbol(ON__UINT32 c) const;
    1462 
    1463  /*
    1464  Parameters:
    1465  c - [in]
    1466  Returns:
    1467  True if c should be parsed as an addition operator
    1468  */
    1469  bool IsAdditionSymbol(ON__UINT32 c) const;
    1470 
    1471  /*
    1472  Parameters:
    1473  c - [in]
    1474  Returns:
    1475  True if c should be parsed as a subtraction operator
    1476  */
    1477  bool IsSubtractionSymbol(ON__UINT32 c) const;
    1478 
    1479  /*
    1480  Parameters:
    1481  c - [in]
    1482  Returns:
    1483  True if c should be parsed as a left parenthesis symbol
    1484  */
    1485  bool IsLeftParenthesisSymbol(ON__UINT32 c) const;
    1486 
    1487  /*
    1488  Parameters:
    1489  c - [in]
    1490  Returns:
    1491  True if c should be parsed as a right parenthesis symbol
    1492  */
    1493  bool IsRightParenthesisSymbol(ON__UINT32 c) const;
    1494 
    1495  /*
    1496  Parameters:
    1497  c - [in]
    1498  Returns:
    1499  True if c should be parsed as a rational number fraction bar
    1500  */
    1501  bool IsRationalNumberFractionBar(ON__UINT32 c) const;
    1502 
    1503  /*
    1504  Parameters:
    1505  c - [in]
    1506  Returns:
    1507  True if c should be parsed as number dash when parsing
    1508  strings like "1-3/4".
    1509  */
    1510  bool IsNumberDash(ON__UINT32 c) const;
    1511 
    1512  /*
    1513  Parameters:
    1514  bParseLeadingWhiteSpace - [in]
    1515  True if leading white space should be parsed.
    1516  Remarks:
    1517  See ON_ParseSettings::ParseLeadingWhiteSpace()
    1518  for details about this property.
    1519  */
    1520  void SetParseLeadingWhiteSpace(
    1521  bool bParseLeadingWhiteSpace
    1522  );
    1523 
    1524  /*
    1525  Parameters:
    1526  bParseArithmeticExpression - [in]
    1527  True if formulae should be parsed.
    1528  Remarks:
    1529  See ON_ParseSettings::ParseArithmeticExpression()
    1530  for details about this property.
    1531  */
    1532  void SetParseArithmeticExpression(
    1533  bool bParseArithmeticExpression
    1534  );
    1535 
    1536  /*
    1537  Parameters:
    1538  bParseMathFunctions - [in]
    1539  True if math functions should be parsed in expressions.
    1540  Remarks:
    1541  See ON_ParseSettings::ParseMathFunctions()
    1542  for details about this property.
    1543  */
    1544  void SetParseMathFunctions(
    1545  bool bParseMathFunctions
    1546  );
    1547 
    1548  /*
    1549  Parameters:
    1550  bParseExplicitFormulaExpression - [in]
    1551  True if explicity formulae should be parsed.
    1552  Remarks:
    1553  See ON_ParseSettings::ParseExplicitFormulaExpression()
    1554  for details about this property.
    1555  */
    1556  void SetParseExplicitFormulaExpression(
    1557  bool bParseExplicitFormulaExpression
    1558  );
    1559 
    1560  /*
    1561  Parameters:
    1562  bParseUnaryMinus - [in]
    1563  True if unary minus should be parsed.
    1564  Remarks:
    1565  See ON_ParseSettings::ParseUnaryMinus()
    1566  for details about this property.
    1567  */
    1568  void SetParseUnaryMinus(
    1569  bool bParseUnaryMinus
    1570  );
    1571 
    1572  /*
    1573  Parameters:
    1574  bParseUnaryPlus - [in]
    1575  True if unary plus should be parsed.
    1576  Remarks:
    1577  See ON_ParseSettings::ParseUnaryPlus()
    1578  for details about this property.
    1579  */
    1580  void SetParseUnaryPlus(
    1581  bool bParseUnaryPlus
    1582  );
    1583 
    1584  /*
    1585  Parameters:
    1586  bParseSignificandIntegerPart - [in]
    1587  True if digits before a decimal point in a decimal
    1588  number or the significand of a scientific E notation
    1589  number should be parsed.
    1590  Remarks:
    1591  See ON_ParseSettings::ParseSignificandIntegerPart()
    1592  for details about this property.
    1593  */
    1594  void SetParseSignificandIntegerPart(
    1595  bool bParseSignificandIntegerPart
    1596  );
    1597 
    1598  /*
    1599  Parameters:
    1600  bParseSignificandDecimalPoint - [in]
    1601  True if a decimal point in a decimal point in a decimal
    1602  number or the significand of a scientific E notation
    1603  number should be parsed.
    1604  Remarks:
    1605  See ON_ParseSettings::ParseSignificandDecimalPoint()
    1606  for details about this property.
    1607  */
    1608  void SetParseSignificandDecimalPoint(
    1609  bool bParseSignificandDecimalPoint
    1610  );
    1611 
    1612  /*
    1613  Parameters:
    1614  bParseSignificandFractionalPart - [in]
    1615  True if digits after the decimal point in a decimal
    1616  number or the significand of a scientific E notation
    1617  number should be parsed.
    1618  Remarks:
    1619  See ON_ParseSettings::ParseSignificandFractionalPart()
    1620  for details about this property.
    1621  */
    1622  void SetParseSignificandFractionalPart(
    1623  bool bParseSignificandFractionalPart
    1624  );
    1625 
    1626  /*
    1627  Parameters:
    1628  bParseSignificandDigitSeparators - [in]
    1629  True if digit separators in a decimal number or a significand
    1630  of a scientific E notation number should be parsed.
    1631  Remarks:
    1632  See ON_ParseSettings::ParseSignificandDigitSeparators()
    1633  for details about this property.
    1634  */
    1635  void SetParseSignificandDigitSeparators(
    1636  bool bParseSignificandDigitSeparators
    1637  );
    1638 
    1639  /*
    1640  Parameters:
    1641  bDecimalPoint - [in]
    1642  True if a decimal point should be parsed.
    1643  Remarks:
    1644  See ON_ParseSettings::ParseDecimalPoint()
    1645  for details about this property.
    1646  */
    1647  void SetParseDecimalPoint(
    1648  bool bParseDecimalPoint
    1649  );
    1650 
    1651  /*
    1652  Parameters:
    1653  bParseDAsExponentInScientificENotation - [in]
    1654  True if both 'D' and 'E' can mark the beginning
    1655  of the exponent in scientific E notation.
    1656  Remarks:
    1657  See ON_ParseSettings::ParseDAsExponentInScientificENotation()
    1658  for details about this property.
    1659  */
    1660  void SetParseDAsExponentInScientificENotation(
    1661  bool bParseDAsExponentInScientificENotation
    1662  );
    1663 
    1664  /*
    1665  Parameters:
    1666  bParseScientificENotation - [in]
    1667  True if scientific E notation should be parsed.
    1668  Remarks:
    1669  See ON_ParseSettings::ParseScientificENotation()
    1670  for details about this property.
    1671  */
    1672  void SetParseScientificENotation(
    1673  bool bParseScientificENotation
    1674  );
    1675 
    1676  void SetParseFullStopAsDecimalPoint( bool bParse );
    1677  void SetParseFullStopAsDigitSeparator( bool bParse );
    1678  void SetParseCommaAsDecimalPoint( bool bParse );
    1679  void SetParseCommaAsDigitSeparator( bool bParse );
    1680  void SetParseSpaceAsDigitSeparator( bool bParse );
    1681  void SetParseThinSpaceAsDigitSeparator( bool bParse );
    1682  void SetParseNoBreakSpaceAsDigitSeparator( bool bParse );
    1683  void SetParseNoBreakThinSpaceAsDigitSeparator( bool bParse );
    1684  void SetParseHyphenMinusAsNumberDash( bool bParse );
    1685  void SetParseHyphenAsNumberDash( bool bParse );
    1686  void SetParseNoBreakHyphenAsNumberDash( bool bParse );
    1687 
    1688  /*
    1689  Parameters:
    1690  bParseRationalNumber - [in]
    1691  True if rational numbers like 3/4 and 8/5
    1692  should be parsed.
    1693  Remarks:
    1694  See ON_ParseSettings::ParseRationalNumber()
    1695  for details about this property.
    1696  */
    1697  void SetParseRationalNumber(
    1698  bool bParseRationalNumber
    1699  );
    1700 
    1701  /*
    1702  Parameters:
    1703  bParsePi - [in]
    1704  True if number parsing should treat "PI", "Pi" "pi",
    1705  and unicode code points 0x03A0 and 0x03C0 as
    1706  3.141592653589793238462643.
    1707  Remarks:
    1708  See ON_ParseSettings::ParsePi()
    1709  for details about this property.
    1710  */
    1711  void SetParsePi(
    1712  bool bParsePi
    1713  );
    1714 
    1715  /*
    1716  Parameters:
    1717  bParseMultiplication - [in]
    1718  True if muiltiplication should be permitted in number parsing.
    1719  Remarks:
    1720  See ON_ParseSettings::ParseMultiplication()
    1721  for details about this property.
    1722  */
    1723  void SetParseMultiplication(
    1724  bool bParseMultiplication
    1725  );
    1726 
    1727  /*
    1728  Parameters:
    1729  bParseDivision - [in]
    1730  True if division should be permitted in number parsing.
    1731  Remarks:
    1732  See ON_ParseSettings::ParseDivision()
    1733  for details about this property.
    1734  */
    1735  void SetParseDivision(
    1736  bool bParseDivision
    1737  );
    1738 
    1739  /*
    1740  Parameters:
    1741  bParseDivision - [in]
    1742  True if addition should be permitted in number parsing.
    1743  Remarks:
    1744  See ON_ParseSettings::ParseAddition()
    1745  for details about this property.
    1746  */
    1747  void SetParseAddition(
    1748  bool bParseAddition
    1749  );
    1750 
    1751  /*
    1752  Parameters:
    1753  bParseDivision - [in]
    1754  True if subtraction should be permitted in number parsing.
    1755  Remarks:
    1756  See ON_ParseSettings::ParseSubtraction()
    1757  for details about this property.
    1758  */
    1759  void SetParseSubtraction(
    1760  bool bParseSubtraction
    1761  );
    1762 
    1763  /*
    1764  Parameters:
    1765  bParseDivision - [in]
    1766  True if paired parentheses should be permitted in number parsing.
    1767  Remarks:
    1768  See ON_ParseSettings::PairedParentheses()
    1769  for details about this property.
    1770  */
    1771  void SetParsePairedParentheses(
    1772  bool bParsePairedParentheses
    1773  );
    1774 
    1775  /*
    1776  Parameters:
    1777  bParseIntegerDashFraction - [in]
    1778  True if strings like "5-3/8" should be parsed as
    1779  a single number
    1780  Remarks:
    1781  See ON_ParseSettings::ParseIntegerDashFraction()
    1782  for details about this property.
    1783  */
    1784  void SetParseIntegerDashFraction(
    1785  bool bParseIntegerDashFraction
    1786  );
    1787 
    1788  /*
    1789  Parameters:
    1790  bParseFeetInches - [in]
    1791  True if length value parsing should parse strings
    1792  like 1'4-3/8" and return a length value of 16.375 inches.
    1793  Remarks:
    1794  See ON_ParseSettings::ParseFeetInches()
    1795  for details about this property.
    1796  */
    1797  void SetParseFeetInches(
    1798  bool bParseFeetInches
    1799  );
    1800 
    1801  /*
    1802  Parameters:
    1803  bParseArcDegreesMinutesSeconds - [in]
    1804  True if angle value parsing should parse strings
    1805  like 2deg17'15" and return a length value of
    1806  ((2.0*60.0 + 17..0)*60.0 + 15.0) arc seconds
    1807  Remarks:
    1808  See ON_ParseSettings::ParseArcDegreesMinutesSeconds()
    1809  for details about this property.
    1810  */
    1811  void SetParseArcDegreesMinutesSeconds(
    1812  bool bParseArcDegreesMinutesSeconds
    1813  );
    1814 
    1815  /*
    1816  Parameters:
    1817  bParseWhiteSpaceBetweenValueAndUnitSystem - [in]
    1818  True if then strings like these
    1819  2 meters
    1820  2meters
    1821  2 m
    1822  2m
    1823  should be parsed as 2 meters.
    1824  Remarks:
    1825  See ON_ParseSettings::ParseWhiteSpaceBetweenValueAndUnitSystem()
    1826  for details about this property.
    1827  */
    1828  void SetParseWhiteSpaceBetweenValueAndUnitSystem(
    1829  bool bParseWhiteSpaceBetweenValueAndUnitSystem
    1830  );
    1831 
    1832  /*
    1833  Parameters:
    1834  bParseWhiteSpaceBetweenFeetAndInches - [in]
    1835  True if strings like these
    1836  1' 3"
    1837  1ft 3in
    1838  will be parsed as 15 inches
    1839  Remarks:
    1840  See ON_ParseSettings::ParseWhiteSpaceBetweenFeetAndInches()
    1841  for details about this property.
    1842  */
    1843  void SetParseWhiteSpaceBetweenFeetAndInches(
    1844  bool bParseWhiteSpaceBetweenFeetAndInches
    1845  );
    1846 
    1847  /*
    1848  Parameters:
    1849  bParseSurveyorsNotation - [in]
    1850  True if angle value parsing should parse
    1851  surveyor's notation like N30W.
    1852  Remarks:
    1853  See ON_ParseSettings::ParseSurveyorsNotation()
    1854  for details about this property.
    1855  */
    1856  void SetParseSurveyorsNotation(
    1857  bool bParseSurveyorsNotation
    1858  );
    1859 
    1860  /*
    1861  Description:
    1862  Set the prefered locale id for parsing unit names. This local
    1863  id is used to resolve ambiguous unit names.
    1864 
    1865  Parameters:
    1866  prefered_locale_id - [in]
    1867  The Microsoft locale id that identifies the locale that should
    1868  be used to resolve ambiguous parsing situtations. The default
    1869  value is zero, which means ambiguous situations are not parsed.
    1870 
    1871  Example:
    1872  When parsing angles, the string "Grad" is ambiguous.
    1873  In German "Grad" identifies arc degree angle units and in
    1874  English "Grad" identifies gradian angle units. If angle parsing
    1875  encounters "Grad" and the prefered locale id is 1031 (de-de),
    1876  then parsing reports the angle value as arc degree units.
    1877  If angle parsing encounters "Grad" and the prefered locale id
    1878  is 1033 (en-us), then parsing reports the angle values as
    1879  gradian units.
    1880  */
    1881  void SetContextLocaleId(
    1882  unsigned int context_locale_id
    1883  );
    1884 
    1885  /*
    1886  Description:
    1887  The context angle unit system determines what length unit system
    1888  is used when a value must be parsed as a length with units and no
    1889  length unit system is explicitly or implicitly specified. The default
    1890  is ON::LengthUnitSystem::None.
    1891 
    1892  Parameters:
    1893  context_length_unit_system - [in]
    1894  ON::LengthUnitSystem::Custom and ON::LengthUnitSystem::Unset
    1895  select ON::LengthUnitSystem::None.
    1896  */
    1897  void SetContextLengthUnitSystem(
    1898  ON::LengthUnitSystem context_length_unit_system
    1899  );
    1900 
    1901  /*
    1902  Description:
    1903  The context angle unit system determines what angle unit system
    1904  is used when a value must be parsed as an angle and no angle
    1905  unit system is explicitly or implicitly specified. The default
    1906  is ON::LengthUnitSystem::Radians.
    1907 
    1908  Parameters:
    1909  default_angle_unit_system - [in]
    1910  ON::AngleUnitSystem::None and ON::AngleUnitSystem::Unset
    1911  select ON::LengthUnitSystem::Radians.
    1912  */
    1913  void SetContextAngleUnitSystem(
    1914  ON::AngleUnitSystem context_angle_unit_system
    1915  );
    1916 
    1917  /*
    1918  Description:
    1919  Deprecated. Use SetConextLocaleId().
    1920  */
    1921  // ON_DEPRECTATED
    1922  void SetPreferedLocaleId(
    1923  unsigned int context_locale_id
    1924  );
    1925  /*
    1926  Description:
    1927  Deprecated. Use SetContextAngleUnitSystem().
    1928  */
    1929  // ON_DEPRECTATED
    1930  void SetDefaultAngleUnitSystem(
    1931  ON::AngleUnitSystem context_angle_unit_system
    1932  );
    1933 
    1934  /*
    1935  Description:
    1936  Set every possible setting to false or zero.
    1937  */
    1938  void SetAllToFalse();
    1939 
    1940 
    1941  /*
    1942  Description:
    1943  Set every possible expression parsing setting to false.
    1944  Remarks:
    1945  This is a simple way to disable all possible parsing of
    1946  expressions. This function calls
    1947  this->SetParseExplicitFormulaExpression(false);
    1948  this->SetParseArithmeticExpression(false);
    1949  this->SetParseMultiplication(false);
    1950  this->SetParseDivision(false);
    1951  this->SetParseAddition(false);
    1952  this->SetParseSubtraction(false);
    1953  this->SetParseMathFunctions(false);
    1954  this->SetParseMathFunctions(false);
    1955  this->SetParsePairedParentheses(false);
    1956  */
    1957  void SetAllExpressionSettingsToFalse();
    1958 
    1959 
    1960  /*
    1961  Returns:
    1962  True if any of the following are true.
    1963  ParseInvalidExpressionError()
    1964  ParseDivideByZeroError()
    1965  ParseOverflowError()
    1966  */
    1967  bool ParseError() const;
    1968 
    1969  /*
    1970  Returns:
    1971  True if parsing and expression resulted in a divide by zero.
    1972  */
    1973  bool ParseDivideByZeroError() const;
    1974 
    1975  /*
    1976  Returns:
    1977  True if parsing and expression created a number that a double
    1978  cannot represent.
    1979  */
    1980  bool ParseOverflowError() const;
    1981 
    1982  /*
    1983  Returns:
    1984  True if parsing and expression failed because the expression
    1985  did not make sense.
    1986  */
    1987  bool ParseInvalidExpressionError() const;
    1988 
    1989  void SetParseDivideByZeroError(
    1990  bool bParseDivideByZeroError
    1991  );
    1992 
    1993  void SetParseOverflowError(
    1994  bool bParseOverflowError
    1995  );
    1996 
    1997  void SetParseInvalidExpressionError(
    1998  bool bParseInvalidExpressionError
    1999  );
    2000 
    2001 private:
    2002  // default constructor sets all elements to zero.
    2003  ON__UINT32 m_true_default_bits[2]; // a "0" bit is true - used for defaults that are true
    2004  ON__UINT32 m_false_default_bits[2]; // a "0" bit is false - used for defaults that are false
    2005 
    2006  ON__UINT32 m_reserved_bits = 0;
    2007 
    2008  // The value of m_context_locale_id is used to resolve
    2009  // ambiguities that occur when parsing unit system names.
    2010  // In German "Grad" identifies arc degree angle units and in
    2011  // English "Grad" identifies gradian angle units. If angle parsing
    2012  // encounters "Grad", it uses the value of m_context_locale_id
    2013  // to determine what arc unit system is being identified.
    2014  ON__UINT16 m_context_locale_id = 0;
    2015 
    2016  // The value of m_context_angle_unit_system determines the
    2017  // angle unit system that is used when a value must be parsed
    2018  // as an angle and no angle unit system is explicitly or
    2019  // implicitly specified.
    2020  // If m_default_angle_unit_system is 0, then radians are used.
    2021  // If m_default_angle_unit_system is not 0 and is equal to an
    2022  // ON::AngleUnitSystem value, that angle unit system is used.
    2023  // In all other cases, radians are used.
    2024  ON__UINT8 m_context_angle_unit_system = 0;
    2025 
    2026  // The value of m_context_length_unit_system determines the
    2027  // length unit system that is used when a value must be parsed
    2028  // as a length and no length unit system is explicitly or
    2029  // implicitly specified.
    2030  // If m_context_length_unit_system is 0, then it is ignored.
    2031  // If m_context_length_unit_system is not 0 and is equal to an
    2032  // ON::LengthUnitSystem value, that length unit system is used.
    2033  // Presently this value is not relavent to internal parsing code,
    2034  // but may be passed along in parse settings to code that
    2035  // use parsing.
    2036  ON__UINT8 m_context_length_unit_system = 0;
    2037 
    2038  ON__UINT64 m_reserved = 0;
    2039 
    2040 private:
    2041  void Internal_DefaultCtor();
    2042 };
    2043 
    2044 /*
    2045 Descriptions:
    2046  result true if a and b are identical.
    2047 */
    2048 ON_DECL
    2049 bool operator==(
    2050  const class ON_ParseSettings& a,
    2051  const class ON_ParseSettings& b
    2052  );
    2053 
    2054 /*
    2055 Descriptions:
    2056  result true if a and b are not identical.
    2057 */
    2058 ON_DECL
    2059 bool operator!=(
    2060  const class ON_ParseSettings& a,
    2061  const class ON_ParseSettings& b
    2062  );
    2063 
    2064 /*
    2065 Descriptions:
    2066  result setting value = a setting value OR b setting value
    2067 Returns:
    2068  Logical OR of the parse settings in a and b.
    2069 */
    2070 ON_DECL
    2071 ON_ParseSettings operator&&(
    2072  const class ON_ParseSettings& a,
    2073  const class ON_ParseSettings& b
    2074  );
    2075 
    2076 /*
    2077 Descriptions:
    2078  result setting value = a setting value AND b setting value
    2079 Returns:
    2080  Logical AND of the parse settings in a and b.
    2081 */
    2082 ON_DECL
    2083 ON_ParseSettings operator||(
    2084  const class ON_ParseSettings& a,
    2085  const class ON_ParseSettings& b
    2086  );
    2087 
    2088 /*
    2089 Description:
    2090  Parses str to determine if it specifies a number.
    2091 
    2092 Parameters:
    2093  str - [in]
    2094 
    2095  str_count - [in]
    2096  str[] and str_count specify the string to parse.
    2097  If str_count >= 0. it specifies the maximum number of elements in str[]
    2098  that may be parsed. If str_count = -1, then the string must contain a
    2099  character that terminates number parsing. This character can
    2100  be a null, arithmetic operator, or a unicode
    2101  code point <= 0x0020 (0x0020 = space = 32 decimal).
    2102 
    2103  parse_settings - [in]
    2104  The value of parse_settings controls what input may be parsed.
    2105  Use one of the predefined
    2106  ON_ParseSettings::DefaultSettings
    2107  ON_ParseSettings::IntegerNumberSettings
    2108  ON_ParseSettings::RationalNumberSettings
    2109  ON_ParseSettings::RealNumberSettings
    2110  for common parsing tasks.
    2111 
    2112  parse_results - [out]
    2113  The value of parse_results reports what was parsed.
    2114 
    2115  value - [out]
    2116  The value of the parsed number.
    2117 
    2118 Returns:
    2119  Number of elments of str[] that were parsed.
    2120  A return value of 0 indicates that str[] could not be
    2121  parsed as a number.
    2122 
    2123 See Also:
    2124  ON_ParseNumberExpression
    2125  ON_ParseLengthExpression
    2126  ON_ParseAngleExpression
    2127 */
    2128 ON_DECL
    2129 int ON_ParseNumber(
    2130  const wchar_t* str,
    2131  int str_count,
    2132  ON_ParseSettings parse_settings,
    2133  ON_ParseSettings* parse_results,
    2134  double* value
    2135  );
    2136 
    2137 /*
    2138 Description:
    2139  Parses str to determine if it specifies a number.
    2140  Expression parsing includes support for parsing in-line multiplication,
    2141  in-line division, automatic multiplication by pi, and formula parsing.
    2142 
    2143 Parameters:
    2144  str - [in]
    2145 
    2146  str_count - [in]
    2147  str[] and str_count specify the string to parse.
    2148  If str_count >= 0. it specifies the maximum number of elements in str[]
    2149  that may be parsed. If str_count = -1, then the string must contain a
    2150  character that terminates number parsing. This character can
    2151  be a null, arithmetic operator, or a unicode
    2152  code point <= 0x0020 (0x0020 = space = 32 decimal).
    2153 
    2154  parse_settings - [in]
    2155  The value of parse_settings controls what input may be parsed.
    2156  Use one of the predefined
    2157  ON_ParseSettings::DefaultSettings
    2158  ON_ParseSettings::IntegerNumberSettings
    2159  ON_ParseSettings::RationalNumberSettings
    2160  ON_ParseSettings::RealNumberSettings
    2161  for common parsing tasks.
    2162 
    2163  parse_results - [out]
    2164  The value of parse_results reports what was parsed.
    2165 
    2166  value - [out]
    2167  The value of the parsed number.
    2168 
    2169 Returns:
    2170  Number of elments of str[] that were parsed.
    2171  A return value of 0 indicates that str[] could not be
    2172  parsed as a number.
    2173 
    2174 See Also:
    2175  ON_ParseNumber
    2176  ON_ParseLengthExpression
    2177  ON_ParseAngleExpression
    2178 */
    2179 ON_DECL
    2180 int ON_ParseNumberExpression(
    2181  const wchar_t* str,
    2182  int str_count,
    2183  ON_ParseSettings parse_settings,
    2184  ON_ParseSettings* parse_results,
    2185  double* value
    2186  );
    2187 
    2188 /*
    2189 Description:
    2190  Parses str if it is a recognized length unit system name or abbreviation.
    2191 
    2192 Parameters:
    2193  str - [in]
    2194 
    2195  str_count - [in]
    2196  str[] and str_count specify the string to parse.
    2197  If str_count >= 0. it specifies the maximum number of elements in str[]
    2198  that may be parsed. If str_count = -1, then the string must contain a
    2199  character that terminates unit system name parsing. This character can
    2200  be a null, digit, punctuation, aritmetic operator, or a unicode
    2201  code point <= 0x0020 (0x0020 = space = 32 decimal).
    2202 
    2203  prefered_locale_id - [in]
    2204  If the parsed length unit name identifies different length unit systems
    2205  in different locales, then this value is used to resolve the
    2206  ambiguity. A list of Microsoft locale id values can be found at
    2207  http://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).
    2208 
    2209  bParseLeadingWhitespace - [in]
    2210  If true, leading white space will be parsed.
    2211  If false, the unit name must begin with element str[0].
    2212 
    2213  length_unit_system - [out] (can be null)
    2214  If length_unit_system is not null, it is set to identify the unit
    2215  system specified by str. If str does not identify a known unit
    2216  system, then *length_unit_system is set to ON::LengthUnitSystem::None.
    2217 
    2218 
    2219 Returns:
    2220  Number of elments of str that were parsed. A return value of
    2221  0 indicates that str did not match know unit system names or
    2222  abbreviations.
    2223 
    2224 Remarks:
    2225  Currently common names and abbreviations for millimeters, centimeters,
    2226  meters and kilometers are supported in Czech (cs-*), English (en-*),
    2227  French (fr-*), German (de-*), Portuguese (pt-*) and Spanish (es-*).
    2228 
    2229  Common names and abreviations for the following United States customary
    2230  length units are supported in United States English (en-US).
    2231  If the first element of str is quotation mark (double quote), unicode
    2232  code point 0x0022, the string is parsed as United Sates customary inch.
    2233  If the first element of str is apostrophe, unicode code point 0x0027,
    2234  the string is parsed as United Sates customary foot.
    2235  All conversions to meters are exact.
    2236  microinch = 2.54e-8 meters (1.0e-6 inches)
    2237  mil = 2.54e-5 meters (0.001 inches)
    2238  inch = 0.0254 meters (1/12 foot)
    2239  foot = 0.3048 meters (12 inches)
    2240  yard = 0.9144 meters (36 inches)
    2241  mile = 1609.344 meters (5280 feet) (US statue or land mile)
    2242 */
    2243 ON_DECL
    2244 int ON_ParseLengthUnitName(
    2245  const wchar_t* str,
    2246  int str_count,
    2247  int prefered_locale_id,
    2248  ON::LengthUnitSystem* length_unit_system
    2249  );
    2250 
    2251 ON_DECL
    2252 int ON_ParseLengthUnitName(
    2253  const wchar_t* str,
    2254  int str_count,
    2255  ON_ParseSettings parse_settings,
    2256  ON::LengthUnitSystem* length_unit_system
    2257  );
    2258 
    2259 /*
    2260 Description:
    2261  Parses str to determine if it specifies a length value.
    2262 
    2263 Parameters:
    2264  str - [in]
    2265 
    2266  str_count - [in]
    2267  str[] and str_count specify the string to parse.
    2268  If str_count >= 0, it specifies the maximum number of elements in str[]
    2269  that may be parsed. If str_count = -1, then the string must contain a
    2270  character that terminates length parsing.
    2271 
    2272  parse_settings - [in]
    2273  The input parse_settings parameter controls what input may be
    2274  parsed and how it is parsed.
    2275  Use ON_ParseSettings::DefaultSettings for common parsing tasks.
    2276 
    2277  length_value_unit_system - [in]
    2278  Length unit system for the returned value.
    2279  For example, if you want the returned value to be in meters,
    2280  you would specify ON::LengthUnitSystem::Meters here. If you want to use custom
    2281  units, you must use the override with the ON_UnitSystem
    2282  parameter.
    2283 
    2284  length_value - [out]
    2285  The value of the parsed length.
    2286 
    2287  parse_results - [out] (input pointer can be null)
    2288  The output parse_results parameter reports what was parsed.
    2289 
    2290  str_length_unit_system - [out] (input pointer can be null)
    2291  length unit in the parsed string. When the
    2292  length_value_unit_system specifies a unit system and a
    2293  a different length unit system is parsed, the number returned
    2294  in length_value is always converted to the unit system
    2295  specified by the length_value_unit_system parameter.
    2296  If needed, you can inspect str_length_unit_system to determine
    2297  if the length unit system scaling was applied.
    2298 
    2299 Returns:
    2300  Number of elements of str that were parsed. A return value of
    2301  0 indicates that str could not be parsed as a length value.
    2302 */
    2303 ON_DECL
    2304 int ON_ParseLengthExpression(
    2305  const wchar_t* str,
    2306  int str_count,
    2307  ON_ParseSettings parse_settings,
    2308  double* length_value,
    2309  ON_ParseSettings* parse_results,
    2310  ON::LengthUnitSystem* str_length_unit_system
    2311  );
    2312 
    2313 ON_DECL
    2314 int ON_ParseLengthExpression(
    2315  const wchar_t* str,
    2316  int str_count,
    2317  ON_ParseSettings parse_settings,
    2318  ON::LengthUnitSystem length_value_unit_system,
    2319  double* length_value,
    2320  ON_ParseSettings* parse_results,
    2321  ON::LengthUnitSystem* str_length_unit_system
    2322  );
    2323 
    2324 ON_DECL
    2325 int ON_ParseLengthExpression(
    2326  const wchar_t* str,
    2327  int str_count,
    2328  ON_ParseSettings parse_settings,
    2329  const ON_UnitSystem& length_value_unit_system,
    2330  double* length_value,
    2331  ON_ParseSettings* parse_results,
    2332  ON::LengthUnitSystem* str_length_unit_system
    2333  );
    2334 
    2335 ON_DECL
    2336 int ON_ParseLengthExpression(
    2337  const wchar_t* str,
    2338  int str_count,
    2339  ON::AngleUnitSystem default_str_angle_unit_system,
    2340  ON::LengthUnitSystem length_value_unit_system,
    2341  double* length_value
    2342  );
    2343 
    2344 ON_DECL
    2345 int ON_ParseLengthExpression(
    2346  const wchar_t* str,
    2347  int str_count,
    2348  ON::AngleUnitSystem default_str_angle_unit_system,
    2349  const ON_UnitSystem& length_value_unit_system,
    2350  double* length_value
    2351  );
    2352 
    2353 
    2354 
    2355 /*
    2356 Description:
    2357  Parses str if it is a recognized angle unit system name or abbreviation.
    2358 
    2359 Parameters:
    2360  str - [in]
    2361 
    2362  str_count - [in]
    2363  str[] and str_count specify the string to parse.
    2364  If str_count >= 0. it specifies the maximum number of elements in str[]
    2365  that may be parsed. If str_count = -1, then the string must contain a
    2366  character that terminates angle unit system name parsing.
    2367  This character can be a null, digit, punctuation, aritmetic operator,
    2368  or a unicode code point <= 0x0020 (0x0020 = space = 32 decimal).
    2369 
    2370  prefered_locale_id - [in]
    2371  If the parsed angle unit name identifies different angle unit systems
    2372  in different locales, then this value is used to resolve the
    2373  ambiguity. A list of Microsoft locale id values can be found at
    2374  http://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).
    2375  For example, "Grad" identifies ON::degrees in German and ON::gradians
    2376  in US English.
    2377 
    2378  bParseLeadingWhitespace - [in]
    2379  If true, leading white space will be parsed.
    2380  If false, the unit name must begin with element str[0].
    2381 
    2382  angle_unit_system - [out] (can be null)
    2383  If angle_unit_system is not null, it is set to the identify the
    2384  angle unit system specified by str. If str does not identify a
    2385  known angle unit system, then *angle_unit_system is set to
    2386  ON::AngleUnitSystem::None.
    2387 
    2388 Returns:
    2389  Number of elments of str that were parsed. A return value of
    2390  0 indicates that str did not match know unit system names or
    2391  abbreviations.
    2392 
    2393 Remarks:
    2394  Currently common names and abbreviations for radians, turns,
    2395  gradians, arc degrees, arc minutes and arc seconds are supported
    2396  in Czech (cs-*), English (en-*), French (fr-*), German (de-*),
    2397  Portuguese (pt-*) and Spanish (es-*).
    2398 
    2399  If the first element of str is quotation mark (double quote), unicode
    2400  code point 0x0022, the string is parsed as arc seconds.
    2401  If the first element of str is apostrophe, unicode code point 0x0027,
    2402  the string is parsed as arc minutes.
    2403 */
    2404 ON_DECL
    2405 int ON_ParseAngleUnitName(
    2406  const wchar_t* str,
    2407  int str_count,
    2408  int prefered_locale_id,
    2409  ON::AngleUnitSystem* angle_unit_system
    2410  );
    2411 
    2412 ON_DECL
    2413 int ON_ParseAngleUnitName(
    2414  const wchar_t* str,
    2415  int str_count,
    2416  ON_ParseSettings parse_settings,
    2417  ON::AngleUnitSystem* angle_unit_system
    2418  );
    2419 
    2420 
    2421 /*
    2422 Description:
    2423  Parses str to determine if it specifies a angle value.
    2424 
    2425 Parameters:
    2426  str - [in]
    2427 
    2428  str_count - [in]
    2429  str[] and str_count specify the string to parse.
    2430  If str_count >= 0. it specifies the maximum number of elements in str[]
    2431  that may be parsed. If str_count = -1, then the string must contain a
    2432  character that terminates angle parsing.
    2433 
    2434  parse_settings - [in]
    2435  The input parse_settings parameter controls what input may be
    2436  parsed and how it is parsed.
    2437  Use ON_ParseSettings::DefaultSettings for common parsing tasks.
    2438 
    2439  angle_value_unit_system - [in]
    2440  Angle unit system for the returned value.
    2441  For example, if you want the returned value to be in degrees,
    2442  you would specify ON::AngleUnitSystem::Degrees here.
    2443 
    2444  angle_value - [out]
    2445  The value of the parsed angle.
    2446 
    2447  parse_results - [out] (input pointer can be null)
    2448  The output parse_results parameter reports what was parsed.
    2449 
    2450  str_angle_unit_system - [out] (input pointer can be null)
    2451  angle unit in the parsed string. When the
    2452  angle_value_unit_system specifies an angle unit system and a
    2453  a different angle unit system is parsed, the number returned
    2454  in angle_value is always converted to the angle unit system
    2455  specified by the angle_value_unit_system parameter.
    2456  If needed, you can inspect str_angle_unit_system to determine
    2457  if the angle unit system scaling was applied.
    2458 
    2459 Returns:
    2460  Number of elements of str that were parsed. A return value of
    2461  0 indicates that str could not be parsed as a angle value.
    2462 */
    2463 ON_DECL
    2464 int ON_ParseAngleExpression(
    2465  const wchar_t* str,
    2466  int str_count,
    2467  ON_ParseSettings parse_settings,
    2468  double* angle_value,
    2469  ON_ParseSettings* parse_results,
    2470  ON::AngleUnitSystem* str_angle_unit_system
    2471  );
    2472 
    2473 ON_DECL
    2474 int ON_ParseAngleExpression(
    2475  const wchar_t* str,
    2476  int str_count,
    2477  ON_ParseSettings parse_settings,
    2478  const ON::AngleUnitSystem angle_value_unit_system,
    2479  double* angle_value,
    2480  ON_ParseSettings* parse_results,
    2481  ON::AngleUnitSystem* str_angle_unit_system
    2482  );
    2483 
    2484 /*
    2485 Description:
    2486  Parses str to determine if it specifies a angle value.
    2487 
    2488 Parameters:
    2489  str - [in]
    2490 
    2491  str_count - [in]
    2492  str[] and str_count specify the string to parse.
    2493  If str_count >= 0. it specifies the maximum number of elements in str[]
    2494  that may be parsed. If str_count = -1, then the string must contain a
    2495  character that terminates angle parsing.
    2496 
    2497  default_str_angle_unit_system - [in]
    2498  If an angle unit system is not specified in the parsed string,
    2499  then default_str_angle_units determines what unit system will
    2500  be used. If default_str_angle_units is ON::AngleUnitSystem::None,
    2501  then ON::radians will be used.
    2502 
    2503  angle_value_in_radians - [out]
    2504  The value of the parsed angle, converted to radians, is returned here.
    2505 
    2506 Returns:
    2507  Number of elements of str that were parsed. A return value of
    2508  0 indicates that str could not be parsed as a angle value.
    2509 
    2510 Remarks:
    2511  This function uses ON_ParseAngleExpression() with the
    2512  angle_value_unit_system parameter set to ON::radians
    2513  to parse the string. If you need more control over parsing
    2514  options, then use ON_ParseAngleExpression().
    2515 */
    2516 ON_DECL
    2517 int ON_ParseAngleRadiansExpression(
    2518  const wchar_t* str,
    2519  int str_count,
    2520  ON::AngleUnitSystem default_str_angle_unit_system,
    2521  double* angle_value_in_radians
    2522  );
    2523 
    2524 /*
    2525 Description:
    2526  Parses str to determine if it specifies a angle value.
    2527 
    2528 Parameters:
    2529  str - [in]
    2530 
    2531  str_count - [in]
    2532  str[] and str_count specify the string to parse.
    2533  If str_count >= 0. it specifies the maximum number of elements in str[]
    2534  that may be parsed. If str_count = -1, then the string must contain a
    2535  character that terminates angle parsing.
    2536 
    2537  default_str_angle_unit_system - [in]
    2538  If an angle unit system is not specified in the parsed string,
    2539  then default_str_angle_units determines what unit system will
    2540  be used. If default_str_angle_units is ON::AngleUnitSystem::None,
    2541  then ON::radians will be used.
    2542 
    2543  angle_value_in_radians - [out]
    2544  The value of the parsed angle, converted to arc degrees,
    2545  is returned here.
    2546 
    2547 Returns:
    2548  Number of elements of str that were parsed. A return value of
    2549  0 indicates that str could not be parsed as a angle value.
    2550 
    2551 Remarks:
    2552  This function uses ON_ParseAngleExpression() with the
    2553  angle_value_unit_system parameter set to ON::AngleUnitSystem::Degrees
    2554  to parse the string. If you need more control over parsing
    2555  options, then use ON_ParseAngleExpression().
    2556 */
    2557 ON_DECL
    2558 int ON_ParseAngleArcDegreesExpression(
    2559  const wchar_t* str,
    2560  int str_count,
    2561  ON::AngleUnitSystem default_str_angle_unit_system,
    2562  double* angle_value_in_arc_degrees
    2563  );
    2564 
    2565 /*
    2566 Description:
    2567  Parses str to determine if it specifies a point value.
    2568 
    2569 Parameters:
    2570  str - [in]
    2571 
    2572  str_count - [in]
    2573  str[] and str_count specify the string to parse.
    2574  If str_count >= 0. it specifies the maximum number of elements in str[]
    2575  that may be parsed. If str_count = -1, then the string must contain a
    2576  character that terminates length parsing.
    2577 
    2578  default_str_angle_unit_system - [in]
    2579  If an angle unit system is not specified in the parsed string,
    2580  then default_str_angle_units determines what unit system will
    2581  be used. If default_str_angle_units is ON::AngleUnitSystem::None,
    2582  then ON::radians will be used.
    2583 
    2584  parse_settings - [in]
    2585  The input parse_settings parameter controls what input may be
    2586  parsed and how it is parsed.
    2587  Use ON_ParseSettings::DefaultSettings for common parsing tasks.
    2588 
    2589  point_value_unit_system - [in]
    2590  Coordinate unit system for the returned point value.
    2591  For example, if you want the returned point coordinates to
    2592  be in meters, you would specify ON::LengthUnitSystem::Meters here.
    2593  If you want to use custom units, you must use the
    2594  override with the ON_UnitSystem parameter.
    2595 
    2596  point_value - [out]
    2597  The value of the parsed point.
    2598 
    2599  parse_results - [out] (input pointer can be null)
    2600  The output parse_results parameter reports what was parsed.
    2601 
    2602 Returns:
    2603  Number of elements of str that were parsed. A return value of
    2604  0 indicates that str could not be parsed as a length value.
    2605 */
    2606 ON_DECL
    2607 int ON_ParsePointExpression(
    2608  const wchar_t* str,
    2609  int str_count,
    2610  ON::AngleUnitSystem default_str_angle_unit_system,
    2611  ON::LengthUnitSystem point_value_unit_system,
    2612  ON_3dPoint* point_value
    2613  );
    2614 
    2615 ON_DECL
    2616 int ON_ParsePointExpression(
    2617  const wchar_t* str,
    2618  int str_count,
    2619  ON::AngleUnitSystem default_str_angle_unit_system,
    2620  const ON_UnitSystem& point_value_unit_system,
    2621  ON_3dPoint* point_value
    2622  );
    2623 
    2624 ON_DECL
    2625 int ON_ParsePointExpression(
    2626  const wchar_t* str,
    2627  int str_count,
    2628  ON_ParseSettings parse_settings,
    2629  ON::LengthUnitSystem point_value_unit_system,
    2630  ON_3dPoint* point_value,
    2631  ON_ParseSettings* parse_results
    2632  );
    2633 
    2634 ON_DECL
    2635 int ON_ParsePointExpression(
    2636  const wchar_t* str,
    2637  int str_count,
    2638  ON_ParseSettings parse_settings,
    2639  const ON_UnitSystem& point_value_unit_system,
    2640  ON_3dPoint* point_value,
    2641  ON_ParseSettings* parse_results
    2642  );
    2643 
    2644 
    2645 
    2646 
    2647 #endif
    2648 
    static const ON_LengthUnitName None
    Definition: opennurbs_parse.h:201
    static const ON_ParseSettings DefaultSettingsInRadians
    Definition: opennurbs_parse.h:547
    static const ON_ParseSettings RationalNumberSettings
    Definition: opennurbs_parse.h:578
    Definition: opennurbs_parse.h:193
    @@ -89,9 +87,9 @@ $(function() {
    diff --git a/6/d7/d4c/class_o_n___texture_coordinates-members.html b/6/d7/d4c/class_o_n___texture_coordinates-members.html index 10538cef..533ba80a 100644 --- a/6/d7/d4c/class_o_n___texture_coordinates-members.html +++ b/6/d7/d4c/class_o_n___texture_coordinates-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d7/d4f/opennurbs__curve_8h_source.html b/6/d7/d4f/opennurbs__curve_8h_source.html index 2febd9c9..c7634002 100644 --- a/6/d7/d4f/opennurbs__curve_8h_source.html +++ b/6/d7/d4f/opennurbs__curve_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_curve.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_curve.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_curve.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // Definition of virtual parametric curve
    20 //
    21 ////////////////////////////////////////////////////////////////
    22 
    23 #if !defined(OPENNURBS_CURVE_INC_)
    24 #define OPENNURBS_CURVE_INC_
    25 
    26 ////////////////////////////////////////////////////////////////
    27 ////////////////////////////////////////////////////////////////
    28 
    29 class ON_CLASS ON_MeshCurveParameters
    30 {
    31 public:
    33 
    34  // If main_seg_count <= 0, then both these parameters are ignored.
    35  // If main_seg_count > 0, then sub_seg_count must be >= 1. In this
    36  // case the curve will be broken into main_seg_count equally spaced
    37  // chords. If needed, each of these chords can be split into as many
    38  // sub_seg_count sub-parts if the subdivision is necessary for the
    39  // mesh to meet the other meshing constraints. In particular, if
    40  // sub_seg_count = 0, then the curve is broken into main_seg_count
    41  // pieces and no further testing is performed.
    44 
    47 
    48  // Maximum angle (in radians) between unit tangents at adjacent
    49  // vertices.
    51 
    52  // Maximum permitted value of
    53  // distance chord midpoint to curve) / (length of chord)
    54  double m_max_chr;
    55 
    56  // If max_aspect < 1.0, the parameter is ignored.
    57  // If 1 <= max_aspect < sqrt(2), it is treated as if
    58  // max_aspect = sqrt(2).
    59  // This parameter controls the maximum permitted value of
    60  // (length of longest chord) / (length of shortest chord)
    61  double m_max_aspect;
    62 
    63  // If tolerance = 0, the parameter is ignored.
    64  // This parameter controls the maximum permitted value of the
    65  // distance from the curve to the mesh.
    66  double m_tolerance;
    67 
    68  // If m_min_edge_length = 0, the parameter is ignored.
    69  // This parameter controls the minimum permitted edge length.
    71 
    72  // If max_edge_length = 0, the parameter is ignored.
    73  // This parameter controls the maximum permitted edge length.
    75 
    76  double m_reserved3;
    77  double m_reserved4;
    78 };
    79 
    80 /*
    81 Description:
    82  ON_Curve is a pure virtual class for curve objects
    83  - Any class derived from ON_Curve should have a
    84  ON_OBJECT_DECLARE(ON_...);
    85  at the beginning of its class definition and a
    86  ON_OBJECT_IMPLEMENT( ON_..., ON_Curve );
    87  in a .cpp file.
    88 Example:
    89  - See the definition of ON_NurbsCurve for an example.
    90 */
    91 class ON_CLASS ON_Curve : public ON_Geometry
    92 {
    93  ON_OBJECT_DECLARE(ON_Curve);
    94 
    95 public:
    96  ON_Curve() ON_NOEXCEPT;
    97  virtual ~ON_Curve();
    98  ON_Curve(const ON_Curve&);
    99  ON_Curve& operator=(const ON_Curve&);
    100 
    101 #if defined(ON_HAS_RVALUEREF)
    102  // rvalue copy constructor
    103  ON_Curve( ON_Curve&& ) ON_NOEXCEPT;
    104 
    105  // The rvalue assignment operator calls ON_Object::operator=(ON_Object&&)
    106  // which could throw exceptions. See the implementation of
    107  // ON_Object::operator=(ON_Object&&) for details.
    109 #endif
    110 
    111 public:
    112  // virtual ON_Object::DestroyRuntimeCache override
    113  void DestroyRuntimeCache( bool bDelete = true ) override;
    114 
    115  // virtual ON_Object::SizeOf override
    116  unsigned int SizeOf() const override;
    117 
    118  // virtual ON_Geometry override
    119  bool EvaluatePoint( const class ON_ObjRef& objref, ON_3dPoint& P ) const override;
    120 
    121  /*
    122  Description:
    123  Get a duplicate of the curve.
    124  Returns:
    125  A duplicate of the curve.
    126  Remarks:
    127  The caller must delete the returned curve.
    128  For non-ON_CurveProxy objects, this simply duplicates the curve using
    129  ON_Object::Duplicate.
    130  For ON_CurveProxy objects, this duplicates the actual proxy curve
    131  geometry and, if necessary, trims and reverse the result to that
    132  the returned curve's parameterization and locus match the proxy curve's.
    133  */
    134  virtual
    135  ON_Curve* DuplicateCurve() const;
    136 
    137  // Description:
    138  // overrides virtual ON_Object::ObjectType.
    139  // Returns:
    140  // ON::curve_object
    141  ON::object_type ObjectType() const override;
    142 
    143  // virtual ON_Geometry GetTightBoundingBox override
    144  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    145 
    146  /*
    147  Description:
    148  overrides virtual ON_Geometry::Transform().
    149  ON_Curve::Transform() calls ON_Geometry::Transform(xform),
    150  which calls ON_Object::TransformUserData(xform), and then
    151  calls this->DestroyCurveTree().
    152  Parameters:
    153  xform - [in] transformation to apply to object.
    154  Remarks:
    155  Classes derived from ON_Curve should call
    156  ON_Curve::Transform() to handle user data
    157  transformations and curve tree destruction
    158  and then transform their definition.
    159  */
    160  bool Transform(
    161  const ON_Xform& xform
    162  ) override;
    163 
    164 
    165  ////////////////////////////////////////////////////////////////////
    166  // curve interface
    167 
    168  // Description:
    169  // Gets domain of the curve
    170  // Parameters:
    171  // t0 - [out]
    172  // t1 - [out] domain is [*t0, *t1]
    173  // Returns:
    174  // true if successful.
    175  bool GetDomain( double* t0, double* t1 ) const;
    176 
    177  // Returns:
    178  // domain of the curve.
    179  virtual
    180  ON_Interval Domain() const = 0;
    181 
    182  /*
    183  Description:
    184  Set the domain of the curve.
    185  Parameters:
    186  domain - [in] increasing interval
    187  Returns:
    188  true if successful.
    189  */
    190  bool SetDomain( ON_Interval domain );
    191 
    192  // Description:
    193  // Set the domain of the curve
    194  // Parameters:
    195  // t0 - [in]
    196  // t1 - [in] new domain will be [t0,t1]
    197  // Returns:
    198  // true if successful.
    199  virtual
    200  bool SetDomain(
    201  double t0,
    202  double t1
    203  );
    204 
    205 
    206  /*
    207  Description:
    208  If this curve is closed, then modify it so that
    209  the start/end point is at curve parameter t.
    210  Parameters:
    211  t - [in] curve parameter of new start/end point. The
    212  returned curves domain will start at t.
    213  Returns:
    214  true if successful.
    215  */
    216  virtual
    217  bool ChangeClosedCurveSeam(
    218  double t
    219  );
    220 
    221  /*
    222  Description:
    223  Change the dimension of a curve.
    224  Parameters:
    225  desired_dimension - [in]
    226  Returns:
    227  true if the curve's dimension was already desired_dimension
    228  or if the curve's dimension was successfully changed to
    229  desired_dimension.
    230  */
    231  virtual
    232  bool ChangeDimension(
    233  int desired_dimension
    234  );
    235 
    236 
    237  // Description:
    238  // Get number of nonempty smooth (c-infinity) spans in curve
    239  // Returns:
    240  // Number of nonempty smooth (c-infinity) spans.
    241  virtual
    242  int SpanCount() const = 0;
    243 
    244  // Description:
    245  // Get number of parameters of "knots".
    246  // Parameters:
    247  // knots - [out] an array of length SpanCount()+1 is filled in
    248  // with the parameters where the curve is not smooth (C-infinity).
    249  // Returns:
    250  // true if successful
    251  virtual
    252  bool GetSpanVector(
    253  double* knots
    254  ) const = 0; //
    255 
    256  //////////
    257  // If t is in the domain of the curve, GetSpanVectorIndex() returns the
    258  // span vector index "i" such that span_vector[i] <= t <= span_vector[i+1].
    259  // The "side" parameter determines which span is selected when t is at the
    260  // end of a span.
    261  virtual
    262  bool GetSpanVectorIndex(
    263  double t , // [IN] t = evaluation parameter
    264  int side, // [IN] side 0 = default, -1 = from below, +1 = from above
    265  int* span_vector_index, // [OUT] span vector index
    266  ON_Interval* span_domain // [OUT] domain of the span containing "t"
    267  ) const;
    268 
    269  // Description:
    270  // Returns maximum algebraic degree of any span
    271  // or a good estimate if curve spans are not algebraic.
    272  // Returns:
    273  // degree
    274  virtual
    275  int Degree() const = 0;
    276 
    277  // Description:
    278  // Returns maximum algebraic degree of any span
    279  // or a good estimate if curve spans are not algebraic.
    280  // Returns:
    281  // degree
    282  virtual
    283  bool GetParameterTolerance( // returns tminus < tplus: parameters tminus <= s <= tplus
    284  double t, // [IN] t = parameter in domain
    285  double* tminus, // [OUT] tminus
    286  double* tplus // [OUT] tplus
    287  ) const;
    288 
    289  // Description:
    290  // Test a curve to see if the locus if its points is a line segment.
    291  // Parameters:
    292  // tolerance - [in] // tolerance to use when checking linearity
    293  // Returns:
    294  // true if the ends of the curve are farther than tolerance apart
    295  // and the maximum distance from any point on the curve to
    296  // the line segment connecting the curve's ends is <= tolerance.
    297  virtual
    298  bool IsLinear(
    299  double tolerance = ON_ZERO_TOLERANCE
    300  ) const;
    301 
    302  /*
    303  Description:
    304  Several types of ON_Curve can have the form of a polyline including
    305  a degree 1 ON_NurbsCurve, an ON_PolylineCurve, and an ON_PolyCurve
    306  all of whose segments are some form of polyline. IsPolyline tests
    307  a curve to see if it can be represented as a polyline.
    308  Parameters:
    309  pline_points - [out] if not nullptr and true is returned, then the
    310  points of the polyline form are returned here.
    311  t - [out] if not nullptr and true is returned, then the parameters of
    312  the polyline points are returned here.
    313  Returns:
    314  @untitled table
    315  0 curve is not some form of a polyline
    316  >=2 number of points in polyline form
    317  */
    318  virtual
    319  int IsPolyline(
    320  ON_SimpleArray<ON_3dPoint>* pline_points = nullptr,
    321  ON_SimpleArray<double>* pline_t = nullptr
    322  ) const;
    323 
    324  // Description:
    325  // Test a curve to see if the locus if its points is an arc or circle.
    326  // Parameters:
    327  // plane - [in] if not nullptr, test is performed in this plane
    328  // arc - [out] if not nullptr and true is returned, then arc parameters
    329  // are filled in
    330  // tolerance - [in] tolerance to use when checking
    331  // Returns:
    332  // ON_Arc.m_angle > 0 if curve locus is an arc between
    333  // specified points. If ON_Arc.m_angle is 2.0*ON_PI, then the curve
    334  // is a circle.
    335  virtual
    336  bool IsArc(
    337  const ON_Plane* plane = nullptr,
    338  ON_Arc* arc = nullptr,
    339  double tolerance = ON_ZERO_TOLERANCE
    340  ) const;
    341 
    342  /*
    343  Description:
    344  Parameters:
    345  t - [in] curve parameter
    346  plane - [in]
    347  if not nullptr, test is performed in this plane
    348  arc - [out]
    349  if not nullptr and true is returned, then arc parameters
    350  are filled in
    351  tolerance - [in]
    352  tolerance to use when checking
    353  t0 - [out]
    354  if not nullptr, and then *t0 is set to the parameter
    355  at the start of the G2 curve segment that was
    356  tested.
    357  t1 - [out]
    358  if not nullptr, and then *t0 is set to the parameter
    359  at the start of the G2 curve segment that was
    360  tested.
    361  Returns:
    362  True if the paramter t is on a arc segment of the curve.
    363  */
    364  bool IsArcAt(
    365  double t,
    366  const ON_Plane* plane = 0,
    367  ON_Arc* arc = 0,
    368  double tolerance = ON_ZERO_TOLERANCE,
    369  double* t0 = 0,
    370  double* t1 = 0
    371  ) const;
    372 
    373  virtual
    374  bool IsEllipse(
    375  const ON_Plane* plane = nullptr,
    376  ON_Ellipse* ellipse = nullptr,
    377  double tolerance = ON_ZERO_TOLERANCE
    378  ) const;
    379 
    380  // Description:
    381  // Test a curve to see if it is planar.
    382  // Parameters:
    383  // plane - [out] if not nullptr and true is returned,
    384  // the plane parameters are filled in.
    385  // tolerance - [in] tolerance to use when checking
    386  // Returns:
    387  // true if there is a plane such that the maximum distance from
    388  // the curve to the plane is <= tolerance.
    389  virtual
    390  bool IsPlanar(
    391  ON_Plane* plane = nullptr,
    392  double tolerance = ON_ZERO_TOLERANCE
    393  ) const;
    394 
    395  // Description:
    396  // Test a curve to see if it lies in a specific plane.
    397  // Parameters:
    398  // test_plane - [in]
    399  // tolerance - [in] tolerance to use when checking
    400  // Returns:
    401  // true if the maximum distance from the curve to the
    402  // test_plane is <= tolerance.
    403  virtual
    404  bool IsInPlane(
    405  const ON_Plane& test_plane,
    406  double tolerance = ON_ZERO_TOLERANCE
    407  ) const = 0;
    408 
    409  /*
    410  Description:
    411  Decide if it makes sense to close off this curve by moving
    412  the endpoint to the start based on start-end gap size and length
    413  of curve as approximated by chord defined by 6 points.
    414  Parameters:
    415  tolerance - [in] maximum allowable distance between start and end.
    416  if start - end gap is greater than tolerance, returns false
    417  min_abs_size - [in] if greater than 0.0 and none of the interior sampled
    418  points are at least min_abs_size from start, returns false.
    419  min_rel_size - [in] if greater than 1.0 and chord length is less than
    420  min_rel_size*gap, returns false.
    421  Returns:
    422  true if start and end points are close enough based on above conditions.
    423  */
    424 
    425  bool IsClosable(
    426  double tolerance,
    427  double min_abs_size = 0.0,
    428  double min_rel_size = 10.0
    429  ) const;
    430 
    431  // Description:
    432  // Test a curve to see if it is closed.
    433  // Returns:
    434  // true if the curve is closed.
    435  virtual
    436  bool IsClosed() const;
    437 
    438  // Description:
    439  // Test a curve to see if it is periodic.
    440  // Returns:
    441  // true if the curve is closed and at least C2 at the start/end.
    442  virtual
    443  bool IsPeriodic() const;
    444 
    445  /*
    446  Description:
    447  Search for a derivatitive, tangent, or curvature
    448  discontinuity.
    449  Parameters:
    450  c - [in] type of continity to test for.
    451  t0 - [in] Search begins at t0. If there is a discontinuity
    452  at t0, it will be ignored. This makes it
    453  possible to repeatedly call GetNextDiscontinuity
    454  and step through the discontinuities.
    455  t1 - [in] (t0 != t1) If there is a discontinuity at t1 is
    456  will be ingored unless c is a locus discontinuity
    457  type and t1 is at the start or end of the curve.
    458  t - [out] if a discontinuity is found, then *t reports the
    459  parameter at the discontinuity.
    460  hint - [in/out] if GetNextDiscontinuity will be called
    461  repeatedly, passing a "hint" with initial value *hint=0
    462  will increase the speed of the search.
    463  dtype - [out] if not nullptr, *dtype reports the kind of
    464  discontinuity found at *t. A value of 1 means the first
    465  derivative or unit tangent was discontinuous. A value
    466  of 2 means the second derivative or curvature was
    467  discontinuous. A value of 0 means teh curve is not
    468  closed, a locus discontinuity test was applied, and
    469  t1 is at the start of end of the curve.
    470  If 'c', the type of continuity to test for
    471  is ON::continuity::Gsmooth_continuous and the curvature changes
    472  from curved to 0 or 0 to curved and there is no
    473  tangency kink dtype is returns 3
    474  cos_angle_tolerance - [in] default = cos(1 degree) Used only
    475  when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the
    476  cosine of the angle between two tangent vectors is
    477  <= cos_angle_tolerance, then a G1 discontinuity is reported.
    478  curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used
    479  only when c is ON::continuity::G2_continuous. If K0 and K1 are
    480  curvatures evaluated from above and below and
    481  |K0 - K1| > curvature_tolerance, then a curvature
    482  discontinuity is reported.
    483  Returns:
    484  Parametric continuity tests c = (C0_continuous, ..., G2_continuous):
    485 
    486  true if a parametric discontinuity was found strictly
    487  between t0 and t1. Note well that all curves are
    488  parametrically continuous at the ends of their domains.
    489 
    490  Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous):
    491 
    492  true if a locus discontinuity was found strictly between
    493  t0 and t1 or at t1 is the at the end of a curve.
    494  Note well that all open curves (IsClosed()=false) are locus
    495  discontinuous at the ends of their domains. All closed
    496  curves (IsClosed()=true) are at least C0_locus_continuous at
    497  the ends of their domains.
    498  */
    499  virtual
    500  bool GetNextDiscontinuity(
    501  ON::continuity c,
    502  double t0,
    503  double t1,
    504  double* t,
    505  int* hint=nullptr,
    506  int* dtype=nullptr,
    507  double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE,
    508  double curvature_tolerance=ON_SQRT_EPSILON
    509  ) const;
    510 
    511  /*
    512  Description:
    513  Test continuity at a curve parameter value.
    514  Parameters:
    515  c - [in] type of continuity to test for. Read ON::continuity
    516  comments for details.
    517  t - [in] parameter to test
    518  hint - [in] evaluation hint
    519  point_tolerance - [in] if the distance between two points is
    520  greater than point_tolerance, then the curve is not C0.
    521  d1_tolerance - [in] if the difference between two first derivatives is
    522  greater than d1_tolerance, then the curve is not C1.
    523  d2_tolerance - [in] if the difference between two second derivatives is
    524  greater than d2_tolerance, then the curve is not C2.
    525  cos_angle_tolerance - [in] default = cos(1 degree) Used only when
    526  c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine
    527  of the angle between two tangent vectors
    528  is <= cos_angle_tolerance, then a G1 discontinuity is reported.
    529  curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when
    530  c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous.
    531  ON::continuity::G2_continuous:
    532  If K0 and K1 are curvatures evaluated
    533  from above and below and |K0 - K1| > curvature_tolerance,
    534  then a curvature discontinuity is reported.
    535  ON::continuity::Gsmooth_continuous:
    536  If K0 and K1 are curvatures evaluated from above and below
    537  and the angle between K0 and K1 is at least twice angle tolerance
    538  or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance,
    539  then a curvature discontinuity is reported.
    540  Returns:
    541  true if the curve has at least the c type continuity at
    542  the parameter t.
    543  */
    544  virtual
    545  bool IsContinuous(
    546  ON::continuity c,
    547  double t,
    548  int* hint = nullptr,
    549  double point_tolerance=ON_ZERO_TOLERANCE,
    550  double d1_tolerance=ON_ZERO_TOLERANCE,
    551  double d2_tolerance=ON_ZERO_TOLERANCE,
    552  double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE,
    553  double curvature_tolerance=ON_SQRT_EPSILON
    554  ) const;
    555 
    556 
    557  // Description:
    558  // Reverse the direction of the curve.
    559  // Returns:
    560  // true if curve was reversed.
    561  // Remarks:
    562  // If reveresed, the domain changes from [a,b] to [-b,-a]
    563  virtual
    564  bool Reverse()=0;
    565 
    566 
    567  /*
    568  Description:
    569  Force the curve to start at a specified point.
    570  Parameters:
    571  start_point - [in]
    572  Returns:
    573  true if successful.
    574  Remarks:
    575  Some end points cannot be moved. Be sure to check return
    576  code.
    577  ON_Curve::SetStartPoint() returns true if start_point is the same as the start of the curve,
    578  false otherwise.
    579  See Also:
    580  ON_Curve::SetEndPoint
    581  ON_Curve::PointAtStart
    582  ON_Curve::PointAtEnd
    583  */
    584  virtual
    585  bool SetStartPoint(
    586  ON_3dPoint start_point
    587  );
    588 
    589  /*
    590  Description:
    591  Force the curve to end at a specified point.
    592  Parameters:
    593  end_point - [in]
    594  Returns:
    595  true if successful.
    596  Remarks:
    597  Some end points cannot be moved. Be sure to check return
    598  code.
    599  ON_Curve::SetEndPoint() returns true if end_point is the same as the end of the curve,
    600  false otherwise.
    601  See Also:
    602  ON_Curve::SetStartPoint
    603  ON_Curve::PointAtStart
    604  ON_Curve::PointAtEnd
    605  */
    606  virtual
    607  bool SetEndPoint(
    608  ON_3dPoint end_point
    609  );
    610 
    611  // Description:
    612  // Evaluate point at a parameter.
    613  // Parameters:
    614  // t - [in] evaluation parameter
    615  // Returns:
    616  // Point (location of curve at the parameter t).
    617  // Remarks:
    618  // No error handling.
    619  // See Also:
    620  // ON_Curve::EvPoint
    621  // ON_Curve::PointAtStart
    622  // ON_Curve::PointAtEnd
    623  ON_3dPoint PointAt(
    624  double t
    625  ) const;
    626 
    627  // Description:
    628  // Evaluate point at the start of the curve.
    629  // Parameters:
    630  // t - [in] evaluation parameter
    631  // Returns:
    632  // Point (location of the start of the curve.)
    633  // Remarks:
    634  // No error handling.
    635  // See Also:
    636  // ON_Curve::PointAt
    637  ON_3dPoint PointAtStart() const;
    638 
    639  // Description:
    640  // Evaluate point at the end of the curve.
    641  // Parameters:
    642  // t - [in] evaluation parameter
    643  // Returns:
    644  // Point (location of the end of the curve.)
    645  // Remarks:
    646  // No error handling.
    647  // See Also:
    648  // ON_Curve::PointAt
    649  ON_3dPoint PointAtEnd() const;
    650 
    651  // Description:
    652  // Evaluate first derivative at a parameter.
    653  // Parameters:
    654  // t - [in] evaluation parameter
    655  // Returns:
    656  // First derivative of the curve at the parameter t.
    657  // Remarks:
    658  // No error handling.
    659  // See Also:
    660  // ON_Curve::Ev1Der
    661  ON_3dVector DerivativeAt(
    662  double t
    663  ) const;
    664 
    665  // Description:
    666  // Evaluate unit tangent vector at a parameter.
    667  // Parameters:
    668  // t - [in] evaluation parameter
    669  // Returns:
    670  // Unit tangent vector of the curve at the parameter t.
    671  // Remarks:
    672  // No error handling.
    673  // See Also:
    674  // ON_Curve::EvTangent
    675  ON_3dVector TangentAt(
    676  double t
    677  ) const;
    678 
    679  // Description:
    680  // Evaluate the curvature vector at a parameter.
    681  // Parameters:
    682  // t - [in] evaluation parameter
    683  // Returns:
    684  // curvature vector of the curve at the parameter t.
    685  // Remarks:
    686  // No error handling.
    687  // See Also:
    688  // ON_Curve::EvCurvature
    689  ON_3dVector CurvatureAt(
    690  double t
    691  ) const;
    692 
    693  // Description:
    694  // Return a 3d frame at a parameter.
    695  // Parameters:
    696  // t - [in] evaluation parameter
    697  // plane - [out] the frame is returned here
    698  // Returns:
    699  // true if successful
    700  // See Also:
    701  // ON_Curve::PointAt, ON_Curve::TangentAt,
    702  // ON_Curve::Ev1Der, Ev2Der
    703  bool FrameAt( double t, ON_Plane& plane) const;
    704 
    705  // Description:
    706  // Evaluate point at a parameter with error checking.
    707  // Parameters:
    708  // t - [in] evaluation parameter
    709  // point - [out] value of curve at t
    710  // side - [in] optional - determines which side to evaluate from
    711  // =0 default
    712  // <0 to evaluate from below,
    713  // >0 to evaluate from above
    714  // hint - [in/out] optional evaluation hint used to speed repeated evaluations
    715  // Returns:
    716  // false if unable to evaluate.
    717  // See Also:
    718  // ON_Curve::PointAt
    719  // ON_Curve::EvTangent
    720  // ON_Curve::Evaluate
    721  bool EvPoint(
    722  double t,
    723  ON_3dPoint& point,
    724  int side = 0,
    725  int* hint = 0
    726  ) const;
    727 
    728  // Description:
    729  // Evaluate first derivative at a parameter with error checking.
    730  // Parameters:
    731  // t - [in] evaluation parameter
    732  // point - [out] value of curve at t
    733  // first_derivative - [out] value of first derivative at t
    734  // side - [in] optional - determines which side to evaluate from
    735  // =0 default
    736  // <0 to evaluate from below,
    737  // >0 to evaluate from above
    738  // hint - [in/out] optional evaluation hint used to speed repeated evaluations
    739  // Returns:
    740  // false if unable to evaluate.
    741  // See Also:
    742  // ON_Curve::EvPoint
    743  // ON_Curve::Ev2Der
    744  // ON_Curve::EvTangent
    745  // ON_Curve::Evaluate
    746  bool Ev1Der(
    747  double t,
    748  ON_3dPoint& point,
    749  ON_3dVector& first_derivative,
    750  int side = 0,
    751  int* hint = 0
    752  ) const;
    753 
    754  // Description:
    755  // Evaluate second derivative at a parameter with error checking.
    756  // Parameters:
    757  // t - [in] evaluation parameter
    758  // point - [out] value of curve at t
    759  // first_derivative - [out] value of first derivative at t
    760  // second_derivative - [out] value of second derivative at t
    761  // side - [in] optional - determines which side to evaluate from
    762  // =0 default
    763  // <0 to evaluate from below,
    764  // >0 to evaluate from above
    765  // hint - [in/out] optional evaluation hint used to speed repeated evaluations
    766  // Returns:
    767  // false if unable to evaluate.
    768  // See Also:
    769  // ON_Curve::Ev1Der
    770  // ON_Curve::EvCurvature
    771  // ON_Curve::Evaluate
    772  bool Ev2Der(
    773  double t,
    774  ON_3dPoint& point,
    775  ON_3dVector& first_derivative,
    776  ON_3dVector& second_derivative,
    777  int side = 0,
    778  int* hint = 0
    779  ) const;
    780 
    781  /*
    782  Description:
    783  Evaluate unit tangent at a parameter with error checking.
    784  Parameters:
    785  t - [in] evaluation parameter
    786  point - [out] value of curve at t
    787  tangent - [out] value of unit tangent
    788  side - [in] optional - determines which side to evaluate from
    789  =0 default
    790  <0 to evaluate from below,
    791  >0 to evaluate from above
    792  hint - [in/out] optional evaluation hint used to speed repeated evaluations
    793  Returns:
    794  false if unable to evaluate.
    795  See Also:
    796  ON_Curve::TangentAt
    797  ON_Curve::Ev1Der
    798  */
    799  bool EvTangent(
    800  double t,
    801  ON_3dPoint& point,
    802  ON_3dVector& tangent,
    803  int side = 0,
    804  int* hint = 0
    805  ) const;
    806 
    807  /*
    808  Description:
    809  Evaluate unit tangent and curvature at a parameter with error checking.
    810  Parameters:
    811  t - [in] evaluation parameter
    812  point - [out] value of curve at t
    813  tangent - [out] value of unit tangent
    814  kappa - [out] value of curvature vector
    815  side - [in] optional - determines which side to evaluate from
    816  =0 default
    817  <0 to evaluate from below,
    818  >0 to evaluate from above
    819  hint - [in/out] optional evaluation hint used to speed repeated evaluations
    820  Returns:
    821  false if unable to evaluate.
    822  See Also:
    823  ON_Curve::CurvatureAt
    824  ON_Curve::Ev2Der
    825  ON_EvCurvature
    826  */
    827  bool EvCurvature(
    828  double t,
    829  ON_3dPoint& point,
    830  ON_3dVector& tangent,
    831  ON_3dVector& kappa,
    832  int side = 0,
    833  int* hint = 0
    834  ) const;
    835 
    836  /*
    837  Description:
    838  This evaluator actually does all the work. The other ON_Curve
    839  evaluation tools call this virtual function.
    840  Parameters:
    841  t - [in] evaluation parameter ( usually in Domain() ).
    842  der_count - [in] (>=0) number of derivatives to evaluate
    843  v_stride - [in] (>=Dimension()) stride to use for the v[] array
    844  v - [out] array of length (der_count+1)*v_stride
    845  curve(t) is returned in (v[0],...,v[m_dim-1]),
    846  curve'(t) is retuned in (v[v_stride],...,v[v_stride+m_dim-1]),
    847  curve"(t) is retuned in (v[2*v_stride],...,v[2*v_stride+m_dim-1]),
    848  etc.
    849  side - [in] optional - determines which side to evaluate from
    850  =0 default
    851  <0 to evaluate from below,
    852  >0 to evaluate from above
    853  hint - [in/out] optional evaluation hint used to speed repeated evaluations
    854  Returns:
    855  false if unable to evaluate.
    856  See Also:
    857  ON_Curve::EvPoint
    858  ON_Curve::Ev1Der
    859  ON_Curve::Ev2Der
    860  */
    861  virtual
    862  bool Evaluate(
    863  double t,
    864  int der_count,
    865  int v_stride,
    866  double* v,
    867  int side = 0,
    868  int* hint = 0
    869  ) const = 0;
    870 
    871 
    872 
    873  /*
    874  Parameters:
    875  min_length -[in]
    876  minimum length of a linear span
    877  tolerance -[in]
    878  distance tolerance to use when checking linearity.
    879  Returns
    880  true if the span is a non-degenrate line. This means:
    881  - dimension = 2 or 3
    882  - The length of the the line segment from the span's initial
    883  point to the span's control point is >= min_length.
    884  - The maximum distance from the line segment to the span
    885  is <= tolerance and the span increases monotonically
    886  in the direction of the line segment.
    887  */
    888  bool FirstSpanIsLinear(
    889  double min_length,
    890  double tolerance
    891  ) const;
    892 
    893  bool LastSpanIsLinear(
    894  double min_length,
    895  double tolerance
    896  ) const;
    897 
    898  bool FirstSpanIsLinear(
    899  double min_length,
    900  double tolerance,
    901  ON_Line* span_line
    902  ) const;
    903 
    904  bool LastSpanIsLinear(
    905  double min_length,
    906  double tolerance,
    907  ON_Line* span_line
    908  ) const;
    909 
    910 
    911  // Description:
    912  // Removes portions of the curve outside the specified interval.
    913  // Parameters:
    914  // domain - [in] interval of the curve to keep. Portions of the
    915  // curve before curve(domain[0]) and after curve(domain[1]) are
    916  // removed.
    917  // Returns:
    918  // true if successful.
    919  virtual
    920  bool Trim(
    921  const ON_Interval& domain
    922  );
    923 
    924  // Description:
    925  // Pure virtual function. Default returns false.
    926  // Where possible, analytically extends curve to include domain.
    927  // Parameters:
    928  // domain - [in] if domain is not included in curve domain,
    929  // curve will be extended so that its domain includes domain.
    930  // Will not work if curve is closed. Original curve is identical
    931  // to the restriction of the resulting curve to the original curve domain,
    932  // Returns:
    933  // true if successful.
    934  virtual
    935  bool Extend(
    936  const ON_Interval& domain
    937  );
    938 
    939  /*
    940  Description:
    941  Splits (divides) the curve at the specified parameter.
    942  The parameter must be in the interior of the curve's domain.
    943  The pointers passed to Split must either be nullptr or point to
    944  an ON_Curve object of the same type. If the pointer is nullptr,
    945  then a curve will be created in Split(). You may pass "this"
    946  as left_side or right_side.
    947  Parameters:
    948  t - [in] parameter to split the curve at in the
    949  interval returned by Domain().
    950  left_side - [out] left portion of curve returned here
    951  right_side - [out] right portion of curve returned here
    952  Returns:
    953  true - The curve was split into two pieces.
    954  false - The curve could not be split. For example if the parameter is
    955  too close to an endpoint.
    956 
    957  Example:
    958  For example, if crv were an ON_NurbsCurve, then
    959 
    960  ON_NurbsCurve right_side;
    961  crv.Split( crv.Domain().Mid() &crv, &right_side );
    962 
    963  would split crv at the parametric midpoint, put the left side
    964  in crv, and return the right side in right_side.
    965  */
    966  virtual
    967  bool Split(
    968  double t,
    969  ON_Curve*& left_side,
    970  ON_Curve*& right_side
    971  ) const;
    972 
    973  /*
    974  Description:
    975  Get a NURBS curve representation of this curve.
    976  Parameters:
    977  nurbs_curve - [out] NURBS representation returned here
    978  tolerance - [in] tolerance to use when creating NURBS
    979  representation.
    980  subdomain - [in] if not nullptr, then the NURBS representation
    981  for this portion of the curve is returned.
    982  Returns:
    983  0 unable to create NURBS representation
    984  with desired accuracy.
    985  1 success - returned NURBS parameterization
    986  matches the curve's to wthe desired accuracy
    987  2 success - returned NURBS point locus matches
    988  the curve's to the desired accuracy and the
    989  domain of the NURBS curve is correct. On
    990  However, This curve's parameterization and
    991  the NURBS curve parameterization may not
    992  match to the desired accuracy. This situation
    993  happens when getting NURBS representations of
    994  curves that have a transendental parameterization
    995  like circles
    996  Remarks:
    997  This is a low-level virtual function. If you do not need
    998  the parameterization information provided by the return code,
    999  then ON_Curve::NurbsCurve may be easier to use.
    1000  See Also:
    1001  ON_Curve::NurbsCurve
    1002  */
    1003  virtual
    1004  int GetNurbForm(
    1005  ON_NurbsCurve& nurbs_curve,
    1006  double tolerance = 0.0,
    1007  const ON_Interval* subdomain = nullptr
    1008  ) const;
    1009  /*
    1010  Description:
    1011  Does a NURBS curve representation of this curve.
    1012  Parameters:
    1013  Returns:
    1014  0 unable to create NURBS representation
    1015  with desired accuracy.
    1016  1 success - NURBS parameterization
    1017  matches the curve's to wthe desired accuracy
    1018  2 success - NURBS point locus matches
    1019  the curve's and the
    1020  domain of the NURBS curve is correct.
    1021  However, This curve's parameterization and
    1022  the NURBS curve parameterization may not
    1023  match. This situation
    1024  happens when getting NURBS representations of
    1025  curves that have a transendental parameterization
    1026  like circles
    1027  Remarks:
    1028  This is a low-level virtual function.
    1029  See Also:
    1030  ON_Curve::GetNurbForm
    1031  ON_Curve::NurbsCurve
    1032  */
    1033  virtual
    1034  int HasNurbForm() const;
    1035 
    1036  /*
    1037  Description:
    1038  Get a NURBS curve representation of this curve.
    1039  Parameters:
    1040  pNurbsCurve - [in/out] if not nullptr, this ON_NurbsCurve
    1041  will be used to store the NURBS representation
    1042  of the curve will be returned.
    1043  tolerance - [in] tolerance to use when creating NURBS
    1044  representation.
    1045  subdomain - [in] if not nullptr, then the NURBS representation
    1046  for this portion of the curve is returned.
    1047  Returns:
    1048  nullptr or a NURBS representation of the curve.
    1049  Remarks:
    1050  See ON_Surface::GetNurbForm for important details about
    1051  the NURBS surface parameterization.
    1052  See Also:
    1053  ON_Curve::GetNurbForm
    1054  */
    1055  ON_NurbsCurve* NurbsCurve(
    1056  ON_NurbsCurve* pNurbsCurve = nullptr,
    1057  double tolerance = 0.0,
    1058  const ON_Interval* subdomain = nullptr
    1059  ) const;
    1060 
    1061  // Description:
    1062  // Convert a NURBS curve parameter to a curve parameter
    1063  //
    1064  // Parameters:
    1065  // nurbs_t - [in] nurbs form parameter
    1066  // curve_t - [out] curve parameter
    1067  //
    1068  // Remarks:
    1069  // If GetNurbForm returns 2, this function converts the curve
    1070  // parameter to the NURBS curve parameter.
    1071  //
    1072  // See Also:
    1073  // ON_Curve::GetNurbForm, ON_Curve::GetNurbFormParameterFromCurveParameter
    1074  virtual
    1075  bool GetCurveParameterFromNurbFormParameter(
    1076  double nurbs_t,
    1077  double* curve_t
    1078  ) const;
    1079 
    1080  // Description:
    1081  // Convert a curve parameter to a NURBS curve parameter.
    1082  //
    1083  // Parameters:
    1084  // curve_t - [in] curve parameter
    1085  // nurbs_t - [out] nurbs form parameter
    1086  //
    1087  // Remarks:
    1088  // If GetNurbForm returns 2, this function converts the curve
    1089  // parameter to the NURBS curve parameter.
    1090  //
    1091  // See Also:
    1092  // ON_Curve::GetNurbForm, ON_Curve::GetCurveParameterFromNurbFormParameter
    1093  virtual
    1094  bool GetNurbFormParameterFromCurveParameter(
    1095  double curve_t,
    1096  double* nurbs_t
    1097  ) const;
    1098 
    1099 
    1100  // Description:
    1101  // Destroys the runtime curve tree used to speed closest
    1102  // point and intersection calcuations.
    1103  // Remarks:
    1104  // If the geometry of the curve is modified in any way,
    1105  // then call DestroyCurveTree(); The curve tree is
    1106  // created as needed.
    1107  void DestroyCurveTree();
    1108 
    1109 
    1110  /*
    1111  Description:
    1112  Lookup a parameter in the m_t array, optionally using a built in snap tolerance to
    1113  snap a parameter value to an element of m_t.
    1114  This function is used by some types derived from ON_Curve to snap parameter values
    1115  Parameters:
    1116  t - [in] parameter
    1117  index -[out] index into m_t such that
    1118  if function returns false then
    1119 
    1120  @table
    1121  value condition
    1122  -1 t<m_t[0] or m_t is empty
    1123  0<=i<=m_t.Count()-2 m_t[i] < t < m_t[i+1]
    1124  m_t.Count()-1 t>m_t[ m_t.Count()-1]
    1125 
    1126  if the function returns true then t is equal to, or is closest to and
    1127  within tolerance of m_t[index].
    1128 
    1129  bEnableSnap-[in] enable snapping
    1130  m_t -[in] Array of parameter values to snap to
    1131  RelTol -[in] tolerance used in snapping
    1132 
    1133  Returns:
    1134  true if the t is exactly equal to (bEnableSnap==false), or within tolerance of
    1135  (bEnableSnap==true) m_t[index].
    1136  */
    1137 protected:
    1138  bool ParameterSearch( double t, int& index, bool bEnableSnap, const ON_SimpleArray<double>& m_t,
    1139  double RelTol=ON_SQRT_EPSILON) const;
    1140 
    1141 private:
    1142 };
    1143 
    1144 #if defined(ON_DLL_TEMPLATE)
    1145 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Curve*>;
    1146 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_Curve*>;
    1147 #endif
    1148 
    1150 {
    1151 public:
    1152  ON_CurveArray( int = 0 );
    1153  ~ON_CurveArray(); // deletes any non-nullptr curves
    1154 
    1155  bool Write( ON_BinaryArchive& ) const;
    1156  bool Read( ON_BinaryArchive& );
    1157 
    1158  void Destroy(); // deletes curves, sets pointers to nullptr, sets count to zero
    1159 
    1160  bool Duplicate( ON_CurveArray& ) const; // operator= copies the pointer values
    1161  // duplicate copies the curves themselves
    1162 
    1163  /*
    1164  Description:
    1165  Get tight bounding box of the bezier.
    1166  Parameters:
    1167  tight_bbox - [in/out] tight bounding box
    1168  bGrowBox -[in] (default=false)
    1169  If true and the input tight_bbox is valid, then returned
    1170  tight_bbox is the union of the input tight_bbox and the
    1171  tight bounding box of the bezier curve.
    1172  xform -[in] (default=nullptr)
    1173  If not nullptr, the tight bounding box of the transformed
    1174  bezier is calculated. The bezier curve is not modified.
    1175  Returns:
    1176  True if the returned tight_bbox is set to a valid
    1177  bounding box.
    1178  */
    1179  bool GetTightBoundingBox(
    1180  ON_BoundingBox& tight_bbox,
    1181  bool bGrowBox = false,
    1182  const ON_Xform* xform = nullptr
    1183  ) const;
    1184 };
    1185 
    1186 /*
    1187 Description:
    1188  Trim a curve.
    1189 Parameters:
    1190  curve - [in] curve to trim (not modified)
    1191  trim_parameters - [in] trimming parameters
    1192  If curve is open, then trim_parameters must be an increasing
    1193  interval.If curve is closed, and trim_parameters ins a
    1194  decreasing interval, then the portion of the curve across the
    1195  start/end is returned.
    1196 Returns:
    1197  trimmed curve or nullptr if input is invalid.
    1198 */
    1199 ON_DECL
    1200 ON_Curve* ON_TrimCurve(
    1201  const ON_Curve& curve,
    1202  ON_Interval trim_parameters
    1203  );
    1204 
    1205 /*
    1206 Description:
    1207  Move ends of curves to a common point. Neither curve can be closed or an ON_CurveProxy.
    1208  If one is an arc or polycurve with arc at end to change, and the other is not,
    1209  then the arc is left unchanged and the other curve is moved to the arc endpoint.
    1210  Otherwise, both are moved to the midpoint of the segment between the ends.
    1211 Parameters:
    1212  Crv0 - [in] first curve to modify.
    1213  [out] with one endpoint possibly changed.
    1214  end0 - [in] if 0, change start of Crv0. Otherwise change end.
    1215  Crv1 - [in] second curve to modify.
    1216  [out] with one endpoint possibly changed.
    1217  end1 - [in] if 0, change start of Crv1. Otherwise change end.
    1218 Returns:
    1219  true if the endpoints match. Falsse otherwise,
    1220 */
    1221 ON_DECL
    1222 bool ON_ForceMatchCurveEnds(
    1223  ON_Curve& Crv0,
    1224  int end0,
    1225  ON_Curve& Crv1,
    1226  int end1
    1227  );
    1228 
    1229 /*
    1230 OBSOLETE. Use int ON_JoinCurves(const ON_SimpleArray<const ON_Curve*>& InCurves,
    1231  ON_SimpleArray<ON_Curve*>& OutCurves,
    1232  double join_tol,
    1233  double kink_tol,
    1234  bool bPreserveDirection = false,
    1235  ON_SimpleArray<int>* key = 0
    1236  );
    1237 
    1238 Description:
    1239  Join all contiguous curves of an array of ON_Curves.
    1240 Parameters:
    1241  InCurves - [in] Array of curves to be joined (not modified)
    1242  OutCurves - [out] Resulting joined curves and copies of curves that were not joined to anything
    1243  are appended.
    1244  join_tol - [in] Distance tolerance used to decide if endpoints are close enough
    1245  bPreserveDirection - [in] If true, curve endpoints will be compared to curve startpoints.
    1246  If false, all start and endpoints will be compared, and copies of input
    1247  curves may be reversed in output.
    1248  key - [out] if key is not null, InCurves[i] was joined into OutCurves[key[i]].
    1249 Returns:
    1250  Number of curves added to Outcurves
    1251 Remarks:
    1252  Closed curves are copied to OutCurves.
    1253  Curves that cannot be joined to others are copied to OutCurves. When curves are joined, the results
    1254  are ON_PolyCurves. All members of InCurves must have same dimension, at most 3.
    1255  */
    1256 ON_DECL
    1257 int ON_JoinCurves(const ON_SimpleArray<const ON_Curve*>& InCurves,
    1258  ON_SimpleArray<ON_Curve*>& OutCurves,
    1259  double join_tol,
    1260  bool bPreserveDirection = false,
    1261  ON_SimpleArray<int>* key = 0
    1262  );
    1263 
    1264 /*
    1265 Description:
    1266  Join all contiguous curves of an array of ON_Curves.
    1267 Parameters:
    1268  InCurves - [in] Array of curves to be joined (not modified)
    1269  OutCurves - [out] Resulting joined curves and copies of curves that were not joined to anything
    1270  are appended.
    1271  join_tol - [in] Distance tolerance used to decide if endpoints are close enough
    1272  kink_tol - [in] Angle in radians. If > 0.0, then curves within join_tol will only be joined if the angle between them
    1273  is less than kink_tol. If <= 0, then the angle will be ignored and only join_tol will be used.
    1274  bUseTanAngle - [in] If true, choose the best match using angle between tangents.
    1275  If false, best match is the closest. This is used whether or not kink_tol is positive.
    1276  bPreserveDirection - [in] If true, curve endpoints will be compared to curve startpoints.
    1277  If false, all start and endpoints will be compared, and copies of input
    1278  curves may be reversed in output.
    1279  key - [out] if key is not null, InCurves[i] was joined into OutCurves[key[i]].
    1280 Returns:
    1281  Number of curves added to Outcurves
    1282 Remarks:
    1283  Closed curves are copied to OutCurves.
    1284  Curves that cannot be joined to others are copied to OutCurves. When curves are joined, the results
    1285  are ON_PolyCurves. All members of InCurves must have same dimension, at most 3.
    1286  */
    1287 ON_DECL
    1288 int ON_JoinCurves(const ON_SimpleArray<const ON_Curve*>& InCurves,
    1289  ON_SimpleArray<ON_Curve*>& OutCurves,
    1290  double join_tol,
    1291  double kink_tol,
    1292  bool bUseTanAngle,
    1293  bool bPreserveDirection = false,
    1294  ON_SimpleArray<int>* key = 0
    1295  );
    1296 
    1297 
    1298 /*
    1299 Description:
    1300  Sort a list of lines so they are geometrically continuous.
    1301 Parameters:
    1302  line_count - [in] number of lines
    1303  line_list - [in] array of lines
    1304  index - [out] The input index[] is an array of line_count unused integers.
    1305  The returned index[] is a permutation of {0,1,...,line_count-1}
    1306  so that the list of lines is in end-to-end order.
    1307  bReverse - [out] The input bReverse[] is an array of line_count unused bools.
    1308  If the returned value of bReverse[j] is true, then
    1309  line_list[index[j]] needs to be reversed.
    1310 Returns:
    1311  True if successful, false if not.
    1312 */
    1313 ON_DECL
    1314 bool ON_SortLines(
    1315  int line_count,
    1316  const ON_Line* line_list,
    1317  int* index,
    1318  bool* bReverse
    1319  );
    1320 
    1321 /*
    1322 Description:
    1323  Sort a list of lines so they are geometrically continuous.
    1324 Parameters:
    1325  line_list - [in] array of lines
    1326  index - [out] The input index[] is an array of line_count unused integers.
    1327  The returned index[] is a permutation of {0,1,...,line_count-1}
    1328  so that the list of lines is in end-to-end order.
    1329  bReverse - [out] The input bReverse[] is an array of line_count unused bools.
    1330  If the returned value of bReverse[j] is true, then
    1331  line_list[index[j]] needs to be reversed.
    1332 Returns:
    1333  True if successful, false if not.
    1334 */
    1335 ON_DECL
    1336 bool ON_SortLines(
    1337  const ON_SimpleArray<ON_Line>& line_list,
    1338  int* index,
    1339  bool* bReverse
    1340  );
    1341 
    1342 /*
    1343 Description:
    1344  Sort a list of open curves so end of a curve matches the start of the next curve.
    1345 Parameters:
    1346  curve_count - [in] number of curves
    1347  curve_list - [in] array of curve pointers
    1348  index - [out] The input index[] is an array of curve_count unused integers.
    1349  The returned index[] is a permutation of {0,1,...,curve_count-1}
    1350  so that the list of curves is in end-to-end order.
    1351  bReverse - [out] The input bReverse[] is an array of curve_count unused bools.
    1352  If the returned value of bReverse[j] is true, then
    1353  curve_list[index[j]] needs to be reversed.
    1354 Returns:
    1355  True if successful, false if not.
    1356 */
    1357 ON_DECL
    1358 bool ON_SortCurves(
    1359  int curve_count,
    1360  const ON_Curve* const* curve_list,
    1361  int* index,
    1362  bool* bReverse
    1363  );
    1364 
    1365 /*
    1366 Description:
    1367  Sort a list of curves so end of a curve matches the start of the next curve.
    1368 Parameters:
    1369  curve - [in] array of curves to sort. The curves themselves are not modified.
    1370  index - [out] The input index[] is an array of curve_count unused integers.
    1371  The returned index[] is a permutation of {0,1,...,curve_count-1}
    1372  so that the list of curves is in end-to-end order.
    1373  bReverse - [out] The input bReverse[] is an array of curve_count unused bools.
    1374  If the returned value of bReverse[j] is true, then
    1375  curve[index[j]] needs to be reversed.
    1376 Returns:
    1377  True if successful, false if not.
    1378 */
    1379 ON_DECL
    1380 bool ON_SortCurves(
    1381  const ON_SimpleArray<const ON_Curve*>& curves,
    1382  ON_SimpleArray<int>& index,
    1383  ON_SimpleArray<bool>& bReverse
    1384  );
    1385 
    1386 /*
    1387 Description:
    1388  Sort a list of curves so end of a curve matches the start of the next curve.
    1389 Parameters:
    1390  curve_count - [in] number of curves
    1391  curve - [in] array of curve pointers
    1392  index - [out] The input index[] is an array of curve_count unused integers.
    1393  The returned index[] is a permutation of {0,1,...,curve_count-1}
    1394  so that the list of curves is in end-to-end order.
    1395  bReverse - [out] The input bReverse[] is an array of curve_count unused bools.
    1396  If the returned value of bReverse[j] is true, then
    1397  curve[index[j]] needs to be reversed.
    1398 Returns:
    1399  True if successful, false if not.
    1400 */
    1401 ON_DECL
    1402 bool ON_SortCurves(
    1403  const ON_SimpleArray<ON_Curve*>& curves,
    1404  ON_SimpleArray<int>& index,
    1405  ON_SimpleArray<bool>& bReverse
    1406  );
    1407 
    1408 /*
    1409 Description:
    1410  Determine the orientaion (counterclockwise or clockwise) of a closed
    1411  planar curve.
    1412 Paramters:
    1413  curve - [in] simple (no self intersections) closed planar curve
    1414  xform - [in] Transformation to map the curve to the xy plane. If the
    1415  curve is parallel to the xy plane, you may pass nullptr.
    1416 Returns:
    1417  +1: The curve's orientation is counter clockwise in the xy plane.
    1418  -1: The curve's orientation is clockwise in the xy plane.
    1419  0: Unable to compute the curve's orientation.
    1420 */
    1421 ON_DECL
    1422 int ON_ClosedCurveOrientation( const ON_Curve& curve, const ON_Xform* xform );
    1423 
    1424 
    1425 /*
    1426 Description:
    1427  Get a crude aproximation of the signed area of the region in the
    1428  x-y plane traced out by the curve. This is useful for calculating
    1429  the orientation of projections of loops to planes when you have
    1430  more than one curve.
    1431 Paramters:
    1432  curve - [in]
    1433  domain - [in]
    1434  optional sub-domain. (null if entire curve should be used).
    1435  xform - [in] Transformation to map the curve to the xy plane. If the
    1436  curve is parallel to the xy plane, you may pass nullptr.
    1437  bReverseCurve - [in]
    1438 Returns:
    1439  1/2 the sum of (p[i].x-p[i+1].x)*(p[i].y+p[i+1].y), where p[i]
    1440  is a series of sampled points on the curve.
    1441 */
    1442 ON_DECL
    1443 double ON_CurveOrientationArea(
    1444  const ON_Curve* curve,
    1445  const ON_Interval* domain,
    1446  const ON_Xform* xform,
    1447  bool bReverseCurve
    1448  );
    1449 
    1450 #endif
    virtual bool Transform(const ON_Xform &xform)
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // Definition of virtual parametric curve
    20 //
    21 ////////////////////////////////////////////////////////////////
    22 
    23 #if !defined(OPENNURBS_CURVE_INC_)
    24 #define OPENNURBS_CURVE_INC_
    25 
    26 ////////////////////////////////////////////////////////////////
    27 ////////////////////////////////////////////////////////////////
    28 
    29 class ON_CLASS ON_MeshCurveParameters
    30 {
    31 public:
    33 
    34  // If main_seg_count <= 0, then both these parameters are ignored.
    35  // If main_seg_count > 0, then sub_seg_count must be >= 1. In this
    36  // case the curve will be broken into main_seg_count equally spaced
    37  // chords. If needed, each of these chords can be split into as many
    38  // sub_seg_count sub-parts if the subdivision is necessary for the
    39  // mesh to meet the other meshing constraints. In particular, if
    40  // sub_seg_count = 0, then the curve is broken into main_seg_count
    41  // pieces and no further testing is performed.
    44 
    47 
    48  // Maximum angle (in radians) between unit tangents at adjacent
    49  // vertices.
    51 
    52  // Maximum permitted value of
    53  // distance chord midpoint to curve) / (length of chord)
    54  double m_max_chr;
    55 
    56  // If max_aspect < 1.0, the parameter is ignored.
    57  // If 1 <= max_aspect < sqrt(2), it is treated as if
    58  // max_aspect = sqrt(2).
    59  // This parameter controls the maximum permitted value of
    60  // (length of longest chord) / (length of shortest chord)
    61  double m_max_aspect;
    62 
    63  // If tolerance = 0, the parameter is ignored.
    64  // This parameter controls the maximum permitted value of the
    65  // distance from the curve to the mesh.
    66  double m_tolerance;
    67 
    68  // If m_min_edge_length = 0, the parameter is ignored.
    69  // This parameter controls the minimum permitted edge length.
    71 
    72  // If max_edge_length = 0, the parameter is ignored.
    73  // This parameter controls the maximum permitted edge length.
    75 
    76  double m_reserved3;
    77  double m_reserved4;
    78 };
    79 
    80 /*
    81 Description:
    82  ON_Curve is a pure virtual class for curve objects
    83  - Any class derived from ON_Curve should have a
    84  ON_OBJECT_DECLARE(ON_...);
    85  at the beginning of its class definition and a
    86  ON_OBJECT_IMPLEMENT( ON_..., ON_Curve );
    87  in a .cpp file.
    88 Example:
    89  - See the definition of ON_NurbsCurve for an example.
    90 */
    91 class ON_CLASS ON_Curve : public ON_Geometry
    92 {
    93  ON_OBJECT_DECLARE(ON_Curve);
    94 
    95 public:
    96  ON_Curve() ON_NOEXCEPT;
    97  virtual ~ON_Curve();
    98  ON_Curve(const ON_Curve&);
    99  ON_Curve& operator=(const ON_Curve&);
    100 
    101 #if defined(ON_HAS_RVALUEREF)
    102  // rvalue copy constructor
    103  ON_Curve( ON_Curve&& ) ON_NOEXCEPT;
    104 
    105  // The rvalue assignment operator calls ON_Object::operator=(ON_Object&&)
    106  // which could throw exceptions. See the implementation of
    107  // ON_Object::operator=(ON_Object&&) for details.
    109 #endif
    110 
    111 public:
    112  // virtual ON_Object::DestroyRuntimeCache override
    113  void DestroyRuntimeCache( bool bDelete = true ) override;
    114 
    115  // virtual ON_Object::SizeOf override
    116  unsigned int SizeOf() const override;
    117 
    118  // virtual ON_Geometry override
    119  bool EvaluatePoint( const class ON_ObjRef& objref, ON_3dPoint& P ) const override;
    120 
    121  /*
    122  Description:
    123  Get a duplicate of the curve.
    124  Returns:
    125  A duplicate of the curve.
    126  Remarks:
    127  The caller must delete the returned curve.
    128  For non-ON_CurveProxy objects, this simply duplicates the curve using
    129  ON_Object::Duplicate.
    130  For ON_CurveProxy objects, this duplicates the actual proxy curve
    131  geometry and, if necessary, trims and reverse the result to that
    132  the returned curve's parameterization and locus match the proxy curve's.
    133  */
    134  virtual
    135  ON_Curve* DuplicateCurve() const;
    136 
    137  // Description:
    138  // overrides virtual ON_Object::ObjectType.
    139  // Returns:
    140  // ON::curve_object
    141  ON::object_type ObjectType() const override;
    142 
    143  // virtual ON_Geometry GetTightBoundingBox override
    144  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    145 
    146  /*
    147  Description:
    148  overrides virtual ON_Geometry::Transform().
    149  ON_Curve::Transform() calls ON_Geometry::Transform(xform),
    150  which calls ON_Object::TransformUserData(xform), and then
    151  calls this->DestroyCurveTree().
    152  Parameters:
    153  xform - [in] transformation to apply to object.
    154  Remarks:
    155  Classes derived from ON_Curve should call
    156  ON_Curve::Transform() to handle user data
    157  transformations and curve tree destruction
    158  and then transform their definition.
    159  */
    160  bool Transform(
    161  const ON_Xform& xform
    162  ) override;
    163 
    164 
    165  ////////////////////////////////////////////////////////////////////
    166  // curve interface
    167 
    168  // Description:
    169  // Gets domain of the curve
    170  // Parameters:
    171  // t0 - [out]
    172  // t1 - [out] domain is [*t0, *t1]
    173  // Returns:
    174  // true if successful.
    175  bool GetDomain( double* t0, double* t1 ) const;
    176 
    177  // Returns:
    178  // domain of the curve.
    179  virtual
    180  ON_Interval Domain() const = 0;
    181 
    182  /*
    183  Description:
    184  Set the domain of the curve.
    185  Parameters:
    186  domain - [in] increasing interval
    187  Returns:
    188  true if successful.
    189  */
    190  bool SetDomain( ON_Interval domain );
    191 
    192  // Description:
    193  // Set the domain of the curve
    194  // Parameters:
    195  // t0 - [in]
    196  // t1 - [in] new domain will be [t0,t1]
    197  // Returns:
    198  // true if successful.
    199  virtual
    200  bool SetDomain(
    201  double t0,
    202  double t1
    203  );
    204 
    205 
    206  /*
    207  Description:
    208  If this curve is closed, then modify it so that
    209  the start/end point is at curve parameter t.
    210  Parameters:
    211  t - [in] curve parameter of new start/end point. The
    212  returned curves domain will start at t.
    213  Returns:
    214  true if successful.
    215  */
    216  virtual
    217  bool ChangeClosedCurveSeam(
    218  double t
    219  );
    220 
    221  /*
    222  Description:
    223  Change the dimension of a curve.
    224  Parameters:
    225  desired_dimension - [in]
    226  Returns:
    227  true if the curve's dimension was already desired_dimension
    228  or if the curve's dimension was successfully changed to
    229  desired_dimension.
    230  */
    231  virtual
    232  bool ChangeDimension(
    233  int desired_dimension
    234  );
    235 
    236 
    237  // Description:
    238  // Get number of nonempty smooth (c-infinity) spans in curve
    239  // Returns:
    240  // Number of nonempty smooth (c-infinity) spans.
    241  virtual
    242  int SpanCount() const = 0;
    243 
    244  // Description:
    245  // Get number of parameters of "knots".
    246  // Parameters:
    247  // knots - [out] an array of length SpanCount()+1 is filled in
    248  // with the parameters where the curve is not smooth (C-infinity).
    249  // Returns:
    250  // true if successful
    251  virtual
    252  bool GetSpanVector(
    253  double* knots
    254  ) const = 0; //
    255 
    256  //////////
    257  // If t is in the domain of the curve, GetSpanVectorIndex() returns the
    258  // span vector index "i" such that span_vector[i] <= t <= span_vector[i+1].
    259  // The "side" parameter determines which span is selected when t is at the
    260  // end of a span.
    261  virtual
    262  bool GetSpanVectorIndex(
    263  double t , // [IN] t = evaluation parameter
    264  int side, // [IN] side 0 = default, -1 = from below, +1 = from above
    265  int* span_vector_index, // [OUT] span vector index
    266  ON_Interval* span_domain // [OUT] domain of the span containing "t"
    267  ) const;
    268 
    269  // Description:
    270  // Returns maximum algebraic degree of any span
    271  // or a good estimate if curve spans are not algebraic.
    272  // Returns:
    273  // degree
    274  virtual
    275  int Degree() const = 0;
    276 
    277  // Description:
    278  // Returns maximum algebraic degree of any span
    279  // or a good estimate if curve spans are not algebraic.
    280  // Returns:
    281  // degree
    282  virtual
    283  bool GetParameterTolerance( // returns tminus < tplus: parameters tminus <= s <= tplus
    284  double t, // [IN] t = parameter in domain
    285  double* tminus, // [OUT] tminus
    286  double* tplus // [OUT] tplus
    287  ) const;
    288 
    289  // Description:
    290  // Test a curve to see if the locus if its points is a line segment.
    291  // Parameters:
    292  // tolerance - [in] // tolerance to use when checking linearity
    293  // Returns:
    294  // true if the ends of the curve are farther than tolerance apart
    295  // and the maximum distance from any point on the curve to
    296  // the line segment connecting the curve's ends is <= tolerance.
    297  virtual
    298  bool IsLinear(
    299  double tolerance = ON_ZERO_TOLERANCE
    300  ) const;
    301 
    302  /*
    303  Description:
    304  Several types of ON_Curve can have the form of a polyline including
    305  a degree 1 ON_NurbsCurve, an ON_PolylineCurve, and an ON_PolyCurve
    306  all of whose segments are some form of polyline. IsPolyline tests
    307  a curve to see if it can be represented as a polyline.
    308  Parameters:
    309  pline_points - [out] if not nullptr and true is returned, then the
    310  points of the polyline form are returned here.
    311  t - [out] if not nullptr and true is returned, then the parameters of
    312  the polyline points are returned here.
    313  Returns:
    314  @untitled table
    315  0 curve is not some form of a polyline
    316  >=2 number of points in polyline form
    317  */
    318  virtual
    319  int IsPolyline(
    320  ON_SimpleArray<ON_3dPoint>* pline_points = nullptr,
    321  ON_SimpleArray<double>* pline_t = nullptr
    322  ) const;
    323 
    324  // Description:
    325  // Test a curve to see if the locus if its points is an arc or circle.
    326  // Parameters:
    327  // plane - [in] if not nullptr, test is performed in this plane
    328  // arc - [out] if not nullptr and true is returned, then arc parameters
    329  // are filled in
    330  // tolerance - [in] tolerance to use when checking
    331  // Returns:
    332  // ON_Arc.m_angle > 0 if curve locus is an arc between
    333  // specified points. If ON_Arc.m_angle is 2.0*ON_PI, then the curve
    334  // is a circle.
    335  virtual
    336  bool IsArc(
    337  const ON_Plane* plane = nullptr,
    338  ON_Arc* arc = nullptr,
    339  double tolerance = ON_ZERO_TOLERANCE
    340  ) const;
    341 
    342  /*
    343  Description:
    344  Parameters:
    345  t - [in] curve parameter
    346  plane - [in]
    347  if not nullptr, test is performed in this plane
    348  arc - [out]
    349  if not nullptr and true is returned, then arc parameters
    350  are filled in
    351  tolerance - [in]
    352  tolerance to use when checking
    353  t0 - [out]
    354  if not nullptr, and then *t0 is set to the parameter
    355  at the start of the G2 curve segment that was
    356  tested.
    357  t1 - [out]
    358  if not nullptr, and then *t0 is set to the parameter
    359  at the start of the G2 curve segment that was
    360  tested.
    361  Returns:
    362  True if the paramter t is on a arc segment of the curve.
    363  */
    364  bool IsArcAt(
    365  double t,
    366  const ON_Plane* plane = 0,
    367  ON_Arc* arc = 0,
    368  double tolerance = ON_ZERO_TOLERANCE,
    369  double* t0 = 0,
    370  double* t1 = 0
    371  ) const;
    372 
    373  virtual
    374  bool IsEllipse(
    375  const ON_Plane* plane = nullptr,
    376  ON_Ellipse* ellipse = nullptr,
    377  double tolerance = ON_ZERO_TOLERANCE
    378  ) const;
    379 
    380  // Description:
    381  // Test a curve to see if it is planar.
    382  // Parameters:
    383  // plane - [out] if not nullptr and true is returned,
    384  // the plane parameters are filled in.
    385  // tolerance - [in] tolerance to use when checking
    386  // Returns:
    387  // true if there is a plane such that the maximum distance from
    388  // the curve to the plane is <= tolerance.
    389  virtual
    390  bool IsPlanar(
    391  ON_Plane* plane = nullptr,
    392  double tolerance = ON_ZERO_TOLERANCE
    393  ) const;
    394 
    395  // Description:
    396  // Test a curve to see if it lies in a specific plane.
    397  // Parameters:
    398  // test_plane - [in]
    399  // tolerance - [in] tolerance to use when checking
    400  // Returns:
    401  // true if the maximum distance from the curve to the
    402  // test_plane is <= tolerance.
    403  virtual
    404  bool IsInPlane(
    405  const ON_Plane& test_plane,
    406  double tolerance = ON_ZERO_TOLERANCE
    407  ) const = 0;
    408 
    409  /*
    410  Description:
    411  Decide if it makes sense to close off this curve by moving
    412  the endpoint to the start based on start-end gap size and length
    413  of curve as approximated by chord defined by 6 points.
    414  Parameters:
    415  tolerance - [in] maximum allowable distance between start and end.
    416  if start - end gap is greater than tolerance, returns false
    417  min_abs_size - [in] if greater than 0.0 and none of the interior sampled
    418  points are at least min_abs_size from start, returns false.
    419  min_rel_size - [in] if greater than 1.0 and chord length is less than
    420  min_rel_size*gap, returns false.
    421  Returns:
    422  true if start and end points are close enough based on above conditions.
    423  */
    424 
    425  bool IsClosable(
    426  double tolerance,
    427  double min_abs_size = 0.0,
    428  double min_rel_size = 10.0
    429  ) const;
    430 
    431  // Description:
    432  // Test a curve to see if it is closed.
    433  // Returns:
    434  // true if the curve is closed.
    435  virtual
    436  bool IsClosed() const;
    437 
    438  // Description:
    439  // Test a curve to see if it is periodic.
    440  // Returns:
    441  // true if the curve is closed and at least C2 at the start/end.
    442  virtual
    443  bool IsPeriodic() const;
    444 
    445  /*
    446  Description:
    447  Search for a derivatitive, tangent, or curvature
    448  discontinuity.
    449  Parameters:
    450  c - [in] type of continity to test for.
    451  t0 - [in] Search begins at t0. If there is a discontinuity
    452  at t0, it will be ignored. This makes it
    453  possible to repeatedly call GetNextDiscontinuity
    454  and step through the discontinuities.
    455  t1 - [in] (t0 != t1) If there is a discontinuity at t1 is
    456  will be ingored unless c is a locus discontinuity
    457  type and t1 is at the start or end of the curve.
    458  t - [out] if a discontinuity is found, then *t reports the
    459  parameter at the discontinuity.
    460  hint - [in/out] if GetNextDiscontinuity will be called
    461  repeatedly, passing a "hint" with initial value *hint=0
    462  will increase the speed of the search.
    463  dtype - [out] if not nullptr, *dtype reports the kind of
    464  discontinuity found at *t. A value of 1 means the first
    465  derivative or unit tangent was discontinuous. A value
    466  of 2 means the second derivative or curvature was
    467  discontinuous. A value of 0 means teh curve is not
    468  closed, a locus discontinuity test was applied, and
    469  t1 is at the start of end of the curve.
    470  If 'c', the type of continuity to test for
    471  is ON::continuity::Gsmooth_continuous and the curvature changes
    472  from curved to 0 or 0 to curved and there is no
    473  tangency kink dtype is returns 3
    474  cos_angle_tolerance - [in] default = cos(1 degree) Used only
    475  when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the
    476  cosine of the angle between two tangent vectors is
    477  <= cos_angle_tolerance, then a G1 discontinuity is reported.
    478  curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used
    479  only when c is ON::continuity::G2_continuous. If K0 and K1 are
    480  curvatures evaluated from above and below and
    481  |K0 - K1| > curvature_tolerance, then a curvature
    482  discontinuity is reported.
    483  Returns:
    484  Parametric continuity tests c = (C0_continuous, ..., G2_continuous):
    485 
    486  true if a parametric discontinuity was found strictly
    487  between t0 and t1. Note well that all curves are
    488  parametrically continuous at the ends of their domains.
    489 
    490  Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous):
    491 
    492  true if a locus discontinuity was found strictly between
    493  t0 and t1 or at t1 is the at the end of a curve.
    494  Note well that all open curves (IsClosed()=false) are locus
    495  discontinuous at the ends of their domains. All closed
    496  curves (IsClosed()=true) are at least C0_locus_continuous at
    497  the ends of their domains.
    498  */
    499  virtual
    500  bool GetNextDiscontinuity(
    501  ON::continuity c,
    502  double t0,
    503  double t1,
    504  double* t,
    505  int* hint=nullptr,
    506  int* dtype=nullptr,
    507  double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE,
    508  double curvature_tolerance=ON_SQRT_EPSILON
    509  ) const;
    510 
    511  /*
    512  Description:
    513  Test continuity at a curve parameter value.
    514  Parameters:
    515  c - [in] type of continuity to test for. Read ON::continuity
    516  comments for details.
    517  t - [in] parameter to test
    518  hint - [in] evaluation hint
    519  point_tolerance - [in] if the distance between two points is
    520  greater than point_tolerance, then the curve is not C0.
    521  d1_tolerance - [in] if the difference between two first derivatives is
    522  greater than d1_tolerance, then the curve is not C1.
    523  d2_tolerance - [in] if the difference between two second derivatives is
    524  greater than d2_tolerance, then the curve is not C2.
    525  cos_angle_tolerance - [in] default = cos(1 degree) Used only when
    526  c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine
    527  of the angle between two tangent vectors
    528  is <= cos_angle_tolerance, then a G1 discontinuity is reported.
    529  curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when
    530  c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous.
    531  ON::continuity::G2_continuous:
    532  If K0 and K1 are curvatures evaluated
    533  from above and below and |K0 - K1| > curvature_tolerance,
    534  then a curvature discontinuity is reported.
    535  ON::continuity::Gsmooth_continuous:
    536  If K0 and K1 are curvatures evaluated from above and below
    537  and the angle between K0 and K1 is at least twice angle tolerance
    538  or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance,
    539  then a curvature discontinuity is reported.
    540  Returns:
    541  true if the curve has at least the c type continuity at
    542  the parameter t.
    543  */
    544  virtual
    545  bool IsContinuous(
    546  ON::continuity c,
    547  double t,
    548  int* hint = nullptr,
    549  double point_tolerance=ON_ZERO_TOLERANCE,
    550  double d1_tolerance=ON_ZERO_TOLERANCE,
    551  double d2_tolerance=ON_ZERO_TOLERANCE,
    552  double cos_angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE_COSINE,
    553  double curvature_tolerance=ON_SQRT_EPSILON
    554  ) const;
    555 
    556 
    557  // Description:
    558  // Reverse the direction of the curve.
    559  // Returns:
    560  // true if curve was reversed.
    561  // Remarks:
    562  // If reveresed, the domain changes from [a,b] to [-b,-a]
    563  virtual
    564  bool Reverse()=0;
    565 
    566 
    567  /*
    568  Description:
    569  Force the curve to start at a specified point.
    570  Parameters:
    571  start_point - [in]
    572  Returns:
    573  true if successful.
    574  Remarks:
    575  Some end points cannot be moved. Be sure to check return
    576  code.
    577  ON_Curve::SetStartPoint() returns true if start_point is the same as the start of the curve,
    578  false otherwise.
    579  See Also:
    580  ON_Curve::SetEndPoint
    581  ON_Curve::PointAtStart
    582  ON_Curve::PointAtEnd
    583  */
    584  virtual
    585  bool SetStartPoint(
    586  ON_3dPoint start_point
    587  );
    588 
    589  /*
    590  Description:
    591  Force the curve to end at a specified point.
    592  Parameters:
    593  end_point - [in]
    594  Returns:
    595  true if successful.
    596  Remarks:
    597  Some end points cannot be moved. Be sure to check return
    598  code.
    599  ON_Curve::SetEndPoint() returns true if end_point is the same as the end of the curve,
    600  false otherwise.
    601  See Also:
    602  ON_Curve::SetStartPoint
    603  ON_Curve::PointAtStart
    604  ON_Curve::PointAtEnd
    605  */
    606  virtual
    607  bool SetEndPoint(
    608  ON_3dPoint end_point
    609  );
    610 
    611  // Description:
    612  // Evaluate point at a parameter.
    613  // Parameters:
    614  // t - [in] evaluation parameter
    615  // Returns:
    616  // Point (location of curve at the parameter t).
    617  // Remarks:
    618  // No error handling.
    619  // See Also:
    620  // ON_Curve::EvPoint
    621  // ON_Curve::PointAtStart
    622  // ON_Curve::PointAtEnd
    623  ON_3dPoint PointAt(
    624  double t
    625  ) const;
    626 
    627  // Description:
    628  // Evaluate point at the start of the curve.
    629  // Parameters:
    630  // t - [in] evaluation parameter
    631  // Returns:
    632  // Point (location of the start of the curve.)
    633  // Remarks:
    634  // No error handling.
    635  // See Also:
    636  // ON_Curve::PointAt
    637  ON_3dPoint PointAtStart() const;
    638 
    639  // Description:
    640  // Evaluate point at the end of the curve.
    641  // Parameters:
    642  // t - [in] evaluation parameter
    643  // Returns:
    644  // Point (location of the end of the curve.)
    645  // Remarks:
    646  // No error handling.
    647  // See Also:
    648  // ON_Curve::PointAt
    649  ON_3dPoint PointAtEnd() const;
    650 
    651  // Description:
    652  // Evaluate first derivative at a parameter.
    653  // Parameters:
    654  // t - [in] evaluation parameter
    655  // Returns:
    656  // First derivative of the curve at the parameter t.
    657  // Remarks:
    658  // No error handling.
    659  // See Also:
    660  // ON_Curve::Ev1Der
    661  ON_3dVector DerivativeAt(
    662  double t
    663  ) const;
    664 
    665  // Description:
    666  // Evaluate unit tangent vector at a parameter.
    667  // Parameters:
    668  // t - [in] evaluation parameter
    669  // Returns:
    670  // Unit tangent vector of the curve at the parameter t.
    671  // Remarks:
    672  // No error handling.
    673  // See Also:
    674  // ON_Curve::EvTangent
    675  ON_3dVector TangentAt(
    676  double t
    677  ) const;
    678 
    679  // Description:
    680  // Evaluate the curvature vector at a parameter.
    681  // Parameters:
    682  // t - [in] evaluation parameter
    683  // Returns:
    684  // curvature vector of the curve at the parameter t.
    685  // Remarks:
    686  // No error handling.
    687  // See Also:
    688  // ON_Curve::EvCurvature
    689  ON_3dVector CurvatureAt(
    690  double t
    691  ) const;
    692 
    693  // Description:
    694  // Return a 3d frame at a parameter.
    695  // Parameters:
    696  // t - [in] evaluation parameter
    697  // plane - [out] the frame is returned here
    698  // Returns:
    699  // true if successful
    700  // See Also:
    701  // ON_Curve::PointAt, ON_Curve::TangentAt,
    702  // ON_Curve::Ev1Der, Ev2Der
    703  bool FrameAt( double t, ON_Plane& plane) const;
    704 
    705  // Description:
    706  // Evaluate point at a parameter with error checking.
    707  // Parameters:
    708  // t - [in] evaluation parameter
    709  // point - [out] value of curve at t
    710  // side - [in] optional - determines which side to evaluate from
    711  // =0 default
    712  // <0 to evaluate from below,
    713  // >0 to evaluate from above
    714  // hint - [in/out] optional evaluation hint used to speed repeated evaluations
    715  // Returns:
    716  // false if unable to evaluate.
    717  // See Also:
    718  // ON_Curve::PointAt
    719  // ON_Curve::EvTangent
    720  // ON_Curve::Evaluate
    721  bool EvPoint(
    722  double t,
    723  ON_3dPoint& point,
    724  int side = 0,
    725  int* hint = 0
    726  ) const;
    727 
    728  // Description:
    729  // Evaluate first derivative at a parameter with error checking.
    730  // Parameters:
    731  // t - [in] evaluation parameter
    732  // point - [out] value of curve at t
    733  // first_derivative - [out] value of first derivative at t
    734  // side - [in] optional - determines which side to evaluate from
    735  // =0 default
    736  // <0 to evaluate from below,
    737  // >0 to evaluate from above
    738  // hint - [in/out] optional evaluation hint used to speed repeated evaluations
    739  // Returns:
    740  // false if unable to evaluate.
    741  // See Also:
    742  // ON_Curve::EvPoint
    743  // ON_Curve::Ev2Der
    744  // ON_Curve::EvTangent
    745  // ON_Curve::Evaluate
    746  bool Ev1Der(
    747  double t,
    748  ON_3dPoint& point,
    749  ON_3dVector& first_derivative,
    750  int side = 0,
    751  int* hint = 0
    752  ) const;
    753 
    754  // Description:
    755  // Evaluate second derivative at a parameter with error checking.
    756  // Parameters:
    757  // t - [in] evaluation parameter
    758  // point - [out] value of curve at t
    759  // first_derivative - [out] value of first derivative at t
    760  // second_derivative - [out] value of second derivative at t
    761  // side - [in] optional - determines which side to evaluate from
    762  // =0 default
    763  // <0 to evaluate from below,
    764  // >0 to evaluate from above
    765  // hint - [in/out] optional evaluation hint used to speed repeated evaluations
    766  // Returns:
    767  // false if unable to evaluate.
    768  // See Also:
    769  // ON_Curve::Ev1Der
    770  // ON_Curve::EvCurvature
    771  // ON_Curve::Evaluate
    772  bool Ev2Der(
    773  double t,
    774  ON_3dPoint& point,
    775  ON_3dVector& first_derivative,
    776  ON_3dVector& second_derivative,
    777  int side = 0,
    778  int* hint = 0
    779  ) const;
    780 
    781  /*
    782  Description:
    783  Evaluate unit tangent at a parameter with error checking.
    784  Parameters:
    785  t - [in] evaluation parameter
    786  point - [out] value of curve at t
    787  tangent - [out] value of unit tangent
    788  side - [in] optional - determines which side to evaluate from
    789  =0 default
    790  <0 to evaluate from below,
    791  >0 to evaluate from above
    792  hint - [in/out] optional evaluation hint used to speed repeated evaluations
    793  Returns:
    794  false if unable to evaluate.
    795  See Also:
    796  ON_Curve::TangentAt
    797  ON_Curve::Ev1Der
    798  */
    799  bool EvTangent(
    800  double t,
    801  ON_3dPoint& point,
    802  ON_3dVector& tangent,
    803  int side = 0,
    804  int* hint = 0
    805  ) const;
    806 
    807  /*
    808  Description:
    809  Evaluate unit tangent and curvature at a parameter with error checking.
    810  Parameters:
    811  t - [in] evaluation parameter
    812  point - [out] value of curve at t
    813  tangent - [out] value of unit tangent
    814  kappa - [out] value of curvature vector
    815  side - [in] optional - determines which side to evaluate from
    816  =0 default
    817  <0 to evaluate from below,
    818  >0 to evaluate from above
    819  hint - [in/out] optional evaluation hint used to speed repeated evaluations
    820  Returns:
    821  false if unable to evaluate.
    822  See Also:
    823  ON_Curve::CurvatureAt
    824  ON_Curve::Ev2Der
    825  ON_EvCurvature
    826  */
    827  bool EvCurvature(
    828  double t,
    829  ON_3dPoint& point,
    830  ON_3dVector& tangent,
    831  ON_3dVector& kappa,
    832  int side = 0,
    833  int* hint = 0
    834  ) const;
    835 
    836  /*
    837  Description:
    838  This evaluator actually does all the work. The other ON_Curve
    839  evaluation tools call this virtual function.
    840  Parameters:
    841  t - [in] evaluation parameter ( usually in Domain() ).
    842  der_count - [in] (>=0) number of derivatives to evaluate
    843  v_stride - [in] (>=Dimension()) stride to use for the v[] array
    844  v - [out] array of length (der_count+1)*v_stride
    845  curve(t) is returned in (v[0],...,v[m_dim-1]),
    846  curve'(t) is retuned in (v[v_stride],...,v[v_stride+m_dim-1]),
    847  curve"(t) is retuned in (v[2*v_stride],...,v[2*v_stride+m_dim-1]),
    848  etc.
    849  side - [in] optional - determines which side to evaluate from
    850  =0 default
    851  <0 to evaluate from below,
    852  >0 to evaluate from above
    853  hint - [in/out] optional evaluation hint used to speed repeated evaluations
    854  Returns:
    855  false if unable to evaluate.
    856  See Also:
    857  ON_Curve::EvPoint
    858  ON_Curve::Ev1Der
    859  ON_Curve::Ev2Der
    860  */
    861  virtual
    862  bool Evaluate(
    863  double t,
    864  int der_count,
    865  int v_stride,
    866  double* v,
    867  int side = 0,
    868  int* hint = 0
    869  ) const = 0;
    870 
    871 
    872 
    873  /*
    874  Parameters:
    875  min_length -[in]
    876  minimum length of a linear span
    877  tolerance -[in]
    878  distance tolerance to use when checking linearity.
    879  Returns
    880  true if the span is a non-degenrate line. This means:
    881  - dimension = 2 or 3
    882  - The length of the the line segment from the span's initial
    883  point to the span's control point is >= min_length.
    884  - The maximum distance from the line segment to the span
    885  is <= tolerance and the span increases monotonically
    886  in the direction of the line segment.
    887  */
    888  bool FirstSpanIsLinear(
    889  double min_length,
    890  double tolerance
    891  ) const;
    892 
    893  bool LastSpanIsLinear(
    894  double min_length,
    895  double tolerance
    896  ) const;
    897 
    898  bool FirstSpanIsLinear(
    899  double min_length,
    900  double tolerance,
    901  ON_Line* span_line
    902  ) const;
    903 
    904  bool LastSpanIsLinear(
    905  double min_length,
    906  double tolerance,
    907  ON_Line* span_line
    908  ) const;
    909 
    910 
    911  // Description:
    912  // Removes portions of the curve outside the specified interval.
    913  // Parameters:
    914  // domain - [in] interval of the curve to keep. Portions of the
    915  // curve before curve(domain[0]) and after curve(domain[1]) are
    916  // removed.
    917  // Returns:
    918  // true if successful.
    919  virtual
    920  bool Trim(
    921  const ON_Interval& domain
    922  );
    923 
    924  // Description:
    925  // Pure virtual function. Default returns false.
    926  // Where possible, analytically extends curve to include domain.
    927  // Parameters:
    928  // domain - [in] if domain is not included in curve domain,
    929  // curve will be extended so that its domain includes domain.
    930  // Will not work if curve is closed. Original curve is identical
    931  // to the restriction of the resulting curve to the original curve domain,
    932  // Returns:
    933  // true if successful.
    934  virtual
    935  bool Extend(
    936  const ON_Interval& domain
    937  );
    938 
    939  /*
    940  Description:
    941  Splits (divides) the curve at the specified parameter.
    942  The parameter must be in the interior of the curve's domain.
    943  The pointers passed to Split must either be nullptr or point to
    944  an ON_Curve object of the same type. If the pointer is nullptr,
    945  then a curve will be created in Split(). You may pass "this"
    946  as left_side or right_side.
    947  Parameters:
    948  t - [in] parameter to split the curve at in the
    949  interval returned by Domain().
    950  left_side - [out] left portion of curve returned here
    951  right_side - [out] right portion of curve returned here
    952  Returns:
    953  true - The curve was split into two pieces.
    954  false - The curve could not be split. For example if the parameter is
    955  too close to an endpoint.
    956 
    957  Example:
    958  For example, if crv were an ON_NurbsCurve, then
    959 
    960  ON_NurbsCurve right_side;
    961  crv.Split( crv.Domain().Mid() &crv, &right_side );
    962 
    963  would split crv at the parametric midpoint, put the left side
    964  in crv, and return the right side in right_side.
    965  */
    966  virtual
    967  bool Split(
    968  double t,
    969  ON_Curve*& left_side,
    970  ON_Curve*& right_side
    971  ) const;
    972 
    973  /*
    974  Description:
    975  Get a NURBS curve representation of this curve.
    976  Parameters:
    977  nurbs_curve - [out] NURBS representation returned here
    978  tolerance - [in] tolerance to use when creating NURBS
    979  representation.
    980  subdomain - [in] if not nullptr, then the NURBS representation
    981  for this portion of the curve is returned.
    982  Returns:
    983  0 unable to create NURBS representation
    984  with desired accuracy.
    985  1 success - returned NURBS parameterization
    986  matches the curve's to wthe desired accuracy
    987  2 success - returned NURBS point locus matches
    988  the curve's to the desired accuracy and the
    989  domain of the NURBS curve is correct. On
    990  However, This curve's parameterization and
    991  the NURBS curve parameterization may not
    992  match to the desired accuracy. This situation
    993  happens when getting NURBS representations of
    994  curves that have a transendental parameterization
    995  like circles
    996  Remarks:
    997  This is a low-level virtual function. If you do not need
    998  the parameterization information provided by the return code,
    999  then ON_Curve::NurbsCurve may be easier to use.
    1000  See Also:
    1001  ON_Curve::NurbsCurve
    1002  */
    1003  virtual
    1004  int GetNurbForm(
    1005  ON_NurbsCurve& nurbs_curve,
    1006  double tolerance = 0.0,
    1007  const ON_Interval* subdomain = nullptr
    1008  ) const;
    1009  /*
    1010  Description:
    1011  Does a NURBS curve representation of this curve.
    1012  Parameters:
    1013  Returns:
    1014  0 unable to create NURBS representation
    1015  with desired accuracy.
    1016  1 success - NURBS parameterization
    1017  matches the curve's to wthe desired accuracy
    1018  2 success - NURBS point locus matches
    1019  the curve's and the
    1020  domain of the NURBS curve is correct.
    1021  However, This curve's parameterization and
    1022  the NURBS curve parameterization may not
    1023  match. This situation
    1024  happens when getting NURBS representations of
    1025  curves that have a transendental parameterization
    1026  like circles
    1027  Remarks:
    1028  This is a low-level virtual function.
    1029  See Also:
    1030  ON_Curve::GetNurbForm
    1031  ON_Curve::NurbsCurve
    1032  */
    1033  virtual
    1034  int HasNurbForm() const;
    1035 
    1036  /*
    1037  Description:
    1038  Get a NURBS curve representation of this curve.
    1039  Parameters:
    1040  pNurbsCurve - [in/out] if not nullptr, this ON_NurbsCurve
    1041  will be used to store the NURBS representation
    1042  of the curve will be returned.
    1043  tolerance - [in] tolerance to use when creating NURBS
    1044  representation.
    1045  subdomain - [in] if not nullptr, then the NURBS representation
    1046  for this portion of the curve is returned.
    1047  Returns:
    1048  nullptr or a NURBS representation of the curve.
    1049  Remarks:
    1050  See ON_Surface::GetNurbForm for important details about
    1051  the NURBS surface parameterization.
    1052  See Also:
    1053  ON_Curve::GetNurbForm
    1054  */
    1055  ON_NurbsCurve* NurbsCurve(
    1056  ON_NurbsCurve* pNurbsCurve = nullptr,
    1057  double tolerance = 0.0,
    1058  const ON_Interval* subdomain = nullptr
    1059  ) const;
    1060 
    1061  // Description:
    1062  // Convert a NURBS curve parameter to a curve parameter
    1063  //
    1064  // Parameters:
    1065  // nurbs_t - [in] nurbs form parameter
    1066  // curve_t - [out] curve parameter
    1067  //
    1068  // Remarks:
    1069  // If GetNurbForm returns 2, this function converts the curve
    1070  // parameter to the NURBS curve parameter.
    1071  //
    1072  // See Also:
    1073  // ON_Curve::GetNurbForm, ON_Curve::GetNurbFormParameterFromCurveParameter
    1074  virtual
    1075  bool GetCurveParameterFromNurbFormParameter(
    1076  double nurbs_t,
    1077  double* curve_t
    1078  ) const;
    1079 
    1080  // Description:
    1081  // Convert a curve parameter to a NURBS curve parameter.
    1082  //
    1083  // Parameters:
    1084  // curve_t - [in] curve parameter
    1085  // nurbs_t - [out] nurbs form parameter
    1086  //
    1087  // Remarks:
    1088  // If GetNurbForm returns 2, this function converts the curve
    1089  // parameter to the NURBS curve parameter.
    1090  //
    1091  // See Also:
    1092  // ON_Curve::GetNurbForm, ON_Curve::GetCurveParameterFromNurbFormParameter
    1093  virtual
    1094  bool GetNurbFormParameterFromCurveParameter(
    1095  double curve_t,
    1096  double* nurbs_t
    1097  ) const;
    1098 
    1099 
    1100  // Description:
    1101  // Destroys the runtime curve tree used to speed closest
    1102  // point and intersection calcuations.
    1103  // Remarks:
    1104  // If the geometry of the curve is modified in any way,
    1105  // then call DestroyCurveTree(); The curve tree is
    1106  // created as needed.
    1107  void DestroyCurveTree();
    1108 
    1109 
    1110  /*
    1111  Description:
    1112  Lookup a parameter in the m_t array, optionally using a built in snap tolerance to
    1113  snap a parameter value to an element of m_t.
    1114  This function is used by some types derived from ON_Curve to snap parameter values
    1115  Parameters:
    1116  t - [in] parameter
    1117  index -[out] index into m_t such that
    1118  if function returns false then
    1119 
    1120  @table
    1121  value condition
    1122  -1 t<m_t[0] or m_t is empty
    1123  0<=i<=m_t.Count()-2 m_t[i] < t < m_t[i+1]
    1124  m_t.Count()-1 t>m_t[ m_t.Count()-1]
    1125 
    1126  if the function returns true then t is equal to, or is closest to and
    1127  within tolerance of m_t[index].
    1128 
    1129  bEnableSnap-[in] enable snapping
    1130  m_t -[in] Array of parameter values to snap to
    1131  RelTol -[in] tolerance used in snapping
    1132 
    1133  Returns:
    1134  true if the t is exactly equal to (bEnableSnap==false), or within tolerance of
    1135  (bEnableSnap==true) m_t[index].
    1136  */
    1137 protected:
    1138  bool ParameterSearch( double t, int& index, bool bEnableSnap, const ON_SimpleArray<double>& m_t,
    1139  double RelTol=ON_SQRT_EPSILON) const;
    1140 
    1141 private:
    1142 };
    1143 
    1144 #if defined(ON_DLL_TEMPLATE)
    1145 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Curve*>;
    1146 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_Curve*>;
    1147 #endif
    1148 
    1150 {
    1151 public:
    1152  ON_CurveArray( int = 0 );
    1153  ~ON_CurveArray(); // deletes any non-nullptr curves
    1154 
    1155  bool Write( ON_BinaryArchive& ) const;
    1156  bool Read( ON_BinaryArchive& );
    1157 
    1158  void Destroy(); // deletes curves, sets pointers to nullptr, sets count to zero
    1159 
    1160  bool Duplicate( ON_CurveArray& ) const; // operator= copies the pointer values
    1161  // duplicate copies the curves themselves
    1162 
    1163  /*
    1164  Description:
    1165  Get tight bounding box of the bezier.
    1166  Parameters:
    1167  tight_bbox - [in/out] tight bounding box
    1168  bGrowBox -[in] (default=false)
    1169  If true and the input tight_bbox is valid, then returned
    1170  tight_bbox is the union of the input tight_bbox and the
    1171  tight bounding box of the bezier curve.
    1172  xform -[in] (default=nullptr)
    1173  If not nullptr, the tight bounding box of the transformed
    1174  bezier is calculated. The bezier curve is not modified.
    1175  Returns:
    1176  True if the returned tight_bbox is set to a valid
    1177  bounding box.
    1178  */
    1179  bool GetTightBoundingBox(
    1180  ON_BoundingBox& tight_bbox,
    1181  bool bGrowBox = false,
    1182  const ON_Xform* xform = nullptr
    1183  ) const;
    1184 };
    1185 
    1186 /*
    1187 Description:
    1188  Trim a curve.
    1189 Parameters:
    1190  curve - [in] curve to trim (not modified)
    1191  trim_parameters - [in] trimming parameters
    1192  If curve is open, then trim_parameters must be an increasing
    1193  interval.If curve is closed, and trim_parameters ins a
    1194  decreasing interval, then the portion of the curve across the
    1195  start/end is returned.
    1196 Returns:
    1197  trimmed curve or nullptr if input is invalid.
    1198 */
    1199 ON_DECL
    1200 ON_Curve* ON_TrimCurve(
    1201  const ON_Curve& curve,
    1202  ON_Interval trim_parameters
    1203  );
    1204 
    1205 /*
    1206 Description:
    1207  Move ends of curves to a common point. Neither curve can be closed or an ON_CurveProxy.
    1208  If one is an arc or polycurve with arc at end to change, and the other is not,
    1209  then the arc is left unchanged and the other curve is moved to the arc endpoint.
    1210  Otherwise, both are moved to the midpoint of the segment between the ends.
    1211 Parameters:
    1212  Crv0 - [in] first curve to modify.
    1213  [out] with one endpoint possibly changed.
    1214  end0 - [in] if 0, change start of Crv0. Otherwise change end.
    1215  Crv1 - [in] second curve to modify.
    1216  [out] with one endpoint possibly changed.
    1217  end1 - [in] if 0, change start of Crv1. Otherwise change end.
    1218 Returns:
    1219  true if the endpoints match. Falsse otherwise,
    1220 */
    1221 ON_DECL
    1222 bool ON_ForceMatchCurveEnds(
    1223  ON_Curve& Crv0,
    1224  int end0,
    1225  ON_Curve& Crv1,
    1226  int end1
    1227  );
    1228 
    1229 /*
    1230 OBSOLETE. Use int ON_JoinCurves(const ON_SimpleArray<const ON_Curve*>& InCurves,
    1231  ON_SimpleArray<ON_Curve*>& OutCurves,
    1232  double join_tol,
    1233  double kink_tol,
    1234  bool bPreserveDirection = false,
    1235  ON_SimpleArray<int>* key = 0
    1236  );
    1237 
    1238 Description:
    1239  Join all contiguous curves of an array of ON_Curves.
    1240 Parameters:
    1241  InCurves - [in] Array of curves to be joined (not modified)
    1242  OutCurves - [out] Resulting joined curves and copies of curves that were not joined to anything
    1243  are appended.
    1244  join_tol - [in] Distance tolerance used to decide if endpoints are close enough
    1245  bPreserveDirection - [in] If true, curve endpoints will be compared to curve startpoints.
    1246  If false, all start and endpoints will be compared, and copies of input
    1247  curves may be reversed in output.
    1248  key - [out] if key is not null, InCurves[i] was joined into OutCurves[key[i]].
    1249 Returns:
    1250  Number of curves added to Outcurves
    1251 Remarks:
    1252  Closed curves are copied to OutCurves.
    1253  Curves that cannot be joined to others are copied to OutCurves. When curves are joined, the results
    1254  are ON_PolyCurves. All members of InCurves must have same dimension, at most 3.
    1255  */
    1256 ON_DECL
    1257 int ON_JoinCurves(const ON_SimpleArray<const ON_Curve*>& InCurves,
    1258  ON_SimpleArray<ON_Curve*>& OutCurves,
    1259  double join_tol,
    1260  bool bPreserveDirection = false,
    1261  ON_SimpleArray<int>* key = 0
    1262  );
    1263 
    1264 /*
    1265 Description:
    1266  Join all contiguous curves of an array of ON_Curves.
    1267 Parameters:
    1268  InCurves - [in] Array of curves to be joined (not modified)
    1269  OutCurves - [out] Resulting joined curves and copies of curves that were not joined to anything
    1270  are appended.
    1271  join_tol - [in] Distance tolerance used to decide if endpoints are close enough
    1272  kink_tol - [in] Angle in radians. If > 0.0, then curves within join_tol will only be joined if the angle between them
    1273  is less than kink_tol. If <= 0, then the angle will be ignored and only join_tol will be used.
    1274  bUseTanAngle - [in] If true, choose the best match using angle between tangents.
    1275  If false, best match is the closest. This is used whether or not kink_tol is positive.
    1276  bPreserveDirection - [in] If true, curve endpoints will be compared to curve startpoints.
    1277  If false, all start and endpoints will be compared, and copies of input
    1278  curves may be reversed in output.
    1279  key - [out] if key is not null, InCurves[i] was joined into OutCurves[key[i]].
    1280 Returns:
    1281  Number of curves added to Outcurves
    1282 Remarks:
    1283  Closed curves are copied to OutCurves.
    1284  Curves that cannot be joined to others are copied to OutCurves. When curves are joined, the results
    1285  are ON_PolyCurves. All members of InCurves must have same dimension, at most 3.
    1286  */
    1287 ON_DECL
    1288 int ON_JoinCurves(const ON_SimpleArray<const ON_Curve*>& InCurves,
    1289  ON_SimpleArray<ON_Curve*>& OutCurves,
    1290  double join_tol,
    1291  double kink_tol,
    1292  bool bUseTanAngle,
    1293  bool bPreserveDirection = false,
    1294  ON_SimpleArray<int>* key = 0
    1295  );
    1296 
    1297 
    1298 /*
    1299 Description:
    1300  Sort a list of lines so they are geometrically continuous.
    1301 Parameters:
    1302  line_count - [in] number of lines
    1303  line_list - [in] array of lines
    1304  index - [out] The input index[] is an array of line_count unused integers.
    1305  The returned index[] is a permutation of {0,1,...,line_count-1}
    1306  so that the list of lines is in end-to-end order.
    1307  bReverse - [out] The input bReverse[] is an array of line_count unused bools.
    1308  If the returned value of bReverse[j] is true, then
    1309  line_list[index[j]] needs to be reversed.
    1310 Returns:
    1311  True if successful, false if not.
    1312 */
    1313 ON_DECL
    1314 bool ON_SortLines(
    1315  int line_count,
    1316  const ON_Line* line_list,
    1317  int* index,
    1318  bool* bReverse
    1319  );
    1320 
    1321 /*
    1322 Description:
    1323  Sort a list of lines so they are geometrically continuous.
    1324 Parameters:
    1325  line_list - [in] array of lines
    1326  index - [out] The input index[] is an array of line_count unused integers.
    1327  The returned index[] is a permutation of {0,1,...,line_count-1}
    1328  so that the list of lines is in end-to-end order.
    1329  bReverse - [out] The input bReverse[] is an array of line_count unused bools.
    1330  If the returned value of bReverse[j] is true, then
    1331  line_list[index[j]] needs to be reversed.
    1332 Returns:
    1333  True if successful, false if not.
    1334 */
    1335 ON_DECL
    1336 bool ON_SortLines(
    1337  const ON_SimpleArray<ON_Line>& line_list,
    1338  int* index,
    1339  bool* bReverse
    1340  );
    1341 
    1342 /*
    1343 Description:
    1344  Sort a list of open curves so end of a curve matches the start of the next curve.
    1345 Parameters:
    1346  curve_count - [in] number of curves
    1347  curve_list - [in] array of curve pointers
    1348  index - [out] The input index[] is an array of curve_count unused integers.
    1349  The returned index[] is a permutation of {0,1,...,curve_count-1}
    1350  so that the list of curves is in end-to-end order.
    1351  bReverse - [out] The input bReverse[] is an array of curve_count unused bools.
    1352  If the returned value of bReverse[j] is true, then
    1353  curve_list[index[j]] needs to be reversed.
    1354 Returns:
    1355  True if successful, false if not.
    1356 */
    1357 ON_DECL
    1358 bool ON_SortCurves(
    1359  int curve_count,
    1360  const ON_Curve* const* curve_list,
    1361  int* index,
    1362  bool* bReverse
    1363  );
    1364 
    1365 /*
    1366 Description:
    1367  Sort a list of curves so end of a curve matches the start of the next curve.
    1368 Parameters:
    1369  curve - [in] array of curves to sort. The curves themselves are not modified.
    1370  index - [out] The input index[] is an array of curve_count unused integers.
    1371  The returned index[] is a permutation of {0,1,...,curve_count-1}
    1372  so that the list of curves is in end-to-end order.
    1373  bReverse - [out] The input bReverse[] is an array of curve_count unused bools.
    1374  If the returned value of bReverse[j] is true, then
    1375  curve[index[j]] needs to be reversed.
    1376 Returns:
    1377  True if successful, false if not.
    1378 */
    1379 ON_DECL
    1380 bool ON_SortCurves(
    1381  const ON_SimpleArray<const ON_Curve*>& curves,
    1382  ON_SimpleArray<int>& index,
    1383  ON_SimpleArray<bool>& bReverse
    1384  );
    1385 
    1386 /*
    1387 Description:
    1388  Sort a list of curves so end of a curve matches the start of the next curve.
    1389 Parameters:
    1390  curve_count - [in] number of curves
    1391  curve - [in] array of curve pointers
    1392  index - [out] The input index[] is an array of curve_count unused integers.
    1393  The returned index[] is a permutation of {0,1,...,curve_count-1}
    1394  so that the list of curves is in end-to-end order.
    1395  bReverse - [out] The input bReverse[] is an array of curve_count unused bools.
    1396  If the returned value of bReverse[j] is true, then
    1397  curve[index[j]] needs to be reversed.
    1398 Returns:
    1399  True if successful, false if not.
    1400 */
    1401 ON_DECL
    1402 bool ON_SortCurves(
    1403  const ON_SimpleArray<ON_Curve*>& curves,
    1404  ON_SimpleArray<int>& index,
    1405  ON_SimpleArray<bool>& bReverse
    1406  );
    1407 
    1408 /*
    1409 Description:
    1410  Determine the orientaion (counterclockwise or clockwise) of a closed
    1411  planar curve.
    1412 Paramters:
    1413  curve - [in] simple (no self intersections) closed planar curve
    1414  xform - [in] Transformation to map the curve to the xy plane. If the
    1415  curve is parallel to the xy plane, you may pass nullptr.
    1416 Returns:
    1417  +1: The curve's orientation is counter clockwise in the xy plane.
    1418  -1: The curve's orientation is clockwise in the xy plane.
    1419  0: Unable to compute the curve's orientation.
    1420 */
    1421 ON_DECL
    1422 int ON_ClosedCurveOrientation( const ON_Curve& curve, const ON_Xform* xform );
    1423 
    1424 
    1425 /*
    1426 Description:
    1427  Get a crude aproximation of the signed area of the region in the
    1428  x-y plane traced out by the curve. This is useful for calculating
    1429  the orientation of projections of loops to planes when you have
    1430  more than one curve.
    1431 Paramters:
    1432  curve - [in]
    1433  domain - [in]
    1434  optional sub-domain. (null if entire curve should be used).
    1435  xform - [in] Transformation to map the curve to the xy plane. If the
    1436  curve is parallel to the xy plane, you may pass nullptr.
    1437  bReverseCurve - [in]
    1438 Returns:
    1439  1/2 the sum of (p[i].x-p[i+1].x)*(p[i].y+p[i+1].y), where p[i]
    1440  is a series of sampled points on the curve.
    1441 */
    1442 ON_DECL
    1443 double ON_CurveOrientationArea(
    1444  const ON_Curve* curve,
    1445  const ON_Interval* domain,
    1446  const ON_Xform* xform,
    1447  bool bReverseCurve
    1448  );
    1449 
    1450 #endif
    virtual bool Transform(const ON_Xform &xform)
    int m_main_seg_count
    Definition: opennurbs_curve.h:42
    Definition: opennurbs_curve.h:1149
    Definition: opennurbs_arc.h:34
    @@ -100,17 +98,19 @@ $(function() {
    ON_Geometry & operator=(const ON_Geometry &)=default
    Definition: opennurbs_nurbscurve.h:26
    < use for generic serialization of binary data
    Definition: opennurbs_archive.h:1866
    +
    virtual bool Read(ON_BinaryArchive &binary_archive)
    Definition: opennurbs_objref.h:163
    Definition: opennurbs_point.h:480
    +
    virtual bool Write(ON_BinaryArchive &binary_archive) const
    Definition: opennurbs_plane.h:20
    Definition: opennurbs_point.h:1182
    Definition: opennurbs_point.h:46
    diff --git a/6/d7/d51/class_o_n__3dm_view.html b/6/d7/d51/class_o_n__3dm_view.html index c71adb97..0d5da69f 100644 --- a/6/d7/d51/class_o_n__3dm_view.html +++ b/6/d7/d51/class_o_n__3dm_view.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmView Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    -

    target point
    -Returns: Target point. This point is saved on m_vp.m_target_point. The default constructor sets the target point to ON_3dPoint::UnsetPoint. You must explicitly set the target point if you want to use it. Remarks: The target point is stored on m_vp.m_target_point. The value ON_3dmView.m_target is obsolete. This function always returns the value of m_vp.m_target_point.

    +

    target point Returns: Target point. This point is saved on m_vp.m_target_point. The default constructor sets the target point to ON_3dPoint::UnsetPoint. You must explicitly set the target point if you want to use it. Remarks: The target point is stored on m_vp.m_target_point. The value ON_3dmView.m_target is obsolete. This function always returns the value of m_vp.m_target_point.

    @@ -786,9 +783,9 @@ Returns: Target point. This point is saved on m_vp.m_target_point. The default c diff --git a/6/d7/d53/class_o_n___material.html b/6/d7/d53/class_o_n___material.html index 326ff5c6..7dba3e10 100644 --- a/6/d7/d53/class_o_n___material.html +++ b/6/d7/d53/class_o_n___material.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Material Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -664,11 +662,7 @@ Additional Inherited Members

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Class ON_Material

    Constructor & Destructor Documentation

    @@ -776,8 +770,7 @@ Additional Inherited Members
    -

    Description: If there is a texture with a matching type, that texture's filename is modified, otherwise a new texture is added.
    -Parameters: filename - [in] new filename type - [in] Returns: Index of the added texture in the m_textures[] array. Remarks: This is intended to be a quick and simple way to add textures to the material. If you need to do something different, then just work on the m_textures[] array.

    +

    Description: If there is a texture with a matching type, that texture's filename is modified, otherwise a new texture is added. Parameters: filename - [in] new filename type - [in] Returns: Index of the added texture in the m_textures[] array. Remarks: This is intended to be a quick and simple way to add textures to the material. If you need to do something different, then just work on the m_textures[] array.

    @@ -1888,8 +1881,8 @@ Parameters: filename - [in] new filename type - [in] Returns: Index of the added
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -2202,9 +2195,9 @@ Parameters: filename - [in] new filename type - [in] Returns: Index of the added
    diff --git a/6/d7/d64/class_o_n___dim_radial.html b/6/d7/d64/class_o_n___dim_radial.html index 932c0644..46f26956 100644 --- a/6/d7/d64/class_o_n___dim_radial.html +++ b/6/d7/d64/class_o_n___dim_radial.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_DimRadial Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    enum  ForceArrow : unsigned int { ForceArrow::Auto = 0, ForceArrow::Inside = 1, ForceArrow::Outside = 2 - } - Arrowheads forced Inside, or Outside of extension lines, or moved to fit. More...
    + } Arrowheads forced Inside, or Outside of extension lines, or moved to fit. More...
    +   enum  ForceText : unsigned int { ForceText::Auto = 0, ForceText::Inside = 1, ForceText::Right = 2, ForceText::Left = 3 - } - Text forced Inside, Right or Left of extension lines, or moved to fit (Auto). More...
    + } Text forced Inside, Right or Left of extension lines, or moved to fit (Auto). More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -1847,8 +1845,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -1930,9 +1928,9 @@ Additional Inherited Members diff --git a/6/d7/d67/class_o_n___mesh_ngon_iterator-members.html b/6/d7/d67/class_o_n___mesh_ngon_iterator-members.html index 57268a83..ed5bdfc9 100644 --- a/6/d7/d67/class_o_n___mesh_ngon_iterator-members.html +++ b/6/d7/d67/class_o_n___mesh_ngon_iterator-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archiveserialize definition to binary archive
    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/d7/d6a/class_o_n___local_zero1.html b/6/d7/d6a/class_o_n___local_zero1.html index ceaa035c..0f49d5d8 100644 --- a/6/d7/d6a/class_o_n___local_zero1.html +++ b/6/d7/d6a/class_o_n___local_zero1.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_LocalZero1 Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d70/opennurbs__array__defs_8h_source.html b/6/d7/d70/opennurbs__array__defs_8h_source.html index 4ee77b56..a6c83fea 100644 --- a/6/d7/d70/opennurbs__array__defs_8h_source.html +++ b/6/d7/d70/opennurbs__array__defs_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_array_defs.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_array_defs.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_array_defs.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(ON_ARRAY_DEFS_INC_)
    18 #define ON_ARRAY_DEFS_INC_
    19 
    20 // When this file is parsed with /W4 warnings, two bogus warnings
    21 // are generated.
    22 #pragma ON_PRAGMA_WARNING_PUSH
    23 
    24 // The ON_ClassArray<T>::DestroyElement template function generates a
    25 // C4100: 'x' : unreferenced formal parameter
    26 // warning.
    27 // This appears to be caused by a bug in the compiler warning code
    28 // or the way templates are expanded. This pragma is needed squelch the
    29 // bogus warning.
    30 #pragma ON_PRAGMA_WARNING_DISABLE_MSC(4100)
    31 
    32 // The ON_CompareIncreasing and ON_CompareDecreasing templates generate a
    33 // C4211: nonstandard extension used : redefined extern to static
    34 // warning. Microsoft's compiler appears to have a little trouble
    35 // when static functions are declared before they are defined in a
    36 // single .cpp file. This pragma is needed squelch the bogus warning.
    37 #pragma ON_PRAGMA_WARNING_DISABLE_MSC(4211)
    38 
    39 // The main reason the definitions of the functions for the
    40 // ON_SimpleArray and ON_ClassArray templates are in this separate
    41 // file is so that the Microsoft developer studio autocomplete
    42 // functions will work on these classes.
    43 //
    44 // This file is included by opennurbs_array.h in the appropriate
    45 // spot. If you need the definitions in the file, then you
    46 // should include opennurbs_array.h and let it take care of
    47 // including this file.
    48 
    49 
    50 /////////////////////////////////////////////////////////////////////////////////////
    51 // Class ON_SimpleArray<>
    52 /////////////////////////////////////////////////////////////////////////////////////
    53 
    54 // construction ////////////////////////////////////////////////////////
    55 
    56 template <class T>
    57 T* ON_SimpleArray<T>::Realloc(T* ptr,int capacity)
    58 {
    59  return (T*)onrealloc(ptr,capacity*sizeof(T));
    60 }
    61 
    62 template <class T>
    64  : m_a(nullptr)
    65  , m_count(0)
    66  , m_capacity(0)
    67 {}
    68 
    69 template <class T>
    71  : m_a(nullptr)
    72  , m_count(0)
    73  , m_capacity(0)
    74 {
    75  if ( c > 0 )
    76  SetCapacity( c );
    77 }
    78 
    79 // Copy constructor
    80 template <class T>
    82  : m_a(0)
    83  , m_count(0)
    84  , m_capacity(0)
    85 {
    86  *this = src; // operator= defined below
    87 }
    88 
    89 template <class T>
    91 {
    92  SetCapacity(0);
    93 }
    94 
    95 template <class T>
    97 {
    98  if( this != &src ) {
    99  if ( src.m_count <= 0 ) {
    100  m_count = 0;
    101  }
    102  else {
    103  if ( m_capacity < src.m_count ) {
    104  SetCapacity( src.m_count );
    105  }
    106  if ( m_a ) {
    107  m_count = src.m_count;
    108  memcpy( (void*)(m_a), (void*)(src.m_a), m_count*sizeof(T) );
    109  }
    110  }
    111  }
    112  return *this;
    113 }
    114 
    115 #if defined(ON_HAS_RVALUEREF)
    116 
    117 // Clone constructor
    118 template <class T>
    120  : m_a(src.m_a)
    121  , m_count(src.m_count)
    122  , m_capacity(src.m_capacity)
    123 {
    124  src.m_a = 0;
    125  src.m_count = 0;
    126  src.m_capacity = 0;
    127 }
    128 
    129 // Clone assignment
    130 template <class T>
    132 {
    133  if( this != &src )
    134  {
    135  this->Destroy();
    136  m_a = src.m_a;
    137  m_count = src.m_count;
    138  m_capacity = src.m_capacity;
    139  src.m_a = 0;
    140  src.m_count = 0;
    141  src.m_capacity = 0;
    142  }
    143  return *this;
    144 }
    145 
    146 #endif
    147 
    148 // emergency destroy ///////////////////////////////////////////////////
    149 
    150 template <class T>
    152 {
    153  m_count = 0;
    154  m_capacity = 0;
    155  m_a = 0;
    156 }
    157 
    158 // query ///////////////////////////////////////////////////////////////
    159 
    160 template <class T>
    162 {
    163  return m_count;
    164 }
    165 
    166 template <class T>
    168 {
    169  return ((unsigned int)m_count);
    170 }
    171 
    172 template <class T>
    174 {
    175  return m_capacity;
    176 }
    177 
    178 template <class T>
    179 unsigned int ON_SimpleArray<T>::SizeOfArray() const
    180 {
    181  return ((unsigned int)(m_capacity*sizeof(T)));
    182 }
    183 
    184 template <class T>
    186 {
    187  return ((unsigned int)(sizeof(T)));
    188 }
    189 
    190 
    191 template <class T>
    192 ON__UINT32 ON_SimpleArray<T>::DataCRC(ON__UINT32 current_remainder) const
    193 {
    194  return ON_CRC32(current_remainder,m_count*sizeof(m_a[0]),m_a);
    195 }
    196 
    197 template <class T>
    199 {
    200 #if defined(ON_DEBUG)
    201  if ( i < 0 || i > m_capacity )
    202  {
    203  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    204  }
    205 #endif
    206  return m_a[i];
    207 }
    208 
    209 template <class T>
    210 T& ON_SimpleArray<T>::operator[]( unsigned int i )
    211 {
    212 #if defined(ON_DEBUG)
    213  if ( i > (unsigned int)m_capacity )
    214  {
    215  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    216  }
    217 #endif
    218  return m_a[i];
    219 }
    220 
    221 
    222 template <class T>
    224 {
    225 #if defined(ON_DEBUG)
    226  if ( i < 0 || i > (ON__INT64)m_capacity )
    227  {
    228  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    229  }
    230 #endif
    231  return m_a[i];
    232 }
    233 
    234 template <class T>
    236 {
    237 #if defined(ON_DEBUG)
    238  if ( i > (ON__UINT64)m_capacity )
    239  {
    240  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    241  }
    242 #endif
    243  return m_a[i];
    244 }
    245 
    246 
    247 #if defined(ON_RUNTIME_APPLE)
    248 template <class T>
    249 T& ON_SimpleArray<T>::operator[](size_t i )
    250 {
    251 #if defined(ON_DEBUG)
    252  if ( i > (size_t)m_capacity )
    253  {
    254  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    255  }
    256 #endif
    257  return m_a[i];
    258 }
    259 #endif
    260 
    261 template <class T>
    262 const T& ON_SimpleArray<T>::operator[](int i) const
    263 {
    264 #if defined(ON_DEBUG)
    265  if ( i < 0 || i > m_capacity )
    266  {
    267  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    268  }
    269 #endif
    270  return m_a[i];
    271 }
    272 
    273 template <class T>
    274 const T& ON_SimpleArray<T>::operator[](unsigned int i) const
    275 {
    276 #if defined(ON_DEBUG)
    277  if ( i > (unsigned int)m_capacity )
    278  {
    279  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    280  }
    281 #endif
    282  return m_a[i];
    283 }
    284 
    285 
    286 template <class T>
    287 const T& ON_SimpleArray<T>::operator[](ON__INT64 i) const
    288 {
    289 #if defined(ON_DEBUG)
    290  if ( i < 0 || i > ((ON__INT64)m_capacity) )
    291  {
    292  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    293  }
    294 #endif
    295  return m_a[i];
    296 }
    297 
    298 template <class T>
    299 const T& ON_SimpleArray<T>::operator[](ON__UINT64 i) const
    300 {
    301 #if defined(ON_DEBUG)
    302  if ( i > (ON__UINT64)m_capacity )
    303  {
    304  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    305  }
    306 #endif
    307  return m_a[i];
    308 }
    309 
    310 #if defined(ON_RUNTIME_APPLE)
    311 template <class T>
    312 const T& ON_SimpleArray<T>::operator[](size_t i) const
    313 {
    314 #if defined(ON_DEBUG)
    315  if ( i > (size_t)m_capacity )
    316  {
    317  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    318  }
    319 #endif
    320  return m_a[i];
    321 }
    322 #endif
    323 
    324 template <class T>
    326 {
    327  return (m_count > 0) ? m_a : 0;
    328 }
    329 
    330 template <class T>
    332 {
    333  return (m_count > 0) ? m_a : 0;
    334 }
    335 
    336 template <class T>
    338 {
    339  return m_a;
    340 }
    341 
    342 template <class T>
    343 const T* ON_SimpleArray<T>::Array() const
    344 {
    345  return m_a;
    346 }
    347 
    348 template <class T>
    350 {
    351  T* p = m_a;
    352  m_a = 0;
    353  m_count = 0;
    354  m_capacity = 0;
    355  return p;
    356 }
    357 
    358 template <class T>
    360 {
    361  if ( m_a && m_a != p )
    362  onfree(m_a);
    363  m_a = p;
    364 }
    365 
    366 template <class T>
    367 void ON_SimpleArray<T>::SetArray(T* p, int count, int capacity)
    368 {
    369  if ( m_a && m_a != p )
    370  onfree(m_a);
    371  m_a = p;
    372  m_count = count;
    373  m_capacity = capacity;
    374 }
    375 
    376 template <class T>
    378 {
    379  return (m_count > 0) ? m_a : 0;
    380 }
    381 
    382 template <class T>
    383 const T* ON_SimpleArray<T>::First() const
    384 {
    385  return (m_count > 0) ? m_a : 0;
    386 }
    387 
    388 template <class T>
    390 {
    391  return (i >= 0 && i < m_count) ? m_a+i : 0;
    392 }
    393 
    394 template <class T>
    395 T* ON_SimpleArray<T>::At( unsigned int i )
    396 {
    397  return (i < (unsigned int)m_count) ? m_a+i : 0;
    398 }
    399 
    400 template <class T>
    401 const T* ON_SimpleArray<T>::At( int i) const
    402 {
    403  return (i >= 0 && i < m_count) ? m_a+i : 0;
    404 }
    405 
    406 template <class T>
    407 const T* ON_SimpleArray<T>::At( unsigned int i) const
    408 {
    409  return (i < (unsigned int)m_count) ? m_a+i : 0;
    410 }
    411 
    412 template <class T>
    413 T* ON_SimpleArray<T>::At( ON__INT64 i )
    414 {
    415  return (i >= 0 && i < (ON__INT64)m_count) ? m_a+i : 0;
    416 }
    417 
    418 template <class T>
    419 T* ON_SimpleArray<T>::At( ON__UINT64 i )
    420 {
    421  return (i < (ON__UINT64)m_count) ? m_a+i : 0;
    422 }
    423 
    424 template <class T>
    425 const T* ON_SimpleArray<T>::At( ON__INT64 i) const
    426 {
    427  return (i >= 0 && i < (ON__INT64)m_count) ? m_a+i : 0;
    428 }
    429 
    430 template <class T>
    431 const T* ON_SimpleArray<T>::At( ON__UINT64 i) const
    432 {
    433  return (i < (ON__UINT64)m_count) ? m_a+i : 0;
    434 }
    435 
    436 template <class T>
    438 {
    439  return (m_count > 0) ? m_a+(m_count-1) : 0;
    440 }
    441 
    442 template <class T>
    443 const T* ON_SimpleArray<T>::Last() const
    444 {
    445  return (m_count > 0) ? m_a+(m_count-1) : 0;
    446 }
    447 
    448 // array operations ////////////////////////////////////////////////////
    449 
    450 template <class T>
    451 void ON_SimpleArray<T>::Move( int dest_i, int src_i, int ele_cnt )
    452 {
    453  // private function for moving blocks of array memory
    454  // caller is responsible for updating m_count.
    455  if ( ele_cnt <= 0 || src_i < 0 || dest_i < 0 || src_i == dest_i ||
    456  src_i + ele_cnt > m_count || dest_i > m_count )
    457  return;
    458 
    459  int capacity = dest_i + ele_cnt;
    460  if ( capacity > m_capacity ) {
    461  if ( capacity < 2*m_capacity )
    462  capacity = 2*m_capacity;
    463  SetCapacity( capacity );
    464  }
    465 
    466  memmove( &m_a[dest_i], &m_a[src_i], ele_cnt*sizeof(T) );
    467 }
    468 
    469 template <class T>
    471 {
    472  if ( m_count == m_capacity )
    473  {
    474  int new_capacity = NewCapacity();
    475  Reserve( new_capacity );
    476  }
    477  memset( (void*)(&m_a[m_count]), 0, sizeof(T) );
    478  return m_a[m_count++];
    479 }
    480 
    481 template <class T>
    482 void ON_SimpleArray<T>::Append( const T& x )
    483 {
    484  if ( m_count == m_capacity )
    485  {
    486  const int newcapacity = NewCapacity();
    487  if (m_a)
    488  {
    489  const int s = (int)(&x - m_a); // (int) cast is for 64 bit pointers
    490  if ( s >= 0 && s < m_capacity )
    491  {
    492  // 26 Sep 2005 Dale Lear
    493  // User passed in an element of the m_a[]
    494  // that will get reallocated by the call
    495  // to Reserve(newcapacity).
    496  T temp; // ON_*Array<> templates do not require robust copy constructor.
    497  temp = x; // ON_*Array<> templates require a robust operator=.
    498  Reserve( newcapacity );
    499  m_a[m_count++] = temp;
    500  return;
    501  }
    502  }
    503  Reserve(newcapacity);
    504  }
    505  m_a[m_count++] = x;
    506 }
    507 
    508 template <class T>
    509 void ON_SimpleArray<T>::Append( int count, const T* p )
    510 {
    511  if ( count > 0 && p )
    512  {
    513  if ( count + m_count > m_capacity )
    514  {
    515  int newcapacity = NewCapacity();
    516  if ( newcapacity < count + m_count )
    517  newcapacity = count + m_count;
    518  Reserve( newcapacity );
    519  }
    520  memcpy( (void*)(m_a + m_count), (void*)(p), count*sizeof(T) );
    521  m_count += count;
    522  }
    523 }
    524 
    525 template <class T>
    526 void ON_SimpleArray<T>::Insert( int i, const T& x )
    527 {
    528  if( i >= 0 && i <= m_count )
    529  {
    530  if ( m_count == m_capacity )
    531  {
    532  int newcapacity = NewCapacity();
    533  Reserve( newcapacity );
    534  }
    535  m_count++;
    536  Move( i+1, i, m_count-1-i );
    537  m_a[i] = x;
    538  }
    539 }
    540 
    541 template <class T>
    543 {
    544  Remove(m_count-1);
    545 }
    546 
    547 template <class T>
    549 {
    550  if ( i >= 0 && i < m_count ) {
    551  Move( i, i+1, m_count-1-i );
    552  m_count--;
    553  memset( (void*)(&m_a[m_count]), 0, sizeof(T) );
    554  }
    555 }
    556 
    557 template <class T>
    559 {
    560  if ( m_a )
    561  memset( (void*)(m_a), 0, m_capacity*sizeof(T) );
    562  m_count = 0;
    563 }
    564 
    565 template <class T>
    567 {
    568  // NOTE:
    569  // If anything in "T" depends on the value of this's address,
    570  // then don't call Reverse().
    571  T t;
    572  int i = 0;
    573  int j = m_count-1;
    574  for ( /*empty*/; i < j; i++, j-- ) {
    575  t = m_a[i];
    576  m_a[i] = m_a[j];
    577  m_a[j] = t;
    578  }
    579 }
    580 
    581 template <class T>
    582 void ON_SimpleArray<T>::Swap( int i, int j )
    583 {
    584  if ( i != j ) {
    585  const T t(m_a[i]);
    586  m_a[i] = m_a[j];
    587  m_a[j] = t;
    588  }
    589 }
    590 
    591 template <class T>
    592 int ON_SimpleArray<T>::Search( const T& key ) const
    593 {
    594  const T* p = &key;
    595  for ( int i = 0; i < m_count; i++ ) {
    596  if (!memcmp(p,m_a+i,sizeof(T)))
    597  return i;
    598  }
    599  return -1;
    600 }
    601 
    602 template <class T>
    603 int ON_SimpleArray<T>::Search( const T* key, int (*compar)(const T*,const T*) ) const
    604 {
    605  for ( int i = 0; i < m_count; i++ ) {
    606  if (!compar(key,m_a+i))
    607  return i;
    608  }
    609  return -1;
    610 }
    611 
    612 template <class T>
    613 int ON_SimpleArray<T>::BinarySearch( const T* key, int (*compar)(const T*,const T*) ) const
    614 {
    615  const T* found = (key&&m_a&&m_count>0)
    616  ? (const T*)bsearch( key, m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar )
    617  : 0;
    618 
    619  // This worked on a wide range of 32 bit compilers.
    620 
    621  int rc;
    622  if ( 0 != found )
    623  {
    624  // Convert "found" pointer to array index.
    625 
    626 #if defined(ON_COMPILER_MSC1300)
    627  rc = ((int)(found - m_a));
    628 #elif 8 == ON_SIZEOF_POINTER
    629  // In an ideal world, return ((int)(found - m_a)) would work everywhere.
    630  // In practice, this should work any 64 bit compiler and we can hope
    631  // the optimzer generates efficient code.
    632  const ON__UINT64 fptr = (ON__UINT64)found;
    633  const ON__UINT64 aptr = (ON__UINT64)m_a;
    634  const ON__UINT64 sz = (ON__UINT64)sizeof(T);
    635  const ON__UINT64 i = (fptr - aptr)/sz;
    636  rc = (int)i;
    637 #else
    638  // In an ideal world, return ((int)(found - m_a)) would work everywhere.
    639  // In practice, this should work any 32 bit compiler and we can hope
    640  // the optimzer generates efficient code.
    641  const ON__UINT32 fptr = (ON__UINT32)found;
    642  const ON__UINT32 aptr = (ON__UINT32)m_a;
    643  const ON__UINT32 sz = (ON__UINT32)sizeof(T);
    644  const ON__UINT32 i = (fptr - aptr)/sz;
    645  rc = (int)i;
    646 #endif
    647  }
    648  else
    649  {
    650  // "key" not found
    651  rc = -1;
    652  }
    653 
    654  return rc;
    655 
    656 }
    657 
    658 template <class T>
    659 int ON_SimpleArray<T>::BinarySearch( const T* key, int (*compar)(const T*,const T*), int count ) const
    660 {
    661  if ( count > m_count )
    662  count = m_count;
    663  if ( count <= 0 )
    664  return -1;
    665  const T* found = (key&&m_a&&m_count>0)
    666  ? (const T*)bsearch( key, m_a, count, sizeof(T), (int(*)(const void*,const void*))compar )
    667  : 0;
    668 
    669  // This worked on a wide range of 32 bit compilers.
    670 
    671  int rc;
    672  if ( 0 != found )
    673  {
    674  // Convert "found" pointer to array index.
    675 
    676 #if defined(ON_COMPILER_MSC1300)
    677  rc = ((int)(found - m_a));
    678 #elif 8 == ON_SIZEOF_POINTER
    679  // In an ideal world, return ((int)(found - m_a)) would work everywhere.
    680  // In practice, this should work any 64 bit compiler and we can hope
    681  // the optimzer generates efficient code.
    682  const ON__UINT64 fptr = (ON__UINT64)found;
    683  const ON__UINT64 aptr = (ON__UINT64)m_a;
    684  const ON__UINT64 sz = (ON__UINT64)sizeof(T);
    685  const ON__UINT64 i = (fptr - aptr)/sz;
    686  rc = (int)i;
    687 #else
    688  // In an ideal world, return ((int)(found - m_a)) would work everywhere.
    689  // In practice, this should work any 32 bit compiler and we can hope
    690  // the optimzer generates efficient code.
    691  const ON__UINT32 fptr = (ON__UINT32)found;
    692  const ON__UINT32 aptr = (ON__UINT32)m_a;
    693  const ON__UINT32 sz = (ON__UINT32)sizeof(T);
    694  const ON__UINT32 i = (fptr - aptr)/sz;
    695  rc = (int)i;
    696 #endif
    697  }
    698  else
    699  {
    700  // "key" not found
    701  rc = -1;
    702  }
    703  return rc;
    704 }
    705 
    706 
    707 
    708 template <class T>
    709 bool ON_SimpleArray<T>::HeapSort( int (*compar)(const T*,const T*) )
    710 {
    711  bool rc = false;
    712  if ( m_a && m_count > 0 && compar ) {
    713  if ( m_count > 1 )
    714  ON_hsort( m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    715  rc = true;
    716  }
    717  return rc;
    718 }
    719 
    720 template <class T>
    721 bool ON_SimpleArray<T>::QuickSort( int (*compar)(const T*,const T*) )
    722 {
    723  bool rc = false;
    724  if ( m_a && m_count > 0 && compar ) {
    725  if ( m_count > 1 )
    726  ON_qsort( m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    727  rc = true;
    728  }
    729  return rc;
    730 }
    731 
    732 template <class T>
    733 bool ON_SimpleArray<T>::Sort( ON::sort_algorithm sa, int* index, int (*compar)(const T*,const T*) ) const
    734 {
    735  bool rc = false;
    736  if ( m_a && m_count > 0 && compar && index ) {
    737  if ( m_count > 1 )
    738  ON_Sort(sa, index, m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    739  else if ( m_count == 1 )
    740  index[0] = 0;
    741  rc = true;
    742  }
    743  return rc;
    744 }
    745 
    746 template <class T>
    747 bool ON_SimpleArray<T>::Sort( ON::sort_algorithm sa, int* index, int (*compar)(const T*,const T*,void*),void* p ) const
    748 {
    749  bool rc = false;
    750  if ( m_a && m_count > 0 && compar && index ) {
    751  if ( m_count > 1 )
    752  ON_Sort(sa, index, m_a, m_count, sizeof(T), (int(*)(const void*,const void*,void*))compar, p );
    753  else if ( m_count == 1 )
    754  index[0] = 0;
    755  rc = true;
    756  }
    757  return rc;
    758 }
    759 
    760 template <class T>
    761 bool ON_SimpleArray<T>::Permute( const int* index )
    762 {
    763  bool rc = false;
    764  if ( m_a && m_count > 0 && index ) {
    765  int i;
    766  T* buffer = (T*)onmalloc(m_count*sizeof(buffer[0]));
    767  memcpy( (void*)(buffer), (void*)(m_a), m_count*sizeof(T) );
    768  for (i = 0; i < m_count; i++ )
    769  memcpy( (void*)(m_a+i), (void*)(buffer+index[i]), sizeof(T) ); // must use memcopy and not operator=
    770  onfree(buffer);
    771  rc = true;
    772  }
    773  return rc;
    774 }
    775 
    776 template <class T>
    778 {
    779  if ( m_a && m_capacity > 0 ) {
    780  memset( (void*)(m_a), 0, m_capacity*sizeof(T) );
    781  }
    782 }
    783 
    784 template <class T>
    785 void ON_SimpleArray<T>::MemSet( unsigned char value )
    786 {
    787  if ( m_a && m_capacity > 0 ) {
    788  memset( (void*)(m_a), value, m_capacity*sizeof(T) );
    789  }
    790 }
    791 
    792 // memory managment ////////////////////////////////////////////////////
    793 
    794 template <class T>
    795 T* ON_SimpleArray<T>::Reserve( size_t newcap )
    796 {
    797  if( (size_t)m_capacity < newcap )
    798  SetCapacity( newcap );
    799  return m_a;
    800 }
    801 
    802 template <class T>
    804 {
    805  SetCapacity( m_count );
    806 }
    807 
    808 template <class T>
    810 {
    811  SetCapacity( 0 );
    812 }
    813 
    814 // low level memory managment //////////////////////////////////////////
    815 
    816 template <class T>
    817 void ON_SimpleArray<T>::SetCount( int count )
    818 {
    819  if ( count >= 0 && count <= m_capacity )
    820  m_count = count;
    821 }
    822 
    823 template <class T>
    824 T* ON_SimpleArray<T>::SetCapacity( size_t new_capacity )
    825 {
    826  if (0 == m_capacity)
    827  {
    828  // Allow "expert" users of ON_SimpleArray<>.SetArray(*,*,0) to clean up after themselves
    829  // and deals with the case when the forget to clean up after themselves.
    830  m_a = nullptr;
    831  m_count = 0;
    832  }
    833 
    834  // sets capacity to input value
    835  int capacity = (new_capacity > 0 && new_capacity < ON_UNSET_UINT_INDEX)
    836  ? (int)new_capacity
    837  : 0;
    838  if ( capacity != m_capacity ) {
    839  if( capacity > 0 ) {
    840  if ( m_count > capacity )
    841  m_count = capacity;
    842  // NOTE: Realloc() does an allocation if the first argument is nullptr.
    843  m_a = Realloc( m_a, capacity );
    844  if ( m_a ) {
    845  if ( capacity > m_capacity ) {
    846  // zero new memory
    847  memset( (void*) (m_a + m_capacity), 0, (capacity-m_capacity)*sizeof(T) );
    848  }
    849  m_capacity = capacity;
    850  }
    851  else {
    852  // out of memory
    853  m_count = m_capacity = 0;
    854  }
    855  }
    856  else if (m_a) {
    857  Realloc(m_a,0);
    858  m_a = 0;
    859  m_count = m_capacity = 0;
    860  }
    861  }
    862  return m_a;
    863 }
    864 
    865 template <class T>
    867 {
    868  // Note:
    869  // This code appears in ON_SimpleArray<T>::NewCapacity()
    870  // and ON_ClassArray<T>::NewCapacity(). Changes made to
    871  // either function should be made to both functions.
    872  // Because this code is template code that has to
    873  // support dynamic linking and the code is defined
    874  // in a header, I'm using copy-and-paste rather
    875  // than a static.
    876 
    877  // This function returns 2*m_count unless that will
    878  // result in an additional allocation of more than
    879  // cap_size bytes. The cap_size concept was added in
    880  // January 2010 because some calculations on enormous
    881  // models were slightly underestimating the initial
    882  // Reserve() size and then wasting gigabytes of memory.
    883 
    884  // cap_size = 128 MB on 32-bit os, 256 MB on 64 bit os
    885  const size_t cap_size = 32*sizeof(void*)*1024*1024;
    886  if (m_count*sizeof(T) <= cap_size || m_count < 8)
    887  return ((m_count <= 2) ? 4 : 2*m_count);
    888 
    889  // Growing the array will increase the memory
    890  // use by more than cap_size.
    891  int delta_count = 8 + cap_size/sizeof(T);
    892  if ( delta_count > m_count )
    893  delta_count = m_count;
    894  return (m_count + delta_count);
    895 }
    896 
    897 template <class T>
    899 {
    900  // Note:
    901  // This code appears in ON_SimpleArray<T>::NewCapacity()
    902  // and ON_ClassArray<T>::NewCapacity(). Changes made to
    903  // either function should be made to both functions.
    904  // Because this code is template code that has to
    905  // support dynamic linking and the code is defined
    906  // in a header, I'm using copy-and-paste rather
    907  // than a static.
    908 
    909  // This function returns 2*m_count unless that will
    910  // result in an additional allocation of more than
    911  // cap_size bytes. The cap_size concept was added in
    912  // January 2010 because some calculations on enormous
    913  // models were slightly underestimating the initial
    914  // Reserve() size and then wasting gigabytes of memory.
    915 
    916  // cap_size = 128 MB on 32-bit os, 256 MB on 64 bit os
    917  const size_t cap_size = 32*sizeof(void*)*1024*1024;
    918  if (m_count*sizeof(T) <= cap_size || m_count < 8)
    919  return ((m_count <= 2) ? 4 : 2*m_count);
    920 
    921  // Growing the array will increase the memory
    922  // use by more than cap_size.
    923  int delta_count = 8 + cap_size/sizeof(T);
    924  if ( delta_count > m_count )
    925  delta_count = m_count;
    926  return (m_count + delta_count);
    927 }
    928 
    929 /////////////////////////////////////////////////////////////////////////////////////
    930 // Class ON_ObjectArray<>
    931 /////////////////////////////////////////////////////////////////////////////////////
    932 
    933 template <class T>
    935 {
    936 }
    937 
    938 template <class T>
    940 {
    941 }
    942 
    943 template <class T>
    945 {
    946 }
    947 
    948 template <class T>
    950 {
    951  if( this != &src)
    952  {
    954  }
    955  return *this;
    956 }
    957 
    958 #if defined(ON_HAS_RVALUEREF)
    959 
    960 // Clone constructor
    961 template <class T>
    963  : ON_ClassArray<T>(std::move(src))
    964 {}
    965 
    966 // Clone assignment
    967 template <class T>
    969 {
    970  if( this != &src )
    971  {
    972  this->Destroy();
    973  m_a = src.m_a;
    974  m_count = src.m_count;
    975  m_capacity = src.m_capacity;
    976  src.m_a = 0;
    977  src.m_count = 0;
    978  src.m_capacity = 0;
    979  }
    980  return *this;
    981 }
    982 
    983 #endif
    984 
    985 template <class T>
    987  : ON_ClassArray<T>(c)
    988 {
    989 }
    990 
    991 template <class T>
    992 T* ON_ObjectArray<T>::Realloc(T* ptr,int capacity)
    993 {
    994  T* reptr = (T*)onrealloc(ptr,capacity*sizeof(T));
    995  if ( ptr && reptr && reptr != ptr )
    996  {
    997  // The "this->" in this->m_count and this->m_a
    998  // are needed for gcc 4 to compile.
    999  int i;
    1000  for ( i = 0; i < this->m_count; i++ )
    1001  {
    1002  reptr[i].MemoryRelocate();
    1003  }
    1004  }
    1005  return reptr;
    1006 }
    1007 
    1008 /////////////////////////////////////////////////////////////////////////////////////
    1009 // Class ON_ClassArray<>
    1010 /////////////////////////////////////////////////////////////////////////////////////
    1011 
    1012 
    1013 // construction ////////////////////////////////////////////////////////
    1014 
    1015 template <class T>
    1016 T* ON_ClassArray<T>::Realloc(T* ptr,int capacity)
    1017 {
    1018  return (T*)onrealloc(ptr,capacity*sizeof(T));
    1019 }
    1020 
    1021 template <class T>
    1022 ON__UINT32 ON_ObjectArray<T>::DataCRC(ON__UINT32 current_remainder) const
    1023 {
    1024  // The "this->" in this->m_count and this->m_a
    1025  // are needed for gcc 4 to compile.
    1026  int i;
    1027  for ( i = 0; i < this->m_count; i++ )
    1028  {
    1029  current_remainder = this->m_a[i].DataCRC(current_remainder);
    1030  }
    1031  return current_remainder;
    1032 }
    1033 
    1034 template <class T>
    1036  : m_a(nullptr)
    1037  , m_count(0)
    1038  , m_capacity(0)
    1039 {}
    1040 
    1041 template <class T>
    1043  : m_a(nullptr)
    1044  , m_count(0)
    1045  , m_capacity(0)
    1046 {
    1047  if ( c > 0 )
    1048  SetCapacity( c );
    1049 }
    1050 
    1051 // Copy constructor
    1052 template <class T>
    1054  : m_a(nullptr)
    1055  , m_count(0)
    1056  , m_capacity(0)
    1057 {
    1058  *this = src; // operator= defined below
    1059 }
    1060 
    1061 template <class T>
    1063 {
    1064  SetCapacity(0);
    1065 }
    1066 
    1067 template <class T>
    1069 {
    1070  int i;
    1071  if( this != &src ) {
    1072  if ( src.m_count <= 0 ) {
    1073  m_count = 0;
    1074  }
    1075  else {
    1076  if ( m_capacity < src.m_count ) {
    1077  SetCapacity( src.m_count );
    1078  }
    1079  if ( m_a ) {
    1080  m_count = src.m_count;
    1081  for ( i = 0; i < m_count; i++ ) {
    1082  m_a[i] = src.m_a[i];
    1083  }
    1084  }
    1085  }
    1086  }
    1087  return *this;
    1088 }
    1089 
    1090 #if defined(ON_HAS_RVALUEREF)
    1091 
    1092 // Clone constructor
    1093 template <class T>
    1095  : m_a(src.m_a)
    1096  , m_count(src.m_count)
    1097  , m_capacity(src.m_capacity)
    1098 {
    1099  src.m_a = 0;
    1100  src.m_count = 0;
    1101  src.m_capacity = 0;
    1102 }
    1103 
    1104 // Clone assignment
    1105 template <class T>
    1107 {
    1108  if( this != &src )
    1109  {
    1110  this->Destroy();
    1111  m_a = src.m_a;
    1112  m_count = src.m_count;
    1113  m_capacity = src.m_capacity;
    1114  src.m_a = 0;
    1115  src.m_count = 0;
    1116  src.m_capacity = 0;
    1117  }
    1118  return *this;
    1119 }
    1120 
    1121 #endif
    1122 
    1123 // emergency destroy ///////////////////////////////////////////////////
    1124 
    1125 template <class T>
    1127 {
    1128  m_count = 0;
    1129  m_capacity = 0;
    1130  m_a = 0;
    1131 }
    1132 
    1133 // query ///////////////////////////////////////////////////////////////
    1134 
    1135 template <class T>
    1137 {
    1138  return m_count;
    1139 }
    1140 
    1141 template <class T>
    1143 {
    1144  return ((unsigned int)m_count);
    1145 }
    1146 
    1147 template <class T>
    1149 {
    1150  return m_capacity;
    1151 }
    1152 
    1153 template <class T>
    1154 unsigned int ON_ClassArray<T>::SizeOfArray() const
    1155 {
    1156  return ((unsigned int)(m_capacity*sizeof(T)));
    1157 }
    1158 
    1159 template <class T>
    1161 {
    1162  return ((unsigned int)(sizeof(T)));
    1163 }
    1164 
    1165 template <class T>
    1167 {
    1168 #if defined(ON_DEBUG)
    1169  if ( i < 0 || i > m_capacity )
    1170  {
    1171  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1172  }
    1173 #endif
    1174  return m_a[i];
    1175 }
    1176 
    1177 
    1178 template <class T>
    1180 {
    1181 #if defined(ON_DEBUG)
    1182  if ( i < 0 || i > (ON__INT64)m_capacity )
    1183  {
    1184  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1185  }
    1186 #endif
    1187  return m_a[i];
    1188 }
    1189 
    1190 template <class T>
    1191 T& ON_ClassArray<T>::operator[]( unsigned int i )
    1192 {
    1193 #if defined(ON_DEBUG)
    1194  if ( i > (unsigned int)m_capacity )
    1195  {
    1196  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1197  }
    1198 #endif
    1199  return m_a[i];
    1200 }
    1201 
    1202 template <class T>
    1204 {
    1205 #if defined(ON_DEBUG)
    1206  if ( i > (ON__UINT64)m_capacity )
    1207  {
    1208  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1209  }
    1210 #endif
    1211  return m_a[i];
    1212 }
    1213 
    1214 #if defined(ON_RUNTIME_APPLE)
    1215 template <class T>
    1216 T& ON_ClassArray<T>::operator[](size_t i )
    1217 {
    1218 #if defined(ON_DEBUG)
    1219  if ( i > (size_t)m_capacity )
    1220  {
    1221  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1222  }
    1223 #endif
    1224  return m_a[i];
    1225 }
    1226 #endif
    1227 
    1228 template <class T>
    1229 const T& ON_ClassArray<T>::operator[](int i) const
    1230 {
    1231 #if defined(ON_DEBUG)
    1232  if ( i < 0 || i > m_capacity )
    1233  {
    1234  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1235  }
    1236 #endif
    1237  return m_a[i];
    1238 }
    1239 
    1240 template <class T>
    1241 const T& ON_ClassArray<T>::operator[](ON__INT64 i) const
    1242 {
    1243 #if defined(ON_DEBUG)
    1244  if ( i < 0 || i > (ON__INT64)m_capacity )
    1245  {
    1246  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1247  }
    1248 #endif
    1249  return m_a[i];
    1250 }
    1251 
    1252 template <class T>
    1253 const T& ON_ClassArray<T>::operator[](unsigned int i) const
    1254 {
    1255 #if defined(ON_DEBUG)
    1256  if ( i > (unsigned int)m_capacity )
    1257  {
    1258  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1259  }
    1260 #endif
    1261  return m_a[i];
    1262 }
    1263 
    1264 template <class T>
    1265 const T& ON_ClassArray<T>::operator[](ON__UINT64 i) const
    1266 {
    1267 #if defined(ON_DEBUG)
    1268  if ( i > (ON__UINT64)m_capacity )
    1269  {
    1270  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1271  }
    1272 #endif
    1273  return m_a[i];
    1274 }
    1275 
    1276 #if defined(ON_RUNTIME_APPLE)
    1277 template <class T>
    1278 const T& ON_ClassArray<T>::operator[](size_t i) const
    1279 {
    1280 #if defined(ON_DEBUG)
    1281  if ( i > (size_t)m_capacity )
    1282  {
    1283  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1284  }
    1285 #endif
    1286  return m_a[i];
    1287 }
    1288 #endif
    1289 
    1290 template <class T>
    1292 {
    1293  return (m_count > 0) ? m_a : 0;
    1294 }
    1295 
    1296 template <class T>
    1298 {
    1299  return (m_count > 0) ? m_a : 0;
    1300 }
    1301 
    1302 template <class T>
    1304 {
    1305  return m_a;
    1306 }
    1307 
    1308 template <class T>
    1309 const T* ON_ClassArray<T>::Array() const
    1310 {
    1311  return m_a;
    1312 }
    1313 
    1314 template <class T>
    1316 {
    1317  T* p = m_a;
    1318  m_a = 0;
    1319  m_count = 0;
    1320  m_capacity = 0;
    1321  return p;
    1322 }
    1323 
    1324 template <class T>
    1326 {
    1327  if ( m_a && m_a != p )
    1328  Destroy();
    1329  m_a = p;
    1330 }
    1331 
    1332 template <class T>
    1333 void ON_ClassArray<T>::SetArray(T* p, int count, int capacity)
    1334 {
    1335  if ( m_a && m_a != p )
    1336  Destroy();
    1337  m_a = p;
    1338  m_count = count;
    1339  m_capacity = capacity;
    1340 }
    1341 
    1342 template <class T>
    1344 {
    1345  return (m_count > 0) ? m_a : 0;
    1346 }
    1347 
    1348 template <class T>
    1349 const T* ON_ClassArray<T>::First() const
    1350 {
    1351  return (m_count > 0) ? m_a : 0;
    1352 }
    1353 
    1354 template <class T>
    1356 {
    1357  return (i >= 0 && i < m_count) ? m_a+i : 0;
    1358 }
    1359 
    1360 template <class T>
    1361 T* ON_ClassArray<T>::At( unsigned int i )
    1362 {
    1363  return (i < (unsigned int)m_count) ? m_a+i : 0;
    1364 }
    1365 
    1366 template <class T>
    1367 const T* ON_ClassArray<T>::At( int i) const
    1368 {
    1369  return (i >= 0 && i < m_count) ? m_a+i : 0;
    1370 }
    1371 
    1372 template <class T>
    1373 const T* ON_ClassArray<T>::At( unsigned int i) const
    1374 {
    1375  return (i < (unsigned int)m_count) ? m_a+i : 0;
    1376 }
    1377 
    1378 
    1379 template <class T>
    1380 T* ON_ClassArray<T>::At( ON__INT64 i )
    1381 {
    1382  return (i >= 0 && i < (ON__INT64)m_count) ? m_a+i : 0;
    1383 }
    1384 
    1385 template <class T>
    1386 T* ON_ClassArray<T>::At( ON__UINT64 i )
    1387 {
    1388  return (i < (ON__UINT64)m_count) ? m_a+i : 0;
    1389 }
    1390 
    1391 template <class T>
    1392 const T* ON_ClassArray<T>::At( ON__INT64 i) const
    1393 {
    1394  return (i >= 0 && i < (ON__INT64)m_count) ? m_a+i : 0;
    1395 }
    1396 
    1397 template <class T>
    1398 const T* ON_ClassArray<T>::At( ON__UINT64 i) const
    1399 {
    1400  return (i < (ON__UINT64)m_count) ? m_a+i : 0;
    1401 }
    1402 
    1403 
    1404 template <class T>
    1406 {
    1407  return (m_count > 0) ? m_a+(m_count-1) : 0;
    1408 }
    1409 
    1410 template <class T>
    1411 const T* ON_ClassArray<T>::Last() const
    1412 {
    1413  return (m_count > 0) ? m_a+(m_count-1) : 0;
    1414 }
    1415 
    1416 // array operations ////////////////////////////////////////////////////
    1417 
    1418 template <class T>
    1419 void ON_ClassArray<T>::Move( int dest_i, int src_i, int ele_cnt )
    1420 {
    1421  // private function for moving blocks of array memory
    1422  // caller is responsible for updating m_count and managing
    1423  // destruction/creation.
    1424  if ( ele_cnt <= 0 || src_i < 0 || dest_i < 0 || src_i == dest_i ||
    1425  src_i + ele_cnt > m_count || dest_i > m_count )
    1426  return;
    1427 
    1428  int capacity = dest_i + ele_cnt;
    1429  if ( capacity > m_capacity ) {
    1430  if ( capacity < 2*m_capacity )
    1431  capacity = 2*m_capacity;
    1432  SetCapacity( capacity );
    1433  }
    1434 
    1435  // This call to memmove is ok, even when T is a class with a vtable
    1436  // because the it doesn't change the vtable for the class.
    1437  // Classes that have back pointers, like ON_UserData, are
    1438  // handled elsewhere and cannot be in ON_ClassArray<>s.
    1439  memmove( (void*)(&m_a[dest_i]), (const void*)(&m_a[src_i]), ele_cnt*sizeof(T) );
    1440 }
    1441 
    1442 template <class T>
    1444 {
    1445  // use placement ( new(size_t,void*) ) to construct
    1446  // T in supplied memory
    1447  new(p) T;
    1448 }
    1449 
    1450 template <class T>
    1452 {
    1453  x.~T();
    1454 }
    1455 
    1456 template <class T>
    1458 {
    1459  if ( m_count == m_capacity )
    1460  {
    1461  int newcapacity = NewCapacity();
    1462  Reserve( newcapacity );
    1463  }
    1464  else
    1465  {
    1466  // First destroy what's there ..
    1467  DestroyElement(m_a[m_count]);
    1468  // and then get a properly initialized element
    1469  ConstructDefaultElement(&m_a[m_count]);
    1470  }
    1471  return m_a[m_count++];
    1472 }
    1473 
    1474 template <class T>
    1475 void ON_ClassArray<T>::Append( const T& x )
    1476 {
    1477  if ( m_count == m_capacity )
    1478  {
    1479  const int newcapacity = NewCapacity();
    1480  if (m_a)
    1481  {
    1482  const int s = (int)(&x - m_a); // (int) cast is for 64 bit pointers
    1483  if ( s >= 0 && s < m_capacity )
    1484  {
    1485  // 26 Sep 2005 Dale Lear
    1486  // User passed in an element of the m_a[]
    1487  // that will get reallocated by the call
    1488  // to Reserve(newcapacity).
    1489  T temp; // ON_*Array<> templates do not require robust copy constructor.
    1490  temp = x; // ON_*Array<> templates require a robust operator=.
    1491  Reserve( newcapacity );
    1492  m_a[m_count++] = temp;
    1493  return;
    1494  }
    1495  }
    1496  Reserve(newcapacity);
    1497  }
    1498  m_a[m_count++] = x;
    1499 }
    1500 
    1501 template <class T>
    1502 void ON_ClassArray<T>::Append( int count, const T* p )
    1503 {
    1504  int i;
    1505  if ( count > 0 && p )
    1506  {
    1507  if ( count + m_count > m_capacity )
    1508  {
    1509  int newcapacity = NewCapacity();
    1510  if ( newcapacity < count + m_count )
    1511  newcapacity = count + m_count;
    1512  Reserve( newcapacity );
    1513  }
    1514  for ( i = 0; i < count; i++ ) {
    1515  m_a[m_count++] = p[i];
    1516  }
    1517  }
    1518 }
    1519 
    1520 // Insert called with a reference uses operator =
    1521 template <class T>
    1522 void ON_ClassArray<T>::Insert( int i, const T& x )
    1523 {
    1524  if( i >= 0 && i <= m_count )
    1525  {
    1526  if ( m_count == m_capacity )
    1527  {
    1528  int newcapacity = NewCapacity();
    1529  Reserve( newcapacity );
    1530  }
    1531  DestroyElement( m_a[m_count] );
    1532  m_count++;
    1533  if ( i < m_count-1 ) {
    1534  Move( i+1, i, m_count-1-i );
    1535  // This call to memset is ok even when T has a vtable
    1536  // because in-place construction is used later.
    1537  memset( (void*)(&m_a[i]), 0, sizeof(T) );
    1538  ConstructDefaultElement( &m_a[i] );
    1539  }
    1540  else {
    1541  ConstructDefaultElement( &m_a[m_count-1] );
    1542  }
    1543  m_a[i] = x; // uses T::operator=() to copy x to array
    1544  }
    1545 }
    1546 
    1547 template <class T>
    1549 {
    1550  Remove(m_count-1);
    1551 }
    1552 
    1553 template <class T>
    1555 {
    1556  if ( i >= 0 && i < m_count )
    1557  {
    1558  DestroyElement( m_a[i] );
    1559  // This call to memset is ok even when T has a vtable
    1560  // because in-place construction is used later.
    1561  memset( (void*)(&m_a[i]), 0, sizeof(T) );
    1562  Move( i, i+1, m_count-1-i );
    1563  // This call to memset is ok even when T has a vtable
    1564  // because in-place construction is used later.
    1565  memset( (void*)(&m_a[m_count-1]), 0, sizeof(T) );
    1566  ConstructDefaultElement(&m_a[m_count-1]);
    1567  m_count--;
    1568  }
    1569 }
    1570 
    1571 template <class T>
    1573 {
    1574  int i;
    1575  for ( i = m_count-1; i >= 0; i-- ) {
    1576  DestroyElement( m_a[i] );
    1577  // This call to memset is ok even when T has a vtable
    1578  // because in-place construction is used later.
    1579  memset( (void*)(&m_a[i]), 0, sizeof(T) );
    1580  ConstructDefaultElement( &m_a[i] );
    1581  }
    1582  m_count = 0;
    1583 }
    1584 
    1585 template <class T>
    1587 {
    1588  // NOTE:
    1589  // If anything in "T" depends on the value of this's address,
    1590  // then don't call Reverse().
    1591  char t[sizeof(T)];
    1592  int i = 0;
    1593  int j = m_count-1;
    1594  for ( /*empty*/; i < j; i++, j-- ) {
    1595  memcpy( (void*)(t), (void*)(&m_a[i]), sizeof(T) );
    1596  memcpy( (void*)(&m_a[i]), (void*)(&m_a[j]), sizeof(T) );
    1597  memcpy( (void*)(&m_a[j]), (void*)(t), sizeof(T) );
    1598  }
    1599 }
    1600 
    1601 template <class T>
    1602 void ON_ClassArray<T>::Swap( int i, int j )
    1603 {
    1604  if ( i != j && i >= 0 && j >= 0 && i < m_count && j < m_count ) {
    1605  char t[sizeof(T)];
    1606  memcpy( (void*)(t), (void*)(&m_a[i]), sizeof(T) );
    1607  memcpy( (void*)(&m_a[i]), (void*)(&m_a[j]), sizeof(T) );
    1608  memcpy( (void*)(&m_a[j]), (void*)(t), sizeof(T) );
    1609  }
    1610 }
    1611 
    1612 template <class T>
    1613 int ON_ClassArray<T>::Search( const T* key, int (*compar)(const T*,const T*) ) const
    1614 {
    1615  for ( int i = 0; i < m_count; i++ )
    1616  {
    1617  if (!compar(key,m_a+i))
    1618  return i;
    1619  }
    1620  return -1;
    1621 }
    1622 
    1623 template <class T>
    1624 int ON_ClassArray<T>::BinarySearch( const T* key, int (*compar)(const T*,const T*) ) const
    1625 {
    1626  const T* found = (key&&m_a&&m_count>0) ? (const T*)bsearch( key, m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar ) : nullptr;
    1627  return (nullptr != found && found >= m_a) ? ((int)(found - m_a)) : -1;
    1628 }
    1629 
    1630 template <class T>
    1631 int ON_ClassArray<T>::BinarySearch( const T* key, int (*compar)(const T*,const T*), int count ) const
    1632 {
    1633  if ( count > m_count )
    1634  count = m_count;
    1635  if ( count <= 0 )
    1636  return -1;
    1637  const T* found = (key&&m_a&&m_count>0) ? (const T*)bsearch( key, m_a, count, sizeof(T), (int(*)(const void*,const void*))compar ) : nullptr;
    1638  return (nullptr != found && found >= m_a) ? ((int)(found - m_a)) : -1;
    1639 }
    1640 
    1641 template <class T>
    1642 bool ON_ClassArray<T>::HeapSort( int (*compar)(const T*,const T*) )
    1643 {
    1644  bool rc = false;
    1645  if ( m_a && m_count > 0 && compar )
    1646  {
    1647  if ( m_count > 1 )
    1648  ON_hsort( m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    1649  rc = true;
    1650  }
    1651  return rc;
    1652 }
    1653 
    1654 template <class T>
    1655 bool ON_ClassArray<T>::QuickSort( int (*compar)(const T*,const T*) )
    1656 {
    1657  bool rc = false;
    1658  if ( m_a && m_count > 0 && compar )
    1659  {
    1660  if ( m_count > 1 )
    1661  ON_qsort( m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    1662  rc = true;
    1663  }
    1664  return rc;
    1665 }
    1666 
    1667 
    1668 
    1669 template <class T>
    1670 bool ON_ObjectArray<T>::HeapSort( int (*compar)(const T*,const T*) )
    1671 {
    1672  bool rc = false;
    1673  // The "this->" in this->m_count and this->m_a
    1674  // are needed for gcc 4 to compile.
    1675  if ( this->m_a && this->m_count > 0 && compar )
    1676  {
    1677  if ( this->m_count > 1 )
    1678  {
    1679  ON_hsort( this->m_a, this->m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    1680 
    1681  // The MemoryRelocate step is required to synch userdata back pointers
    1682  // so the user data destructor will work correctly.
    1683  int i;
    1684  for ( i = 0; i < this->m_count; i++ )
    1685  {
    1686  this->m_a[i].MemoryRelocate();
    1687  }
    1688  }
    1689  rc = true;
    1690  }
    1691  return rc;
    1692 }
    1693 
    1694 template <class T>
    1695 bool ON_ObjectArray<T>::QuickSort( int (*compar)(const T*,const T*) )
    1696 {
    1697  bool rc = false;
    1698  // The "this->" in this->m_count and this->m_a
    1699  // are needed for gcc 4 to compile.
    1700  if ( this->m_a && this->m_count > 0 && compar )
    1701  {
    1702  if ( this->m_count > 1 )
    1703  {
    1704  ON_qsort( this->m_a, this->m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    1705 
    1706  // The MemoryRelocate step is required to synch userdata back pointers
    1707  // so the user data destructor will work correctly.
    1708  int i;
    1709  for ( i = 0; i < this->m_count; i++ )
    1710  {
    1711  this->m_a[i].MemoryRelocate();
    1712  }
    1713  }
    1714  rc = true;
    1715  }
    1716  return rc;
    1717 }
    1718 
    1719 
    1720 template <class T>
    1721 bool ON_ClassArray<T>::Sort( ON::sort_algorithm sa, int* index, int (*compar)(const T*,const T*) ) const
    1722 {
    1723  bool rc = false;
    1724  if ( m_a && m_count > 0 && compar && index )
    1725  {
    1726  if ( m_count > 1 )
    1727  ON_Sort(sa, index, m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    1728  else if ( m_count == 1 )
    1729  index[0] = 0;
    1730  rc = true;
    1731  }
    1732  return rc;
    1733 }
    1734 
    1735 template <class T>
    1736 bool ON_ClassArray<T>::Sort( ON::sort_algorithm sa, int* index, int (*compar)(const T*,const T*,void*),void* p ) const
    1737 {
    1738  bool rc = false;
    1739  if ( m_a && m_count > 0 && compar && index )
    1740  {
    1741  if ( m_count > 1 )
    1742  ON_Sort(sa, index, m_a, m_count, sizeof(T), (int(*)(const void*,const void*,void*))compar, p );
    1743  else if ( m_count == 1 )
    1744  index[0] = 0;
    1745  rc = true;
    1746  }
    1747  return rc;
    1748 }
    1749 
    1750 template <class T>
    1751 bool ON_ClassArray<T>::Permute( const int* index )
    1752 {
    1753  bool rc = false;
    1754  if ( m_a && m_count > 0 && index )
    1755  {
    1756  int i;
    1757  T* buffer = (T*)onmalloc(m_count*sizeof(buffer[0]));
    1758  memcpy( (void*)(buffer), (void*)(m_a), m_count*sizeof(T) );
    1759  for (i = 0; i < m_count; i++ )
    1760  memcpy( (void*)(m_a+i), (void*)(buffer+index[i]), sizeof(T) ); // must use memcopy and not operator=
    1761  onfree(buffer);
    1762  rc = true;
    1763  }
    1764  return rc;
    1765 }
    1766 
    1767 template <class T>
    1769 {
    1770  int i;
    1771  if ( m_a && m_capacity > 0 ) {
    1772  for ( i = m_capacity-1; i >= 0; i-- ) {
    1773  DestroyElement(m_a[i]);
    1774  // This call to memset is ok even when T has a vtable
    1775  // because in-place construction is used later.
    1776  memset( (void*)(&m_a[i]), 0, sizeof(T) );
    1777  ConstructDefaultElement(&m_a[i]);
    1778  }
    1779  }
    1780 }
    1781 
    1782 // memory managment ////////////////////////////////////////////////////
    1783 
    1784 template <class T>
    1785 T* ON_ClassArray<T>::Reserve( size_t newcap )
    1786 {
    1787  if( (size_t)m_capacity < newcap )
    1788  SetCapacity( newcap );
    1789  return m_a;
    1790 }
    1791 
    1792 template <class T>
    1794 {
    1795  SetCapacity( m_count );
    1796 }
    1797 
    1798 template <class T>
    1800 {
    1801  SetCapacity( 0 );
    1802 }
    1803 
    1804 // low level memory managment //////////////////////////////////////////
    1805 
    1806 template <class T>
    1807 void ON_ClassArray<T>::SetCount( int count )
    1808 {
    1809  if ( count >= 0 && count <= m_capacity )
    1810  m_count = count;
    1811 }
    1812 
    1813 template <class T>
    1814 T* ON_ClassArray<T>::SetCapacity( size_t new_capacity )
    1815 {
    1816  if (0 == m_capacity)
    1817  {
    1818  // Allow "expert" users of ON_SimpleArray<>.SetArray(*,*,0) to clean up after themselves
    1819  // and deals with the case when the forget to clean up after themselves.
    1820  m_a = nullptr;
    1821  m_count = 0;
    1822  }
    1823  // uses "placement" for class construction/destruction
    1824  int i;
    1825  int capacity = (new_capacity > 0 && new_capacity < ON_UNSET_UINT_INDEX)
    1826  ? (int)new_capacity
    1827  : 0;
    1828 
    1829  if ( capacity <= 0 ) {
    1830  if ( m_a ) {
    1831  for ( i = m_capacity-1; i >= 0; i-- ) {
    1832  DestroyElement(m_a[i]);
    1833  }
    1834  Realloc(m_a,0);
    1835  m_a = 0;
    1836  }
    1837  m_count = 0;
    1838  m_capacity = 0;
    1839  }
    1840  else if ( m_capacity < capacity ) {
    1841  // growing
    1842  m_a = Realloc( m_a, capacity );
    1843  // initialize new elements with default constructor
    1844  if ( 0 != m_a )
    1845  {
    1846  // even when m_a is an array of classes with vtable pointers,
    1847  // this call to memset(..., 0, ...) is what I want to do
    1848  // because in-place construction will be used when needed
    1849  // on this memory.
    1850  memset( (void*)(m_a + m_capacity), 0, (capacity-m_capacity)*sizeof(T) );
    1851  for ( i = m_capacity; i < capacity; i++ ) {
    1852  ConstructDefaultElement(&m_a[i]);
    1853  }
    1854  m_capacity = capacity;
    1855  }
    1856  else
    1857  {
    1858  // memory allocation failed
    1859  m_capacity = 0;
    1860  m_count = 0;
    1861  }
    1862  }
    1863  else if ( m_capacity > capacity ) {
    1864  // shrinking
    1865  for ( i = m_capacity-1; i >= capacity; i-- ) {
    1866  DestroyElement(m_a[i]);
    1867  }
    1868  if ( m_count > capacity )
    1869  m_count = capacity;
    1870  m_capacity = capacity;
    1871  m_a = Realloc( m_a, capacity );
    1872  if ( 0 == m_a )
    1873  {
    1874  // memory allocation failed
    1875  m_capacity = 0;
    1876  m_count = 0;
    1877  }
    1878  }
    1879  return m_a;
    1880 }
    1881 
    1882 /////////////////////////////////////////////////////////////////////////////////////
    1883 /////////////////////////////////////////////////////////////////////////////////////
    1884 /////////////////////////////////////////////////////////////////////////////////////
    1885 
    1886 template< class T>
    1887 int ON_CompareIncreasing( const T* a, const T* b)
    1888 {
    1889  if( *a < *b )
    1890  return -1;
    1891  if( *b < *a )
    1892  return 1;
    1893  return 0;
    1894 }
    1895 
    1896 template< class T>
    1897 int ON_CompareDecreasing( const T* a, const T* b)
    1898 {
    1899  if( *b < *a )
    1900  return -1;
    1901  if( *a < *b )
    1902  return 1;
    1903  return 0;
    1904 }
    1905 
    1906 #pragma ON_PRAGMA_WARNING_POP
    1907 
    1908 #endif
    void Empty()
    Sets count to 0, leaves capacity untouched.
    Definition: opennurbs_array_defs.h:558
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(ON_ARRAY_DEFS_INC_)
    18 #define ON_ARRAY_DEFS_INC_
    19 
    20 // When this file is parsed with /W4 warnings, two bogus warnings
    21 // are generated.
    22 #pragma ON_PRAGMA_WARNING_PUSH
    23 
    24 // The ON_ClassArray<T>::DestroyElement template function generates a
    25 // C4100: 'x' : unreferenced formal parameter
    26 // warning.
    27 // This appears to be caused by a bug in the compiler warning code
    28 // or the way templates are expanded. This pragma is needed squelch the
    29 // bogus warning.
    30 #pragma ON_PRAGMA_WARNING_DISABLE_MSC(4100)
    31 
    32 // The ON_CompareIncreasing and ON_CompareDecreasing templates generate a
    33 // C4211: nonstandard extension used : redefined extern to static
    34 // warning. Microsoft's compiler appears to have a little trouble
    35 // when static functions are declared before they are defined in a
    36 // single .cpp file. This pragma is needed squelch the bogus warning.
    37 #pragma ON_PRAGMA_WARNING_DISABLE_MSC(4211)
    38 
    39 // The main reason the definitions of the functions for the
    40 // ON_SimpleArray and ON_ClassArray templates are in this separate
    41 // file is so that the Microsoft developer studio autocomplete
    42 // functions will work on these classes.
    43 //
    44 // This file is included by opennurbs_array.h in the appropriate
    45 // spot. If you need the definitions in the file, then you
    46 // should include opennurbs_array.h and let it take care of
    47 // including this file.
    48 
    49 
    50 /////////////////////////////////////////////////////////////////////////////////////
    51 // Class ON_SimpleArray<>
    52 /////////////////////////////////////////////////////////////////////////////////////
    53 
    54 // construction ////////////////////////////////////////////////////////
    55 
    56 template <class T>
    57 T* ON_SimpleArray<T>::Realloc(T* ptr,int capacity)
    58 {
    59  return (T*)onrealloc(ptr,capacity*sizeof(T));
    60 }
    61 
    62 template <class T>
    64  : m_a(nullptr)
    65  , m_count(0)
    66  , m_capacity(0)
    67 {}
    68 
    69 template <class T>
    71  : m_a(nullptr)
    72  , m_count(0)
    73  , m_capacity(0)
    74 {
    75  if ( c > 0 )
    76  SetCapacity( c );
    77 }
    78 
    79 // Copy constructor
    80 template <class T>
    82  : m_a(0)
    83  , m_count(0)
    84  , m_capacity(0)
    85 {
    86  *this = src; // operator= defined below
    87 }
    88 
    89 template <class T>
    91 {
    92  SetCapacity(0);
    93 }
    94 
    95 template <class T>
    97 {
    98  if( this != &src ) {
    99  if ( src.m_count <= 0 ) {
    100  m_count = 0;
    101  }
    102  else {
    103  if ( m_capacity < src.m_count ) {
    104  SetCapacity( src.m_count );
    105  }
    106  if ( m_a ) {
    107  m_count = src.m_count;
    108  memcpy( (void*)(m_a), (void*)(src.m_a), m_count*sizeof(T) );
    109  }
    110  }
    111  }
    112  return *this;
    113 }
    114 
    115 #if defined(ON_HAS_RVALUEREF)
    116 
    117 // Clone constructor
    118 template <class T>
    120  : m_a(src.m_a)
    121  , m_count(src.m_count)
    122  , m_capacity(src.m_capacity)
    123 {
    124  src.m_a = 0;
    125  src.m_count = 0;
    126  src.m_capacity = 0;
    127 }
    128 
    129 // Clone assignment
    130 template <class T>
    132 {
    133  if( this != &src )
    134  {
    135  this->Destroy();
    136  m_a = src.m_a;
    137  m_count = src.m_count;
    138  m_capacity = src.m_capacity;
    139  src.m_a = 0;
    140  src.m_count = 0;
    141  src.m_capacity = 0;
    142  }
    143  return *this;
    144 }
    145 
    146 #endif
    147 
    148 // emergency destroy ///////////////////////////////////////////////////
    149 
    150 template <class T>
    152 {
    153  m_count = 0;
    154  m_capacity = 0;
    155  m_a = 0;
    156 }
    157 
    158 // query ///////////////////////////////////////////////////////////////
    159 
    160 template <class T>
    162 {
    163  return m_count;
    164 }
    165 
    166 template <class T>
    168 {
    169  return ((unsigned int)m_count);
    170 }
    171 
    172 template <class T>
    174 {
    175  return m_capacity;
    176 }
    177 
    178 template <class T>
    179 unsigned int ON_SimpleArray<T>::SizeOfArray() const
    180 {
    181  return ((unsigned int)(m_capacity*sizeof(T)));
    182 }
    183 
    184 template <class T>
    186 {
    187  return ((unsigned int)(sizeof(T)));
    188 }
    189 
    190 
    191 template <class T>
    192 ON__UINT32 ON_SimpleArray<T>::DataCRC(ON__UINT32 current_remainder) const
    193 {
    194  return ON_CRC32(current_remainder,m_count*sizeof(m_a[0]),m_a);
    195 }
    196 
    197 template <class T>
    199 {
    200 #if defined(ON_DEBUG)
    201  if ( i < 0 || i > m_capacity )
    202  {
    203  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    204  }
    205 #endif
    206  return m_a[i];
    207 }
    208 
    209 template <class T>
    210 T& ON_SimpleArray<T>::operator[]( unsigned int i )
    211 {
    212 #if defined(ON_DEBUG)
    213  if ( i > (unsigned int)m_capacity )
    214  {
    215  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    216  }
    217 #endif
    218  return m_a[i];
    219 }
    220 
    221 
    222 template <class T>
    224 {
    225 #if defined(ON_DEBUG)
    226  if ( i < 0 || i > (ON__INT64)m_capacity )
    227  {
    228  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    229  }
    230 #endif
    231  return m_a[i];
    232 }
    233 
    234 template <class T>
    236 {
    237 #if defined(ON_DEBUG)
    238  if ( i > (ON__UINT64)m_capacity )
    239  {
    240  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    241  }
    242 #endif
    243  return m_a[i];
    244 }
    245 
    246 
    247 #if defined(ON_RUNTIME_APPLE)
    248 template <class T>
    249 T& ON_SimpleArray<T>::operator[](size_t i )
    250 {
    251 #if defined(ON_DEBUG)
    252  if ( i > (size_t)m_capacity )
    253  {
    254  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    255  }
    256 #endif
    257  return m_a[i];
    258 }
    259 #endif
    260 
    261 template <class T>
    262 const T& ON_SimpleArray<T>::operator[](int i) const
    263 {
    264 #if defined(ON_DEBUG)
    265  if ( i < 0 || i > m_capacity )
    266  {
    267  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    268  }
    269 #endif
    270  return m_a[i];
    271 }
    272 
    273 template <class T>
    274 const T& ON_SimpleArray<T>::operator[](unsigned int i) const
    275 {
    276 #if defined(ON_DEBUG)
    277  if ( i > (unsigned int)m_capacity )
    278  {
    279  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    280  }
    281 #endif
    282  return m_a[i];
    283 }
    284 
    285 
    286 template <class T>
    287 const T& ON_SimpleArray<T>::operator[](ON__INT64 i) const
    288 {
    289 #if defined(ON_DEBUG)
    290  if ( i < 0 || i > ((ON__INT64)m_capacity) )
    291  {
    292  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    293  }
    294 #endif
    295  return m_a[i];
    296 }
    297 
    298 template <class T>
    299 const T& ON_SimpleArray<T>::operator[](ON__UINT64 i) const
    300 {
    301 #if defined(ON_DEBUG)
    302  if ( i > (ON__UINT64)m_capacity )
    303  {
    304  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    305  }
    306 #endif
    307  return m_a[i];
    308 }
    309 
    310 #if defined(ON_RUNTIME_APPLE)
    311 template <class T>
    312 const T& ON_SimpleArray<T>::operator[](size_t i) const
    313 {
    314 #if defined(ON_DEBUG)
    315  if ( i > (size_t)m_capacity )
    316  {
    317  ON_ERROR("ON_SimpleArray[i]: i out of range.");
    318  }
    319 #endif
    320  return m_a[i];
    321 }
    322 #endif
    323 
    324 template <class T>
    326 {
    327  return (m_count > 0) ? m_a : 0;
    328 }
    329 
    330 template <class T>
    332 {
    333  return (m_count > 0) ? m_a : 0;
    334 }
    335 
    336 template <class T>
    338 {
    339  return m_a;
    340 }
    341 
    342 template <class T>
    343 const T* ON_SimpleArray<T>::Array() const
    344 {
    345  return m_a;
    346 }
    347 
    348 template <class T>
    350 {
    351  T* p = m_a;
    352  m_a = 0;
    353  m_count = 0;
    354  m_capacity = 0;
    355  return p;
    356 }
    357 
    358 template <class T>
    360 {
    361  if ( m_a && m_a != p )
    362  onfree(m_a);
    363  m_a = p;
    364 }
    365 
    366 template <class T>
    367 void ON_SimpleArray<T>::SetArray(T* p, int count, int capacity)
    368 {
    369  if ( m_a && m_a != p )
    370  onfree(m_a);
    371  m_a = p;
    372  m_count = count;
    373  m_capacity = capacity;
    374 }
    375 
    376 template <class T>
    378 {
    379  return (m_count > 0) ? m_a : 0;
    380 }
    381 
    382 template <class T>
    383 const T* ON_SimpleArray<T>::First() const
    384 {
    385  return (m_count > 0) ? m_a : 0;
    386 }
    387 
    388 template <class T>
    390 {
    391  return (i >= 0 && i < m_count) ? m_a+i : 0;
    392 }
    393 
    394 template <class T>
    395 T* ON_SimpleArray<T>::At( unsigned int i )
    396 {
    397  return (i < (unsigned int)m_count) ? m_a+i : 0;
    398 }
    399 
    400 template <class T>
    401 const T* ON_SimpleArray<T>::At( int i) const
    402 {
    403  return (i >= 0 && i < m_count) ? m_a+i : 0;
    404 }
    405 
    406 template <class T>
    407 const T* ON_SimpleArray<T>::At( unsigned int i) const
    408 {
    409  return (i < (unsigned int)m_count) ? m_a+i : 0;
    410 }
    411 
    412 template <class T>
    413 T* ON_SimpleArray<T>::At( ON__INT64 i )
    414 {
    415  return (i >= 0 && i < (ON__INT64)m_count) ? m_a+i : 0;
    416 }
    417 
    418 template <class T>
    419 T* ON_SimpleArray<T>::At( ON__UINT64 i )
    420 {
    421  return (i < (ON__UINT64)m_count) ? m_a+i : 0;
    422 }
    423 
    424 template <class T>
    425 const T* ON_SimpleArray<T>::At( ON__INT64 i) const
    426 {
    427  return (i >= 0 && i < (ON__INT64)m_count) ? m_a+i : 0;
    428 }
    429 
    430 template <class T>
    431 const T* ON_SimpleArray<T>::At( ON__UINT64 i) const
    432 {
    433  return (i < (ON__UINT64)m_count) ? m_a+i : 0;
    434 }
    435 
    436 template <class T>
    438 {
    439  return (m_count > 0) ? m_a+(m_count-1) : 0;
    440 }
    441 
    442 template <class T>
    443 const T* ON_SimpleArray<T>::Last() const
    444 {
    445  return (m_count > 0) ? m_a+(m_count-1) : 0;
    446 }
    447 
    448 // array operations ////////////////////////////////////////////////////
    449 
    450 template <class T>
    451 void ON_SimpleArray<T>::Move( int dest_i, int src_i, int ele_cnt )
    452 {
    453  // private function for moving blocks of array memory
    454  // caller is responsible for updating m_count.
    455  if ( ele_cnt <= 0 || src_i < 0 || dest_i < 0 || src_i == dest_i ||
    456  src_i + ele_cnt > m_count || dest_i > m_count )
    457  return;
    458 
    459  int capacity = dest_i + ele_cnt;
    460  if ( capacity > m_capacity ) {
    461  if ( capacity < 2*m_capacity )
    462  capacity = 2*m_capacity;
    463  SetCapacity( capacity );
    464  }
    465 
    466  memmove( &m_a[dest_i], &m_a[src_i], ele_cnt*sizeof(T) );
    467 }
    468 
    469 template <class T>
    471 {
    472  if ( m_count == m_capacity )
    473  {
    474  int new_capacity = NewCapacity();
    475  Reserve( new_capacity );
    476  }
    477  memset( (void*)(&m_a[m_count]), 0, sizeof(T) );
    478  return m_a[m_count++];
    479 }
    480 
    481 template <class T>
    482 void ON_SimpleArray<T>::Append( const T& x )
    483 {
    484  if ( m_count == m_capacity )
    485  {
    486  const int newcapacity = NewCapacity();
    487  if (m_a)
    488  {
    489  const int s = (int)(&x - m_a); // (int) cast is for 64 bit pointers
    490  if ( s >= 0 && s < m_capacity )
    491  {
    492  // 26 Sep 2005 Dale Lear
    493  // User passed in an element of the m_a[]
    494  // that will get reallocated by the call
    495  // to Reserve(newcapacity).
    496  T temp; // ON_*Array<> templates do not require robust copy constructor.
    497  temp = x; // ON_*Array<> templates require a robust operator=.
    498  Reserve( newcapacity );
    499  m_a[m_count++] = temp;
    500  return;
    501  }
    502  }
    503  Reserve(newcapacity);
    504  }
    505  m_a[m_count++] = x;
    506 }
    507 
    508 template <class T>
    509 void ON_SimpleArray<T>::Append( int count, const T* p )
    510 {
    511  if ( count > 0 && p )
    512  {
    513  if ( count + m_count > m_capacity )
    514  {
    515  int newcapacity = NewCapacity();
    516  if ( newcapacity < count + m_count )
    517  newcapacity = count + m_count;
    518  Reserve( newcapacity );
    519  }
    520  memcpy( (void*)(m_a + m_count), (void*)(p), count*sizeof(T) );
    521  m_count += count;
    522  }
    523 }
    524 
    525 template <class T>
    526 void ON_SimpleArray<T>::Insert( int i, const T& x )
    527 {
    528  if( i >= 0 && i <= m_count )
    529  {
    530  if ( m_count == m_capacity )
    531  {
    532  int newcapacity = NewCapacity();
    533  Reserve( newcapacity );
    534  }
    535  m_count++;
    536  Move( i+1, i, m_count-1-i );
    537  m_a[i] = x;
    538  }
    539 }
    540 
    541 template <class T>
    543 {
    544  Remove(m_count-1);
    545 }
    546 
    547 template <class T>
    549 {
    550  if ( i >= 0 && i < m_count ) {
    551  Move( i, i+1, m_count-1-i );
    552  m_count--;
    553  memset( (void*)(&m_a[m_count]), 0, sizeof(T) );
    554  }
    555 }
    556 
    557 template <class T>
    559 {
    560  if ( m_a )
    561  memset( (void*)(m_a), 0, m_capacity*sizeof(T) );
    562  m_count = 0;
    563 }
    564 
    565 template <class T>
    567 {
    568  // NOTE:
    569  // If anything in "T" depends on the value of this's address,
    570  // then don't call Reverse().
    571  T t;
    572  int i = 0;
    573  int j = m_count-1;
    574  for ( /*empty*/; i < j; i++, j-- ) {
    575  t = m_a[i];
    576  m_a[i] = m_a[j];
    577  m_a[j] = t;
    578  }
    579 }
    580 
    581 template <class T>
    582 void ON_SimpleArray<T>::Swap( int i, int j )
    583 {
    584  if ( i != j ) {
    585  const T t(m_a[i]);
    586  m_a[i] = m_a[j];
    587  m_a[j] = t;
    588  }
    589 }
    590 
    591 template <class T>
    592 int ON_SimpleArray<T>::Search( const T& key ) const
    593 {
    594  const T* p = &key;
    595  for ( int i = 0; i < m_count; i++ ) {
    596  if (!memcmp(p,m_a+i,sizeof(T)))
    597  return i;
    598  }
    599  return -1;
    600 }
    601 
    602 template <class T>
    603 int ON_SimpleArray<T>::Search( const T* key, int (*compar)(const T*,const T*) ) const
    604 {
    605  for ( int i = 0; i < m_count; i++ ) {
    606  if (!compar(key,m_a+i))
    607  return i;
    608  }
    609  return -1;
    610 }
    611 
    612 template <class T>
    613 int ON_SimpleArray<T>::BinarySearch( const T* key, int (*compar)(const T*,const T*) ) const
    614 {
    615  const T* found = (key&&m_a&&m_count>0)
    616  ? (const T*)bsearch( key, m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar )
    617  : 0;
    618 
    619  // This worked on a wide range of 32 bit compilers.
    620 
    621  int rc;
    622  if ( 0 != found )
    623  {
    624  // Convert "found" pointer to array index.
    625 
    626 #if defined(ON_COMPILER_MSC1300)
    627  rc = ((int)(found - m_a));
    628 #elif 8 == ON_SIZEOF_POINTER
    629  // In an ideal world, return ((int)(found - m_a)) would work everywhere.
    630  // In practice, this should work any 64 bit compiler and we can hope
    631  // the optimzer generates efficient code.
    632  const ON__UINT64 fptr = (ON__UINT64)found;
    633  const ON__UINT64 aptr = (ON__UINT64)m_a;
    634  const ON__UINT64 sz = (ON__UINT64)sizeof(T);
    635  const ON__UINT64 i = (fptr - aptr)/sz;
    636  rc = (int)i;
    637 #else
    638  // In an ideal world, return ((int)(found - m_a)) would work everywhere.
    639  // In practice, this should work any 32 bit compiler and we can hope
    640  // the optimzer generates efficient code.
    641  const ON__UINT32 fptr = (ON__UINT32)found;
    642  const ON__UINT32 aptr = (ON__UINT32)m_a;
    643  const ON__UINT32 sz = (ON__UINT32)sizeof(T);
    644  const ON__UINT32 i = (fptr - aptr)/sz;
    645  rc = (int)i;
    646 #endif
    647  }
    648  else
    649  {
    650  // "key" not found
    651  rc = -1;
    652  }
    653 
    654  return rc;
    655 
    656 }
    657 
    658 template <class T>
    659 int ON_SimpleArray<T>::BinarySearch( const T* key, int (*compar)(const T*,const T*), int count ) const
    660 {
    661  if ( count > m_count )
    662  count = m_count;
    663  if ( count <= 0 )
    664  return -1;
    665  const T* found = (key&&m_a&&m_count>0)
    666  ? (const T*)bsearch( key, m_a, count, sizeof(T), (int(*)(const void*,const void*))compar )
    667  : 0;
    668 
    669  // This worked on a wide range of 32 bit compilers.
    670 
    671  int rc;
    672  if ( 0 != found )
    673  {
    674  // Convert "found" pointer to array index.
    675 
    676 #if defined(ON_COMPILER_MSC1300)
    677  rc = ((int)(found - m_a));
    678 #elif 8 == ON_SIZEOF_POINTER
    679  // In an ideal world, return ((int)(found - m_a)) would work everywhere.
    680  // In practice, this should work any 64 bit compiler and we can hope
    681  // the optimzer generates efficient code.
    682  const ON__UINT64 fptr = (ON__UINT64)found;
    683  const ON__UINT64 aptr = (ON__UINT64)m_a;
    684  const ON__UINT64 sz = (ON__UINT64)sizeof(T);
    685  const ON__UINT64 i = (fptr - aptr)/sz;
    686  rc = (int)i;
    687 #else
    688  // In an ideal world, return ((int)(found - m_a)) would work everywhere.
    689  // In practice, this should work any 32 bit compiler and we can hope
    690  // the optimzer generates efficient code.
    691  const ON__UINT32 fptr = (ON__UINT32)found;
    692  const ON__UINT32 aptr = (ON__UINT32)m_a;
    693  const ON__UINT32 sz = (ON__UINT32)sizeof(T);
    694  const ON__UINT32 i = (fptr - aptr)/sz;
    695  rc = (int)i;
    696 #endif
    697  }
    698  else
    699  {
    700  // "key" not found
    701  rc = -1;
    702  }
    703  return rc;
    704 }
    705 
    706 
    707 
    708 template <class T>
    709 bool ON_SimpleArray<T>::HeapSort( int (*compar)(const T*,const T*) )
    710 {
    711  bool rc = false;
    712  if ( m_a && m_count > 0 && compar ) {
    713  if ( m_count > 1 )
    714  ON_hsort( m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    715  rc = true;
    716  }
    717  return rc;
    718 }
    719 
    720 template <class T>
    721 bool ON_SimpleArray<T>::QuickSort( int (*compar)(const T*,const T*) )
    722 {
    723  bool rc = false;
    724  if ( m_a && m_count > 0 && compar ) {
    725  if ( m_count > 1 )
    726  ON_qsort( m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    727  rc = true;
    728  }
    729  return rc;
    730 }
    731 
    732 template <class T>
    733 bool ON_SimpleArray<T>::Sort( ON::sort_algorithm sa, int* index, int (*compar)(const T*,const T*) ) const
    734 {
    735  bool rc = false;
    736  if ( m_a && m_count > 0 && compar && index ) {
    737  if ( m_count > 1 )
    738  ON_Sort(sa, index, m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    739  else if ( m_count == 1 )
    740  index[0] = 0;
    741  rc = true;
    742  }
    743  return rc;
    744 }
    745 
    746 template <class T>
    747 bool ON_SimpleArray<T>::Sort( ON::sort_algorithm sa, int* index, int (*compar)(const T*,const T*,void*),void* p ) const
    748 {
    749  bool rc = false;
    750  if ( m_a && m_count > 0 && compar && index ) {
    751  if ( m_count > 1 )
    752  ON_Sort(sa, index, m_a, m_count, sizeof(T), (int(*)(const void*,const void*,void*))compar, p );
    753  else if ( m_count == 1 )
    754  index[0] = 0;
    755  rc = true;
    756  }
    757  return rc;
    758 }
    759 
    760 template <class T>
    761 bool ON_SimpleArray<T>::Permute( const int* index )
    762 {
    763  bool rc = false;
    764  if ( m_a && m_count > 0 && index ) {
    765  int i;
    766  T* buffer = (T*)onmalloc(m_count*sizeof(buffer[0]));
    767  memcpy( (void*)(buffer), (void*)(m_a), m_count*sizeof(T) );
    768  for (i = 0; i < m_count; i++ )
    769  memcpy( (void*)(m_a+i), (void*)(buffer+index[i]), sizeof(T) ); // must use memcopy and not operator=
    770  onfree(buffer);
    771  rc = true;
    772  }
    773  return rc;
    774 }
    775 
    776 template <class T>
    778 {
    779  if ( m_a && m_capacity > 0 ) {
    780  memset( (void*)(m_a), 0, m_capacity*sizeof(T) );
    781  }
    782 }
    783 
    784 template <class T>
    785 void ON_SimpleArray<T>::MemSet( unsigned char value )
    786 {
    787  if ( m_a && m_capacity > 0 ) {
    788  memset( (void*)(m_a), value, m_capacity*sizeof(T) );
    789  }
    790 }
    791 
    792 // memory managment ////////////////////////////////////////////////////
    793 
    794 template <class T>
    795 T* ON_SimpleArray<T>::Reserve( size_t newcap )
    796 {
    797  if( (size_t)m_capacity < newcap )
    798  SetCapacity( newcap );
    799  return m_a;
    800 }
    801 
    802 template <class T>
    804 {
    805  SetCapacity( m_count );
    806 }
    807 
    808 template <class T>
    810 {
    811  SetCapacity( 0 );
    812 }
    813 
    814 // low level memory managment //////////////////////////////////////////
    815 
    816 template <class T>
    817 void ON_SimpleArray<T>::SetCount( int count )
    818 {
    819  if ( count >= 0 && count <= m_capacity )
    820  m_count = count;
    821 }
    822 
    823 template <class T>
    824 T* ON_SimpleArray<T>::SetCapacity( size_t new_capacity )
    825 {
    826  if (0 == m_capacity)
    827  {
    828  // Allow "expert" users of ON_SimpleArray<>.SetArray(*,*,0) to clean up after themselves
    829  // and deals with the case when the forget to clean up after themselves.
    830  m_a = nullptr;
    831  m_count = 0;
    832  }
    833 
    834  // sets capacity to input value
    835  int capacity = (new_capacity > 0 && new_capacity < ON_UNSET_UINT_INDEX)
    836  ? (int)new_capacity
    837  : 0;
    838  if ( capacity != m_capacity ) {
    839  if( capacity > 0 ) {
    840  if ( m_count > capacity )
    841  m_count = capacity;
    842  // NOTE: Realloc() does an allocation if the first argument is nullptr.
    843  m_a = Realloc( m_a, capacity );
    844  if ( m_a ) {
    845  if ( capacity > m_capacity ) {
    846  // zero new memory
    847  memset( (void*) (m_a + m_capacity), 0, (capacity-m_capacity)*sizeof(T) );
    848  }
    849  m_capacity = capacity;
    850  }
    851  else {
    852  // out of memory
    853  m_count = m_capacity = 0;
    854  }
    855  }
    856  else if (m_a) {
    857  Realloc(m_a,0);
    858  m_a = 0;
    859  m_count = m_capacity = 0;
    860  }
    861  }
    862  return m_a;
    863 }
    864 
    865 template <class T>
    867 {
    868  // Note:
    869  // This code appears in ON_SimpleArray<T>::NewCapacity()
    870  // and ON_ClassArray<T>::NewCapacity(). Changes made to
    871  // either function should be made to both functions.
    872  // Because this code is template code that has to
    873  // support dynamic linking and the code is defined
    874  // in a header, I'm using copy-and-paste rather
    875  // than a static.
    876 
    877  // This function returns 2*m_count unless that will
    878  // result in an additional allocation of more than
    879  // cap_size bytes. The cap_size concept was added in
    880  // January 2010 because some calculations on enormous
    881  // models were slightly underestimating the initial
    882  // Reserve() size and then wasting gigabytes of memory.
    883 
    884  // cap_size = 128 MB on 32-bit os, 256 MB on 64 bit os
    885  const size_t cap_size = 32*sizeof(void*)*1024*1024;
    886  if (m_count*sizeof(T) <= cap_size || m_count < 8)
    887  return ((m_count <= 2) ? 4 : 2*m_count);
    888 
    889  // Growing the array will increase the memory
    890  // use by more than cap_size.
    891  int delta_count = 8 + cap_size/sizeof(T);
    892  if ( delta_count > m_count )
    893  delta_count = m_count;
    894  return (m_count + delta_count);
    895 }
    896 
    897 template <class T>
    899 {
    900  // Note:
    901  // This code appears in ON_SimpleArray<T>::NewCapacity()
    902  // and ON_ClassArray<T>::NewCapacity(). Changes made to
    903  // either function should be made to both functions.
    904  // Because this code is template code that has to
    905  // support dynamic linking and the code is defined
    906  // in a header, I'm using copy-and-paste rather
    907  // than a static.
    908 
    909  // This function returns 2*m_count unless that will
    910  // result in an additional allocation of more than
    911  // cap_size bytes. The cap_size concept was added in
    912  // January 2010 because some calculations on enormous
    913  // models were slightly underestimating the initial
    914  // Reserve() size and then wasting gigabytes of memory.
    915 
    916  // cap_size = 128 MB on 32-bit os, 256 MB on 64 bit os
    917  const size_t cap_size = 32*sizeof(void*)*1024*1024;
    918  if (m_count*sizeof(T) <= cap_size || m_count < 8)
    919  return ((m_count <= 2) ? 4 : 2*m_count);
    920 
    921  // Growing the array will increase the memory
    922  // use by more than cap_size.
    923  int delta_count = 8 + cap_size/sizeof(T);
    924  if ( delta_count > m_count )
    925  delta_count = m_count;
    926  return (m_count + delta_count);
    927 }
    928 
    929 /////////////////////////////////////////////////////////////////////////////////////
    930 // Class ON_ObjectArray<>
    931 /////////////////////////////////////////////////////////////////////////////////////
    932 
    933 template <class T>
    935 {
    936 }
    937 
    938 template <class T>
    940 {
    941 }
    942 
    943 template <class T>
    945 {
    946 }
    947 
    948 template <class T>
    950 {
    951  if( this != &src)
    952  {
    954  }
    955  return *this;
    956 }
    957 
    958 #if defined(ON_HAS_RVALUEREF)
    959 
    960 // Clone constructor
    961 template <class T>
    963  : ON_ClassArray<T>(std::move(src))
    964 {}
    965 
    966 // Clone assignment
    967 template <class T>
    969 {
    970  if( this != &src )
    971  {
    972  this->Destroy();
    973  m_a = src.m_a;
    974  m_count = src.m_count;
    975  m_capacity = src.m_capacity;
    976  src.m_a = 0;
    977  src.m_count = 0;
    978  src.m_capacity = 0;
    979  }
    980  return *this;
    981 }
    982 
    983 #endif
    984 
    985 template <class T>
    987  : ON_ClassArray<T>(c)
    988 {
    989 }
    990 
    991 template <class T>
    992 T* ON_ObjectArray<T>::Realloc(T* ptr,int capacity)
    993 {
    994  T* reptr = (T*)onrealloc(ptr,capacity*sizeof(T));
    995  if ( ptr && reptr && reptr != ptr )
    996  {
    997  // The "this->" in this->m_count and this->m_a
    998  // are needed for gcc 4 to compile.
    999  int i;
    1000  for ( i = 0; i < this->m_count; i++ )
    1001  {
    1002  reptr[i].MemoryRelocate();
    1003  }
    1004  }
    1005  return reptr;
    1006 }
    1007 
    1008 /////////////////////////////////////////////////////////////////////////////////////
    1009 // Class ON_ClassArray<>
    1010 /////////////////////////////////////////////////////////////////////////////////////
    1011 
    1012 
    1013 // construction ////////////////////////////////////////////////////////
    1014 
    1015 template <class T>
    1016 T* ON_ClassArray<T>::Realloc(T* ptr,int capacity)
    1017 {
    1018  return (T*)onrealloc(ptr,capacity*sizeof(T));
    1019 }
    1020 
    1021 template <class T>
    1022 ON__UINT32 ON_ObjectArray<T>::DataCRC(ON__UINT32 current_remainder) const
    1023 {
    1024  // The "this->" in this->m_count and this->m_a
    1025  // are needed for gcc 4 to compile.
    1026  int i;
    1027  for ( i = 0; i < this->m_count; i++ )
    1028  {
    1029  current_remainder = this->m_a[i].DataCRC(current_remainder);
    1030  }
    1031  return current_remainder;
    1032 }
    1033 
    1034 template <class T>
    1036  : m_a(nullptr)
    1037  , m_count(0)
    1038  , m_capacity(0)
    1039 {}
    1040 
    1041 template <class T>
    1043  : m_a(nullptr)
    1044  , m_count(0)
    1045  , m_capacity(0)
    1046 {
    1047  if ( c > 0 )
    1048  SetCapacity( c );
    1049 }
    1050 
    1051 // Copy constructor
    1052 template <class T>
    1054  : m_a(nullptr)
    1055  , m_count(0)
    1056  , m_capacity(0)
    1057 {
    1058  *this = src; // operator= defined below
    1059 }
    1060 
    1061 template <class T>
    1063 {
    1064  SetCapacity(0);
    1065 }
    1066 
    1067 template <class T>
    1069 {
    1070  int i;
    1071  if( this != &src ) {
    1072  if ( src.m_count <= 0 ) {
    1073  m_count = 0;
    1074  }
    1075  else {
    1076  if ( m_capacity < src.m_count ) {
    1077  SetCapacity( src.m_count );
    1078  }
    1079  if ( m_a ) {
    1080  m_count = src.m_count;
    1081  for ( i = 0; i < m_count; i++ ) {
    1082  m_a[i] = src.m_a[i];
    1083  }
    1084  }
    1085  }
    1086  }
    1087  return *this;
    1088 }
    1089 
    1090 #if defined(ON_HAS_RVALUEREF)
    1091 
    1092 // Clone constructor
    1093 template <class T>
    1095  : m_a(src.m_a)
    1096  , m_count(src.m_count)
    1097  , m_capacity(src.m_capacity)
    1098 {
    1099  src.m_a = 0;
    1100  src.m_count = 0;
    1101  src.m_capacity = 0;
    1102 }
    1103 
    1104 // Clone assignment
    1105 template <class T>
    1107 {
    1108  if( this != &src )
    1109  {
    1110  this->Destroy();
    1111  m_a = src.m_a;
    1112  m_count = src.m_count;
    1113  m_capacity = src.m_capacity;
    1114  src.m_a = 0;
    1115  src.m_count = 0;
    1116  src.m_capacity = 0;
    1117  }
    1118  return *this;
    1119 }
    1120 
    1121 #endif
    1122 
    1123 // emergency destroy ///////////////////////////////////////////////////
    1124 
    1125 template <class T>
    1127 {
    1128  m_count = 0;
    1129  m_capacity = 0;
    1130  m_a = 0;
    1131 }
    1132 
    1133 // query ///////////////////////////////////////////////////////////////
    1134 
    1135 template <class T>
    1137 {
    1138  return m_count;
    1139 }
    1140 
    1141 template <class T>
    1143 {
    1144  return ((unsigned int)m_count);
    1145 }
    1146 
    1147 template <class T>
    1149 {
    1150  return m_capacity;
    1151 }
    1152 
    1153 template <class T>
    1154 unsigned int ON_ClassArray<T>::SizeOfArray() const
    1155 {
    1156  return ((unsigned int)(m_capacity*sizeof(T)));
    1157 }
    1158 
    1159 template <class T>
    1161 {
    1162  return ((unsigned int)(sizeof(T)));
    1163 }
    1164 
    1165 template <class T>
    1167 {
    1168 #if defined(ON_DEBUG)
    1169  if ( i < 0 || i > m_capacity )
    1170  {
    1171  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1172  }
    1173 #endif
    1174  return m_a[i];
    1175 }
    1176 
    1177 
    1178 template <class T>
    1180 {
    1181 #if defined(ON_DEBUG)
    1182  if ( i < 0 || i > (ON__INT64)m_capacity )
    1183  {
    1184  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1185  }
    1186 #endif
    1187  return m_a[i];
    1188 }
    1189 
    1190 template <class T>
    1191 T& ON_ClassArray<T>::operator[]( unsigned int i )
    1192 {
    1193 #if defined(ON_DEBUG)
    1194  if ( i > (unsigned int)m_capacity )
    1195  {
    1196  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1197  }
    1198 #endif
    1199  return m_a[i];
    1200 }
    1201 
    1202 template <class T>
    1204 {
    1205 #if defined(ON_DEBUG)
    1206  if ( i > (ON__UINT64)m_capacity )
    1207  {
    1208  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1209  }
    1210 #endif
    1211  return m_a[i];
    1212 }
    1213 
    1214 #if defined(ON_RUNTIME_APPLE)
    1215 template <class T>
    1216 T& ON_ClassArray<T>::operator[](size_t i )
    1217 {
    1218 #if defined(ON_DEBUG)
    1219  if ( i > (size_t)m_capacity )
    1220  {
    1221  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1222  }
    1223 #endif
    1224  return m_a[i];
    1225 }
    1226 #endif
    1227 
    1228 template <class T>
    1229 const T& ON_ClassArray<T>::operator[](int i) const
    1230 {
    1231 #if defined(ON_DEBUG)
    1232  if ( i < 0 || i > m_capacity )
    1233  {
    1234  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1235  }
    1236 #endif
    1237  return m_a[i];
    1238 }
    1239 
    1240 template <class T>
    1241 const T& ON_ClassArray<T>::operator[](ON__INT64 i) const
    1242 {
    1243 #if defined(ON_DEBUG)
    1244  if ( i < 0 || i > (ON__INT64)m_capacity )
    1245  {
    1246  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1247  }
    1248 #endif
    1249  return m_a[i];
    1250 }
    1251 
    1252 template <class T>
    1253 const T& ON_ClassArray<T>::operator[](unsigned int i) const
    1254 {
    1255 #if defined(ON_DEBUG)
    1256  if ( i > (unsigned int)m_capacity )
    1257  {
    1258  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1259  }
    1260 #endif
    1261  return m_a[i];
    1262 }
    1263 
    1264 template <class T>
    1265 const T& ON_ClassArray<T>::operator[](ON__UINT64 i) const
    1266 {
    1267 #if defined(ON_DEBUG)
    1268  if ( i > (ON__UINT64)m_capacity )
    1269  {
    1270  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1271  }
    1272 #endif
    1273  return m_a[i];
    1274 }
    1275 
    1276 #if defined(ON_RUNTIME_APPLE)
    1277 template <class T>
    1278 const T& ON_ClassArray<T>::operator[](size_t i) const
    1279 {
    1280 #if defined(ON_DEBUG)
    1281  if ( i > (size_t)m_capacity )
    1282  {
    1283  ON_ERROR("ON_ClassArray[i]: i out of range.");
    1284  }
    1285 #endif
    1286  return m_a[i];
    1287 }
    1288 #endif
    1289 
    1290 template <class T>
    1292 {
    1293  return (m_count > 0) ? m_a : 0;
    1294 }
    1295 
    1296 template <class T>
    1298 {
    1299  return (m_count > 0) ? m_a : 0;
    1300 }
    1301 
    1302 template <class T>
    1304 {
    1305  return m_a;
    1306 }
    1307 
    1308 template <class T>
    1309 const T* ON_ClassArray<T>::Array() const
    1310 {
    1311  return m_a;
    1312 }
    1313 
    1314 template <class T>
    1316 {
    1317  T* p = m_a;
    1318  m_a = 0;
    1319  m_count = 0;
    1320  m_capacity = 0;
    1321  return p;
    1322 }
    1323 
    1324 template <class T>
    1326 {
    1327  if ( m_a && m_a != p )
    1328  Destroy();
    1329  m_a = p;
    1330 }
    1331 
    1332 template <class T>
    1333 void ON_ClassArray<T>::SetArray(T* p, int count, int capacity)
    1334 {
    1335  if ( m_a && m_a != p )
    1336  Destroy();
    1337  m_a = p;
    1338  m_count = count;
    1339  m_capacity = capacity;
    1340 }
    1341 
    1342 template <class T>
    1344 {
    1345  return (m_count > 0) ? m_a : 0;
    1346 }
    1347 
    1348 template <class T>
    1349 const T* ON_ClassArray<T>::First() const
    1350 {
    1351  return (m_count > 0) ? m_a : 0;
    1352 }
    1353 
    1354 template <class T>
    1356 {
    1357  return (i >= 0 && i < m_count) ? m_a+i : 0;
    1358 }
    1359 
    1360 template <class T>
    1361 T* ON_ClassArray<T>::At( unsigned int i )
    1362 {
    1363  return (i < (unsigned int)m_count) ? m_a+i : 0;
    1364 }
    1365 
    1366 template <class T>
    1367 const T* ON_ClassArray<T>::At( int i) const
    1368 {
    1369  return (i >= 0 && i < m_count) ? m_a+i : 0;
    1370 }
    1371 
    1372 template <class T>
    1373 const T* ON_ClassArray<T>::At( unsigned int i) const
    1374 {
    1375  return (i < (unsigned int)m_count) ? m_a+i : 0;
    1376 }
    1377 
    1378 
    1379 template <class T>
    1380 T* ON_ClassArray<T>::At( ON__INT64 i )
    1381 {
    1382  return (i >= 0 && i < (ON__INT64)m_count) ? m_a+i : 0;
    1383 }
    1384 
    1385 template <class T>
    1386 T* ON_ClassArray<T>::At( ON__UINT64 i )
    1387 {
    1388  return (i < (ON__UINT64)m_count) ? m_a+i : 0;
    1389 }
    1390 
    1391 template <class T>
    1392 const T* ON_ClassArray<T>::At( ON__INT64 i) const
    1393 {
    1394  return (i >= 0 && i < (ON__INT64)m_count) ? m_a+i : 0;
    1395 }
    1396 
    1397 template <class T>
    1398 const T* ON_ClassArray<T>::At( ON__UINT64 i) const
    1399 {
    1400  return (i < (ON__UINT64)m_count) ? m_a+i : 0;
    1401 }
    1402 
    1403 
    1404 template <class T>
    1406 {
    1407  return (m_count > 0) ? m_a+(m_count-1) : 0;
    1408 }
    1409 
    1410 template <class T>
    1411 const T* ON_ClassArray<T>::Last() const
    1412 {
    1413  return (m_count > 0) ? m_a+(m_count-1) : 0;
    1414 }
    1415 
    1416 // array operations ////////////////////////////////////////////////////
    1417 
    1418 template <class T>
    1419 void ON_ClassArray<T>::Move( int dest_i, int src_i, int ele_cnt )
    1420 {
    1421  // private function for moving blocks of array memory
    1422  // caller is responsible for updating m_count and managing
    1423  // destruction/creation.
    1424  if ( ele_cnt <= 0 || src_i < 0 || dest_i < 0 || src_i == dest_i ||
    1425  src_i + ele_cnt > m_count || dest_i > m_count )
    1426  return;
    1427 
    1428  int capacity = dest_i + ele_cnt;
    1429  if ( capacity > m_capacity ) {
    1430  if ( capacity < 2*m_capacity )
    1431  capacity = 2*m_capacity;
    1432  SetCapacity( capacity );
    1433  }
    1434 
    1435  // This call to memmove is ok, even when T is a class with a vtable
    1436  // because the it doesn't change the vtable for the class.
    1437  // Classes that have back pointers, like ON_UserData, are
    1438  // handled elsewhere and cannot be in ON_ClassArray<>s.
    1439  memmove( (void*)(&m_a[dest_i]), (const void*)(&m_a[src_i]), ele_cnt*sizeof(T) );
    1440 }
    1441 
    1442 template <class T>
    1444 {
    1445  // use placement ( new(size_t,void*) ) to construct
    1446  // T in supplied memory
    1447  new(p) T;
    1448 }
    1449 
    1450 template <class T>
    1452 {
    1453  x.~T();
    1454 }
    1455 
    1456 template <class T>
    1458 {
    1459  if ( m_count == m_capacity )
    1460  {
    1461  int newcapacity = NewCapacity();
    1462  Reserve( newcapacity );
    1463  }
    1464  else
    1465  {
    1466  // First destroy what's there ..
    1468  // and then get a properly initialized element
    1469  ConstructDefaultElement(&m_a[m_count]);
    1470  }
    1471  return m_a[m_count++];
    1472 }
    1473 
    1474 template <class T>
    1475 void ON_ClassArray<T>::Append( const T& x )
    1476 {
    1477  if ( m_count == m_capacity )
    1478  {
    1479  const int newcapacity = NewCapacity();
    1480  if (m_a)
    1481  {
    1482  const int s = (int)(&x - m_a); // (int) cast is for 64 bit pointers
    1483  if ( s >= 0 && s < m_capacity )
    1484  {
    1485  // 26 Sep 2005 Dale Lear
    1486  // User passed in an element of the m_a[]
    1487  // that will get reallocated by the call
    1488  // to Reserve(newcapacity).
    1489  T temp; // ON_*Array<> templates do not require robust copy constructor.
    1490  temp = x; // ON_*Array<> templates require a robust operator=.
    1491  Reserve( newcapacity );
    1492  m_a[m_count++] = temp;
    1493  return;
    1494  }
    1495  }
    1496  Reserve(newcapacity);
    1497  }
    1498  m_a[m_count++] = x;
    1499 }
    1500 
    1501 template <class T>
    1502 void ON_ClassArray<T>::Append( int count, const T* p )
    1503 {
    1504  int i;
    1505  if ( count > 0 && p )
    1506  {
    1507  if ( count + m_count > m_capacity )
    1508  {
    1509  int newcapacity = NewCapacity();
    1510  if ( newcapacity < count + m_count )
    1511  newcapacity = count + m_count;
    1512  Reserve( newcapacity );
    1513  }
    1514  for ( i = 0; i < count; i++ ) {
    1515  m_a[m_count++] = p[i];
    1516  }
    1517  }
    1518 }
    1519 
    1520 // Insert called with a reference uses operator =
    1521 template <class T>
    1522 void ON_ClassArray<T>::Insert( int i, const T& x )
    1523 {
    1524  if( i >= 0 && i <= m_count )
    1525  {
    1526  if ( m_count == m_capacity )
    1527  {
    1528  int newcapacity = NewCapacity();
    1529  Reserve( newcapacity );
    1530  }
    1532  m_count++;
    1533  if ( i < m_count-1 ) {
    1534  Move( i+1, i, m_count-1-i );
    1535  // This call to memset is ok even when T has a vtable
    1536  // because in-place construction is used later.
    1537  memset( (void*)(&m_a[i]), 0, sizeof(T) );
    1539  }
    1540  else {
    1541  ConstructDefaultElement( &m_a[m_count-1] );
    1542  }
    1543  m_a[i] = x; // uses T::operator=() to copy x to array
    1544  }
    1545 }
    1546 
    1547 template <class T>
    1549 {
    1550  Remove(m_count-1);
    1551 }
    1552 
    1553 template <class T>
    1555 {
    1556  if ( i >= 0 && i < m_count )
    1557  {
    1558  DestroyElement( m_a[i] );
    1559  // This call to memset is ok even when T has a vtable
    1560  // because in-place construction is used later.
    1561  memset( (void*)(&m_a[i]), 0, sizeof(T) );
    1562  Move( i, i+1, m_count-1-i );
    1563  // This call to memset is ok even when T has a vtable
    1564  // because in-place construction is used later.
    1565  memset( (void*)(&m_a[m_count-1]), 0, sizeof(T) );
    1567  m_count--;
    1568  }
    1569 }
    1570 
    1571 template <class T>
    1573 {
    1574  int i;
    1575  for ( i = m_count-1; i >= 0; i-- ) {
    1576  DestroyElement( m_a[i] );
    1577  // This call to memset is ok even when T has a vtable
    1578  // because in-place construction is used later.
    1579  memset( (void*)(&m_a[i]), 0, sizeof(T) );
    1581  }
    1582  m_count = 0;
    1583 }
    1584 
    1585 template <class T>
    1587 {
    1588  // NOTE:
    1589  // If anything in "T" depends on the value of this's address,
    1590  // then don't call Reverse().
    1591  char t[sizeof(T)];
    1592  int i = 0;
    1593  int j = m_count-1;
    1594  for ( /*empty*/; i < j; i++, j-- ) {
    1595  memcpy( (void*)(t), (void*)(&m_a[i]), sizeof(T) );
    1596  memcpy( (void*)(&m_a[i]), (void*)(&m_a[j]), sizeof(T) );
    1597  memcpy( (void*)(&m_a[j]), (void*)(t), sizeof(T) );
    1598  }
    1599 }
    1600 
    1601 template <class T>
    1602 void ON_ClassArray<T>::Swap( int i, int j )
    1603 {
    1604  if ( i != j && i >= 0 && j >= 0 && i < m_count && j < m_count ) {
    1605  char t[sizeof(T)];
    1606  memcpy( (void*)(t), (void*)(&m_a[i]), sizeof(T) );
    1607  memcpy( (void*)(&m_a[i]), (void*)(&m_a[j]), sizeof(T) );
    1608  memcpy( (void*)(&m_a[j]), (void*)(t), sizeof(T) );
    1609  }
    1610 }
    1611 
    1612 template <class T>
    1613 int ON_ClassArray<T>::Search( const T* key, int (*compar)(const T*,const T*) ) const
    1614 {
    1615  for ( int i = 0; i < m_count; i++ )
    1616  {
    1617  if (!compar(key,m_a+i))
    1618  return i;
    1619  }
    1620  return -1;
    1621 }
    1622 
    1623 template <class T>
    1624 int ON_ClassArray<T>::BinarySearch( const T* key, int (*compar)(const T*,const T*) ) const
    1625 {
    1626  const T* found = (key&&m_a&&m_count>0) ? (const T*)bsearch( key, m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar ) : nullptr;
    1627  return (nullptr != found && found >= m_a) ? ((int)(found - m_a)) : -1;
    1628 }
    1629 
    1630 template <class T>
    1631 int ON_ClassArray<T>::BinarySearch( const T* key, int (*compar)(const T*,const T*), int count ) const
    1632 {
    1633  if ( count > m_count )
    1634  count = m_count;
    1635  if ( count <= 0 )
    1636  return -1;
    1637  const T* found = (key&&m_a&&m_count>0) ? (const T*)bsearch( key, m_a, count, sizeof(T), (int(*)(const void*,const void*))compar ) : nullptr;
    1638  return (nullptr != found && found >= m_a) ? ((int)(found - m_a)) : -1;
    1639 }
    1640 
    1641 template <class T>
    1642 bool ON_ClassArray<T>::HeapSort( int (*compar)(const T*,const T*) )
    1643 {
    1644  bool rc = false;
    1645  if ( m_a && m_count > 0 && compar )
    1646  {
    1647  if ( m_count > 1 )
    1648  ON_hsort( m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    1649  rc = true;
    1650  }
    1651  return rc;
    1652 }
    1653 
    1654 template <class T>
    1655 bool ON_ClassArray<T>::QuickSort( int (*compar)(const T*,const T*) )
    1656 {
    1657  bool rc = false;
    1658  if ( m_a && m_count > 0 && compar )
    1659  {
    1660  if ( m_count > 1 )
    1661  ON_qsort( m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    1662  rc = true;
    1663  }
    1664  return rc;
    1665 }
    1666 
    1667 
    1668 
    1669 template <class T>
    1670 bool ON_ObjectArray<T>::HeapSort( int (*compar)(const T*,const T*) )
    1671 {
    1672  bool rc = false;
    1673  // The "this->" in this->m_count and this->m_a
    1674  // are needed for gcc 4 to compile.
    1675  if ( this->m_a && this->m_count > 0 && compar )
    1676  {
    1677  if ( this->m_count > 1 )
    1678  {
    1679  ON_hsort( this->m_a, this->m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    1680 
    1681  // The MemoryRelocate step is required to synch userdata back pointers
    1682  // so the user data destructor will work correctly.
    1683  int i;
    1684  for ( i = 0; i < this->m_count; i++ )
    1685  {
    1686  this->m_a[i].MemoryRelocate();
    1687  }
    1688  }
    1689  rc = true;
    1690  }
    1691  return rc;
    1692 }
    1693 
    1694 template <class T>
    1695 bool ON_ObjectArray<T>::QuickSort( int (*compar)(const T*,const T*) )
    1696 {
    1697  bool rc = false;
    1698  // The "this->" in this->m_count and this->m_a
    1699  // are needed for gcc 4 to compile.
    1700  if ( this->m_a && this->m_count > 0 && compar )
    1701  {
    1702  if ( this->m_count > 1 )
    1703  {
    1704  ON_qsort( this->m_a, this->m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    1705 
    1706  // The MemoryRelocate step is required to synch userdata back pointers
    1707  // so the user data destructor will work correctly.
    1708  int i;
    1709  for ( i = 0; i < this->m_count; i++ )
    1710  {
    1711  this->m_a[i].MemoryRelocate();
    1712  }
    1713  }
    1714  rc = true;
    1715  }
    1716  return rc;
    1717 }
    1718 
    1719 
    1720 template <class T>
    1721 bool ON_ClassArray<T>::Sort( ON::sort_algorithm sa, int* index, int (*compar)(const T*,const T*) ) const
    1722 {
    1723  bool rc = false;
    1724  if ( m_a && m_count > 0 && compar && index )
    1725  {
    1726  if ( m_count > 1 )
    1727  ON_Sort(sa, index, m_a, m_count, sizeof(T), (int(*)(const void*,const void*))compar );
    1728  else if ( m_count == 1 )
    1729  index[0] = 0;
    1730  rc = true;
    1731  }
    1732  return rc;
    1733 }
    1734 
    1735 template <class T>
    1736 bool ON_ClassArray<T>::Sort( ON::sort_algorithm sa, int* index, int (*compar)(const T*,const T*,void*),void* p ) const
    1737 {
    1738  bool rc = false;
    1739  if ( m_a && m_count > 0 && compar && index )
    1740  {
    1741  if ( m_count > 1 )
    1742  ON_Sort(sa, index, m_a, m_count, sizeof(T), (int(*)(const void*,const void*,void*))compar, p );
    1743  else if ( m_count == 1 )
    1744  index[0] = 0;
    1745  rc = true;
    1746  }
    1747  return rc;
    1748 }
    1749 
    1750 template <class T>
    1751 bool ON_ClassArray<T>::Permute( const int* index )
    1752 {
    1753  bool rc = false;
    1754  if ( m_a && m_count > 0 && index )
    1755  {
    1756  int i;
    1757  T* buffer = (T*)onmalloc(m_count*sizeof(buffer[0]));
    1758  memcpy( (void*)(buffer), (void*)(m_a), m_count*sizeof(T) );
    1759  for (i = 0; i < m_count; i++ )
    1760  memcpy( (void*)(m_a+i), (void*)(buffer+index[i]), sizeof(T) ); // must use memcopy and not operator=
    1761  onfree(buffer);
    1762  rc = true;
    1763  }
    1764  return rc;
    1765 }
    1766 
    1767 template <class T>
    1769 {
    1770  int i;
    1771  if ( m_a && m_capacity > 0 ) {
    1772  for ( i = m_capacity-1; i >= 0; i-- ) {
    1773  DestroyElement(m_a[i]);
    1774  // This call to memset is ok even when T has a vtable
    1775  // because in-place construction is used later.
    1776  memset( (void*)(&m_a[i]), 0, sizeof(T) );
    1778  }
    1779  }
    1780 }
    1781 
    1782 // memory managment ////////////////////////////////////////////////////
    1783 
    1784 template <class T>
    1785 T* ON_ClassArray<T>::Reserve( size_t newcap )
    1786 {
    1787  if( (size_t)m_capacity < newcap )
    1788  SetCapacity( newcap );
    1789  return m_a;
    1790 }
    1791 
    1792 template <class T>
    1794 {
    1795  SetCapacity( m_count );
    1796 }
    1797 
    1798 template <class T>
    1800 {
    1801  SetCapacity( 0 );
    1802 }
    1803 
    1804 // low level memory managment //////////////////////////////////////////
    1805 
    1806 template <class T>
    1807 void ON_ClassArray<T>::SetCount( int count )
    1808 {
    1809  if ( count >= 0 && count <= m_capacity )
    1810  m_count = count;
    1811 }
    1812 
    1813 template <class T>
    1814 T* ON_ClassArray<T>::SetCapacity( size_t new_capacity )
    1815 {
    1816  if (0 == m_capacity)
    1817  {
    1818  // Allow "expert" users of ON_SimpleArray<>.SetArray(*,*,0) to clean up after themselves
    1819  // and deals with the case when the forget to clean up after themselves.
    1820  m_a = nullptr;
    1821  m_count = 0;
    1822  }
    1823  // uses "placement" for class construction/destruction
    1824  int i;
    1825  int capacity = (new_capacity > 0 && new_capacity < ON_UNSET_UINT_INDEX)
    1826  ? (int)new_capacity
    1827  : 0;
    1828 
    1829  if ( capacity <= 0 ) {
    1830  if ( m_a ) {
    1831  for ( i = m_capacity-1; i >= 0; i-- ) {
    1832  DestroyElement(m_a[i]);
    1833  }
    1834  Realloc(m_a,0);
    1835  m_a = 0;
    1836  }
    1837  m_count = 0;
    1838  m_capacity = 0;
    1839  }
    1840  else if ( m_capacity < capacity ) {
    1841  // growing
    1842  m_a = Realloc( m_a, capacity );
    1843  // initialize new elements with default constructor
    1844  if ( 0 != m_a )
    1845  {
    1846  // even when m_a is an array of classes with vtable pointers,
    1847  // this call to memset(..., 0, ...) is what I want to do
    1848  // because in-place construction will be used when needed
    1849  // on this memory.
    1850  memset( (void*)(m_a + m_capacity), 0, (capacity-m_capacity)*sizeof(T) );
    1851  for ( i = m_capacity; i < capacity; i++ ) {
    1853  }
    1854  m_capacity = capacity;
    1855  }
    1856  else
    1857  {
    1858  // memory allocation failed
    1859  m_capacity = 0;
    1860  m_count = 0;
    1861  }
    1862  }
    1863  else if ( m_capacity > capacity ) {
    1864  // shrinking
    1865  for ( i = m_capacity-1; i >= capacity; i-- ) {
    1866  DestroyElement(m_a[i]);
    1867  }
    1868  if ( m_count > capacity )
    1869  m_count = capacity;
    1870  m_capacity = capacity;
    1871  m_a = Realloc( m_a, capacity );
    1872  if ( 0 == m_a )
    1873  {
    1874  // memory allocation failed
    1875  m_capacity = 0;
    1876  m_count = 0;
    1877  }
    1878  }
    1879  return m_a;
    1880 }
    1881 
    1882 /////////////////////////////////////////////////////////////////////////////////////
    1883 /////////////////////////////////////////////////////////////////////////////////////
    1884 /////////////////////////////////////////////////////////////////////////////////////
    1885 
    1886 template< class T>
    1887 int ON_CompareIncreasing( const T* a, const T* b)
    1888 {
    1889  if( *a < *b )
    1890  return -1;
    1891  if( *b < *a )
    1892  return 1;
    1893  return 0;
    1894 }
    1895 
    1896 template< class T>
    1897 int ON_CompareDecreasing( const T* a, const T* b)
    1898 {
    1899  if( *b < *a )
    1900  return -1;
    1901  if( *a < *b )
    1902  return 1;
    1903  return 0;
    1904 }
    1905 
    1906 #pragma ON_PRAGMA_WARNING_POP
    1907 
    1908 #endif
    void Empty()
    Sets count to 0, leaves capacity untouched.
    Definition: opennurbs_array_defs.h:558
    void EmergencyDestroy(void)
    emergency bailout ///////////////////////////////////////////////////
    Definition: opennurbs_array_defs.h:1126
    int Capacity() const
    capacity of array
    Definition: opennurbs_array_defs.h:173
    virtual ~ON_SimpleArray()
    Definition: opennurbs_array_defs.h:90
    @@ -99,6 +97,7 @@ $(function() {
    void Shrink()
    remove unused capacity
    Definition: opennurbs_array_defs.h:803
    T * SetCapacity(size_t)
    Definition: opennurbs_array_defs.h:824
    virtual bool QuickSort(int(*)(const T *, const T *))
    Sorts the array using the heap sort algorithm.
    Definition: opennurbs_array_defs.h:1655
    +
    int m_capacity
    actual length of m_a[]
    Definition: opennurbs_array.h:714
    Definition: opennurbs_array.h:732
    int BinarySearch(const T *, int(*)(const T *, const T *)) const
    See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T>
    Definition: opennurbs_array_defs.h:613
    void ConstructDefaultElement(T *)
    Definition: opennurbs_array_defs.h:1443
    @@ -117,6 +116,7 @@ $(function() {
    bool QuickSort(int(*)(const T *, const T *))
    See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T>
    Definition: opennurbs_array_defs.h:721
    void Insert(int, const T &)
    Definition: opennurbs_array_defs.h:526
    void SetCount(int)
    low level memory managment //////////////////////////////////////////
    Definition: opennurbs_array_defs.h:1807
    +
    int m_capacity
    actual length of m_a[]
    Definition: opennurbs_array.h:364
    bool QuickSort(int(*)(const T *, const T *))
    Definition: opennurbs_array_defs.h:1695
    bool HeapSort(int(*)(const T *, const T *))
    Definition: opennurbs_array_defs.h:1670
    T * First()
    Definition: opennurbs_array_defs.h:1343
    @@ -166,9 +166,9 @@ $(function() {
    diff --git a/6/d7/d73/class_o_n___user_data_item_filter-members.html b/6/d7/d73/class_o_n___user_data_item_filter-members.html index e8241a5b..37323603 100644 --- a/6/d7/d73/class_o_n___user_data_item_filter-members.html +++ b/6/d7/d73/class_o_n___user_data_item_filter-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d7/d74/class_o_n___mesh-members.html b/6/d7/d74/class_o_n___mesh-members.html index 02829c91..f87a8c45 100644 --- a/6/d7/d74/class_o_n___mesh-members.html +++ b/6/d7/d74/class_o_n___mesh-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d7f/class_o_n___unknown_user_data-members.html b/6/d7/d7f/class_o_n___unknown_user_data-members.html index 6e4f18a7..fee9477f 100644 --- a/6/d7/d7f/class_o_n___unknown_user_data-members.html +++ b/6/d7/d7f/class_o_n___unknown_user_data-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d8a/class_o_n___hatch-members.html b/6/d7/d8a/class_o_n___hatch-members.html index 5baba06a..7ac853e1 100644 --- a/6/d7/d8a/class_o_n___hatch-members.html +++ b/6/d7/d8a/class_o_n___hatch-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d8b/struct_o_n___serial_number_map_1_1_s_n___e_l_e_m_e_n_t-members.html b/6/d7/d8b/struct_o_n___serial_number_map_1_1_s_n___e_l_e_m_e_n_t-members.html index 1317c7b1..84cb5a83 100644 --- a/6/d7/d8b/struct_o_n___serial_number_map_1_1_s_n___e_l_e_m_e_n_t-members.html +++ b/6/d7/d8b/struct_o_n___serial_number_map_1_1_s_n___e_l_e_m_e_n_t-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d8c/class_o_n___compress_stream.html b/6/d7/d8c/class_o_n___compress_stream.html index 12420990..fef07b97 100644 --- a/6/d7/d8c/class_o_n___compress_stream.html +++ b/6/d7/d8c/class_o_n___compress_stream.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_CompressStream Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Call Begin() one time to initialize the compression calculation. Then call In() one or more times to submit the uncompressed stream to the compression calculation.
    - When you reach the end of the uncompressed stream, call End(). Returns: true if successful, false if an error occured.

    +

    Description: Call Begin() one time to initialize the compression calculation. Then call In() one or more times to submit the uncompressed stream to the compression calculation. When you reach the end of the uncompressed stream, call End(). Returns: true if successful, false if an error occured.

    @@ -213,8 +210,7 @@ Public Member Functions
    -

    Description: After the last call to In(), call End().
    - Calling End() may generate zero or more calls to the output stream handler. Returns: true if successful, false if an error occured.

    +

    Description: After the last call to In(), call End(). Calling End() may generate zero or more calls to the output stream handler. Returns: true if successful, false if an error occured.

    @@ -397,9 +393,9 @@ Public Member Functions diff --git a/6/d7/d90/class_o_n___bezier_cage_morph-members.html b/6/d7/d90/class_o_n___bezier_cage_morph-members.html index a3652ffe..463f1e4e 100644 --- a/6/d7/d90/class_o_n___bezier_cage_morph-members.html +++ b/6/d7/d90/class_o_n___bezier_cage_morph-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d91/class_o_n___texture-members.html b/6/d7/d91/class_o_n___texture-members.html index 255e9f6f..3cb94745 100644 --- a/6/d7/d91/class_o_n___texture-members.html +++ b/6/d7/d91/class_o_n___texture-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/d94/class_o_n___arrowhead.html b/6/d7/d94/class_o_n___arrowhead.html index 7b80db89..090ecbd7 100644 --- a/6/d7/d94/class_o_n___arrowhead.html +++ b/6/d7/d94/class_o_n___arrowhead.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Arrowhead Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
      arrow_type::LongTriangle = 8, arrow_type::LongerTriangle = 9
    - } - Defines enumerated values for arrowhead shapes. More...
    + } Defines enumerated values for arrowhead shapes. More...
    +  

    @@ -131,9 +129,7 @@ Static Public Member Functions

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Member Enumeration Documentation

    ◆ arrow_type

    @@ -565,9 +561,9 @@ Static Public Member Functions
    diff --git a/6/d7/da4/opennurbs__fpoint_8h_source.html b/6/d7/da4/opennurbs__fpoint_8h_source.html index 195c720e..7f506450 100644 --- a/6/d7/da4/opennurbs__fpoint_8h_source.html +++ b/6/d7/da4/opennurbs__fpoint_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_fpoint.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_fpoint.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_fpoint.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // defines float precision point, vector, and array classes
    20 //
    21 ////////////////////////////////////////////////////////////////
    22 #if !defined(ON_FPOINT_INC_)
    23 #define ON_FPOINT_INC_
    24 
    25 class ON_Xform;
    26 
    27 class ON_2fPoint;
    28 class ON_3fPoint;
    29 class ON_4fPoint;
    30 
    31 class ON_2fVector;
    32 class ON_3fVector;
    33 
    34 ////////////////////////////////////////////////////////////////
    35 //
    36 // ON_2fPoint
    37 //
    38 class ON_CLASS ON_2fPoint
    39 {
    40 public:
    41  float x, y;
    42 
    43 public:
    44  // x,y not initialized
    45  ON_2fPoint() = default;
    46  ~ON_2fPoint() = default;
    47  ON_2fPoint(const ON_2fPoint&) = default;
    48  ON_2fPoint& operator=(const ON_2fPoint&) = default;
    49 
    50 public:
    51  static const ON_2fPoint Origin; // (0.0f,0.0f)
    52  static const ON_2fPoint NanPoint; // (ON_FLT_QNAN,ON_FLT_QNAN)
    53 
    54 public:
    55  explicit ON_2fPoint(float x,float y);
    56 
    57  /*
    58  Description:
    59  A well ordered dictionary compare function that is nan aware and can
    60  be used for robust sorting.
    61  */
    62  static int Compare(
    63  const ON_2fPoint& lhs,
    64  const ON_2fPoint& rhs
    65  );
    66 
    67  explicit ON_2fPoint(const ON_3fPoint& ); // from 3f point
    68  explicit ON_2fPoint(const ON_4fPoint& ); // from 4f point
    69  explicit ON_2fPoint(const ON_2fVector& ); // from 2f vector
    70  explicit ON_2fPoint(const ON_3fVector& ); // from 3f vector
    71  explicit ON_2fPoint(const float*); // from float[2] array
    72 
    73  explicit ON_2fPoint(const ON_2dPoint& ); // from 2d point
    74  explicit ON_2fPoint(const ON_3dPoint& ); // from 3d point
    75  explicit ON_2fPoint(const ON_4dPoint& ); // from 4d point
    76  explicit ON_2fPoint(const ON_2dVector& ); // from 2d vector
    77  explicit ON_2fPoint(const ON_3dVector& ); // from 3d vector
    78  explicit ON_2fPoint(const double*); // from double[2] array
    79 
    80  // (float*) conversion operators
    81  operator float*();
    82  operator const float*() const;
    83 
    84  // use implicit operator=(const ON_2fPoint&)
    85  ON_2fPoint& operator=(const ON_3fPoint&);
    86  ON_2fPoint& operator=(const ON_4fPoint&);
    87  ON_2fPoint& operator=(const ON_2fVector&);
    88  ON_2fPoint& operator=(const ON_3fVector&);
    89  ON_2fPoint& operator=(const float*); // point = float[2] support
    90 
    91  ON_2fPoint& operator=(const ON_2dPoint&);
    92  ON_2fPoint& operator=(const ON_3dPoint&);
    93  ON_2fPoint& operator=(const ON_4dPoint&);
    94  ON_2fPoint& operator=(const ON_2dVector&);
    95  ON_2fPoint& operator=(const ON_3dVector&);
    96  ON_2fPoint& operator=(const double*); // point = double[2] support
    97 
    98  ON_2fPoint& operator*=(float);
    99  ON_2fPoint& operator/=(float);
    100  ON_2fPoint& operator+=(const ON_2fVector&);
    101  ON_2fPoint& operator-=(const ON_2fVector&);
    102 
    103  ON_2fPoint operator*(int) const;
    104  ON_2fPoint operator/(int) const;
    105  ON_2fPoint operator*(float) const;
    106  ON_2fPoint operator/(float) const;
    107  ON_2dPoint operator*(double) const;
    108  ON_2dPoint operator/(double) const;
    109 
    110  ON_2fPoint operator+(const ON_2fPoint&) const;
    111  ON_2fPoint operator+(const ON_2fVector&) const;
    112  ON_2fVector operator-(const ON_2fPoint&) const;
    113  ON_2fPoint operator-(const ON_2fVector&) const;
    114  ON_3fPoint operator+(const ON_3fPoint&) const;
    115  ON_3fPoint operator+(const ON_3fVector&) const;
    116  ON_3fVector operator-(const ON_3fPoint&) const;
    117  ON_3fPoint operator-(const ON_3fVector&) const;
    118 
    119  ON_2dPoint operator+(const ON_2dPoint&) const;
    120  ON_2dPoint operator+(const ON_2dVector&) const;
    121  ON_2dVector operator-(const ON_2dPoint&) const;
    122  ON_2dPoint operator-(const ON_2dVector&) const;
    123  ON_3dPoint operator+(const ON_3dPoint&) const;
    124  ON_3dPoint operator+(const ON_3dVector&) const;
    125  ON_3dVector operator-(const ON_3dPoint&) const;
    126  ON_3dPoint operator-(const ON_3dVector&) const;
    127 
    128  float operator*(const ON_2fPoint&) const; // for points acting as vectors
    129  float operator*(const ON_2fVector&) const; // for points acting as vectors
    130 
    131  bool operator==(const ON_2fPoint&) const;
    132  bool operator!=(const ON_2fPoint&) const;
    133 
    134  // dictionary order comparisons
    135  bool operator<=(const ON_2fPoint&) const;
    136  bool operator>=(const ON_2fPoint&) const;
    137  bool operator<(const ON_2fPoint&) const;
    138  bool operator>(const ON_2fPoint&) const;
    139 
    140  // index operators mimic float[2] behavior
    141  float& operator[](int);
    142  float operator[](int) const;
    143  float& operator[](unsigned int);
    144  float operator[](unsigned int) const;
    145 
    146  /*
    147  Returns:
    148  False if any coordinate is ON_UNSET_FLOAT, ON_UNSET_POSITIVE_FLOAT, nan, or infinite.
    149  True, otherwise.
    150  */
    151  bool IsValid() const;
    152 
    153  /*
    154  Returns:
    155  True if any coordinate is ON_UNSET_FLOAT or ON_UNSET_POSITIVE_FLOAT
    156  */
    157  bool IsUnset() const;
    158 
    159  // set 2d point value
    160  void Set(float,float);
    161 
    162  double DistanceTo( const ON_2fPoint& ) const;
    163 
    164  int MaximumCoordinateIndex() const;
    165  double MaximumCoordinate() const; // absolute value of maximum coordinate
    166 
    167  ON_DEPRECATED_MSG("Use p = ON_2fPoint::Origin;")
    168  void Zero(); // set all coordinates to zero;
    169 
    170  /*
    171  Returns:
    172  true if all coordinates are not zero and no coordinates are nans.
    173  false otherwise.
    174  */
    175  bool IsZero() const;
    176 
    177  /*
    178  Returns:
    179  true if at least one coordinate is not zero and no coordinates are nans.
    180  */
    181  bool IsNotZero() const;
    182 
    183  // These transform the point in place. The transformation matrix acts on
    184  // the left of the point; i.e., result = transformation*point
    185  void Transform(
    186  const ON_Xform&
    187  );
    188 
    189  void Rotate( // rotatation in XY plane
    190  double, // angle in radians
    191  const ON_2fPoint& // center of rotation
    192  );
    193 
    194  void Rotate( // rotatation in XY plane
    195  double, // sin(angle)
    196  double, // cos(angle)
    197  const ON_2fPoint& // center of rotation
    198  );
    199 
    200  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    201 };
    202 
    203 ON_DECL
    204 ON_2fPoint operator*(int, const ON_2fPoint&);
    205 
    206 ON_DECL
    207 ON_2fPoint operator*(float, const ON_2fPoint&);
    208 
    209 ON_DECL
    210 ON_2dPoint operator*(double, const ON_2fPoint&);
    211 
    212 ////////////////////////////////////////////////////////////////
    213 //
    214 // ON_3fPoint
    215 //
    216 class ON_CLASS ON_3fPoint
    217 {
    218 public:
    219  float x, y, z;
    220 
    221 public:
    222  // x,y,z not initialized
    223  ON_3fPoint() = default;
    224  ~ON_3fPoint() = default;
    225  ON_3fPoint(const ON_3fPoint&) = default;
    226  ON_3fPoint& operator=(const ON_3fPoint&) = default;
    227 
    228 public:
    229  static const ON_3fPoint Origin; // (0.0f,0.0f,0.0f)
    230  static const ON_3fPoint NanPoint; // (ON_FLT_QNAN,ON_FLT_QNAN,ON_FLT_QNAN)
    231 
    232  /*
    233  Description:
    234  A well ordered dictionary compare function that is nan aware and can
    235  be used for robust sorting.
    236  */
    237  static int Compare(
    238  const ON_3fPoint& lhs,
    239  const ON_3fPoint& rhs
    240  );
    241 
    242  explicit ON_3fPoint(float x,float y,float z);
    243  explicit ON_3fPoint(const ON_2fPoint& ); // from 2f point
    244  explicit ON_3fPoint(const ON_4fPoint& ); // from 4f point
    245  explicit ON_3fPoint(const ON_2fVector& ); // from 2f vector
    246  explicit ON_3fPoint(const ON_3fVector& ); // from 3f vector
    247  explicit ON_3fPoint(const float*); // from float[3] array
    248 
    249  explicit ON_3fPoint(const ON_2dPoint& ); // from 2d point
    250  explicit ON_3fPoint(const ON_3dPoint& ); // from 3d point
    251  explicit ON_3fPoint(const ON_4dPoint& ); // from 4d point
    252  explicit ON_3fPoint(const ON_2dVector& ); // from 2d vector
    253  explicit ON_3fPoint(const ON_3dVector& ); // from 3d vector
    254  explicit ON_3fPoint(const double*); // from double[3] array
    255 
    256  // (float*) conversion operators
    257  operator float*();
    258  operator const float*() const;
    259 
    260  // use implicit operator=(const ON_3fPoint&)
    261  ON_3fPoint& operator=(const ON_2fPoint&);
    262  ON_3fPoint& operator=(const ON_4fPoint&);
    263  ON_3fPoint& operator=(const ON_2fVector&);
    264  ON_3fPoint& operator=(const ON_3fVector&);
    265  ON_3fPoint& operator=(const float*); // point = float[3] support
    266 
    267  ON_3fPoint& operator=(const ON_2dPoint&);
    268  ON_3fPoint& operator=(const ON_3dPoint&);
    269  ON_3fPoint& operator=(const ON_4dPoint&);
    270  ON_3fPoint& operator=(const ON_2dVector&);
    271  ON_3fPoint& operator=(const ON_3dVector&);
    272  ON_3fPoint& operator=(const double*); // point = double[3] support
    273 
    274  ON_3fPoint& operator*=(float);
    275  ON_3fPoint& operator/=(float);
    276  ON_3fPoint& operator+=(const ON_3fVector&);
    277  ON_3fPoint& operator-=(const ON_3fVector&);
    278 
    279  ON_3fPoint operator*(int) const;
    280  ON_3fPoint operator/(int) const;
    281  ON_3fPoint operator*(float) const;
    282  ON_3fPoint operator/(float) const;
    283  ON_3dPoint operator*(double) const;
    284  ON_3dPoint operator/(double) const;
    285 
    286  ON_3fPoint operator+(const ON_3fPoint&) const;
    287  ON_3fPoint operator+(const ON_3fVector&) const;
    288  ON_3fVector operator-(const ON_3fPoint&) const;
    289  ON_3fPoint operator-(const ON_3fVector&) const;
    290  ON_3fPoint operator+(const ON_2fPoint&) const;
    291  ON_3fPoint operator+(const ON_2fVector&) const;
    292  ON_3fVector operator-(const ON_2fPoint&) const;
    293  ON_3fPoint operator-(const ON_2fVector&) const;
    294 
    295  ON_3dPoint operator+(const ON_3dPoint&) const;
    296  ON_3dPoint operator+(const ON_3dVector&) const;
    297  ON_3dVector operator-(const ON_3dPoint&) const;
    298  ON_3dPoint operator-(const ON_3dVector&) const;
    299  ON_3dPoint operator+(const ON_2dPoint&) const;
    300  ON_3dPoint operator+(const ON_2dVector&) const;
    301  ON_3dVector operator-(const ON_2dPoint&) const;
    302  ON_3dPoint operator-(const ON_2dVector&) const;
    303 
    304  float operator*(const ON_3fPoint&) const; // for points acting as vectors
    305  float operator*(const ON_3fVector&) const; // for points acting as vectors
    306 
    307  bool operator==(const ON_3fPoint&) const;
    308  bool operator!=(const ON_3fPoint&) const;
    309 
    310  // dictionary order comparisons
    311  bool operator<=(const ON_3fPoint&) const;
    312  bool operator>=(const ON_3fPoint&) const;
    313  bool operator<(const ON_3fPoint&) const;
    314  bool operator>(const ON_3fPoint&) const;
    315 
    316  // index operators mimic float[3] behavior
    317  float& operator[](int);
    318  float operator[](int) const;
    319  float& operator[](unsigned int);
    320  float operator[](unsigned int) const;
    321 
    322  /*
    323  Returns:
    324  False if any coordinate is ON_UNSET_FLOAT, ON_UNSET_POSITIVE_FLOAT, nan, or infinite.
    325  True, otherwise.
    326  */
    327  bool IsValid() const;
    328 
    329  /*
    330  Returns:
    331  True if any coordinate is ON_UNSET_FLOAT or ON_UNSET_POSITIVE_FLOAT
    332  */
    333  bool IsUnset() const;
    334 
    335  // set 3d point value
    336  void Set(float,float,float);
    337 
    338  double DistanceTo( const ON_3fPoint& ) const;
    339 
    340  int MaximumCoordinateIndex() const;
    341  double MaximumCoordinate() const; // absolute value of maximum coordinate
    342  double Fuzz( double = ON_ZERO_TOLERANCE ) const; // tolerance to use when comparing 3d points
    343 
    344  ON_DEPRECATED_MSG("Use p = ON_3fPoint::Origin;")
    345  void Zero(); // set all coordinates to zero;
    346 
    347  /*
    348  Returns:
    349  true if all coordinates are not zero and no coordinates are nans.
    350  false otherwise.
    351  */
    352  bool IsZero() const;
    353 
    354  /*
    355  Returns:
    356  true if at lease one coordinate is not zero and no coordinates are nans.
    357  */
    358  bool IsNotZero() const;
    359 
    360  // These transform the point in place. The transformation matrix acts on
    361  // the left of the point; i.e., result = transformation*point
    362  void Transform(
    363  const ON_Xform&
    364  );
    365 
    366  void Rotate(
    367  double, // angle in radians
    368  const ON_3fVector&, // axis of rotation
    369  const ON_3fPoint& // center of rotation
    370  );
    371 
    372  void Rotate(
    373  double, // sin(angle)
    374  double, // cos(angle)
    375  const ON_3fVector&, // axis of rotation
    376  const ON_3fPoint& // center of rotation
    377  );
    378 
    379  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    380 };
    381 
    382 ON_DECL
    383 ON_3fPoint operator*(int, const ON_3fPoint&);
    384 
    385 ON_DECL
    386 ON_3fPoint operator*(float, const ON_3fPoint&);
    387 
    388 ON_DECL
    389 ON_3dPoint operator*(double, const ON_3fPoint&);
    390 
    391 ////////////////////////////////////////////////////////////////
    392 //
    393 // ON_4fPoint (homogeneous coordinates)
    394 //
    395 class ON_CLASS ON_4fPoint
    396 {
    397 public:
    398  float x, y, z, w;
    399 
    400  /*
    401  Returns:
    402  ON_UNSET_VALUE, if x or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    403  and neither x nor w is a nan.
    404  x/w, otherwise
    405  Remarks:
    406  If w is 0.0 or nan, the result will be a nan.
    407  */
    408  float EuclideanX() const;
    409 
    410  /*
    411  Returns:
    412  ON_UNSET_VALUE, if y or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    413  and neither y nor w is a nan.
    414  y/w, otherwise
    415  Remarks:
    416  If w is 0.0 or nan, the result will be a nan.
    417  */
    418  float EuclideanY() const;
    419 
    420  /*
    421  Returns:
    422  ON_UNSET_VALUE, if z or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    423  and neither z nor w is a nan.
    424  z/w, otherwise
    425  Remarks:
    426  If w is 0.0 or nan, the result will be a nan.
    427  */
    428  float EuclideanZ() const;
    429 
    430 public:
    431  // x,y,z,w not initialized
    432  ON_4fPoint() = default;
    433  ~ON_4fPoint() = default;
    434  ON_4fPoint(const ON_4fPoint&) = default;
    435  ON_4fPoint& operator=(const ON_4fPoint&) = default;
    436 
    437 public:
    438  static const ON_4fPoint Zero; // (0,0,0,0)
    439  static const ON_4fPoint Nan; // (ON_FLT_QNAN,ON_FLT_QNAN,ON_FLT_QNAN,ON_FLT_QNAN)
    440 
    441  /*
    442  Description:
    443  A well ordered projective compare function that is nan aware and can
    444  be used for robust sorting.
    445  Remarks:
    446  float c = non-nan value.
    447  ON_4fPoint h0 = ...;
    448  ON_4fPoint h1(c*h0.x,c*h0.x,c*h0.x,c*h0.x);
    449  0 == ON_4fPoint::ProjectiveCompare(h0,ha);
    450  */
    451  static int ProjectiveCompare(
    452  const ON_4fPoint& lhs,
    453  const ON_4fPoint& rhs
    454  );
    455 
    456  /*
    457  Description:
    458  A well ordered dictionary compare function that is nan aware and can
    459  be used for robust sorting.
    460  */
    461  static int DictionaryCompare(
    462  const ON_4fPoint& lhs,
    463  const ON_4fPoint& rhs
    464  );
    465 
    466  /*
    467  Returns:
    468  True if (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z && lhs.w == rhs.w).
    469  */
    470  bool operator==(const ON_4fPoint& rhs) const;
    471 
    472  /*
    473  Returns:
    474  True if lhs.* != rhs.* for some coordinate and no values are nans.
    475  */
    476  bool operator!=(const ON_4fPoint& rhs) const;
    477 
    478  explicit ON_4fPoint(float x,float y,float z,float w);
    479 
    480  ON_4fPoint(const ON_2fPoint& ); // from 2f point
    481  ON_4fPoint(const ON_3fPoint& ); // from 3f point
    482  ON_4fPoint(const ON_2fVector& ); // from 2f vector
    483  ON_4fPoint(const ON_3fVector& ); // from 3f vector
    484 
    485  // Require explicit construction when dev must insure array has length >= 4.
    486  explicit ON_4fPoint(const float*); // from float[4] array
    487 
    488  // Require explicit construction when loosing precision
    489  explicit ON_4fPoint(const ON_2dPoint& ); // from 2d point
    490  explicit ON_4fPoint(const ON_3dPoint& ); // from 3d point
    491  explicit ON_4fPoint(const ON_4dPoint& ); // from 4d point
    492  explicit ON_4fPoint(const ON_2dVector& ); // from 2d vector
    493  explicit ON_4fPoint(const ON_3dVector& ); // from 3d vector
    494  explicit ON_4fPoint(const double*); // from double[4] array
    495 
    496  // (float*) conversion operators
    497  operator float*();
    498  operator const float*() const;
    499 
    500  // use implicit operator=(const ON_4fPoint&)
    501  ON_4fPoint& operator=(const ON_2fPoint&);
    502  ON_4fPoint& operator=(const ON_3fPoint&);
    503  ON_4fPoint& operator=(const ON_2fVector&);
    504  ON_4fPoint& operator=(const ON_3fVector&);
    505  ON_4fPoint& operator=(const float*); // point = float[4] support
    506 
    507  ON_4fPoint& operator=(const ON_2dPoint&);
    508  ON_4fPoint& operator=(const ON_3dPoint&);
    509  ON_4fPoint& operator=(const ON_4dPoint&);
    510  ON_4fPoint& operator=(const ON_2dVector&);
    511  ON_4fPoint& operator=(const ON_3dVector&);
    512  ON_4fPoint& operator=(const double*); // point = double[4] support
    513 
    514  ON_4fPoint& operator*=(float);
    515  ON_4fPoint& operator/=(float);
    516  ON_4fPoint& operator+=(const ON_4fPoint&);
    517  ON_4fPoint& operator-=(const ON_4fPoint&);
    518 
    519  ON_4fPoint operator*(float) const;
    520  ON_4fPoint operator/(float) const;
    521  ON_4fPoint operator+(const ON_4fPoint&) const; // sum w = sqrt(w1*w2)
    522  ON_4fPoint operator-(const ON_4fPoint&) const; // difference w = sqrt(w1*w2)
    523 
    524 public:
    525  // index operators mimic float[4] behavior
    526  float& operator[](int);
    527  float operator[](int) const;
    528  float& operator[](unsigned int);
    529  float operator[](unsigned int) const;
    530 
    531  /*
    532  Returns:
    533  False if any coordinate is ON_UNSET_FLOAT, ON_UNSET_POSITIVE_FLOAT, nan, or infinite.
    534  True, otherwise.
    535  */
    536  bool IsValid() const;
    537 
    538  /*
    539  Returns:
    540  True if any coordinate is ON_UNSET_FLOAT or ON_UNSET_POSITIVE_FLOAT
    541  */
    542  bool IsUnset() const;
    543 
    544  // set 4d point value
    545  void Set(float,float,float,float);
    546 
    547  int MaximumCoordinateIndex() const;
    548  double MaximumCoordinate() const; // absolute value of maximum coordinate
    549 
    550  bool Normalize(); // set so x^2 + y^2 + z^2 + w^2 = 1
    551 
    552  // These transform the point in place. The transformation matrix acts on
    553  // the left of the point; i.e., result = transformation*point
    554  void Transform(
    555  const ON_Xform&
    556  );
    557 
    558  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    559 };
    560 
    561 ON_DECL
    562 ON_4fPoint operator*(float, const ON_4fPoint&);
    563 
    564 ON_DECL
    565 ON_4dPoint operator*(double, const ON_4fPoint&);
    566 
    567 ////////////////////////////////////////////////////////////////
    568 //
    569 // ON_2fVector
    570 //
    571 class ON_CLASS ON_2fVector
    572 {
    573 public:
    574  float x, y;
    575 
    576 public:
    577  // x,y not initialized
    578  ON_2fVector() = default;
    579  ~ON_2fVector() = default;
    580  ON_2fVector(const ON_2fVector&) = default;
    581  ON_2fVector& operator=(const ON_2fVector&) = default;
    582 
    583 public:
    584  static const ON_2fVector NanVector; // (ON_FLT_QNAN,ON_FLT_QNAN)
    585  static const ON_2fVector ZeroVector; // (0.0f,0.0f)
    586  static const ON_2fVector XAxis; // (1.0f,0.0f)
    587  static const ON_2fVector YAxis; // (0.0f,1.0f)
    588 
    589  /*
    590  Description:
    591  A well ordered dictionary compare function that is nan aware and can
    592  be used for robust sorting.
    593  */
    594  static int Compare(
    595  const ON_2fVector& lhs,
    596  const ON_2fVector& rhs
    597  );
    598 
    599  // Description:
    600  // A index driven function to get unit axis vectors.
    601  // Parameters:
    602  // index - [in] 0 returns (1,0), 1 returns (0,1)
    603  // Returns:
    604  // Unit 3d vector with vector[i] = (i==index)?1:0;
    605  static const ON_2fVector& UnitVector(
    606  int // index
    607  );
    608 
    609  explicit ON_2fVector(float x,float y);
    610  explicit ON_2fVector(const ON_2fPoint& ); // from 2f point
    611  explicit ON_2fVector(const ON_3fPoint& ); // from 3f point
    612  explicit ON_2fVector(const ON_3fVector& ); // from 3f vector
    613  explicit ON_2fVector(const float*); // from float[2] array
    614 
    615  explicit ON_2fVector(const ON_2dPoint& ); // from 2d point
    616  explicit ON_2fVector(const ON_3dPoint& ); // from 3d point
    617  explicit ON_2fVector(const ON_2dVector& ); // from 2d vector
    618  explicit ON_2fVector(const ON_3dVector& ); // from 3d vector
    619  explicit ON_2fVector(const double*); // from double[2] array
    620 
    621  // (float*) conversion operators
    622  operator float*();
    623  operator const float*() const;
    624 
    625  // use implicit operator=(const ON_2fVector&)
    626  ON_2fVector& operator=(const ON_2fPoint&);
    627  ON_2fVector& operator=(const ON_3fPoint&);
    628  ON_2fVector& operator=(const ON_3fVector&);
    629  ON_2fVector& operator=(const float*); // point = float[2] support
    630 
    631  ON_2fVector& operator=(const ON_2dPoint&);
    632  ON_2fVector& operator=(const ON_3dPoint&);
    633  ON_2fVector& operator=(const ON_2dVector&);
    634  ON_2fVector& operator=(const ON_3dVector&);
    635  ON_2fVector& operator=(const double*); // point = double[2] support
    636 
    637  ON_2fVector operator-() const;
    638 
    639  ON_2fVector& operator*=(float);
    640  ON_2fVector& operator/=(float);
    641  ON_2fVector& operator+=(const ON_2fVector&);
    642  ON_2fVector& operator-=(const ON_2fVector&);
    643 
    644  float operator*(const ON_2fVector&) const; // inner (dot) product
    645  float operator*(const ON_2fPoint&) const; // inner (dot) product point acting as a vector
    646  double operator*(const ON_2dVector&) const; // inner (dot) product
    647 
    648  ON_2fVector operator*(int) const;
    649  ON_2fVector operator/(int) const;
    650  ON_2fVector operator*(float) const;
    651  ON_2fVector operator/(float) const;
    652  ON_2dVector operator*(double) const;
    653  ON_2dVector operator/(double) const;
    654 
    655  ON_2fVector operator+(const ON_2fVector&) const;
    656  ON_2fPoint operator+(const ON_2fPoint&) const;
    657  ON_2fVector operator-(const ON_2fVector&) const;
    658  ON_2fPoint operator-(const ON_2fPoint&) const;
    659  ON_3fVector operator+(const ON_3fVector&) const;
    660  ON_3fPoint operator+(const ON_3fPoint&) const;
    661  ON_3fVector operator-(const ON_3fVector&) const;
    662  ON_3fPoint operator-(const ON_3fPoint&) const;
    663 
    664  ON_2dVector operator+(const ON_2dVector&) const;
    665  ON_2dPoint operator+(const ON_2dPoint&) const;
    666  ON_2dVector operator-(const ON_2dVector&) const;
    667  ON_2dPoint operator-(const ON_2dPoint&) const;
    668  ON_3dVector operator+(const ON_3dVector&) const;
    669  ON_3dPoint operator+(const ON_3dPoint&) const;
    670  ON_3dVector operator-(const ON_3dVector&) const;
    671  ON_3dPoint operator-(const ON_3dPoint&) const;
    672 
    673  bool operator==(const ON_2fVector&) const;
    674  bool operator!=(const ON_2fVector&) const;
    675 
    676  // dictionary order comparisons
    677  bool operator<=(const ON_2fVector&) const;
    678  bool operator>=(const ON_2fVector&) const;
    679  bool operator<(const ON_2fVector&) const;
    680  bool operator>(const ON_2fVector&) const;
    681 
    682  // index operators mimic float[2] behavior
    683  float& operator[](int);
    684  float operator[](int) const;
    685  float& operator[](unsigned int);
    686  float operator[](unsigned int) const;
    687 
    688  /*
    689  Returns:
    690  False if any coordinate is ON_UNSET_FLOAT, ON_UNSET_POSITIVE_FLOAT, nan, or infinite.
    691  True, otherwise.
    692  */
    693  bool IsValid() const;
    694 
    695  /*
    696  Returns:
    697  True if any coordinate is ON_UNSET_FLOAT or ON_UNSET_POSITIVE_FLOAT
    698  */
    699  bool IsUnset() const;
    700 
    701  // set 2d vector value
    702  void Set(float,float);
    703 
    704  int MaximumCoordinateIndex() const;
    705  double MaximumCoordinate() const; // absolute value of maximum coordinate
    706 
    707  double LengthSquared() const;
    708  double Length() const;
    709 
    710  bool Decompose( // Computes a, b such that this vector = a*X + b*Y
    711  // Returns false if unable to solve for a,b. This happens
    712  // when X,Y is not really a basis.
    713  //
    714  // If X,Y is known to be an orthonormal frame,
    715  // then a = V*X, b = V*Y will compute
    716  // the same result more quickly.
    717  const ON_2fVector&, // X
    718  const ON_2fVector&, // Y
    719  double*, // a
    720  double* // b
    721  ) const;
    722 
    723  int IsParallelTo(
    724  // returns 1: this and other vectors are parallel
    725  // -1: this and other vectors are anti-parallel
    726  // 0: this and other vectors are not parallel
    727  // or at least one of the vectors is zero
    728  const ON_2fVector&, // other vector
    729  double = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    730  ) const;
    731 
    732  bool IsPerpendicularTo(
    733  // returns true: this and other vectors are perpendicular
    734  // false: this and other vectors are not perpendicular
    735  // or at least one of the vectors is zero
    736  const ON_2fVector&, // other vector
    737  double = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    738  ) const;
    739 
    740  ON_DEPRECATED_MSG("Use p = ON_2fVector::ZeroVector;")
    741  void Zero(); // set all coordinates to zero;
    742 
    743  ON_DEPRECATED_MSG("Use v = -v;")
    744  void Reverse(); // negate all coordinates
    745 
    746  bool Unitize(); // returns false if vector has zero length
    747 
    748  bool IsUnitVector() const;
    749 
    750  /*
    751  Returns:
    752  If this is a valid non-zero vector, a unit vector parallel to this is returned.
    753  Otherwise the zero vector is returned.
    754  */
    755  ON_2fVector UnitVector() const;
    756 
    757  // Description:
    758  // Test a vector to see if it is very short
    759  //
    760  // Parameters:
    761  // tiny_tol - [in] (default = ON_ZERO_TOLERANCE) a nonzero
    762  // value used as the coordinate zero tolerance.
    763  //
    764  // Returns:
    765  // ( fabs(x) <= tiny_tol && fabs(y) <= tiny_tol )
    766  //
    767  bool IsTiny(
    768  double = ON_ZERO_TOLERANCE // tiny_tol
    769  ) const;
    770 
    771  // Returns:
    772  // true if vector is the zero vector.
    773  bool IsZero() const;
    774 
    775  /*
    776  Returns:
    777  true if at lease one coordinate is not zero and no coordinates are nans.
    778  */
    779  bool IsNotZero() const;
    780 
    781  // set this vector to be perpendicular to another vector
    782  bool PerpendicularTo( // Result is not unitized.
    783  // returns false if input vector is zero
    784  const ON_2fVector&
    785  );
    786 
    787  // set this vector to be perpendicular to a line defined by 2 points
    788  bool PerpendicularTo(
    789  const ON_2fPoint&,
    790  const ON_2fPoint&
    791  );
    792 
    793  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    794 };
    795 
    796 ON_DECL
    797 ON_2fVector operator*(int, const ON_2fVector&);
    798 
    799 ON_DECL
    800 ON_2fVector operator*(float, const ON_2fVector&);
    801 
    802 ON_DECL
    803 ON_2dVector operator*(double, const ON_2fVector&);
    804 
    805 ///////////////////////////////////////////////////////////////
    806 //
    807 // ON_2fVector utilities
    808 //
    809 
    810 ON_DECL
    811 float
    812 ON_DotProduct(
    813  const ON_2fVector&,
    814  const ON_2fVector&
    815  );
    816 
    817 ON_DECL
    819 ON_CrossProduct(
    820  const ON_2fVector&,
    821  const ON_2fVector&
    822  );
    823 
    824 ON_DECL
    825 bool
    826 ON_IsOrthogonalFrame( // true if X, Y are nonzero and mutually perpendicular
    827  const ON_2fVector&, // X
    828  const ON_2fVector& // Y
    829  );
    830 
    831 ON_DECL
    832 bool
    833 ON_IsOrthonormalFrame( // true if X, Y are orthogonal and unit length
    834  const ON_2fVector&, // X
    835  const ON_2fVector& // Y
    836  );
    837 
    838 ON_DECL
    839 bool
    840 ON_IsRightHandFrame( // true if X, Y are orthonormal and right handed
    841  const ON_2fVector&, // X
    842  const ON_2fVector& // Y
    843  );
    844 
    845 ////////////////////////////////////////////////////////////////
    846 //
    847 // ON_3fVector
    848 //
    849 class ON_CLASS ON_3fVector
    850 {
    851 public:
    852  float x, y, z;
    853 
    854 public:
    855  // x,y,z not initialized
    856  ON_3fVector() = default;
    857  ~ON_3fVector() = default;
    858  ON_3fVector(const ON_3fVector&) = default;
    859  ON_3fVector& operator=(const ON_3fVector&) = default;
    860 
    861 public:
    862  static const ON_3fVector NanVector; // (ON_FLT_QNAN,ON_FLT_QNAN,ON_FLT_QNAN)
    863  static const ON_3fVector ZeroVector; // (0.0f,0.0f,0.0f)
    864  static const ON_3fVector XAxis; // (1.0f,0.0f,0.0f)
    865  static const ON_3fVector YAxis; // (0.0f,1.0f,0.0f)
    866  static const ON_3fVector ZAxis; // (0.0f,0.0f,1.0f)
    867 
    868  /*
    869  Description:
    870  A well ordered dictionary compare function that is nan aware and can
    871  be used for robust sorting.
    872  */
    873  static int Compare(
    874  const ON_3fVector& lhs,
    875  const ON_3fVector& rhs
    876  );
    877 
    878  // Description:
    879  // A index driven function to get unit axis vectors.
    880  // Parameters:
    881  // index - [in] 0 returns (1,0,0), 1 returns (0,1,0)
    882  // 2 returns (0,0,1)
    883  // Returns:
    884  // Unit 3d vector with vector[i] = (i==index)?1:0;
    885  static const ON_3fVector& UnitVector(
    886  int // index
    887  );
    888 
    889  explicit ON_3fVector(float x,float y,float z);
    890 
    891  explicit ON_3fVector(const ON_2fPoint& ); // from 2f point
    892  explicit ON_3fVector(const ON_3fPoint& ); // from 3f point
    893  explicit ON_3fVector(const ON_2fVector& ); // from 2f vector
    894  explicit ON_3fVector(const float*); // from float[3] array
    895 
    896  explicit ON_3fVector(const ON_2dPoint& ); // from 2d point
    897  explicit ON_3fVector(const ON_3dPoint& ); // from 3d point
    898  explicit ON_3fVector(const ON_2dVector& ); // from 2d vector
    899  explicit ON_3fVector(const ON_3dVector& ); // from 3d vector
    900  explicit ON_3fVector(const double*); // from double[3] array
    901 
    902  // (float*) conversion operators
    903  operator float*();
    904  operator const float*() const;
    905 
    906  // use implicit operator=(const ON_3fVector&)
    907  ON_3fVector& operator=(const ON_2fPoint&);
    908  ON_3fVector& operator=(const ON_3fPoint&);
    909  ON_3fVector& operator=(const ON_2fVector&);
    910  ON_3fVector& operator=(const float*); // point = float[3] support
    911 
    912  ON_3fVector& operator=(const ON_2dPoint&);
    913  ON_3fVector& operator=(const ON_3dPoint&);
    914  ON_3fVector& operator=(const ON_2dVector&);
    915  ON_3fVector& operator=(const ON_3dVector&);
    916  ON_3fVector& operator=(const double*); // point = double[3] support
    917 
    918  ON_3fVector operator-() const;
    919 
    920  ON_3fVector& operator*=(float);
    921  ON_3fVector& operator/=(float);
    922  ON_3fVector& operator+=(const ON_3fVector&);
    923  ON_3fVector& operator-=(const ON_3fVector&);
    924 
    925  float operator*(const ON_3fVector&) const; // inner (dot) product
    926  float operator*(const ON_3fPoint&) const; // inner (dot) product (point acting as a vector)
    927  double operator*(const ON_3dVector&) const; // inner (dot) product
    928 
    929  ON_3fVector operator*(int) const;
    930  ON_3fVector operator/(int) const;
    931  ON_3fVector operator*(float) const;
    932  ON_3fVector operator/(float) const;
    933  ON_3dVector operator*(double) const;
    934  ON_3dVector operator/(double) const;
    935 
    936  ON_3fVector operator+(const ON_3fVector&) const;
    937  ON_3fPoint operator+(const ON_3fPoint&) const;
    938  ON_3fVector operator-(const ON_3fVector&) const;
    939  ON_3fPoint operator-(const ON_3fPoint&) const;
    940  ON_3fVector operator+(const ON_2fVector&) const;
    941  ON_3fPoint operator+(const ON_2fPoint&) const;
    942  ON_3fVector operator-(const ON_2fVector&) const;
    943  ON_3fPoint operator-(const ON_2fPoint&) const;
    944 
    945  ON_3dVector operator+(const ON_3dVector&) const;
    946  ON_3dPoint operator+(const ON_3dPoint&) const;
    947  ON_3dVector operator-(const ON_3dVector&) const;
    948  ON_3dPoint operator-(const ON_3dPoint&) const;
    949  ON_3dVector operator+(const ON_2dVector&) const;
    950  ON_3dPoint operator+(const ON_2dPoint&) const;
    951  ON_3dVector operator-(const ON_2dVector&) const;
    952  ON_3dPoint operator-(const ON_2dPoint&) const;
    953 
    954  bool operator==(const ON_3fVector&) const;
    955  bool operator!=(const ON_3fVector&) const;
    956 
    957  // dictionary order comparisons
    958  bool operator<=(const ON_3fVector&) const;
    959  bool operator>=(const ON_3fVector&) const;
    960  bool operator<(const ON_3fVector&) const;
    961  bool operator>(const ON_3fVector&) const;
    962 
    963  // index operators mimic float[3] behavior
    964  float& operator[](int);
    965  float operator[](int) const;
    966  float& operator[](unsigned int);
    967  float operator[](unsigned int) const;
    968 
    969  /*
    970  Returns:
    971  False if any coordinate is ON_UNSET_FLOAT, ON_UNSET_POSITIVE_FLOAT, nan, or infinite.
    972  True, otherwise.
    973  */
    974  bool IsValid() const;
    975 
    976  /*
    977  Returns:
    978  True if any coordinate is ON_UNSET_FLOAT or ON_UNSET_POSITIVE_FLOAT
    979  */
    980  bool IsUnset() const;
    981 
    982  // set 3d vector value
    983  void Set(float,float,float);
    984 
    985  int MaximumCoordinateIndex() const;
    986  double MaximumCoordinate() const; // absolute value of maximum coordinate
    987 
    988  double LengthSquared() const;
    989  double Length() const;
    990 
    991  bool IsPerpendicularTo(
    992  // returns true: this and other vectors are perpendicular
    993  // false: this and other vectors are not perpendicular
    994  // or at least one of the vectors is zero
    995  const ON_3fVector&, // other vector
    996  double = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    997  ) const;
    998 
    999  double Fuzz( double = ON_ZERO_TOLERANCE ) const; // tolerance to use when comparing 3d vectors
    1000 
    1001  ON_DEPRECATED_MSG("Use p = ON_3fVector::ZeroVector;")
    1002  void Zero(); // set all coordinates to zero
    1003 
    1004  ON_DEPRECATED_MSG("Use v = -v;")
    1005  void Reverse(); // negate all coordinates
    1006 
    1007  bool Unitize(); // returns false if vector has zero length
    1008 
    1009  bool IsUnitVector() const;
    1010 
    1011  /*
    1012  Returns:
    1013  If this is a valid non-zero vector, a unit vector parallel to this is returned.
    1014  Otherwise the zero vector is returned.
    1015  */
    1016  ON_3fVector UnitVector() const;
    1017 
    1018 
    1019  // Description:
    1020  // Test a vector to see if it is very short
    1021  //
    1022  // Parameters:
    1023  // tiny_tol - [in] (default = ON_ZERO_TOLERANCE) a nonzero
    1024  // value used as the coordinate zero tolerance.
    1025  //
    1026  // Returns:
    1027  // ( fabs(x) <= tiny_tol && fabs(y) <= tiny_tol && fabs(z) <= tiny_tol )
    1028  //
    1029  bool IsTiny(
    1030  double = ON_ZERO_TOLERANCE // tiny_tol
    1031  ) const;
    1032 
    1033  // Returns:
    1034  // true if vector is the zero vector.
    1035  bool IsZero() const;
    1036 
    1037  /*
    1038  Returns:
    1039  true if at lease one coordinate is not zero and no coordinates are nans.
    1040  */
    1041  bool IsNotZero() const;
    1042 
    1043  // set this vector to be perpendicular to another vector
    1044  bool PerpendicularTo( // Result is not unitized.
    1045  // returns false if input vector is zero
    1046  const ON_3fVector&
    1047  );
    1048 
    1049  // These transform the vector in place. The transformation matrix acts on
    1050  // the left of the vector; i.e., result = transformation*vector
    1051  void Transform(
    1052  const ON_Xform& // can use ON_Xform here
    1053  );
    1054 
    1055  void Rotate(
    1056  double, // angle in radians
    1057  const ON_3fVector& // axis of rotation
    1058  );
    1059 
    1060  void Rotate(
    1061  double, // sin(angle)
    1062  double, // cos(angle)
    1063  const ON_3fVector& // axis of rotation
    1064  );
    1065 
    1066  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    1067 };
    1068 
    1069 ON_DECL
    1070 ON_3fVector operator*(int, const ON_3fVector&);
    1071 
    1072 ON_DECL
    1073 ON_3fVector operator*(float, const ON_3fVector&);
    1074 
    1075 ON_DECL
    1076 ON_3dVector operator*(double, const ON_3fVector&);
    1077 
    1078 ///////////////////////////////////////////////////////////////
    1079 //
    1080 // ON_3fVector utilities
    1081 //
    1082 
    1083 ON_DECL
    1084 float
    1085 ON_DotProduct(
    1086  const ON_3fVector&,
    1087  const ON_3fVector&
    1088  );
    1089 
    1090 
    1091 ON_DECL
    1092 ON_3fVector
    1093 ON_CrossProduct(
    1094  const ON_3fVector&,
    1095  const ON_3fVector&
    1096  );
    1097 
    1098 ON_DECL
    1099 ON_3fVector
    1100 ON_CrossProduct( // 3d cross product for old fashioned arrays
    1101  const float*, // array of 3d floats
    1102  const float* // array of 3d floats
    1103  );
    1104 
    1105 ON_DECL
    1106 float
    1107 ON_TripleProduct(
    1108  const ON_3fVector&,
    1109  const ON_3fVector&,
    1110  const ON_3fVector&
    1111  );
    1112 
    1113 ON_DECL
    1114 float
    1115 ON_TripleProduct( // 3d triple product for old fashioned arrays
    1116  const float*, // array of 3d floats
    1117  const float*, // array of 3d floats
    1118  const float* // array of 3d floats
    1119  );
    1120 
    1121 ON_DECL
    1122 bool
    1123 ON_IsOrthogonalFrame( // true if X, Y, Z are nonzero and mutually perpendicular
    1124  const ON_3fVector&, // X
    1125  const ON_3fVector&, // Y
    1126  const ON_3fVector& // Z
    1127  );
    1128 
    1129 ON_DECL
    1130 bool
    1131 ON_IsOrthonormalFrame( // true if X, Y, Z are orthogonal and unit length
    1132  const ON_3fVector&, // X
    1133  const ON_3fVector&, // Y
    1134  const ON_3fVector& // Z
    1135  );
    1136 
    1137 ON_DECL
    1138 bool
    1139 ON_IsRightHandFrame( // true if X, Y, Z are orthonormal and right handed
    1140  const ON_3fVector&, // X
    1141  const ON_3fVector&, // Y
    1142  const ON_3fVector& // Z
    1143  );
    1144 
    1145 #endif
    Definition: opennurbs_fpoint.h:571
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // defines float precision point, vector, and array classes
    20 //
    21 ////////////////////////////////////////////////////////////////
    22 #if !defined(ON_FPOINT_INC_)
    23 #define ON_FPOINT_INC_
    24 
    25 class ON_Xform;
    26 
    27 class ON_2fPoint;
    28 class ON_3fPoint;
    29 class ON_4fPoint;
    30 
    31 class ON_2fVector;
    32 class ON_3fVector;
    33 
    34 ////////////////////////////////////////////////////////////////
    35 //
    36 // ON_2fPoint
    37 //
    38 class ON_CLASS ON_2fPoint
    39 {
    40 public:
    41  float x, y;
    42 
    43 public:
    44  // x,y not initialized
    45  ON_2fPoint() = default;
    46  ~ON_2fPoint() = default;
    47  ON_2fPoint(const ON_2fPoint&) = default;
    48  ON_2fPoint& operator=(const ON_2fPoint&) = default;
    49 
    50 public:
    51  static const ON_2fPoint Origin; // (0.0f,0.0f)
    52  static const ON_2fPoint NanPoint; // (ON_FLT_QNAN,ON_FLT_QNAN)
    53 
    54 public:
    55  explicit ON_2fPoint(float x,float y);
    56 
    57  /*
    58  Description:
    59  A well ordered dictionary compare function that is nan aware and can
    60  be used for robust sorting.
    61  */
    62  static int Compare(
    63  const ON_2fPoint& lhs,
    64  const ON_2fPoint& rhs
    65  );
    66 
    67  explicit ON_2fPoint(const ON_3fPoint& ); // from 3f point
    68  explicit ON_2fPoint(const ON_4fPoint& ); // from 4f point
    69  explicit ON_2fPoint(const ON_2fVector& ); // from 2f vector
    70  explicit ON_2fPoint(const ON_3fVector& ); // from 3f vector
    71  explicit ON_2fPoint(const float*); // from float[2] array
    72 
    73  explicit ON_2fPoint(const ON_2dPoint& ); // from 2d point
    74  explicit ON_2fPoint(const ON_3dPoint& ); // from 3d point
    75  explicit ON_2fPoint(const ON_4dPoint& ); // from 4d point
    76  explicit ON_2fPoint(const ON_2dVector& ); // from 2d vector
    77  explicit ON_2fPoint(const ON_3dVector& ); // from 3d vector
    78  explicit ON_2fPoint(const double*); // from double[2] array
    79 
    80  // (float*) conversion operators
    81  operator float*();
    82  operator const float*() const;
    83 
    84  // use implicit operator=(const ON_2fPoint&)
    85  ON_2fPoint& operator=(const ON_3fPoint&);
    86  ON_2fPoint& operator=(const ON_4fPoint&);
    87  ON_2fPoint& operator=(const ON_2fVector&);
    88  ON_2fPoint& operator=(const ON_3fVector&);
    89  ON_2fPoint& operator=(const float*); // point = float[2] support
    90 
    91  ON_2fPoint& operator=(const ON_2dPoint&);
    92  ON_2fPoint& operator=(const ON_3dPoint&);
    93  ON_2fPoint& operator=(const ON_4dPoint&);
    94  ON_2fPoint& operator=(const ON_2dVector&);
    95  ON_2fPoint& operator=(const ON_3dVector&);
    96  ON_2fPoint& operator=(const double*); // point = double[2] support
    97 
    98  ON_2fPoint& operator*=(float);
    99  ON_2fPoint& operator/=(float);
    100  ON_2fPoint& operator+=(const ON_2fVector&);
    101  ON_2fPoint& operator-=(const ON_2fVector&);
    102 
    103  ON_2fPoint operator*(int) const;
    104  ON_2fPoint operator/(int) const;
    105  ON_2fPoint operator*(float) const;
    106  ON_2fPoint operator/(float) const;
    107  ON_2dPoint operator*(double) const;
    108  ON_2dPoint operator/(double) const;
    109 
    110  ON_2fPoint operator+(const ON_2fPoint&) const;
    111  ON_2fPoint operator+(const ON_2fVector&) const;
    112  ON_2fVector operator-(const ON_2fPoint&) const;
    113  ON_2fPoint operator-(const ON_2fVector&) const;
    114  ON_3fPoint operator+(const ON_3fPoint&) const;
    115  ON_3fPoint operator+(const ON_3fVector&) const;
    116  ON_3fVector operator-(const ON_3fPoint&) const;
    117  ON_3fPoint operator-(const ON_3fVector&) const;
    118 
    119  ON_2dPoint operator+(const ON_2dPoint&) const;
    120  ON_2dPoint operator+(const ON_2dVector&) const;
    121  ON_2dVector operator-(const ON_2dPoint&) const;
    122  ON_2dPoint operator-(const ON_2dVector&) const;
    123  ON_3dPoint operator+(const ON_3dPoint&) const;
    124  ON_3dPoint operator+(const ON_3dVector&) const;
    125  ON_3dVector operator-(const ON_3dPoint&) const;
    126  ON_3dPoint operator-(const ON_3dVector&) const;
    127 
    128  float operator*(const ON_2fPoint&) const; // for points acting as vectors
    129  float operator*(const ON_2fVector&) const; // for points acting as vectors
    130 
    131  bool operator==(const ON_2fPoint&) const;
    132  bool operator!=(const ON_2fPoint&) const;
    133 
    134  // dictionary order comparisons
    135  bool operator<=(const ON_2fPoint&) const;
    136  bool operator>=(const ON_2fPoint&) const;
    137  bool operator<(const ON_2fPoint&) const;
    138  bool operator>(const ON_2fPoint&) const;
    139 
    140  // index operators mimic float[2] behavior
    141  float& operator[](int);
    142  float operator[](int) const;
    143  float& operator[](unsigned int);
    144  float operator[](unsigned int) const;
    145 
    146  /*
    147  Returns:
    148  False if any coordinate is ON_UNSET_FLOAT, ON_UNSET_POSITIVE_FLOAT, nan, or infinite.
    149  True, otherwise.
    150  */
    151  bool IsValid() const;
    152 
    153  /*
    154  Returns:
    155  True if any coordinate is ON_UNSET_FLOAT or ON_UNSET_POSITIVE_FLOAT
    156  */
    157  bool IsUnset() const;
    158 
    159  // set 2d point value
    160  void Set(float,float);
    161 
    162  double DistanceTo( const ON_2fPoint& ) const;
    163 
    164  int MaximumCoordinateIndex() const;
    165  double MaximumCoordinate() const; // absolute value of maximum coordinate
    166 
    167  ON_DEPRECATED_MSG("Use p = ON_2fPoint::Origin;")
    168  void Zero(); // set all coordinates to zero;
    169 
    170  /*
    171  Returns:
    172  true if all coordinates are not zero and no coordinates are nans.
    173  false otherwise.
    174  */
    175  bool IsZero() const;
    176 
    177  /*
    178  Returns:
    179  true if at least one coordinate is not zero and no coordinates are nans.
    180  */
    181  bool IsNotZero() const;
    182 
    183  // These transform the point in place. The transformation matrix acts on
    184  // the left of the point; i.e., result = transformation*point
    185  void Transform(
    186  const ON_Xform&
    187  );
    188 
    189  void Rotate( // rotatation in XY plane
    190  double, // angle in radians
    191  const ON_2fPoint& // center of rotation
    192  );
    193 
    194  void Rotate( // rotatation in XY plane
    195  double, // sin(angle)
    196  double, // cos(angle)
    197  const ON_2fPoint& // center of rotation
    198  );
    199 
    200  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    201 };
    202 
    203 ON_DECL
    204 ON_2fPoint operator*(int, const ON_2fPoint&);
    205 
    206 ON_DECL
    207 ON_2fPoint operator*(float, const ON_2fPoint&);
    208 
    209 ON_DECL
    210 ON_2dPoint operator*(double, const ON_2fPoint&);
    211 
    212 ////////////////////////////////////////////////////////////////
    213 //
    214 // ON_3fPoint
    215 //
    216 class ON_CLASS ON_3fPoint
    217 {
    218 public:
    219  float x, y, z;
    220 
    221 public:
    222  // x,y,z not initialized
    223  ON_3fPoint() = default;
    224  ~ON_3fPoint() = default;
    225  ON_3fPoint(const ON_3fPoint&) = default;
    226  ON_3fPoint& operator=(const ON_3fPoint&) = default;
    227 
    228 public:
    229  static const ON_3fPoint Origin; // (0.0f,0.0f,0.0f)
    230  static const ON_3fPoint NanPoint; // (ON_FLT_QNAN,ON_FLT_QNAN,ON_FLT_QNAN)
    231 
    232  /*
    233  Description:
    234  A well ordered dictionary compare function that is nan aware and can
    235  be used for robust sorting.
    236  */
    237  static int Compare(
    238  const ON_3fPoint& lhs,
    239  const ON_3fPoint& rhs
    240  );
    241 
    242  explicit ON_3fPoint(float x,float y,float z);
    243  explicit ON_3fPoint(const ON_2fPoint& ); // from 2f point
    244  explicit ON_3fPoint(const ON_4fPoint& ); // from 4f point
    245  explicit ON_3fPoint(const ON_2fVector& ); // from 2f vector
    246  explicit ON_3fPoint(const ON_3fVector& ); // from 3f vector
    247  explicit ON_3fPoint(const float*); // from float[3] array
    248 
    249  explicit ON_3fPoint(const ON_2dPoint& ); // from 2d point
    250  explicit ON_3fPoint(const ON_3dPoint& ); // from 3d point
    251  explicit ON_3fPoint(const ON_4dPoint& ); // from 4d point
    252  explicit ON_3fPoint(const ON_2dVector& ); // from 2d vector
    253  explicit ON_3fPoint(const ON_3dVector& ); // from 3d vector
    254  explicit ON_3fPoint(const double*); // from double[3] array
    255 
    256  // (float*) conversion operators
    257  operator float*();
    258  operator const float*() const;
    259 
    260  // use implicit operator=(const ON_3fPoint&)
    261  ON_3fPoint& operator=(const ON_2fPoint&);
    262  ON_3fPoint& operator=(const ON_4fPoint&);
    263  ON_3fPoint& operator=(const ON_2fVector&);
    264  ON_3fPoint& operator=(const ON_3fVector&);
    265  ON_3fPoint& operator=(const float*); // point = float[3] support
    266 
    267  ON_3fPoint& operator=(const ON_2dPoint&);
    268  ON_3fPoint& operator=(const ON_3dPoint&);
    269  ON_3fPoint& operator=(const ON_4dPoint&);
    270  ON_3fPoint& operator=(const ON_2dVector&);
    271  ON_3fPoint& operator=(const ON_3dVector&);
    272  ON_3fPoint& operator=(const double*); // point = double[3] support
    273 
    274  ON_3fPoint& operator*=(float);
    275  ON_3fPoint& operator/=(float);
    276  ON_3fPoint& operator+=(const ON_3fVector&);
    277  ON_3fPoint& operator-=(const ON_3fVector&);
    278 
    279  ON_3fPoint operator*(int) const;
    280  ON_3fPoint operator/(int) const;
    281  ON_3fPoint operator*(float) const;
    282  ON_3fPoint operator/(float) const;
    283  ON_3dPoint operator*(double) const;
    284  ON_3dPoint operator/(double) const;
    285 
    286  ON_3fPoint operator+(const ON_3fPoint&) const;
    287  ON_3fPoint operator+(const ON_3fVector&) const;
    288  ON_3fVector operator-(const ON_3fPoint&) const;
    289  ON_3fPoint operator-(const ON_3fVector&) const;
    290  ON_3fPoint operator+(const ON_2fPoint&) const;
    291  ON_3fPoint operator+(const ON_2fVector&) const;
    292  ON_3fVector operator-(const ON_2fPoint&) const;
    293  ON_3fPoint operator-(const ON_2fVector&) const;
    294 
    295  ON_3dPoint operator+(const ON_3dPoint&) const;
    296  ON_3dPoint operator+(const ON_3dVector&) const;
    297  ON_3dVector operator-(const ON_3dPoint&) const;
    298  ON_3dPoint operator-(const ON_3dVector&) const;
    299  ON_3dPoint operator+(const ON_2dPoint&) const;
    300  ON_3dPoint operator+(const ON_2dVector&) const;
    301  ON_3dVector operator-(const ON_2dPoint&) const;
    302  ON_3dPoint operator-(const ON_2dVector&) const;
    303 
    304  float operator*(const ON_3fPoint&) const; // for points acting as vectors
    305  float operator*(const ON_3fVector&) const; // for points acting as vectors
    306 
    307  bool operator==(const ON_3fPoint&) const;
    308  bool operator!=(const ON_3fPoint&) const;
    309 
    310  // dictionary order comparisons
    311  bool operator<=(const ON_3fPoint&) const;
    312  bool operator>=(const ON_3fPoint&) const;
    313  bool operator<(const ON_3fPoint&) const;
    314  bool operator>(const ON_3fPoint&) const;
    315 
    316  // index operators mimic float[3] behavior
    317  float& operator[](int);
    318  float operator[](int) const;
    319  float& operator[](unsigned int);
    320  float operator[](unsigned int) const;
    321 
    322  /*
    323  Returns:
    324  False if any coordinate is ON_UNSET_FLOAT, ON_UNSET_POSITIVE_FLOAT, nan, or infinite.
    325  True, otherwise.
    326  */
    327  bool IsValid() const;
    328 
    329  /*
    330  Returns:
    331  True if any coordinate is ON_UNSET_FLOAT or ON_UNSET_POSITIVE_FLOAT
    332  */
    333  bool IsUnset() const;
    334 
    335  // set 3d point value
    336  void Set(float,float,float);
    337 
    338  double DistanceTo( const ON_3fPoint& ) const;
    339 
    340  int MaximumCoordinateIndex() const;
    341  double MaximumCoordinate() const; // absolute value of maximum coordinate
    342  double Fuzz( double = ON_ZERO_TOLERANCE ) const; // tolerance to use when comparing 3d points
    343 
    344  ON_DEPRECATED_MSG("Use p = ON_3fPoint::Origin;")
    345  void Zero(); // set all coordinates to zero;
    346 
    347  /*
    348  Returns:
    349  true if all coordinates are not zero and no coordinates are nans.
    350  false otherwise.
    351  */
    352  bool IsZero() const;
    353 
    354  /*
    355  Returns:
    356  true if at lease one coordinate is not zero and no coordinates are nans.
    357  */
    358  bool IsNotZero() const;
    359 
    360  // These transform the point in place. The transformation matrix acts on
    361  // the left of the point; i.e., result = transformation*point
    362  void Transform(
    363  const ON_Xform&
    364  );
    365 
    366  void Rotate(
    367  double, // angle in radians
    368  const ON_3fVector&, // axis of rotation
    369  const ON_3fPoint& // center of rotation
    370  );
    371 
    372  void Rotate(
    373  double, // sin(angle)
    374  double, // cos(angle)
    375  const ON_3fVector&, // axis of rotation
    376  const ON_3fPoint& // center of rotation
    377  );
    378 
    379  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    380 };
    381 
    382 ON_DECL
    383 ON_3fPoint operator*(int, const ON_3fPoint&);
    384 
    385 ON_DECL
    386 ON_3fPoint operator*(float, const ON_3fPoint&);
    387 
    388 ON_DECL
    389 ON_3dPoint operator*(double, const ON_3fPoint&);
    390 
    391 ////////////////////////////////////////////////////////////////
    392 //
    393 // ON_4fPoint (homogeneous coordinates)
    394 //
    395 class ON_CLASS ON_4fPoint
    396 {
    397 public:
    398  float x, y, z, w;
    399 
    400  /*
    401  Returns:
    402  ON_UNSET_VALUE, if x or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    403  and neither x nor w is a nan.
    404  x/w, otherwise
    405  Remarks:
    406  If w is 0.0 or nan, the result will be a nan.
    407  */
    408  float EuclideanX() const;
    409 
    410  /*
    411  Returns:
    412  ON_UNSET_VALUE, if y or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    413  and neither y nor w is a nan.
    414  y/w, otherwise
    415  Remarks:
    416  If w is 0.0 or nan, the result will be a nan.
    417  */
    418  float EuclideanY() const;
    419 
    420  /*
    421  Returns:
    422  ON_UNSET_VALUE, if z or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    423  and neither z nor w is a nan.
    424  z/w, otherwise
    425  Remarks:
    426  If w is 0.0 or nan, the result will be a nan.
    427  */
    428  float EuclideanZ() const;
    429 
    430 public:
    431  // x,y,z,w not initialized
    432  ON_4fPoint() = default;
    433  ~ON_4fPoint() = default;
    434  ON_4fPoint(const ON_4fPoint&) = default;
    435  ON_4fPoint& operator=(const ON_4fPoint&) = default;
    436 
    437 public:
    438  static const ON_4fPoint Zero; // (0,0,0,0)
    439  static const ON_4fPoint Nan; // (ON_FLT_QNAN,ON_FLT_QNAN,ON_FLT_QNAN,ON_FLT_QNAN)
    440 
    441  /*
    442  Description:
    443  A well ordered projective compare function that is nan aware and can
    444  be used for robust sorting.
    445  Remarks:
    446  float c = non-nan value.
    447  ON_4fPoint h0 = ...;
    448  ON_4fPoint h1(c*h0.x,c*h0.x,c*h0.x,c*h0.x);
    449  0 == ON_4fPoint::ProjectiveCompare(h0,ha);
    450  */
    451  static int ProjectiveCompare(
    452  const ON_4fPoint& lhs,
    453  const ON_4fPoint& rhs
    454  );
    455 
    456  /*
    457  Description:
    458  A well ordered dictionary compare function that is nan aware and can
    459  be used for robust sorting.
    460  */
    461  static int DictionaryCompare(
    462  const ON_4fPoint& lhs,
    463  const ON_4fPoint& rhs
    464  );
    465 
    466  /*
    467  Returns:
    468  True if (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z && lhs.w == rhs.w).
    469  */
    470  bool operator==(const ON_4fPoint& rhs) const;
    471 
    472  /*
    473  Returns:
    474  True if lhs.* != rhs.* for some coordinate and no values are nans.
    475  */
    476  bool operator!=(const ON_4fPoint& rhs) const;
    477 
    478  explicit ON_4fPoint(float x,float y,float z,float w);
    479 
    480  ON_4fPoint(const ON_2fPoint& ); // from 2f point
    481  ON_4fPoint(const ON_3fPoint& ); // from 3f point
    482  ON_4fPoint(const ON_2fVector& ); // from 2f vector
    483  ON_4fPoint(const ON_3fVector& ); // from 3f vector
    484 
    485  // Require explicit construction when dev must insure array has length >= 4.
    486  explicit ON_4fPoint(const float*); // from float[4] array
    487 
    488  // Require explicit construction when loosing precision
    489  explicit ON_4fPoint(const ON_2dPoint& ); // from 2d point
    490  explicit ON_4fPoint(const ON_3dPoint& ); // from 3d point
    491  explicit ON_4fPoint(const ON_4dPoint& ); // from 4d point
    492  explicit ON_4fPoint(const ON_2dVector& ); // from 2d vector
    493  explicit ON_4fPoint(const ON_3dVector& ); // from 3d vector
    494  explicit ON_4fPoint(const double*); // from double[4] array
    495 
    496  // (float*) conversion operators
    497  operator float*();
    498  operator const float*() const;
    499 
    500  // use implicit operator=(const ON_4fPoint&)
    501  ON_4fPoint& operator=(const ON_2fPoint&);
    502  ON_4fPoint& operator=(const ON_3fPoint&);
    503  ON_4fPoint& operator=(const ON_2fVector&);
    504  ON_4fPoint& operator=(const ON_3fVector&);
    505  ON_4fPoint& operator=(const float*); // point = float[4] support
    506 
    507  ON_4fPoint& operator=(const ON_2dPoint&);
    508  ON_4fPoint& operator=(const ON_3dPoint&);
    509  ON_4fPoint& operator=(const ON_4dPoint&);
    510  ON_4fPoint& operator=(const ON_2dVector&);
    511  ON_4fPoint& operator=(const ON_3dVector&);
    512  ON_4fPoint& operator=(const double*); // point = double[4] support
    513 
    514  ON_4fPoint& operator*=(float);
    515  ON_4fPoint& operator/=(float);
    516  ON_4fPoint& operator+=(const ON_4fPoint&);
    517  ON_4fPoint& operator-=(const ON_4fPoint&);
    518 
    519  ON_4fPoint operator*(float) const;
    520  ON_4fPoint operator/(float) const;
    521  ON_4fPoint operator+(const ON_4fPoint&) const; // sum w = sqrt(w1*w2)
    522  ON_4fPoint operator-(const ON_4fPoint&) const; // difference w = sqrt(w1*w2)
    523 
    524 public:
    525  // index operators mimic float[4] behavior
    526  float& operator[](int);
    527  float operator[](int) const;
    528  float& operator[](unsigned int);
    529  float operator[](unsigned int) const;
    530 
    531  /*
    532  Returns:
    533  False if any coordinate is ON_UNSET_FLOAT, ON_UNSET_POSITIVE_FLOAT, nan, or infinite.
    534  True, otherwise.
    535  */
    536  bool IsValid() const;
    537 
    538  /*
    539  Returns:
    540  True if any coordinate is ON_UNSET_FLOAT or ON_UNSET_POSITIVE_FLOAT
    541  */
    542  bool IsUnset() const;
    543 
    544  // set 4d point value
    545  void Set(float,float,float,float);
    546 
    547  int MaximumCoordinateIndex() const;
    548  double MaximumCoordinate() const; // absolute value of maximum coordinate
    549 
    550  bool Normalize(); // set so x^2 + y^2 + z^2 + w^2 = 1
    551 
    552  // These transform the point in place. The transformation matrix acts on
    553  // the left of the point; i.e., result = transformation*point
    554  void Transform(
    555  const ON_Xform&
    556  );
    557 
    558  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    559 };
    560 
    561 ON_DECL
    562 ON_4fPoint operator*(float, const ON_4fPoint&);
    563 
    564 ON_DECL
    565 ON_4dPoint operator*(double, const ON_4fPoint&);
    566 
    567 ////////////////////////////////////////////////////////////////
    568 //
    569 // ON_2fVector
    570 //
    571 class ON_CLASS ON_2fVector
    572 {
    573 public:
    574  float x, y;
    575 
    576 public:
    577  // x,y not initialized
    578  ON_2fVector() = default;
    579  ~ON_2fVector() = default;
    580  ON_2fVector(const ON_2fVector&) = default;
    581  ON_2fVector& operator=(const ON_2fVector&) = default;
    582 
    583 public:
    584  static const ON_2fVector NanVector; // (ON_FLT_QNAN,ON_FLT_QNAN)
    585  static const ON_2fVector ZeroVector; // (0.0f,0.0f)
    586  static const ON_2fVector XAxis; // (1.0f,0.0f)
    587  static const ON_2fVector YAxis; // (0.0f,1.0f)
    588 
    589  /*
    590  Description:
    591  A well ordered dictionary compare function that is nan aware and can
    592  be used for robust sorting.
    593  */
    594  static int Compare(
    595  const ON_2fVector& lhs,
    596  const ON_2fVector& rhs
    597  );
    598 
    599  // Description:
    600  // A index driven function to get unit axis vectors.
    601  // Parameters:
    602  // index - [in] 0 returns (1,0), 1 returns (0,1)
    603  // Returns:
    604  // Unit 3d vector with vector[i] = (i==index)?1:0;
    605  static const ON_2fVector& UnitVector(
    606  int // index
    607  );
    608 
    609  explicit ON_2fVector(float x,float y);
    610  explicit ON_2fVector(const ON_2fPoint& ); // from 2f point
    611  explicit ON_2fVector(const ON_3fPoint& ); // from 3f point
    612  explicit ON_2fVector(const ON_3fVector& ); // from 3f vector
    613  explicit ON_2fVector(const float*); // from float[2] array
    614 
    615  explicit ON_2fVector(const ON_2dPoint& ); // from 2d point
    616  explicit ON_2fVector(const ON_3dPoint& ); // from 3d point
    617  explicit ON_2fVector(const ON_2dVector& ); // from 2d vector
    618  explicit ON_2fVector(const ON_3dVector& ); // from 3d vector
    619  explicit ON_2fVector(const double*); // from double[2] array
    620 
    621  // (float*) conversion operators
    622  operator float*();
    623  operator const float*() const;
    624 
    625  // use implicit operator=(const ON_2fVector&)
    626  ON_2fVector& operator=(const ON_2fPoint&);
    627  ON_2fVector& operator=(const ON_3fPoint&);
    628  ON_2fVector& operator=(const ON_3fVector&);
    629  ON_2fVector& operator=(const float*); // point = float[2] support
    630 
    631  ON_2fVector& operator=(const ON_2dPoint&);
    632  ON_2fVector& operator=(const ON_3dPoint&);
    633  ON_2fVector& operator=(const ON_2dVector&);
    634  ON_2fVector& operator=(const ON_3dVector&);
    635  ON_2fVector& operator=(const double*); // point = double[2] support
    636 
    637  ON_2fVector operator-() const;
    638 
    639  ON_2fVector& operator*=(float);
    640  ON_2fVector& operator/=(float);
    641  ON_2fVector& operator+=(const ON_2fVector&);
    642  ON_2fVector& operator-=(const ON_2fVector&);
    643 
    644  float operator*(const ON_2fVector&) const; // inner (dot) product
    645  float operator*(const ON_2fPoint&) const; // inner (dot) product point acting as a vector
    646  double operator*(const ON_2dVector&) const; // inner (dot) product
    647 
    648  ON_2fVector operator*(int) const;
    649  ON_2fVector operator/(int) const;
    650  ON_2fVector operator*(float) const;
    651  ON_2fVector operator/(float) const;
    652  ON_2dVector operator*(double) const;
    653  ON_2dVector operator/(double) const;
    654 
    655  ON_2fVector operator+(const ON_2fVector&) const;
    656  ON_2fPoint operator+(const ON_2fPoint&) const;
    657  ON_2fVector operator-(const ON_2fVector&) const;
    658  ON_2fPoint operator-(const ON_2fPoint&) const;
    659  ON_3fVector operator+(const ON_3fVector&) const;
    660  ON_3fPoint operator+(const ON_3fPoint&) const;
    661  ON_3fVector operator-(const ON_3fVector&) const;
    662  ON_3fPoint operator-(const ON_3fPoint&) const;
    663 
    664  ON_2dVector operator+(const ON_2dVector&) const;
    665  ON_2dPoint operator+(const ON_2dPoint&) const;
    666  ON_2dVector operator-(const ON_2dVector&) const;
    667  ON_2dPoint operator-(const ON_2dPoint&) const;
    668  ON_3dVector operator+(const ON_3dVector&) const;
    669  ON_3dPoint operator+(const ON_3dPoint&) const;
    670  ON_3dVector operator-(const ON_3dVector&) const;
    671  ON_3dPoint operator-(const ON_3dPoint&) const;
    672 
    673  bool operator==(const ON_2fVector&) const;
    674  bool operator!=(const ON_2fVector&) const;
    675 
    676  // dictionary order comparisons
    677  bool operator<=(const ON_2fVector&) const;
    678  bool operator>=(const ON_2fVector&) const;
    679  bool operator<(const ON_2fVector&) const;
    680  bool operator>(const ON_2fVector&) const;
    681 
    682  // index operators mimic float[2] behavior
    683  float& operator[](int);
    684  float operator[](int) const;
    685  float& operator[](unsigned int);
    686  float operator[](unsigned int) const;
    687 
    688  /*
    689  Returns:
    690  False if any coordinate is ON_UNSET_FLOAT, ON_UNSET_POSITIVE_FLOAT, nan, or infinite.
    691  True, otherwise.
    692  */
    693  bool IsValid() const;
    694 
    695  /*
    696  Returns:
    697  True if any coordinate is ON_UNSET_FLOAT or ON_UNSET_POSITIVE_FLOAT
    698  */
    699  bool IsUnset() const;
    700 
    701  // set 2d vector value
    702  void Set(float,float);
    703 
    704  int MaximumCoordinateIndex() const;
    705  double MaximumCoordinate() const; // absolute value of maximum coordinate
    706 
    707  double LengthSquared() const;
    708  double Length() const;
    709 
    710  bool Decompose( // Computes a, b such that this vector = a*X + b*Y
    711  // Returns false if unable to solve for a,b. This happens
    712  // when X,Y is not really a basis.
    713  //
    714  // If X,Y is known to be an orthonormal frame,
    715  // then a = V*X, b = V*Y will compute
    716  // the same result more quickly.
    717  const ON_2fVector&, // X
    718  const ON_2fVector&, // Y
    719  double*, // a
    720  double* // b
    721  ) const;
    722 
    723  int IsParallelTo(
    724  // returns 1: this and other vectors are parallel
    725  // -1: this and other vectors are anti-parallel
    726  // 0: this and other vectors are not parallel
    727  // or at least one of the vectors is zero
    728  const ON_2fVector&, // other vector
    729  double = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    730  ) const;
    731 
    732  bool IsPerpendicularTo(
    733  // returns true: this and other vectors are perpendicular
    734  // false: this and other vectors are not perpendicular
    735  // or at least one of the vectors is zero
    736  const ON_2fVector&, // other vector
    737  double = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    738  ) const;
    739 
    740  ON_DEPRECATED_MSG("Use p = ON_2fVector::ZeroVector;")
    741  void Zero(); // set all coordinates to zero;
    742 
    743  ON_DEPRECATED_MSG("Use v = -v;")
    744  void Reverse(); // negate all coordinates
    745 
    746  bool Unitize(); // returns false if vector has zero length
    747 
    748  bool IsUnitVector() const;
    749 
    750  /*
    751  Returns:
    752  If this is a valid non-zero vector, a unit vector parallel to this is returned.
    753  Otherwise the zero vector is returned.
    754  */
    755  ON_2fVector UnitVector() const;
    756 
    757  // Description:
    758  // Test a vector to see if it is very short
    759  //
    760  // Parameters:
    761  // tiny_tol - [in] (default = ON_ZERO_TOLERANCE) a nonzero
    762  // value used as the coordinate zero tolerance.
    763  //
    764  // Returns:
    765  // ( fabs(x) <= tiny_tol && fabs(y) <= tiny_tol )
    766  //
    767  bool IsTiny(
    768  double = ON_ZERO_TOLERANCE // tiny_tol
    769  ) const;
    770 
    771  // Returns:
    772  // true if vector is the zero vector.
    773  bool IsZero() const;
    774 
    775  /*
    776  Returns:
    777  true if at lease one coordinate is not zero and no coordinates are nans.
    778  */
    779  bool IsNotZero() const;
    780 
    781  // set this vector to be perpendicular to another vector
    782  bool PerpendicularTo( // Result is not unitized.
    783  // returns false if input vector is zero
    784  const ON_2fVector&
    785  );
    786 
    787  // set this vector to be perpendicular to a line defined by 2 points
    788  bool PerpendicularTo(
    789  const ON_2fPoint&,
    790  const ON_2fPoint&
    791  );
    792 
    793  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    794 };
    795 
    796 ON_DECL
    797 ON_2fVector operator*(int, const ON_2fVector&);
    798 
    799 ON_DECL
    800 ON_2fVector operator*(float, const ON_2fVector&);
    801 
    802 ON_DECL
    803 ON_2dVector operator*(double, const ON_2fVector&);
    804 
    805 ///////////////////////////////////////////////////////////////
    806 //
    807 // ON_2fVector utilities
    808 //
    809 
    810 ON_DECL
    811 float
    812 ON_DotProduct(
    813  const ON_2fVector&,
    814  const ON_2fVector&
    815  );
    816 
    817 ON_DECL
    819 ON_CrossProduct(
    820  const ON_2fVector&,
    821  const ON_2fVector&
    822  );
    823 
    824 ON_DECL
    825 bool
    826 ON_IsOrthogonalFrame( // true if X, Y are nonzero and mutually perpendicular
    827  const ON_2fVector&, // X
    828  const ON_2fVector& // Y
    829  );
    830 
    831 ON_DECL
    832 bool
    833 ON_IsOrthonormalFrame( // true if X, Y are orthogonal and unit length
    834  const ON_2fVector&, // X
    835  const ON_2fVector& // Y
    836  );
    837 
    838 ON_DECL
    839 bool
    840 ON_IsRightHandFrame( // true if X, Y are orthonormal and right handed
    841  const ON_2fVector&, // X
    842  const ON_2fVector& // Y
    843  );
    844 
    845 ////////////////////////////////////////////////////////////////
    846 //
    847 // ON_3fVector
    848 //
    849 class ON_CLASS ON_3fVector
    850 {
    851 public:
    852  float x, y, z;
    853 
    854 public:
    855  // x,y,z not initialized
    856  ON_3fVector() = default;
    857  ~ON_3fVector() = default;
    858  ON_3fVector(const ON_3fVector&) = default;
    859  ON_3fVector& operator=(const ON_3fVector&) = default;
    860 
    861 public:
    862  static const ON_3fVector NanVector; // (ON_FLT_QNAN,ON_FLT_QNAN,ON_FLT_QNAN)
    863  static const ON_3fVector ZeroVector; // (0.0f,0.0f,0.0f)
    864  static const ON_3fVector XAxis; // (1.0f,0.0f,0.0f)
    865  static const ON_3fVector YAxis; // (0.0f,1.0f,0.0f)
    866  static const ON_3fVector ZAxis; // (0.0f,0.0f,1.0f)
    867 
    868  /*
    869  Description:
    870  A well ordered dictionary compare function that is nan aware and can
    871  be used for robust sorting.
    872  */
    873  static int Compare(
    874  const ON_3fVector& lhs,
    875  const ON_3fVector& rhs
    876  );
    877 
    878  // Description:
    879  // A index driven function to get unit axis vectors.
    880  // Parameters:
    881  // index - [in] 0 returns (1,0,0), 1 returns (0,1,0)
    882  // 2 returns (0,0,1)
    883  // Returns:
    884  // Unit 3d vector with vector[i] = (i==index)?1:0;
    885  static const ON_3fVector& UnitVector(
    886  int // index
    887  );
    888 
    889  explicit ON_3fVector(float x,float y,float z);
    890 
    891  explicit ON_3fVector(const ON_2fPoint& ); // from 2f point
    892  explicit ON_3fVector(const ON_3fPoint& ); // from 3f point
    893  explicit ON_3fVector(const ON_2fVector& ); // from 2f vector
    894  explicit ON_3fVector(const float*); // from float[3] array
    895 
    896  explicit ON_3fVector(const ON_2dPoint& ); // from 2d point
    897  explicit ON_3fVector(const ON_3dPoint& ); // from 3d point
    898  explicit ON_3fVector(const ON_2dVector& ); // from 2d vector
    899  explicit ON_3fVector(const ON_3dVector& ); // from 3d vector
    900  explicit ON_3fVector(const double*); // from double[3] array
    901 
    902  // (float*) conversion operators
    903  operator float*();
    904  operator const float*() const;
    905 
    906  // use implicit operator=(const ON_3fVector&)
    907  ON_3fVector& operator=(const ON_2fPoint&);
    908  ON_3fVector& operator=(const ON_3fPoint&);
    909  ON_3fVector& operator=(const ON_2fVector&);
    910  ON_3fVector& operator=(const float*); // point = float[3] support
    911 
    912  ON_3fVector& operator=(const ON_2dPoint&);
    913  ON_3fVector& operator=(const ON_3dPoint&);
    914  ON_3fVector& operator=(const ON_2dVector&);
    915  ON_3fVector& operator=(const ON_3dVector&);
    916  ON_3fVector& operator=(const double*); // point = double[3] support
    917 
    918  ON_3fVector operator-() const;
    919 
    920  ON_3fVector& operator*=(float);
    921  ON_3fVector& operator/=(float);
    922  ON_3fVector& operator+=(const ON_3fVector&);
    923  ON_3fVector& operator-=(const ON_3fVector&);
    924 
    925  float operator*(const ON_3fVector&) const; // inner (dot) product
    926  float operator*(const ON_3fPoint&) const; // inner (dot) product (point acting as a vector)
    927  double operator*(const ON_3dVector&) const; // inner (dot) product
    928 
    929  ON_3fVector operator*(int) const;
    930  ON_3fVector operator/(int) const;
    931  ON_3fVector operator*(float) const;
    932  ON_3fVector operator/(float) const;
    933  ON_3dVector operator*(double) const;
    934  ON_3dVector operator/(double) const;
    935 
    936  ON_3fVector operator+(const ON_3fVector&) const;
    937  ON_3fPoint operator+(const ON_3fPoint&) const;
    938  ON_3fVector operator-(const ON_3fVector&) const;
    939  ON_3fPoint operator-(const ON_3fPoint&) const;
    940  ON_3fVector operator+(const ON_2fVector&) const;
    941  ON_3fPoint operator+(const ON_2fPoint&) const;
    942  ON_3fVector operator-(const ON_2fVector&) const;
    943  ON_3fPoint operator-(const ON_2fPoint&) const;
    944 
    945  ON_3dVector operator+(const ON_3dVector&) const;
    946  ON_3dPoint operator+(const ON_3dPoint&) const;
    947  ON_3dVector operator-(const ON_3dVector&) const;
    948  ON_3dPoint operator-(const ON_3dPoint&) const;
    949  ON_3dVector operator+(const ON_2dVector&) const;
    950  ON_3dPoint operator+(const ON_2dPoint&) const;
    951  ON_3dVector operator-(const ON_2dVector&) const;
    952  ON_3dPoint operator-(const ON_2dPoint&) const;
    953 
    954  bool operator==(const ON_3fVector&) const;
    955  bool operator!=(const ON_3fVector&) const;
    956 
    957  // dictionary order comparisons
    958  bool operator<=(const ON_3fVector&) const;
    959  bool operator>=(const ON_3fVector&) const;
    960  bool operator<(const ON_3fVector&) const;
    961  bool operator>(const ON_3fVector&) const;
    962 
    963  // index operators mimic float[3] behavior
    964  float& operator[](int);
    965  float operator[](int) const;
    966  float& operator[](unsigned int);
    967  float operator[](unsigned int) const;
    968 
    969  /*
    970  Returns:
    971  False if any coordinate is ON_UNSET_FLOAT, ON_UNSET_POSITIVE_FLOAT, nan, or infinite.
    972  True, otherwise.
    973  */
    974  bool IsValid() const;
    975 
    976  /*
    977  Returns:
    978  True if any coordinate is ON_UNSET_FLOAT or ON_UNSET_POSITIVE_FLOAT
    979  */
    980  bool IsUnset() const;
    981 
    982  // set 3d vector value
    983  void Set(float,float,float);
    984 
    985  int MaximumCoordinateIndex() const;
    986  double MaximumCoordinate() const; // absolute value of maximum coordinate
    987 
    988  double LengthSquared() const;
    989  double Length() const;
    990 
    991  bool IsPerpendicularTo(
    992  // returns true: this and other vectors are perpendicular
    993  // false: this and other vectors are not perpendicular
    994  // or at least one of the vectors is zero
    995  const ON_3fVector&, // other vector
    996  double = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    997  ) const;
    998 
    999  double Fuzz( double = ON_ZERO_TOLERANCE ) const; // tolerance to use when comparing 3d vectors
    1000 
    1001  ON_DEPRECATED_MSG("Use p = ON_3fVector::ZeroVector;")
    1002  void Zero(); // set all coordinates to zero
    1003 
    1004  ON_DEPRECATED_MSG("Use v = -v;")
    1005  void Reverse(); // negate all coordinates
    1006 
    1007  bool Unitize(); // returns false if vector has zero length
    1008 
    1009  bool IsUnitVector() const;
    1010 
    1011  /*
    1012  Returns:
    1013  If this is a valid non-zero vector, a unit vector parallel to this is returned.
    1014  Otherwise the zero vector is returned.
    1015  */
    1016  ON_3fVector UnitVector() const;
    1017 
    1018 
    1019  // Description:
    1020  // Test a vector to see if it is very short
    1021  //
    1022  // Parameters:
    1023  // tiny_tol - [in] (default = ON_ZERO_TOLERANCE) a nonzero
    1024  // value used as the coordinate zero tolerance.
    1025  //
    1026  // Returns:
    1027  // ( fabs(x) <= tiny_tol && fabs(y) <= tiny_tol && fabs(z) <= tiny_tol )
    1028  //
    1029  bool IsTiny(
    1030  double = ON_ZERO_TOLERANCE // tiny_tol
    1031  ) const;
    1032 
    1033  // Returns:
    1034  // true if vector is the zero vector.
    1035  bool IsZero() const;
    1036 
    1037  /*
    1038  Returns:
    1039  true if at lease one coordinate is not zero and no coordinates are nans.
    1040  */
    1041  bool IsNotZero() const;
    1042 
    1043  // set this vector to be perpendicular to another vector
    1044  bool PerpendicularTo( // Result is not unitized.
    1045  // returns false if input vector is zero
    1046  const ON_3fVector&
    1047  );
    1048 
    1049  // These transform the vector in place. The transformation matrix acts on
    1050  // the left of the vector; i.e., result = transformation*vector
    1051  void Transform(
    1052  const ON_Xform& // can use ON_Xform here
    1053  );
    1054 
    1055  void Rotate(
    1056  double, // angle in radians
    1057  const ON_3fVector& // axis of rotation
    1058  );
    1059 
    1060  void Rotate(
    1061  double, // sin(angle)
    1062  double, // cos(angle)
    1063  const ON_3fVector& // axis of rotation
    1064  );
    1065 
    1066  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    1067 };
    1068 
    1069 ON_DECL
    1070 ON_3fVector operator*(int, const ON_3fVector&);
    1071 
    1072 ON_DECL
    1073 ON_3fVector operator*(float, const ON_3fVector&);
    1074 
    1075 ON_DECL
    1076 ON_3dVector operator*(double, const ON_3fVector&);
    1077 
    1078 ///////////////////////////////////////////////////////////////
    1079 //
    1080 // ON_3fVector utilities
    1081 //
    1082 
    1083 ON_DECL
    1084 float
    1085 ON_DotProduct(
    1086  const ON_3fVector&,
    1087  const ON_3fVector&
    1088  );
    1089 
    1090 
    1091 ON_DECL
    1092 ON_3fVector
    1093 ON_CrossProduct(
    1094  const ON_3fVector&,
    1095  const ON_3fVector&
    1096  );
    1097 
    1098 ON_DECL
    1099 ON_3fVector
    1100 ON_CrossProduct( // 3d cross product for old fashioned arrays
    1101  const float*, // array of 3d floats
    1102  const float* // array of 3d floats
    1103  );
    1104 
    1105 ON_DECL
    1106 float
    1107 ON_TripleProduct(
    1108  const ON_3fVector&,
    1109  const ON_3fVector&,
    1110  const ON_3fVector&
    1111  );
    1112 
    1113 ON_DECL
    1114 float
    1115 ON_TripleProduct( // 3d triple product for old fashioned arrays
    1116  const float*, // array of 3d floats
    1117  const float*, // array of 3d floats
    1118  const float* // array of 3d floats
    1119  );
    1120 
    1121 ON_DECL
    1122 bool
    1123 ON_IsOrthogonalFrame( // true if X, Y, Z are nonzero and mutually perpendicular
    1124  const ON_3fVector&, // X
    1125  const ON_3fVector&, // Y
    1126  const ON_3fVector& // Z
    1127  );
    1128 
    1129 ON_DECL
    1130 bool
    1131 ON_IsOrthonormalFrame( // true if X, Y, Z are orthogonal and unit length
    1132  const ON_3fVector&, // X
    1133  const ON_3fVector&, // Y
    1134  const ON_3fVector& // Z
    1135  );
    1136 
    1137 ON_DECL
    1138 bool
    1139 ON_IsRightHandFrame( // true if X, Y, Z are orthonormal and right handed
    1140  const ON_3fVector&, // X
    1141  const ON_3fVector&, // Y
    1142  const ON_3fVector& // Z
    1143  );
    1144 
    1145 #endif
    Definition: opennurbs_fpoint.h:571
    Definition: opennurbs_fpoint.h:849
    static const ON_3fVector YAxis
    (0.0f,1.0f,0.0f)
    Definition: opennurbs_fpoint.h:865
    float z
    Definition: opennurbs_fpoint.h:852
    @@ -103,9 +101,9 @@ $(function() {
    diff --git a/6/d7/da5/opennurbs__unicode_8h_source.html b/6/d7/da5/opennurbs__unicode_8h_source.html index 211a6859..ce67dddc 100644 --- a/6/d7/da5/opennurbs__unicode_8h_source.html +++ b/6/d7/da5/opennurbs__unicode_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_unicode.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_unicode.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d7/db4/opennurbs__polyline_8h_source.html b/6/d7/db4/opennurbs__polyline_8h_source.html index 98d18a13..d28f48b7 100644 --- a/6/d7/db4/opennurbs__polyline_8h_source.html +++ b/6/d7/db4/opennurbs__polyline_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_polyline.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_polyline.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/dc7/class_o_n___bezier_surface.html b/6/d7/dc7/class_o_n___bezier_surface.html index e9b103d7..a0b5390b 100644 --- a/6/d7/dc7/class_o_n___bezier_surface.html +++ b/6/d7/dc7/class_o_n___bezier_surface.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BezierSurface Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/dc7/opennurbs__lookup_8h_source.html b/6/d7/dc7/opennurbs__lookup_8h_source.html index bd709905..43b91f67 100644 --- a/6/d7/dc7/opennurbs__lookup_8h_source.html +++ b/6/d7/dc7/opennurbs__lookup_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_lookup.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_lookup.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/dc7/opennurbs__version_8h_source.html b/6/d7/dc7/opennurbs__version_8h_source.html index ce49fda5..3789efba 100644 --- a/6/d7/dc7/opennurbs__version_8h_source.html +++ b/6/d7/dc7/opennurbs__version_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_version.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_version.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 
    18 #if !defined(OPENNURBS_VERSION_INC_)
    19 #define OPENNURBS_VERSION_INC_
    20 
    21 #if !defined(OPENNURBS_VERSION_DEFINITION)
    22 #error Do NOT include opennurbs_version.h in your code. Use ON::Version() instead.
    23 #endif
    24 
    25 ////////////////////////////////////////////////////////////////
    26 //
    27 // Values that identify the version are defined below.
    28 //
    29 // The function
    30 // ON_VersionNumberConstruct(major,minor,year,month,day_of_month,branch)
    31 // creates a 4-byte unsigned integer that encodes the version information.
    32 //
    33 // The function
    34 // ON_GetVersionNumberStringConstruct()
    35 // creates a "major.minor.yyddd.hhmmb" version string
    36 // where ddd = day of year (1 to 366).
    37 //
    38 // The function
    39 // ON_GetVersionNumberQuarted()
    40 // returns an array of 4 unsigned short values
    41 // (major,minor,yyddd,hhmmb)
    42 // where ddd = day of year (1 to 366).
    43 
    44 
    45 #include "opennurbs_public_version.h"
    46 
    47 ////////////////////////////////////////////////////////////////
    48 //
    49 // Major version number >= 0 and <= 63
    50 // Minor version number >= 0 and <= 127
    51 //
    52 
    53 #define OPENNURBS_VERSION_MAJOR RMA_VERSION_MAJOR
    54 #define OPENNURBS_VERSION_MINOR RMA_VERSION_MINOR
    55 
    56 ////////////////////////////////////////////////////////////////
    57 //
    58 // The five OPENNURBS_VERSION_... time defines are set
    59 // automatically by the build system as the first step
    60 // in each build.
    61 //
    62 
    63 #define OPENNURBS_VERSION_YEAR RMA_VERSION_YEAR
    64 #define OPENNURBS_VERSION_MONTH RMA_VERSION_MONTH
    65 #define OPENNURBS_VERSION_DAY_OF_MONTH RMA_VERSION_DATE
    66 #define OPENNURBS_VERSION_HOUR RMA_VERSION_HOUR
    67 #define OPENNURBS_VERSION_MINUTE RMA_VERSION_MINUTE
    68 
    69 ////////////////////////////////////////////////////////////////
    70 //
    71 // branch = 0 to 3
    72 // Use ON::VersionBranch() to get this value.
    73 // This number identifies the branch used in the build.
    74 //
    75 // The build system automatically sets the value to
    76 // 1, 2 or 3 before compiling any code.
    77 //
    78 // The file checked into the source code repository
    79 // always has branch set to 0.
    80 // 0 = developer build
    81 // 1 = build system trunk build
    82 // 2 = build system release candidate build
    83 // 3 = build system release build
    84 //#define OPENNURBS_VERSION_BRANCH 0
    85 
    86 #define OPENNURBS_VERSION_BRANCH RMA_VERSION_BRANCH
    87 
    88 ////////////////////////////////////////////////////////////////
    89 //
    90 // The build process modifies version.h and sets
    91 // RMA_SRC_SVN_REVISION = "<git revision SHA-1 hash>"
    92 // before compiling applications.
    93 //
    94 
    95 #define OPENNURBS_GIT_REVISION_HASH RMA_GIT_REVISION_HASH_STRING
    96 #define OPENNURBS_GIT_BRANCH_NAME RMA_GIT_BRANCH_NAME_STRING
    97 
    98 ////////////////////////////////////////////////////////////////
    99 //
    100 // OPENNURBS_VERSION_QUARTET_STRING is a macro whose value is the
    101 // opennurbs version quartet as a string.
    102 //
    103 #define OPENNURBS_VERSION_QUARTET_STRING RMA_VERSION_WITH_PERIODS_STRING
    104 #define OPENNURBS_VERSION_QUARTET_WSTRING RMA_VERSION_WITH_PERIODS_WSTRING
    105 #define OPENNURBS_VERSION_QUARTET_WITH_COMMAS VERSION_WITH_COMMAS
    106 #define OPENNURBS_VERSION_QUARTET_WITH_PERIODS VERSION_WITH_PERIODS
    107 
    108 ////////////////////////////////////////////////////////////////
    109 //
    110 // ON_VERSION_NUMBER_FEBDAYS(year) is a macro whose value is
    111 // the number of days in the month of February in a specified
    112 // year.
    113 //
    114 // In almost every situation, it is best to used the function
    115 // call ON_DaysInMonthOfGregorianYear(year,2) to get this value.
    116 // The ON_VERSION_NUMBER_FEBDAYS macro is for rare and unusual
    117 // situations where the C preprocessor needs this value.
    118 //
    119 #define ON_VERSION_NUMBER_FEBDAYS(year) \
    120  (((year) % 400) == 0 ? 29 : \
    121  (((year) % 100) == 0 ? 28 : \
    122  (((year) % 4) == 0 ? 29 : \
    123  28)))
    124 
    125 ////////////////////////////////////////////////////////////////
    126 //
    127 // ON_VERSION_NUMBER_DAYOFYEAR(year, month, day_of_month) is a macro
    128 // whose value is the cardinal day of the year for the
    129 // specified year, month and day_of_month.
    130 //
    131 // In almost every situation, it is best to used the function call
    132 // ON_DayOfGregorianYear(year,month,day_of_month) to get this value.
    133 // The ON_VERSION_NUMBER_DAYOFYEAR macro is for rare and unusual
    134 // situations where the C preprocessor needs this value.
    135 //
    136 #define ON_VERSION_NUMBER_DAYOFYEAR(year, month, day_of_month) \
    137  ( (day_of_month) \
    138  + ((month) >= 2 ? 31 : 0) \
    139  + ((month) >= 3 ? ON_VERSION_NUMBER_FEBDAYS(year) : 0) \
    140  + ((month) >= 4 ? 31 : 0) \
    141  + ((month) >= 5 ? 30 : 0) \
    142  + ((month) >= 6 ? 31 : 0) \
    143  + ((month) >= 7 ? 30 : 0) \
    144  + ((month) >= 8 ? 31 : 0) \
    145  + ((month) >= 9 ? 31 : 0) \
    146  + ((month) >= 10 ? 30 : 0) \
    147  + ((month) >= 11 ? 31 : 0) \
    148  + ((month) >= 12 ? 30 : 0) \
    149  )
    150 
    151 #define ON_VERSION_NUMBER_TIME(year, month, day_of_month) \
    152  ((((year)-2000)*367) + (ON_VERSION_NUMBER_DAYOFYEAR(year,month,day_of_month)))
    153 
    154 
    155 ////////////////////////////////////////////////////////////////
    156 //
    157 // ON_VERSION_NUMBER_CTOR(major,minor,year,month,day_of_month,branch)
    158 // is a macro whose value is the opennurbs version number encoding
    159 // for the specified major, minor, year, month and day_of_month
    160 // values.
    161 //
    162 // In almost every situation, it is best to used the function call
    163 // ON_VersionNumberConstruct(major,minor,year,month,day_of_month)
    164 // to get this value. The ON_VERSION_NUMBER_CTOR macro is for
    165 // rare and unusual situations where the C preprocessor needs
    166 // this value.
    167 //
    168 #define ON_VERSION_NUMBER_CTOR(major,minor,year,month,day_of_month,branch) \
    169  (0x80000000U \
    170  + ((((major)*0x080U + (minor)))*0x010000U \
    171  + ((ON_VERSION_NUMBER_TIME(year,month,day_of_month))))*0x04U \
    172  + ((branch)))
    173 
    174 ////////////////////////////////////////////////////////////////
    175 //
    176 // OPENNURBS_VERSION_NUMBER is a macro whose value is the
    177 // opennurbs version number.
    178 //
    179 // Always use ON::Version() when you need this value.
    180 // The OPENNURBS_VERSION_NUMBER macro is for rare and unusual
    181 // situations where the C preprocessor needs this value.
    182 //
    183 #define OPENNURBS_VERSION_NUMBER ON_VERSION_NUMBER_CTOR( \
    184  OPENNURBS_VERSION_MAJOR, OPENNURBS_VERSION_MINOR, \
    185  OPENNURBS_VERSION_YEAR, OPENNURBS_VERSION_MONTH, OPENNURBS_VERSION_DAY_OF_MONTH, \
    186  OPENNURBS_VERSION_BRANCH )
    187 
    188 #endif
    diff --git a/6/d7/dd2/class_o_n___instance_ref-members.html b/6/d7/dd2/class_o_n___instance_ref-members.html index cf86fcd3..366637a7 100644 --- a/6/d7/dd2/class_o_n___instance_ref-members.html +++ b/6/d7/dd2/class_o_n___instance_ref-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/dd8/class_o_n___sphere.html b/6/d7/dd8/class_o_n___sphere.html index 14a3cc8d..91b0f809 100644 --- a/6/d7/dd8/class_o_n___sphere.html +++ b/6/d7/dd8/class_o_n___sphere.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Sphere Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/dde/class_o_n___file_system_path-members.html b/6/d7/dde/class_o_n___file_system_path-members.html index 3dc6d3d7..e152f12c 100644 --- a/6/d7/dde/class_o_n___file_system_path-members.html +++ b/6/d7/dde/class_o_n___file_system_path-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/de0/opennurbs__system_8h_source.html b/6/d7/de0/opennurbs__system_8h_source.html index 16f5bcbd..9588f348 100644 --- a/6/d7/de0/opennurbs__system_8h_source.html +++ b/6/d7/de0/opennurbs__system_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_system.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_system.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2014 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 /*
    18 ////////////////////////////////////////////////////////////////
    19 //
    20 // Includes all system headers required to use the openNURBS toolkit.
    21 //
    22 ////////////////////////////////////////////////////////////////
    23 */
    24 
    25 #if !defined(OPENNURBS_SYSTEM_INC_)
    26 #define OPENNURBS_SYSTEM_INC_
    27 
    28 
    29 
    30 
    31 
    32 #define OPENNURBS_PP2STR_HELPER(s) #s
    33 #define OPENNURBS_PP2STR(s) OPENNURBS_PP2STR_HELPER(s)
    34 /*
    35 // To print the value of a preprocessor macro, do something like:
    36 //
    37 // #pragma message( "MY_MACRO = " OPENNURBS_PP2STR(MY_MACRO) )
    38 //
    39 // Typically something mysterious is defining a macro whose value
    40 // you would like to see at compile time so you can fix a issue
    41 // involving the preprocessor macro's value.
    42 */
    43 
    44 #if defined(ON_DLL_EXPORTS)
    45 #error "ON_DLL_EXPORTS" is obsolete. V6 uses "OPENNURBS_EXPORTS".
    46 #endif
    47 
    48 #if defined(ON_EXPORTS)
    49 #error "ON_EXPORTS" is obsolete. V6 uses "OPENNURBS_EXPORTS".
    50 #endif
    51 
    52 #if defined(ON_DLL_IMPORTS)
    53 #error "ON_DLL_IMPORTS" is obsolete. V6 uses "OPENNURBS_IMPORTS".
    54 #endif
    55 
    56 #if defined(ON_IMPORTS)
    57 #error "ON_IMPORTS" is obsolete. V6 uses "OPENNURBS_IMPORTS".
    58 #endif
    59 
    60 #if defined(OPENNURBS_EXPORTS) && defined(OPENNURBS_IMPORTS)
    61 /*
    62 // - When compiling opennurbs as a dll, define OPENNURBS_EXPORTS.
    63 // - When using opennurbs as a dll, define OPENNURBS_IMPORTS.
    64 // - When compiling opennurbs as a static library, ON_COMPILING_OPENNURBS
    65 // should be defined and neither OPENNURBS_EXPORTS nor OPENNURBS_IMPORTS
    66 // should be defined.
    67 // - When using opennurbs as a static library, neither
    68 // ON_COMPILING_OPENNURBS nor OPENNURBS_EXPORTS nor OPENNURBS_IMPORTS
    69 // should be defined.
    70 */
    71 #error At most one of OPENNURBS_EXPORTS or OPENNURBS_IMPORTS can be defined.
    72 #endif
    73 
    74 #if defined(OPENNURBS_EXPORTS)
    75 #if !defined(ON_COMPILING_OPENNURBS)
    76 #define ON_COMPILING_OPENNURBS
    77 #endif
    78 #endif
    79 
    80 #if defined(_DEBUG)
    81 /* enable OpenNurbs debugging code */
    82 #if !defined(ON_DEBUG)
    83 #define ON_DEBUG
    84 #endif
    85 #endif
    86 
    87 #if defined(ON_COMPILING_OPENNURBS) && defined(OPENNURBS_IMPORTS)
    88 /*
    89 // - If you are using opennurbs as library, do not define
    90 // ON_COMPILING_OPENNURBS.
    91 // - If you are compiling an opennurbs library, define
    92 // ON_COMPILING_OPENNURBS.
    93 */
    94 #error At most one of ON_COMPILING_OPENNURBS or OPENNURBS_IMPORTS can be defined.
    95 #endif
    96 
    97 /*
    98 // Define ON_NO_WINDOWS if you are compiling on a Windows system but want
    99 // to explicitly exclude inclusion of windows.h.
    100 */
    101 
    102 #if defined(ON_COMPILING_OPENNURBS)
    103 #if !defined(OPENNURBS_WALL)
    104 /*
    105 // When OPENNURBS_WALL is defined, warnings and deprications that
    106 // encourage the highest quality of code are used.
    107 */
    108 #define OPENNURBS_WALL
    109 #endif
    110 #endif
    111 
    112 #include "opennurbs_system_compiler.h"
    113 
    114 #include "opennurbs_system_runtime.h"
    115 
    116 #pragma ON_PRAGMA_WARNING_PUSH
    117 
    118 /* compiler choice */
    119 #if defined(ON_COMPILER_MSC)
    120 #include "opennurbs_windows_targetver.h"
    121 #endif
    122 
    123 #if defined(ON_RUNTIME_APPLE) && defined(__OBJC__)
    124 
    125 // The header file opennurbs_system_runtime.h is included in several
    126 // places before opennurbs.h or opennurbs_system.h is included.
    127 // Therefore, this define cannot be in opennurbs_system_runtime.h
    128 //
    129 // When ON_RUNTIME_APPLE_OBJECTIVE_C_AVAILABLE is defined,
    130 // <Cocoa/Cocoa.h> is included by opennurbs_system.h and
    131 // your project must link with the Apple Cocoa Framework.
    132 #define ON_RUNTIME_APPLE_OBJECTIVE_C_AVAILABLE
    133 
    134 #endif
    135 
    136 #if defined(ON_64BIT_RUNTIME)
    137 /* 64 bit (8 byte) pointers */
    138 #define ON_SIZEOF_POINTER 8
    139 /* ON_MAX_SIZET = maximum value of a size_t type */
    140 #define ON_MAX_SIZE_T 0xFFFFFFFFFFFFFFFFULL
    141 
    142 #if defined(ON_COMPILER_MSC)
    143 
    144 typedef __int64 ON__INT_PTR;
    145 typedef unsigned __int64 ON__UINT_PTR;
    146 #elif defined(_GNU_SOURCE) || defined(ON_COMPILER_CLANG)
    147 typedef long long ON__INT_PTR;
    148 typedef unsigned long long ON__UINT_PTR;
    149 #endif
    150 #define ON__UINT_PTR_MAX 0xFFFFFFFFFFFFFFFFULL
    151 
    152 #elif defined(ON_32BIT_RUNTIME)
    153 /* 32 bit (4 byte) pointers */
    154 #define ON_SIZEOF_POINTER 4
    155 /* ON_MAX_SIZET = maximum value of a size_t type */
    156 #define ON_MAX_SIZE_T 0xFFFFFFFFULL
    157 
    158 typedef int ON__INT_PTR;
    159 typedef unsigned int ON__UINT_PTR;
    160 #define ON__UINT_PTR_MAX 0xFFFFFFFFULL
    161 
    162 #endif
    163 
    164 // 8 bit integer
    165 typedef char ON__INT8;
    166 
    167 // 8 bit unsigned integer
    168 typedef unsigned char ON__UINT8;
    169 
    170 // 16 bit integer
    171 typedef short ON__INT16;
    172 
    173 // 16 bit unsigned integer
    174 typedef unsigned short ON__UINT16;
    175 
    176 // 32 bit integer
    177 typedef int ON__INT32;
    178 
    179 // 32 bit unsigned integer
    180 typedef unsigned int ON__UINT32;
    181 
    182 #if defined(ON_COMPILER_MSC)
    183 // 64 bit integer
    184 typedef __int64 ON__INT64;
    185 // 64 bit unsigned integer
    186 typedef unsigned __int64 ON__UINT64;
    187 
    188 #elif defined(_GNU_SOURCE) || defined(ON_COMPILER_CLANG)
    189 // 64 bit integer
    190 typedef long long ON__INT64;
    191 // 64 bit unsigned integer
    192 typedef unsigned long long ON__UINT64;
    193 
    194 #else
    195 
    196 #error Verify that long long is a 64 bit integer with your compiler!
    197 
    198 // 64 bit integer
    199 typedef long long ON__INT64;
    200 
    201 // 64 bit unsigned integer
    202 typedef unsigned long long ON__UINT64;
    203 
    204 #endif
    205 
    206 
    207 // ON_INT_PTR must be an integer type with sizeof(ON_INT_PTR) = sizeof(void*).
    208 #if 8 == ON_SIZEOF_POINTER
    209 
    210 #if defined(ON_COMPILER_GNU) || defined(ON_COMPILER_CLANG)
    211 typedef long long ON__INT_PTR;
    212 typedef unsigned long long ON__UINT_PTR;
    213 #else
    214 typedef __int64 ON__INT_PTR;
    215 typedef unsigned __int64 ON__UINT_PTR;
    216 #endif
    217 
    218 #elif 4 == ON_SIZEOF_POINTER
    219 
    220 typedef int ON__INT_PTR;
    221 typedef unsigned int ON__UINT_PTR;
    222 
    223 #else
    224 #error Update OpenNURBS to work with new pointer size.
    225 #endif
    226 
    227 /*
    228 ////////////////////////////////////////////////////////////
    229 ////////////////////////////////////////////////////////////
    230 ////////////////////////////////////////////////////////////
    231 //
    232 // BEGIN - fill in missing types and defines
    233 //
    234 // If you are using an old compiler, then define ON_NEED_* when
    235 // you define ON_COMPILER_* above.
    236 //
    237 */
    238 #if defined(ON_NEED_BOOL_TYPEDEF)
    239 #undef ON_NEED_BOOL_TYPEDEF
    240 typedef ON__UINT8 bool;
    241 #endif
    242 
    243 #if defined(ON_NEED_TRUEFALSE_DEFINE)
    244 #undef ON_NEED_TRUEFALSE_DEFINE
    245 #define true ((bool)1)
    246 #define false ((bool)0)
    247 #endif
    248 
    249 #if defined(ON_NEED_NULLPTR_DEFINE)
    250 #undef ON_NEED_NULLPTR_DEFINE
    251 #define nullptr 0
    252 #endif
    253 
    254 #if defined(ON_NEED_UTF8_WCHAR_T_TYPEDEF)
    255 #if defined(ON_NEED_UTF16_WCHAR_T_TYPEDEF) || defined(ON_NEED_UTF32_WCHAR_T_TYPEDEF)
    256 #error You may define at most one of ON_NEED_UTF8_WCHAR_T_TYPEDEF, ON_NEED_UTF16_WCHAR_T_TYPEDEF and ON_NEED_UTF16_WCHAR_T_TYPEDEF
    257 #endif
    258 #undef ON_NEED_UTF8_WCHAR_T_TYPEDEF
    259 typedef ON__UINT8 wchar_t;
    260 #define ON_SIZEOF_WCHAR_T 1
    261 
    262 #elif defined(ON_NEED_UTF16_WCHAR_T_TYPEDEF)
    263 #if defined(ON_NEED_UTF32_WCHAR_T_TYPEDEF)
    264 #error You may define at most one of ON_NEED_UTF8_WCHAR_T_TYPEDEF, ON_NEED_UTF16_WCHAR_T_TYPEDEF and ON_NEED_UTF16_WCHAR_T_TYPEDEF
    265 #endif
    266 #undef ON_NEED_UTF16_WCHAR_T_TYPEDEF
    267 typedef ON__UINT16 wchar_t;
    268 #define ON_SIZEOF_WCHAR_T 2
    269 
    270 #elif defined(ON_NEED_UTF32_WCHAR_T_TYPEDEF)
    271 #undef ON_NEED_UTF32_WCHAR_T_TYPEDEF
    272 typedef ON__UINT32 wchar_t;
    273 #define ON_SIZEOF_WCHAR_T 4
    274 
    275 #endif
    276 
    277 /*
    278 ////////////////////////////////////////////////////////////
    279 ////////////////////////////////////////////////////////////
    280 ////////////////////////////////////////////////////////////
    281 //
    282 // Validate ON_SIZEOF_WCHAR_T and set ON_WCHAR_T_ENCODING
    283 //
    284 */
    285 
    286 #if !defined(ON_SIZEOF_WCHAR_T)
    287 #error unknown sizeof(wchar_t)
    288 #endif
    289 
    290 #if !defined(ON_WCHAR_T_ENCODING)
    291 
    292 #if (1 == ON_SIZEOF_WCHAR_T)
    293 #define ON_WCHAR_T_ENCODING ON_UnicodeEncoding::ON_UTF_8
    294 #elif (2 == ON_SIZEOF_WCHAR_T)
    295 #if defined(ON_LITTLE_ENDIAN)
    296 #define ON_WCHAR_T_ENCODING ON_UnicodeEncoding::ON_UTF_16LE
    297 #elif defined(ON_BIG_ENDIAN)
    298 #define ON_WCHAR_T_ENCODING ON_UnicodeEncoding::ON_UTF_16BE
    299 #endif
    300 #elif (4 == ON_SIZEOF_WCHAR_T)
    301 #if defined(ON_LITTLE_ENDIAN)
    302 #define ON_WCHAR_T_ENCODING ON_UnicodeEncoding::ON_UTF_32LE
    303 #elif defined(ON_BIG_ENDIAN)
    304 #define ON_WCHAR_T_ENCODING ON_UnicodeEncoding::ON_UTF_32BE
    305 #endif
    306 #endif
    307 
    308 #if !defined(ON_WCHAR_T_ENCODING)
    309 #error unable to automatically set ON_WCHAR_T_ENCODING
    310 #endif
    311 
    312 #endif
    313 
    314 
    315 /*
    316 ////////////////////////////////////////////////////////////
    317 ////////////////////////////////////////////////////////////
    318 ////////////////////////////////////////////////////////////
    319 //
    320 // BEGIN - OBSOLETE defines
    321 //
    322 // These legacy defines will be remvoed from V6
    323 //
    324 */
    325 
    326 #if defined(__APPLE__) && (defined(_GNU_SOURCE) || defined(ON_COMPILER_CLANG))
    327 /* Poorly named and used define that indicated using Apple's OSX compiler and/or runtime */
    328 #if !defined(ON_COMPILER_XCODE)
    329 #define ON_COMPILER_XCODE
    330 #endif
    331 #endif
    332 
    333 #if defined (ON_RUNTIME_WIN) && !defined(ON_OS_WINDOWS)
    334 #define ON_OS_WINDOWS
    335 #endif
    336 
    337 #define ON_MSC_CDECL ON_CALLBACK_CDECL
    338 
    339 #if defined(ON_64BIT_RUNTIME)
    340 #define ON_64BIT_POINTER
    341 #elif defined(ON_32BIT_RUNTIME)
    342 #define ON_32BIT_POINTER
    343 #endif
    344 
    345 /*
    346 //
    347 // END - OBSOLETE defines
    348 //
    349 ////////////////////////////////////////////////////////////
    350 ////////////////////////////////////////////////////////////
    351 ////////////////////////////////////////////////////////////
    352 */
    353 
    354 // To debug linking pragma path issues, uncomment the followint line
    355 //#pragma message( "OPENNURBS_OUTPUT_DIR = " OPENNURBS_PP2STR(OPENNURBS_OUTPUT_DIR) )
    356 
    357 #if defined(ON_RUNTIME_WIN) && !defined(ON_NO_WINDOWS)
    358 
    359 /*
    360 /////////////////////////////////////////////////////////////////////////
    361 //
    362 // Begin Windows system includes -
    363 */
    364 
    365 
    366 #if defined(_M_X64) && defined(WIN32) && defined(WIN64)
    367 // 23 August 2007 Dale Lear
    368 
    369 #if defined(_INC_WINDOWS)
    370 // The user has included Microsoft's windows.h before opennurbs.h,
    371 // and windows.h has nested includes that unconditionally define WIN32.
    372 // Just undo the damage here or everybody that includes opennurbs.h after
    373 // windows.h has to fight with this Microsoft bug.
    374 #undef WIN32
    375 #else
    376 #error do not define WIN32 for x64 builds
    377 #endif
    378 // NOTE _WIN32 is defined for any type of Windows build
    379 #endif
    380 
    381 #if !defined(_WINDOWS_)
    382 /* windows.h has not been read - read just what we need */
    383 #define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
    384 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    385 #include <windows.h>
    386 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    387 #endif
    388 
    389 #if defined(_M_X64) && defined(WIN32) && defined(WIN64)
    390 // 23 August 2007 Dale Lear
    391 // windows.h unconditionally defines WIN32 This is a bug
    392 // and the hope is this simple undef will let us continue.
    393 #undef WIN32
    394 #endif
    395 
    396 #if defined(ON_RUNTIME_WIN) && !defined(NOGDI)
    397 /*
    398 // ok to use Windows GDI RECT, LOGFONT, ... stucts.
    399 */
    400 #define ON_OS_WINDOWS_GDI
    401 #endif
    402 
    403 #endif
    404 
    405 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    406 #include <stdlib.h>
    407 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    408 
    409 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    410 #include <memory.h>
    411 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    412 
    413 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    414 #if defined(ON_COMPILER_CLANG) && defined(ON_RUNTIME_APPLE)
    415 #include <malloc/malloc.h>
    416 #else
    417 #include <malloc.h>
    418 #endif
    419 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    420 
    421 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    422 #include <string.h>
    423 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    424 
    425 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    426 #include <math.h>
    427 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    428 
    429 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    430 #include <stdio.h>
    431 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    432 
    433 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    434 #include <stdarg.h>
    435 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    436 
    437 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    438 #include <float.h>
    439 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    440 
    441 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    442 #include <time.h>
    443 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    444 
    445 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    446 #include <limits.h>
    447 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    448 
    449 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    450 #include <ctype.h>
    451 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    452 
    453 #if defined(ON_COMPILER_IRIX)
    454 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    455 #include <alloca.h>
    456 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    457 
    458 #endif
    459 
    460 #if !defined(ON_COMPILER_BORLANDC)
    461 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    462 #include <wchar.h>
    463 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    464 
    465 #endif
    466 
    467 #if defined(ON_COMPILER_MSC)
    468 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    469 #include <io.h>
    470 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    471 
    472 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    473 #include <sys/stat.h>
    474 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    475 
    476 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    477 #include <tchar.h>
    478 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    479 
    480 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    481 #include <Rpc.h>
    482 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    483 
    484 #endif
    485 
    486 #if defined(ON_COMPILER_GNU)
    487 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    488 #include <sys/types.h>
    489 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    490 
    491 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    492 #include <sys/stat.h>
    493 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    494 
    495 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    496 #include <wctype.h>
    497 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    498 
    499 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    500 #include <dirent.h>
    501 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    502 
    503 #endif
    504 
    505 #if defined(ON_COMPILER_CLANG)
    506 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    507 #include <sys/types.h>
    508 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    509 
    510 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    511 #include <sys/stat.h>
    512 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    513 
    514 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    515 #include <wctype.h>
    516 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    517 
    518 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    519 #include <dirent.h>
    520 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    521 
    522 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    523 #if defined(ON_RUNTIME_ANDROID)
    524 #include "android_uuid/uuid.h"
    525 #else
    526 #include <uuid/uuid.h>
    527 #endif
    528 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    529 
    530 #endif
    531 
    532 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    533 #include <errno.h>
    534 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    535 
    536 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    537 // For definition of PRIu64 to print 64-bit ints portably.
    538 #include <inttypes.h>
    539 #if !defined(PRIu64)
    540 #error no PRIu64
    541 #endif
    542 
    543 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    544 
    545 
    546 #if defined (cplusplus) || defined(_cplusplus) || defined(__cplusplus)
    547 // C++ system includes
    548 
    549 #if !defined(ON_CPLUSPLUS)
    550 #define ON_CPLUSPLUS
    551 #endif
    552 
    553 // Standard C++ tools
    554 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    555 #include <new> // for declaration of placement versions of new used in ON_ClassArray<>.
    556 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    557 
    558 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    559 #include <memory> // for std::shared_ptr
    560 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    561 
    562 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    563 #include <utility> // std::move
    564 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    565 
    566 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    567 #include <string> // std::string, std::wstring
    568 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    569 
    570 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    571 #include <locale> // for call create_locale(LC_ALL,"C") in ON_Locale().
    572 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    573 
    574 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    575 #include <atomic> // for std:atomic<type>
    576 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    577 
    578 
    579 #define ON_NO_SHARED_PTR_DTOR(T) [=](T*){}
    580 #define ON_MANAGED_SHARED_PTR(T, p) std::shared_ptr<T>(p)
    581 #define ON_UNMANAGED_SHARED_PTR(T, p) std::shared_ptr<T>(p,[=](T*){})
    582 
    583 #if defined(ON_RUNTIME_APPLE)
    584 
    585 #if defined(ON_COMPILER_CLANG)
    586 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    587 #include <wchar.h>
    588 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    589 
    590 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    591 #include <xlocale.h>
    592 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    593 
    594 #endif
    595 
    596 #if defined(ON_RUNTIME_APPLE_OBJECTIVE_C_AVAILABLE)
    597 // Opennurbs uses NSFont and NSString to load Apple fonts
    598 // int the ON_Font and freetype internals.
    599 // When ON_RUNTIME_APPLE_OBJECTIVE_C_AVAILABLE is defined, you
    600 // must link with the Apple Cocoa Framework.
    601 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    602 #include <Cocoa/Cocoa.h>
    603 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    604 
    605 #endif
    606 #endif
    607 
    608 #endif
    609 
    610 /*
    611 /////////////////////////////////////////////////////////////////////////////////
    612 //
    613 // Validate defines
    614 //
    615 */
    616 
    617 /*
    618 // Validate ON_x_ENDIAN defines
    619 */
    620 #if defined(ON_LITTLE_ENDIAN) && defined(ON_BIG_ENDIAN)
    621 #error Exactly one of ON_LITTLE_ENDIAN or ON_BIG_ENDIAN must be defined.
    622 #endif
    623 
    624 #if !defined(ON_LITTLE_ENDIAN) && !defined(ON_BIG_ENDIAN)
    625 #error Either ON_LITTLE_ENDIAN or ON_BIG_ENDIAN must be defined.
    626 #endif
    627 
    628 /*
    629 // Validate ON_xBIT_RUNTIME defines
    630 */
    631 #if defined(ON_64BIT_RUNTIME) && defined(ON_32BIT_RUNTIME)
    632 #error Exactly one of ON_64BIT_RUNTIME or ON_32BIT_RUNTIME must be defined.
    633 #endif
    634 
    635 #if !defined(ON_64BIT_RUNTIME) && !defined(ON_32BIT_RUNTIME)
    636 #error Either ON_64BIT_RUNTIME or ON_32BIT_RUNTIME must be defined.
    637 #endif
    638 
    639 /*
    640 // Validate ON_SIZEOF_POINTER defines
    641 */
    642 #if 8 == ON_SIZEOF_POINTER
    643 
    644 #if !defined(ON_64BIT_RUNTIME)
    645 #error 8 = ON_SIZEOF_POINTER and ON_64BIT_RUNTIME is not defined
    646 #endif
    647 #if defined(ON_32BIT_RUNTIME)
    648 #error 8 = ON_SIZEOF_POINTER and ON_32BIT_RUNTIME is defined
    649 #error
    650 #endif
    651 
    652 #elif 4 == ON_SIZEOF_POINTER
    653 
    654 #if !defined(ON_32BIT_RUNTIME)
    655 #error 4 = ON_SIZEOF_POINTER and ON_32BIT_RUNTIME is not defined
    656 #endif
    657 #if defined(ON_64BIT_RUNTIME)
    658 #error 4 = ON_SIZEOF_POINTER and ON_64BIT_RUNTIME is defined
    659 #endif
    660 
    661 #else
    662 
    663 #error OpenNURBS assumes sizeof(void*) is 4 or 8 bytes
    664 
    665 #endif
    666 
    667 #if defined(__FUNCTION__)
    668 #define OPENNURBS__FUNCTION__ __FUNCTION__
    669 #elif defined(__func__)
    670 #define OPENNURBS__FUNCTION__ __func__
    671 #else
    672 #define OPENNURBS__FUNCTION__ ""
    673 #endif
    674 
    675 #pragma ON_PRAGMA_WARNING_POP
    676 
    677 
    678 #endif
    diff --git a/6/d7/de3/class_o_n___texture_mapping.html b/6/d7/de3/class_o_n___texture_mapping.html index 18790a99..49b86096 100644 --- a/6/d7/de3/class_o_n___texture_mapping.html +++ b/6/d7/de3/class_o_n___texture_mapping.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextureMapping Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -958,8 +956,8 @@ Additional Inherited Members

    Description: Evaluate the mapping to get a texture coordinate. Parameters: P - [in] Vertex location N - [in] If the mapping projection is ray_projection, then this is the vertex unit normal. Otherwise N is ignored. T - [out] Texture coordinate (u,v,w)

    P_xform -[in] Transformation to be applied to P before performing the mapping calculation. N_xform - [in] Transformation to be applied to N before performing the mapping calculation. One way to calculate N_xform is to use the call P_xform::GetVectorTransform(N_xform).

    Returns: Nonzero if evaluation is successful. When the mapping is a box or capped cylinder mapping, the value indicates which side was evaluated.

    -

    Cylinder mapping: 1 = cylinder wall, 2 = bottom cap, 3 = top cap Box mapping: 1 = front 2 = right 3 = back 4 = left 5 = bottom 6 = top
    - See Also: ON_TextureMapping::GetTextureCoordinates ON_Mesh::SetTextureCoordinates

    +

    Cylinder mapping: 1 = cylinder wall, 2 = bottom cap, 3 = top cap Box mapping: 1 = front 2 = right 3 = back 4 = left 5 = bottom 6 = top

    +

    See Also: ON_TextureMapping::GetTextureCoordinates ON_Mesh::SetTextureCoordinates

    @@ -1227,8 +1225,7 @@ Additional Inherited Members
    -

    Get a box projection from the texture mapping. Parameters: plane - [out]
    - The center of the box is at plane.origin and the sides of the box are parallel to the plane's coordinate planes. dx - [out] The "front" and "back" sides of the box are in spanned by the vectors plane.yaxis and plane.zaxis. The back plane contains the point plane.PointAt(dx[0],0,0) and the front plane contains the point plane.PointAt(dx[1],0,0). dy - [out] The "left" and "right" sides of the box are in spanned by the vectors plane.zaxis and plane.xaxis. The left plane contains the point plane.PointAt(0,dx[0],0) and the back plane contains the point plane.PointAt(0,dy[1],0). dz - [out] The "top" and "bottom" sides of the box are in spanned by the vectors plane.xaxis and plane.yaxis. The bottom plane contains the point plane.PointAt(0,0,dz[0]) and the top plane contains the point plane.PointAt(0,0,dz[1]). Returns: True if a valid box is returned. Remarks: Generally, GetMappingBox will not return the same parameters passed to SetBoxMapping. However, the location of the box will be the same.

    +

    Get a box projection from the texture mapping. Parameters: plane - [out] The center of the box is at plane.origin and the sides of the box are parallel to the plane's coordinate planes. dx - [out] The "front" and "back" sides of the box are in spanned by the vectors plane.yaxis and plane.zaxis. The back plane contains the point plane.PointAt(dx[0],0,0) and the front plane contains the point plane.PointAt(dx[1],0,0). dy - [out] The "left" and "right" sides of the box are in spanned by the vectors plane.zaxis and plane.xaxis. The left plane contains the point plane.PointAt(0,dx[0],0) and the back plane contains the point plane.PointAt(0,dy[1],0). dz - [out] The "top" and "bottom" sides of the box are in spanned by the vectors plane.xaxis and plane.yaxis. The bottom plane contains the point plane.PointAt(0,0,dz[0]) and the top plane contains the point plane.PointAt(0,0,dz[1]). Returns: True if a valid box is returned. Remarks: Generally, GetMappingBox will not return the same parameters passed to SetBoxMapping. However, the location of the box will be the same.

    @@ -1247,9 +1244,7 @@ Additional Inherited Members
    -

    Description: Get a cylindrical projection parameters from this texture mapping. Parameters: cylinder - [out]
    -Returns: True if a valid cylinder is returned. Remarks: Generally, GetMappingCylinder will not return the same parameters passed to SetCylinderMapping. However, the location of the cylinder will be the same.
    - If this mapping is not cylindrical, the cylinder will approximate the actual mapping primitive.

    +

    Description: Get a cylindrical projection parameters from this texture mapping. Parameters: cylinder - [out] Returns: True if a valid cylinder is returned. Remarks: Generally, GetMappingCylinder will not return the same parameters passed to SetCylinderMapping. However, the location of the cylinder will be the same. If this mapping is not cylindrical, the cylinder will approximate the actual mapping primitive.

    @@ -1309,8 +1304,7 @@ Returns: True if a valid cylinder is returned. Remarks: Generally, GetMappingCyl
    -

    Description: Get a spherical projection parameters from this texture mapping. Parameters: sphere - [out]
    -Returns: True if a valid sphere is returned. Remarks: Generally, GetMappingShere will not return the same parameters passed to SetSphereMapping. However, the location of the sphere will be the same. If this mapping is not cylindrical, the cylinder will approximate the actual mapping primitive.

    +

    Description: Get a spherical projection parameters from this texture mapping. Parameters: sphere - [out] Returns: True if a valid sphere is returned. Remarks: Generally, GetMappingShere will not return the same parameters passed to SetSphereMapping. However, the location of the sphere will be the same. If this mapping is not cylindrical, the cylinder will approximate the actual mapping primitive.

    @@ -1357,8 +1351,7 @@ Returns: True if a valid sphere is returned. Remarks: Generally, GetMappingShere
    -

    Description: Get texture coordinates. This calculation is expensive. When possible, use a MappingMatch() query to avoid unnecessary calculations. Parameters: mesh - [in] T - [out] Texture coordinates returned here. mesh_xform - [in] (optional) If the mesh has been transformed since the texture mapping was set up, pass the transformation here. Typically this is the value of ON_Mesh::m_mapping_xform or ON_MappingRef::m_object_xform bLazy - [in] If true and the mesh.m_T[] values were calculated using this mapping, they are simply copied to the T[] array and no calculations are performed. If you are calling the 3d point version and you care about the z-coordinate, then do not use the lazy option (meshes only store 2d texture coordinates). Tside - [out] In the case of divided textures, side information is returned here if a lazy mapping is not done. Otherwise Tside->Count() will be zero. Cylinder mapping: 1 = cylinder wall, 2 = bottom cap, 3 = top cap Box mapping: 1 = front 2 = right 3 = back 4 = left 5 = bottom 6 = top
    -Example:

        ON_TextureMapping mapping = ...;
    +

    Description: Get texture coordinates. This calculation is expensive. When possible, use a MappingMatch() query to avoid unnecessary calculations. Parameters: mesh - [in] T - [out] Texture coordinates returned here. mesh_xform - [in] (optional) If the mesh has been transformed since the texture mapping was set up, pass the transformation here. Typically this is the value of ON_Mesh::m_mapping_xform or ON_MappingRef::m_object_xform bLazy - [in] If true and the mesh.m_T[] values were calculated using this mapping, they are simply copied to the T[] array and no calculations are performed. If you are calling the 3d point version and you care about the z-coordinate, then do not use the lazy option (meshes only store 2d texture coordinates). Tside - [out] In the case of divided textures, side information is returned here if a lazy mapping is not done. Otherwise Tside->Count() will be zero. Cylinder mapping: 1 = cylinder wall, 2 = bottom cap, 3 = top cap Box mapping: 1 = front 2 = right 3 = back 4 = left 5 = bottom 6 = top Example:

        ON_TextureMapping mapping = ...;
         const ON_Mesh* mesh = ...;
         bool bLazy = true;
         ON_SimpleArray<ON_3dPoint> T(mesh->VertexCount());
    @@ -1716,9 +1709,7 @@ Example: 

        ON_TextureMapping mapping = ...;
             
           
     
    -

    Description: Create a box projection texture mapping. Parameters: plane - [in]
    - The sides of the box the box are parallel to the plane's coordinate planes. The dx, dy, dz intervals determine the location of the sides. dx - [in] Determines the location of the front and back planes. The vector plane.xaxis is perpendicular to these planes and they pass through plane.PointAt(dx[0],0,0) and plane.PointAt(dx[1],0,0), respectivly. dy - [in] Determines the location of the left and right planes. The vector plane.yaxis is perpendicular to these planes and they pass through plane.PointAt(0,dy[0],0) and plane.PointAt(0,dy[1],0), respectivly. dz - [in] Determines the location of the top and bottom planes. The vector plane.zaxis is perpendicular to these planes and they pass through plane.PointAt(0,0,dz[0]) and plane.PointAt(0,0,dz[1]), respectivly. bIsCapped - [in] If true, the box is treated as a finite capped box.
    -Returns: True if input is valid. Remarks: When m_texture_space = divided, the box is mapped to texture space as follows:

    +

    Description: Create a box projection texture mapping. Parameters: plane - [in] The sides of the box the box are parallel to the plane's coordinate planes. The dx, dy, dz intervals determine the location of the sides. dx - [in] Determines the location of the front and back planes. The vector plane.xaxis is perpendicular to these planes and they pass through plane.PointAt(dx[0],0,0) and plane.PointAt(dx[1],0,0), respectivly. dy - [in] Determines the location of the left and right planes. The vector plane.yaxis is perpendicular to these planes and they pass through plane.PointAt(0,dy[0],0) and plane.PointAt(0,dy[1],0), respectivly. dz - [in] Determines the location of the top and bottom planes. The vector plane.zaxis is perpendicular to these planes and they pass through plane.PointAt(0,0,dz[0]) and plane.PointAt(0,0,dz[1]), respectivly. bIsCapped - [in] If true, the box is treated as a finite capped box. Returns: True if input is valid. Remarks: When m_texture_space = divided, the box is mapped to texture space as follows:

    If the box is not capped, then each side maps to 1/4 of the texture map.

      v=1+---------+---------+---------+---------+
          | x=dx[1] | y=dy[1] | x=dx[0] | y=dy[0] |
          | Front   | Right   | Back    | Left    |
    @@ -1776,9 +1767,7 @@ Returns: True if input is valid. Remarks: When m_texture_space = divided, the bo
             
           
     
    -

    Description: Create a cylindrical projection texture mapping. Parameters: cylinder - [in]
    - cylinder in world space used to define a cylindrical coordinate system. The angular parameter maps (0,2pi) to texture "u" (0,1), The height parameter maps (height[0],height[1]) to texture "v" (0,1), and the radial parameter maps (0,r) to texture "w" (0,1). bIsCapped - [in] If true, the cylinder is treated as a finite capped cylinder.
    -Returns: True if input is valid. Remarks: When the cylinder is capped and m_texture_space = divided, the cylinder is mapped to texture space as follows: The side is mapped to 0 <= "u" <= 2/3. The bottom is mapped to 2/3 <= "u" <= 5/6. The top is mapped to 5/6 <= "u" <= 5/6. This is the same convention box mapping uses.

    +

    Description: Create a cylindrical projection texture mapping. Parameters: cylinder - [in] cylinder in world space used to define a cylindrical coordinate system. The angular parameter maps (0,2pi) to texture "u" (0,1), The height parameter maps (height[0],height[1]) to texture "v" (0,1), and the radial parameter maps (0,r) to texture "w" (0,1). bIsCapped - [in] If true, the cylinder is treated as a finite capped cylinder. Returns: True if input is valid. Remarks: When the cylinder is capped and m_texture_space = divided, the cylinder is mapped to texture space as follows: The side is mapped to 0 <= "u" <= 2/3. The bottom is mapped to 2/3 <= "u" <= 5/6. The top is mapped to 5/6 <= "u" <= 5/6. This is the same convention box mapping uses.

    @@ -1819,10 +1808,7 @@ Returns: True if input is valid. Remarks: When the cylinder is capped and m_text
    -

    Description: Create a planar projection texture mapping. Parameters: plane - [in] dx - [in] portion of the plane's x axis that is mapped to [0,1] (can be a decreasing interval)
    - dy - [in] portion of the plane's x axis that is mapped to [0,1] (can be a decreasing interval)
    - dz - [in] portion of the plane's x axis that is mapped to [0,1] (can be a decreasing interval)
    - projection_method - [in] 1: Closest point mapping. A target point P is mapped to the point on the plane that is closest to P. The target normal is ignored. 2: Target line mapping. A target point-vector pair (P, N), are mapped to the point on the plane where the line through P, parallel to N, intersects the plane. If the line is parallel to the plane, the closest point mapping is used. Example: Create a mapping that maps the world axis aligned rectangle in the world yz plane with corners at (0,3,5) and (0,7,19) to the texture coordinate unit square.

      ON_3dVector plane_xaxis(0.0,1.0,0.0);
    +

    Description: Create a planar projection texture mapping. Parameters: plane - [in] dx - [in] portion of the plane's x axis that is mapped to [0,1] (can be a decreasing interval) dy - [in] portion of the plane's x axis that is mapped to [0,1] (can be a decreasing interval) dz - [in] portion of the plane's x axis that is mapped to [0,1] (can be a decreasing interval) projection_method - [in] 1: Closest point mapping. A target point P is mapped to the point on the plane that is closest to P. The target normal is ignored. 2: Target line mapping. A target point-vector pair (P, N), are mapped to the point on the plane where the line through P, parallel to N, intersects the plane. If the line is parallel to the plane, the closest point mapping is used. Example: Create a mapping that maps the world axis aligned rectangle in the world yz plane with corners at (0,3,5) and (0,7,19) to the texture coordinate unit square.

      ON_3dVector plane_xaxis(0.0,1.0,0.0);
       ON_3dVector plane_yaxis(0.0,0,0,1.0);
       ON_3dPoint plane_origin(0.0,2.0,4.0);
       ON_Plane plane(plane_origin,plane_xaxis,plane_yaxis);
    @@ -1850,8 +1836,7 @@ Returns: True if input is valid. Remarks: When the cylinder is capped and m_text
             
           
     
    -

    Description: Create a spherical projection texture mapping. Parameters: sphere - [in]
    - sphere in world space used to define a spherical coordinate system. The longitude parameter maps (0,2pi) to texture "u" (0,1). The latitude paramter maps (-pi/2,+pi/2) to texture "v" (0,1). The radial parameter maps (0,r) to texture "w" (0,1). Returns: True if input is valid.

    +

    Description: Create a spherical projection texture mapping. Parameters: sphere - [in] sphere in world space used to define a spherical coordinate system. The longitude parameter maps (0,2pi) to texture "u" (0,1). The latitude paramter maps (-pi/2,+pi/2) to texture "v" (0,1). The radial parameter maps (0,r) to texture "w" (0,1). Returns: True if input is valid.

    @@ -2093,8 +2078,8 @@ Returns: True if input is valid. Remarks: When the cylinder is capped and m_text
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -2252,9 +2237,9 @@ Returns: True if input is valid. Remarks: When the cylinder is capped and m_text
    diff --git a/6/d7/de3/class_o_n_x___error_counter.html b/6/d7/de3/class_o_n_x___error_counter.html index 6b3d3a75..93ae8564 100644 --- a/6/d7/de3/class_o_n_x___error_counter.html +++ b/6/d7/de3/class_o_n_x___error_counter.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ONX_ErrorCounter Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////
    -Description: The ONX_ErrorCounter is useful for counting errors that occur in a section of code.

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// Description: The ONX_ErrorCounter is useful for counting errors that occur in a section of code.

    Constructor & Destructor Documentation

    ◆ ONX_ErrorCounter() [1/2]

    @@ -546,9 +539,9 @@ Description: The diff --git a/6/d7/de4/opennurbs__pointgeometry_8h_source.html b/6/d7/de4/opennurbs__pointgeometry_8h_source.html index 573e7048..cddb5b0c 100644 --- a/6/d7/de4/opennurbs__pointgeometry_8h_source.html +++ b/6/d7/de4/opennurbs__pointgeometry_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_pointgeometry.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_pointgeometry.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d7/de6/class_o_n___cylinder.html b/6/d7/de6/class_o_n___cylinder.html index 738e651d..8a2865f2 100644 --- a/6/d7/de6/class_o_n___cylinder.html +++ b/6/d7/de6/class_o_n___cylinder.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Cylinder Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/de7/class_o_n___decode_base64-members.html b/6/d7/de7/class_o_n___decode_base64-members.html index 427189c8..d11aba83 100644 --- a/6/d7/de7/class_o_n___decode_base64-members.html +++ b/6/d7/de7/class_o_n___decode_base64-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/df0/class_o_n___sum.html b/6/d7/df0/class_o_n___sum.html index 523540ba..cdfea269 100644 --- a/6/d7/df0/class_o_n___sum.html +++ b/6/d7/df0/class_o_n___sum.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Sum Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Calculates the total sum.
    -Parameters: error_estimate - [out] if not nullptr, the returned value of error_estimate is an estimate of the error in the sum. Returns: Total of the sum. Remarks: You can get subtotals by mixing calls to Plus() and Total(). In delicate sums, some precision may be lost in the final total if you call Total() to calculate subtotals.

    +

    Description: Calculates the total sum. Parameters: error_estimate - [out] if not nullptr, the returned value of error_estimate is an estimate of the error in the sum. Returns: Total of the sum. Remarks: You can get subtotals by mixing calls to Plus() and Total(). In delicate sums, some precision may be lost in the final total if you call Total() to calculate subtotals.

    diff --git a/6/d7/df1/class_o_n___rendering_attributes.html b/6/d7/df1/class_o_n___rendering_attributes.html index d6e6db89..f25714f8 100644 --- a/6/d7/df1/class_o_n___rendering_attributes.html +++ b/6/d7/df1/class_o_n___rendering_attributes.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RenderingAttributes Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_RenderingAttributes()

    @@ -252,9 +248,9 @@ Public Attributes
    diff --git a/6/d7/df6/class_o_n___mapping_tag.html b/6/d7/df6/class_o_n___mapping_tag.html index d7807ad3..fcaded01 100644 --- a/6/d7/df6/class_o_n___mapping_tag.html +++ b/6/d7/df6/class_o_n___mapping_tag.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MappingTag Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/dfd/class_o_n__4d_rect-members.html b/6/d7/dfd/class_o_n__4d_rect-members.html index 9a069f96..851308f5 100644 --- a/6/d7/dfd/class_o_n__4d_rect-members.html +++ b/6/d7/dfd/class_o_n__4d_rect-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d7/dff/class_o_n___dimension-members.html b/6/d7/dff/class_o_n___dimension-members.html index c53f8ec8..49f041f4 100644 --- a/6/d7/dff/class_o_n___dimension-members.html +++ b/6/d7/dff/class_o_n___dimension-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d00/class_o_n___poly_curve.html b/6/d8/d00/class_o_n___poly_curve.html index 4cae3f02..fce5cdbe 100644 --- a/6/d8/d00/class_o_n___poly_curve.html +++ b/6/d8/d00/class_o_n___poly_curve.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_PolyCurve Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    -

    Definition of poly curve (composite curve)
    -Description: An ON_PolyCurve is an ON_Curve represented by a sequence of contiguous ON_Curve segments. A valid polycurve is represented by an array m_segment of Count()>=1 curve objects and a strictly increasing array m_t of Count()+1 parameter values. The i-th curve segment, when considered as part of the polycurve, is affinely reparamaterized from m_t[i] to m_t[i+1], i.e., m_segment[i].Domain()[0] is mapped to m_t[i] and m_segment[i].Domain()[1] is mapped to m_t[i+1].

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    Definition of poly curve (composite curve) Description: An ON_PolyCurve is an ON_Curve represented by a sequence of contiguous ON_Curve segments. A valid polycurve is represented by an array m_segment of Count()>=1 curve objects and a strictly increasing array m_t of Count()+1 parameter values. The i-th curve segment, when considered as part of the polycurve, is affinely reparamaterized from m_t[i] to m_t[i+1], i.e., m_segment[i].Domain()[0] is mapped to m_t[i] and m_segment[i].Domain()[1] is mapped to m_t[i+1].

    Constructor & Destructor Documentation

    ◆ ON_PolyCurve() [1/3]

    @@ -687,8 +678,7 @@ Description: An ON
    -

    Description: Modify the one or both locations at the end of segment[gap_index-1] and the start of segment[gap_index] so they are coindicent.
    -Parameters: gap_index - [in] 1 <= gap_index <
    Count() If the locations at the end of segment[gap_index-1] and the start of segment[gap_index] are not identical, then an attempt is made to modify the segments so these locations are closer. ends_to_modify - [in] 0: (suggested) The code will decide what segments to modify. 1: modify the end location of segment[gap_index-1] 2: modify the start location of segment[gap_index] Returns: True if a modification was performed and HasGap(gap_index-1) returns 0 after the modification. False if no modification was preformed because there was no gap or because one could not be performed. Remarks: Note that passing the return value from FindNextGap() will close the gap found by FindNextGap().

    +

    Description: Modify the one or both locations at the end of segment[gap_index-1] and the start of segment[gap_index] so they are coindicent. Parameters: gap_index - [in] 1 <= gap_index < Count() If the locations at the end of segment[gap_index-1] and the start of segment[gap_index] are not identical, then an attempt is made to modify the segments so these locations are closer. ends_to_modify - [in] 0: (suggested) The code will decide what segments to modify. 1: modify the end location of segment[gap_index-1] 2: modify the start location of segment[gap_index] Returns: True if a modification was performed and HasGap(gap_index-1) returns 0 after the modification. False if no modification was preformed because there was no gap or because one could not be performed. Remarks: Note that passing the return value from FindNextGap() will close the gap found by FindNextGap().

    @@ -1113,8 +1103,7 @@ Parameters: gap_index - [in] 1 <= gap_index < -

    Description: Where possible, analytically extends curve to include domain. Parameters: domain - [in] if domain is not included in curve domain, curve will be extended so that its domain includes domain.
    - Will not work if curve is closed. Original curve is identical to the restriction of the resulting curve to the original curve domain, Returns: true if successful.

    +

    Description: Where possible, analytically extends curve to include domain. Parameters: domain - [in] if domain is not included in curve domain, curve will be extended so that its domain includes domain. Will not work if curve is closed. Original curve is identical to the restriction of the resulting curve to the original curve domain, Returns: true if successful.

    Reimplemented from ON_Curve.

    @@ -1135,8 +1124,7 @@ Parameters: gap_index - [in] 1 <= gap_index < -

    Description: Search the curve for gaps between the sub curve segments. Parameters: segment_index0 - [in] The search for gaps starts at with the comparing the end of segment[segment_index0] and the start of segment[segment_index0+1]. Returns: 0:
    - No gaps were found. i > segment_index0: The end of polycuve segment[i-1] is not coincident with the start of polycurve segment[i].

    +

    Description: Search the curve for gaps between the sub curve segments. Parameters: segment_index0 - [in] The search for gaps starts at with the comparing the end of segment[segment_index0] and the start of segment[segment_index0+1]. Returns: 0: No gaps were found. i > segment_index0: The end of polycuve segment[i-1] is not coincident with the start of polycurve segment[i].

    @@ -1314,9 +1302,7 @@ Parameters: gap_index - [in] 1 <= gap_index <
    -

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: c - [in] type of continity to test for. If ON::continuity::C1_continuous t0 - [in] search begins at t0 t1 - [in] (t0 < t1) search ends at t1 t - [out] if a discontinuity is found, the *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search.
    - dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous.
    - ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if a discontinuity was found on the interior of the interval (t0,t1). Remarks: Overrides
    ON_Curve::GetNextDiscontinuity.

    +

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: c - [in] type of continity to test for. If ON::continuity::C1_continuous t0 - [in] search begins at t0 t1 - [in] (t0 < t1) search ends at t1 t - [out] if a discontinuity is found, the *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search. dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous. ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if a discontinuity was found on the interior of the interval (t0,t1). Remarks: Overrides ON_Curve::GetNextDiscontinuity.

    Reimplemented from ON_Curve.

    @@ -1555,9 +1541,7 @@ Parameters: gap_index - [in] 1 <= gap_index < -

    Description: Does a NURBS curve representation of this curve. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the curve's to wthe desired accuracy 2 success - NURBS point locus matches the curve's and the domain of the NURBS curve is correct.
    - However, This curve's parameterization and the NURBS curve parameterization may not match. This situation happens when getting NURBS representations of curves that have a transendental parameterization like circles Remarks: This is a low-level virtual function.
    -See Also:
    ON_Curve::GetNurbForm ON_Curve::NurbsCurve

    +

    Description: Does a NURBS curve representation of this curve. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the curve's to wthe desired accuracy 2 success - NURBS point locus matches the curve's and the domain of the NURBS curve is correct. However, This curve's parameterization and the NURBS curve parameterization may not match. This situation happens when getting NURBS representations of curves that have a transendental parameterization like circles Remarks: This is a low-level virtual function. See Also: ON_Curve::GetNurbForm ON_Curve::NurbsCurve

    Reimplemented from ON_Curve.

    @@ -1762,8 +1746,7 @@ See Also: -

    Description: Test continuity at a curve parameter value. Parameters: c - [in] continuity to test for t - [in] parameter to test hint - [in] evaluation hint point_tolerance - [in] if the distance between two points is greater than point_tolerance, then the curve is not C0. d1_tolerance - [in] if the difference between two first derivatives is greater than d1_tolerance, then the curve is not C1. d2_tolerance - [in] if the difference between two second derivatives is greater than d2_tolerance, then the curve is not C2. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous.
    - ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if the curve has at least the c type continuity at the parameter t. Remarks: Overrides
    ON_Curve::IsContinuous.

    +

    Description: Test continuity at a curve parameter value. Parameters: c - [in] continuity to test for t - [in] parameter to test hint - [in] evaluation hint point_tolerance - [in] if the distance between two points is greater than point_tolerance, then the curve is not C0. d1_tolerance - [in] if the difference between two first derivatives is greater than d1_tolerance, then the curve is not C1. d2_tolerance - [in] if the difference between two second derivatives is greater than d2_tolerance, then the curve is not C2. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous. ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if the curve has at least the c type continuity at the parameter t. Remarks: Overrides ON_Curve::IsContinuous.

    Reimplemented from ON_Curve.

    @@ -2228,8 +2211,7 @@ See Also: -

    Description: Returns the polycurve subdomain assigned to a segment curve. Parameters: segment_index - [in] 0 based index (0 <= segment_index < Count() ) Returns: The polycurve subdomain assigned to a segment curve. Returns ([ON_UNSET_VALUE,ON_UNSET_VALUE) if segment_index < 0
    - or segment_index >= Count().

    +

    Description: Returns the polycurve subdomain assigned to a segment curve. Parameters: segment_index - [in] 0 based index (0 <= segment_index < Count() ) Returns: The polycurve subdomain assigned to a segment curve. Returns ([ON_UNSET_VALUE,ON_UNSET_VALUE) if segment_index < 0 or segment_index >= Count().

    @@ -2709,8 +2690,7 @@ t<m_t[0] or m_t is empty -1
    -

    Expert user function
    - Sets the m_segment[index] to crv.

    +

    Expert user function Sets the m_segment[index] to crv.

    @@ -3009,8 +2989,8 @@ t<m_t[0] or m_t is empty -1
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -3025,9 +3005,9 @@ t<m_t[0] or m_t is empty -1 diff --git a/6/d8/d04/class_o_n___display_material_ref-members.html b/6/d8/d04/class_o_n___display_material_ref-members.html index 44dfc6bb..dc3f39fd 100644 --- a/6/d8/d04/class_o_n___display_material_ref-members.html +++ b/6/d8/d04/class_o_n___display_material_ref-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archiveopen binary file
    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/d8/d05/class_o_n___base64_encode_stream.html b/6/d8/d05/class_o_n___base64_encode_stream.html index d7e294bc..9cddc89f 100644 --- a/6/d8/d05/class_o_n___base64_encode_stream.html +++ b/6/d8/d05/class_o_n___base64_encode_stream.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Base64EncodeStream Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_Base64EncodeStream()

    @@ -326,8 +322,7 @@ Public Member Functions

    Description: If an explicit base 64 encoded stream output handler is not specified ( CallbackFunction() returns null ), then the virtual Out() function is called to handle the base 64 encoded output stream. As the input stream is encoded, one or more calls to Out() will occur.

    -

    With a possible exception of the last call to Out(), when Out() is called, 57 input bytes have been encoded into 76 output characters with ASCII codes A-Z, a-z, 0-9, +, /. Parameters: callback_context - [in] context pointer set by calling SetCallback(). Typically the context pointer is not used by a virtual override because the context can be added as member variables of the derived class, but it is available if needed. out_buffer_size - [in] number of non-null characters in out_buffer. out_buffer - [in] A null terminated ASCII string that is a base 64 encoding. out_buffer[0...(out_buffer_size-1)] are ASCII characters with values characters with ASCII codes A-Z, a-z, 0-9, +, / and out_buffer[out_buffer_size] = 0.
    -Returns: True to continue base 64 encodeing and false to cancel the encoding calculation.

    +

    With a possible exception of the last call to Out(), when Out() is called, 57 input bytes have been encoded into 76 output characters with ASCII codes A-Z, a-z, 0-9, +, /. Parameters: callback_context - [in] context pointer set by calling SetCallback(). Typically the context pointer is not used by a virtual override because the context can be added as member variables of the derived class, but it is available if needed. out_buffer_size - [in] number of non-null characters in out_buffer. out_buffer - [in] A null terminated ASCII string that is a base 64 encoding. out_buffer[0...(out_buffer_size-1)] are ASCII characters with values characters with ASCII codes A-Z, a-z, 0-9, +, / and out_buffer[out_buffer_size] = 0. Returns: True to continue base 64 encodeing and false to cancel the encoding calculation.

    @@ -402,9 +397,9 @@ Returns: True to continue base 64 encodeing and false to cancel the encoding cal diff --git a/6/d8/d06/class_o_n___curve_array.html b/6/d8/d06/class_o_n___curve_array.html index d84a2523..5727ef47 100644 --- a/6/d8/d06/class_o_n___curve_array.html +++ b/6/d8/d06/class_o_n___curve_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_CurveArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Get tight bounding box of the bezier. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false)
    - If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the tight bounding box of the bezier curve. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed bezier is calculated. The bezier curve is not modified. Returns: True if the returned tight_bbox is set to a valid bounding box.

    +

    Description: Get tight bounding box of the bezier. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false) If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the tight bounding box of the bezier curve. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed bezier is calculated. The bezier curve is not modified. Returns: True if the returned tight_bbox is set to a valid bounding box.

    @@ -428,9 +425,9 @@ Additional Inherited Members diff --git a/6/d8/d07/class_o_n__4f_point_array.html b/6/d8/d07/class_o_n__4f_point_array.html index 195867ae..d01a4251 100644 --- a/6/d8/d07/class_o_n__4f_point_array.html +++ b/6/d8/d07/class_o_n__4f_point_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_4fPointArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d0d/opennurbs__leader_8h_source.html b/6/d8/d0d/opennurbs__leader_8h_source.html index 4061abaf..86f36ab9 100644 --- a/6/d8/d0d/opennurbs__leader_8h_source.html +++ b/6/d8/d0d/opennurbs__leader_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_leader.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_leader.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d13/class_o_n___progress_reporter.html b/6/d8/d13/class_o_n___progress_reporter.html index 55d23563..c29ac71b 100644 --- a/6/d8/d13/class_o_n___progress_reporter.html +++ b/6/d8/d13/class_o_n___progress_reporter.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ProgressReporter Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Calculation use ON_ProgressReporter to report progress to the calling code.

    Constructor & Destructor Documentation

    @@ -196,9 +190,7 @@ Static Public Member Functions
    -

    Description: The caclulation calls ON_ProgressReporter::ReportProgress to report its current progress. If it is the first call to ReportProgress, or the faction_complete is 1.0, or the fraction_complete has increased a reasonable amount, then the callback function is called. Parameters: progress_reporter - [in] A pointer to an ON_ProgressReporter or null pointer. fraction_complete - [in] a value between 0.0 and 1.0 where 0.0 indicates the calcuation is beginning and 1.0 indicates the calculation is complete. Example:
    - void MyLongCalculation( ..., ON_ProgressReporter* pr, ...) { ... for ( i = 0; i < count; i++ ) { ON_ProgressReporter::ReportProgress(pr,i/((double)count));
    - ... } ON_ProgressReporter::ReportProgress(pr,1.0); ///< finished ... }

    +

    Description: The caclulation calls ON_ProgressReporter::ReportProgress to report its current progress. If it is the first call to ReportProgress, or the faction_complete is 1.0, or the fraction_complete has increased a reasonable amount, then the callback function is called. Parameters: progress_reporter - [in] A pointer to an ON_ProgressReporter or null pointer. fraction_complete - [in] a value between 0.0 and 1.0 where 0.0 indicates the calcuation is beginning and 1.0 indicates the calculation is complete. Example: void MyLongCalculation( ..., ON_ProgressReporter* pr, ...) { ... for ( i = 0; i < count; i++ ) { ON_ProgressReporter::ReportProgress(pr,i/((double)count)); ... } ON_ProgressReporter::ReportProgress(pr,1.0); ///< finished ... }

    @@ -241,9 +233,7 @@ Static Public Member Functions
    -

    Description: The caclulation calls ON_ProgressReporter::ReportProgress to report its current progress. If it is the first call to ReportProgress, or the faction_complete is 1.0, or the fraction_complete has increased a reasonable amount, then the callback function is called. Parameters: progress_reporter - [in] A pointer to an ON_ProgressReporter or null pointer. fraction_complete - [in] a value between 0.0 and 1.0 where 0.0 indicates the calcuation is beginning and 1.0 indicates the calculation is complete. Example:
    - void MyLongCalculation( ..., ON_ProgressReporter* pr, ...) { ... for ( i = 0; i < count; i++ ) { ON_ProgressReporter::ReportProgress(pr,i,count);
    - ... } ON_ProgressReporter::ReportProgress(pr,1.0); ///< finished ... }

    +

    Description: The caclulation calls ON_ProgressReporter::ReportProgress to report its current progress. If it is the first call to ReportProgress, or the faction_complete is 1.0, or the fraction_complete has increased a reasonable amount, then the callback function is called. Parameters: progress_reporter - [in] A pointer to an ON_ProgressReporter or null pointer. fraction_complete - [in] a value between 0.0 and 1.0 where 0.0 indicates the calcuation is beginning and 1.0 indicates the calculation is complete. Example: void MyLongCalculation( ..., ON_ProgressReporter* pr, ...) { ... for ( i = 0; i < count; i++ ) { ON_ProgressReporter::ReportProgress(pr,i,count); ... } ON_ProgressReporter::ReportProgress(pr,1.0); ///< finished ... }

    @@ -286,9 +276,7 @@ Static Public Member Functions
    -

    Description: The caclulation calls ON_ProgressReporter::ReportProgress to report its current progress. If it is the first call to ReportProgress, or the faction_complete is 1.0, or the fraction_complete has increased a reasonable amount, then the callback function is called. Parameters: progress_reporter - [in] A pointer to an ON_ProgressReporter or null pointer. fraction_complete - [in] a value between 0.0 and 1.0 where 0.0 indicates the calcuation is beginning and 1.0 indicates the calculation is complete. Example:
    - void MyLongCalculation( ..., ON_ProgressReporter* pr, ...) { ... for ( i = 0; i < count; i++ ) { ON_ProgressReporter::ReportProgress(pr,i,count);
    - ... } ON_ProgressReporter::ReportProgress(pr,1.0); ///< finished ... }

    +

    Description: The caclulation calls ON_ProgressReporter::ReportProgress to report its current progress. If it is the first call to ReportProgress, or the faction_complete is 1.0, or the fraction_complete has increased a reasonable amount, then the callback function is called. Parameters: progress_reporter - [in] A pointer to an ON_ProgressReporter or null pointer. fraction_complete - [in] a value between 0.0 and 1.0 where 0.0 indicates the calcuation is beginning and 1.0 indicates the calculation is complete. Example: void MyLongCalculation( ..., ON_ProgressReporter* pr, ...) { ... for ( i = 0; i < count; i++ ) { ON_ProgressReporter::ReportProgress(pr,i,count); ... } ON_ProgressReporter::ReportProgress(pr,1.0); ///< finished ... }

    @@ -317,8 +305,7 @@ Static Public Member Functions
    -

    Description: Set the function that is called when a calculation calls ReportProgress(). Parameters: callback_function - [in] This function is called when the calculation reports progress. The calculation thread calls in this callback function. The callback function should do something that is fast and simple, like post a message to a user interface control and return immediately.
    - Paramters passed to the callback function: context - [in] the value of callback_context. fraction_complete - [in] A value between 0.0 and 1.0 indicating how much of the calculation is compete. Example:

            struct MyWindowsMessage
    +

    Description: Set the function that is called when a calculation calls ReportProgress(). Parameters: callback_function - [in] This function is called when the calculation reports progress. The calculation thread calls in this callback function. The callback function should do something that is fast and simple, like post a message to a user interface control and return immediately. Paramters passed to the callback function: context - [in] the value of callback_context. fraction_complete - [in] A value between 0.0 and 1.0 indicating how much of the calculation is compete. Example:

            struct MyWindowsMessage
             {
               HWND m_hWnd;
               UINT m_Msg,
    @@ -357,9 +344,9 @@ Static Public Member Functions
     
    diff --git a/6/d8/d15/class_o_n___sphere-members.html b/6/d8/d15/class_o_n___sphere-members.html index 2c8a39c3..d7caebe2 100644 --- a/6/d8/d15/class_o_n___sphere-members.html +++ b/6/d8/d15/class_o_n___sphere-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d18/class_o_n___parse_settings-members.html b/6/d8/d18/class_o_n___parse_settings-members.html index 9504ddf8..dae73d8d 100644 --- a/6/d8/d18/class_o_n___parse_settings-members.html +++ b/6/d8/d18/class_o_n___parse_settings-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d1e/class_o_n___aerial_photo_image_frustum-members.html b/6/d8/d1e/class_o_n___aerial_photo_image_frustum-members.html index f0fa194d..f1fda07e 100644 --- a/6/d8/d1e/class_o_n___aerial_photo_image_frustum-members.html +++ b/6/d8/d1e/class_o_n___aerial_photo_image_frustum-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d1e/class_o_n___arrowhead-members.html b/6/d8/d1e/class_o_n___arrowhead-members.html index e00f1486..5e842202 100644 --- a/6/d8/d1e/class_o_n___arrowhead-members.html +++ b/6/d8/d1e/class_o_n___arrowhead-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d23/class_o_n___embedded_bitmap.html b/6/d8/d23/class_o_n___embedded_bitmap.html index 9e9e13a3..8a5bc086 100644 --- a/6/d8/d23/class_o_n___embedded_bitmap.html +++ b/6/d8/d23/class_o_n___embedded_bitmap.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_EmbeddedBitmap Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -869,8 +867,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Bitmap.

    @@ -962,9 +960,9 @@ Additional Inherited Members
    diff --git a/6/d8/d26/class_o_n__3_d_m___b_i_g___c_h_u_n_k.html b/6/d8/d26/class_o_n__3_d_m___b_i_g___c_h_u_n_k.html index 7a33a89e..fb5861c7 100644 --- a/6/d8/d26/class_o_n__3_d_m___b_i_g___c_h_u_n_k.html +++ b/6/d8/d26/class_o_n__3_d_m___b_i_g___c_h_u_n_k.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3DM_BIG_CHUNK Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    offset (file position) of the byte immediately after the farthest successful write. When reading 3dm archives, this the archive offset of the first byte after the chunk's information content. When reading, a 16 bit or 32 bit CRC can follow the chunk information content. During ordinary reading and writing, valid seek target positions satisfy m_start_offset <= seek target pos <= m_end_offset.
    -Returns: Number of bytes in the chunk, including bytes used to store CRC values. 0 for short chunks. 0 for chunks currently being written. Remarks: For chunks being read, m_start_offset + Length() = m_end_offset + SizeofCRC().

    +

    offset (file position) of the byte immediately after the farthest successful write. When reading 3dm archives, this the archive offset of the first byte after the chunk's information content. When reading, a 16 bit or 32 bit CRC can follow the chunk information content. During ordinary reading and writing, valid seek target positions satisfy m_start_offset <= seek target pos <= m_end_offset. Returns: Number of bytes in the chunk, including bytes used to store CRC values. 0 for short chunks. 0 for chunks currently being written. Remarks: For chunks being read, m_start_offset + Length() = m_end_offset + SizeofCRC().

    @@ -419,9 +416,9 @@ Returns: Number of bytes in the chunk, including bytes used to store CRC values. diff --git a/6/d8/d2a/class_o_n___object_rendering_attributes-members.html b/6/d8/d2a/class_o_n___object_rendering_attributes-members.html index bb59f90a..516e4e0f 100644 --- a/6/d8/d2a/class_o_n___object_rendering_attributes-members.html +++ b/6/d8/d2a/class_o_n___object_rendering_attributes-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d31/opennurbs__nurbssurface_8h_source.html b/6/d8/d31/opennurbs__nurbssurface_8h_source.html index 3c959fda..46f4c70a 100644 --- a/6/d8/d31/opennurbs__nurbssurface_8h_source.html +++ b/6/d8/d31/opennurbs__nurbssurface_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_nurbssurface.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_nurbssurface.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d37/class_o_n___font_glyph_outline_point-members.html b/6/d8/d37/class_o_n___font_glyph_outline_point-members.html index f9757cc9..6e5d1168 100644 --- a/6/d8/d37/class_o_n___font_glyph_outline_point-members.html +++ b/6/d8/d37/class_o_n___font_glyph_outline_point-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d3e/class_o_n___linetype_segment-members.html b/6/d8/d3e/class_o_n___linetype_segment-members.html index 31869f42..9cd7dbef 100644 --- a/6/d8/d3e/class_o_n___linetype_segment-members.html +++ b/6/d8/d3e/class_o_n___linetype_segment-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d3f/class_o_n__3dm_construction_plane.html b/6/d8/d3f/class_o_n__3dm_construction_plane.html index ede6b507..e178a664 100644 --- a/6/d8/d3f/class_o_n__3dm_construction_plane.html +++ b/6/d8/d3f/class_o_n__3dm_construction_plane.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmConstructionPlane Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d49/class_o_n__2i_size.html b/6/d8/d49/class_o_n__2i_size.html index ab6717c8..4d205576 100644 --- a/6/d8/d49/class_o_n__2i_size.html +++ b/6/d8/d49/class_o_n__2i_size.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2iSize Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d49/class_o_n___text_dot.html b/6/d8/d49/class_o_n___text_dot.html index 70d094be..54a1f4a5 100644 --- a/6/d8/d49/class_o_n___text_dot.html +++ b/6/d8/d49/class_o_n___text_dot.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextDot Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    -

    ON_Geometry overrides
    -Returns the geometric dimension of the object ( usually 3)

    +

    ON_Geometry overrides Returns the geometric dimension of the object ( usually 3)

    Reimplemented from ON_Geometry.

    @@ -1302,9 +1299,9 @@ Returns the geometric dimension of the object ( usually 3)

    diff --git a/6/d8/d4f/class_o_n___locale-members.html b/6/d8/d4f/class_o_n___locale-members.html index 304520bb..f42fb48d 100644 --- a/6/d8/d4f/class_o_n___locale-members.html +++ b/6/d8/d4f/class_o_n___locale-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d57/opennurbs__rand_8h_source.html b/6/d8/d57/opennurbs__rand_8h_source.html index 99671712..b09d2a70 100644 --- a/6/d8/d57/opennurbs__rand_8h_source.html +++ b/6/d8/d57/opennurbs__rand_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_rand.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_rand.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d6f/class_o_n___polyline_curve.html b/6/d8/d6f/class_o_n___polyline_curve.html index bb37119f..49e5b79f 100644 --- a/6/d8/d6f/class_o_n___polyline_curve.html +++ b/6/d8/d6f/class_o_n___polyline_curve.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_PolylineCurve Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Where possible, analytically extends curve to include domain. Parameters: domain - [in] if domain is not included in curve domain, curve will be extended so that its domain includes domain.
    - Will not work if curve is closed. Original curve is identical to the restriction of the resulting curve to the original curve domain, Returns: true if successful.

    +

    Description: Where possible, analytically extends curve to include domain. Parameters: domain - [in] if domain is not included in curve domain, curve will be extended so that its domain includes domain. Will not work if curve is closed. Original curve is identical to the restriction of the resulting curve to the original curve domain, Returns: true if successful.

    Reimplemented from ON_Curve.

    @@ -1015,9 +1012,7 @@ Additional Inherited Members
    -

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: c - [in] type of continity to test for. If ON::continuity::C1_continuous t0 - [in] search begins at t0 t1 - [in] (t0 < t1) search ends at t1 t - [out] if a discontinuity is found, the *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search.
    - dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous.
    - ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if a discontinuity was found on the interior of the interval (t0,t1). Remarks: Overrides ON_Curve::GetNextDiscontinuity.

    +

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: c - [in] type of continity to test for. If ON::continuity::C1_continuous t0 - [in] search begins at t0 t1 - [in] (t0 < t1) search ends at t1 t - [out] if a discontinuity is found, the *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search. dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous. ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if a discontinuity was found on the interior of the interval (t0,t1). Remarks: Overrides ON_Curve::GetNextDiscontinuity.

    Reimplemented from ON_Curve.

    @@ -1212,9 +1207,7 @@ Additional Inherited Members
    -

    Description: Does a NURBS curve representation of this curve. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the curve's to wthe desired accuracy 2 success - NURBS point locus matches the curve's and the domain of the NURBS curve is correct.
    - However, This curve's parameterization and the NURBS curve parameterization may not match. This situation happens when getting NURBS representations of curves that have a transendental parameterization like circles Remarks: This is a low-level virtual function.
    -See Also: ON_Curve::GetNurbForm ON_Curve::NurbsCurve

    +

    Description: Does a NURBS curve representation of this curve. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the curve's to wthe desired accuracy 2 success - NURBS point locus matches the curve's and the domain of the NURBS curve is correct. However, This curve's parameterization and the NURBS curve parameterization may not match. This situation happens when getting NURBS representations of curves that have a transendental parameterization like circles Remarks: This is a low-level virtual function. See Also: ON_Curve::GetNurbForm ON_Curve::NurbsCurve

    Reimplemented from ON_Curve.

    @@ -1362,8 +1355,7 @@ See Also: -

    Description: Test continuity at a curve parameter value. Parameters: c - [in] continuity to test for t - [in] parameter to test hint - [in] evaluation hint point_tolerance - [in] if the distance between two points is greater than point_tolerance, then the curve is not C0. d1_tolerance - [in] if the difference between two first derivatives is greater than d1_tolerance, then the curve is not C1. d2_tolerance - [in] if the difference between two second derivatives is greater than d2_tolerance, then the curve is not C2. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous.
    - ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if the curve has at least the c type continuity at the parameter t. Remarks: Overrides
    ON_Curve::IsContinuous.

    +

    Description: Test continuity at a curve parameter value. Parameters: c - [in] continuity to test for t - [in] parameter to test hint - [in] evaluation hint point_tolerance - [in] if the distance between two points is greater than point_tolerance, then the curve is not C0. d1_tolerance - [in] if the difference between two first derivatives is greater than d1_tolerance, then the curve is not C1. d2_tolerance - [in] if the difference between two second derivatives is greater than d2_tolerance, then the curve is not C2. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous. ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if the curve has at least the c type continuity at the parameter t. Remarks: Overrides ON_Curve::IsContinuous.

    Reimplemented from ON_Curve.

    @@ -1706,9 +1698,7 @@ See Also: diff --git a/6/d8/d72/class_o_n___component_manifest.html b/6/d8/d72/class_o_n___component_manifest.html index 219420e6..918f6c5b 100644 --- a/6/d8/d72/class_o_n___component_manifest.html +++ b/6/d8/d72/class_o_n___component_manifest.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ComponentManifest Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    -

    Description: Add a component to this manifest.
    - If the id is not set or in use, then a new one will be assigned. If the component type requires a unique name and the name is not set or in use, then a new one will be assigned. Parameters: component_type - [in] Type of component. component_serial_number - [in] 0 or the component's unique runtime serial number (ON_ModelComponent::RuntimeSerialNumber()). component_id - [in] If the id is nil or in use, a new id will be assigned. component_name_hash - [in] If the the component type requires a unique name and the name is not valid or in use, the component will not be added. original_name - [in/out] If a new name needs to be assigned, the input value will be used as a candidate and then as the root. Passing in the current name is a good choice. The output value is the final assigned name. Returns: If an item is added to this manifest, then the identification information is returned. Otherwise ON_ComponentManifestItem::Unset is returned.

    +

    Description: Add a component to this manifest. If the id is not set or in use, then a new one will be assigned. If the component type requires a unique name and the name is not set or in use, then a new one will be assigned. Parameters: component_type - [in] Type of component. component_serial_number - [in] 0 or the component's unique runtime serial number (ON_ModelComponent::RuntimeSerialNumber()). component_id - [in] If the id is nil or in use, a new id will be assigned. component_name_hash - [in] If the the component type requires a unique name and the name is not valid or in use, the component will not be added. original_name - [in/out] If a new name needs to be assigned, the input value will be used as a candidate and then as the root. Passing in the current name is a good choice. The output value is the final assigned name. Returns: If an item is added to this manifest, then the identification information is returned. Otherwise ON_ComponentManifestItem::Unset is returned.

    @@ -1512,9 +1509,9 @@ Static Public Attributes diff --git a/6/d8/d75/class_o_n___fixed_size_pool.html b/6/d8/d75/class_o_n___fixed_size_pool.html index e3627ff5..d5a8c5d6 100644 --- a/6/d8/d75/class_o_n___fixed_size_pool.html +++ b/6/d8/d75/class_o_n___fixed_size_pool.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_FixedSizePool Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_FixedSizePool()

    @@ -284,8 +280,7 @@ Friends
    -

    Description: Get the i-th elment in the fixed size pool. Parameters: element_index - [in] Returns: A pointer to the element with the specified index.
    - The first element has element_index = 0 and is the element returned by the first call to AllocateElement(). The last element has element_index = ElementCount()-1. If element_index is out of range, nullptr is returned. Remarks: It is faster to use ON_FixedSizePoolIterator.FirstElement() and ON_FixedSizePoolIterator.NextElement() to iterate through the entire list of elements. This function is relatively efficient when there are a few large blocks in the pool or element_index is small compared to the number of elements in the first few blocks.

    +

    Description: Get the i-th elment in the fixed size pool. Parameters: element_index - [in] Returns: A pointer to the element with the specified index. The first element has element_index = 0 and is the element returned by the first call to AllocateElement(). The last element has element_index = ElementCount()-1. If element_index is out of range, nullptr is returned. Remarks: It is faster to use ON_FixedSizePoolIterator.FirstElement() and ON_FixedSizePoolIterator.NextElement() to iterate through the entire list of elements. This function is relatively efficient when there are a few large blocks in the pool or element_index is small compared to the number of elements in the first few blocks.

    If ReturnElement() is not used or no AllocateElement() calls are made after any use of ReturnElement(), then the i-th element is the one returned by the (i+1)-th call to AllocateElement()

    @@ -459,9 +454,9 @@ Friends diff --git a/6/d8/d7c/class_o_n___m_d5.html b/6/d8/d7c/class_o_n___m_d5.html index a76d328e..6add2204 100644 --- a/6/d8/d7c/class_o_n___m_d5.html +++ b/6/d8/d7c/class_o_n___m_d5.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MD5 Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
     

    Detailed Description

    -

    Description: ON_MD5 is a small class for calculating the MD5 hash of a sequence of bytes. It may be use incrementally (the bytes do not have to be in a contiguous array in memory at one time).
    - Remarks: The ON_MD5 class cannot be used for cryptographic or security applications. The MD5 hash algorithm is not suitable for cryptographic or security applications. The ON_MD5 class does not "wipe" intermediate results.

    +

    Description: ON_MD5 is a small class for calculating the MD5 hash of a sequence of bytes. It may be use incrementally (the bytes do not have to be in a contiguous array in memory at one time).

    +

    Remarks: The ON_MD5 class cannot be used for cryptographic or security applications. The MD5 hash algorithm is not suitable for cryptographic or security applications. The ON_MD5 class does not "wipe" intermediate results.

    The probability of two different randomly selected seqences of N bytes to have the same value MD5 hash depends on N, but it is roughly 2^-64 ~ 10^-19.

    MD5 hash values are 16 bytes. SHA-1 hash values are 20 bytes. If you need a hash and have room for 20 bytes, then ON_SHA1 is preferred over ON_MD5.

    Legal: Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved.

    @@ -327,9 +325,9 @@ Static Public Member Functions
    diff --git a/6/d8/d7f/class_o_n__3dm_annotation_context.html b/6/d8/d7f/class_o_n__3dm_annotation_context.html index 533c138e..c891c27a 100644 --- a/6/d8/d7f/class_o_n__3dm_annotation_context.html +++ b/6/d8/d7f/class_o_n__3dm_annotation_context.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmAnnotationContext Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d8/d91/class_o_n___circle-members.html b/6/d8/d91/class_o_n___circle-members.html index 5f229a3f..f8c3eb88 100644 --- a/6/d8/d91/class_o_n___circle-members.html +++ b/6/d8/d91/class_o_n___circle-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d8/d92/class_o_n___mesh_ngon_allocator-members.html b/6/d8/d92/class_o_n___mesh_ngon_allocator-members.html index 99e9d7e7..5f5c9f33 100644 --- a/6/d8/d92/class_o_n___mesh_ngon_allocator-members.html +++ b/6/d8/d92/class_o_n___mesh_ngon_allocator-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d95/opennurbs__line_8h_source.html b/6/d8/d95/opennurbs__line_8h_source.html index e3810043..6a011088 100644 --- a/6/d8/d95/opennurbs__line_8h_source.html +++ b/6/d8/d95/opennurbs__line_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_line.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_line.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d9a/class_o_n___brep_face_side_array-members.html b/6/d8/d9a/class_o_n___brep_face_side_array-members.html index 8bd84864..0e5205a8 100644 --- a/6/d8/d9a/class_o_n___brep_face_side_array-members.html +++ b/6/d8/d9a/class_o_n___brep_face_side_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d9b/class_o_n__w_string_buffer.html b/6/d8/d9b/class_o_n__w_string_buffer.html index 0f2642f5..45093582 100644 --- a/6/d8/d9b/class_o_n__w_string_buffer.html +++ b/6/d8/d9b/class_o_n__w_string_buffer.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_wStringBuffer Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d9e/class_o_n___text_run_array-members.html b/6/d8/d9e/class_o_n___text_run_array-members.html index aaea195b..80173697 100644 --- a/6/d8/d9e/class_o_n___text_run_array-members.html +++ b/6/d8/d9e/class_o_n___text_run_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d9e/opennurbs__revsurface_8h_source.html b/6/d8/d9e/opennurbs__revsurface_8h_source.html index d5f93602..35b39d19 100644 --- a/6/d8/d9e/opennurbs__revsurface_8h_source.html +++ b/6/d8/d9e/opennurbs__revsurface_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_revsurface.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_revsurface.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/d9f/class_o_n___workspace-members.html b/6/d8/d9f/class_o_n___workspace-members.html index 51d4f502..8b12ebee 100644 --- a/6/d8/d9f/class_o_n___workspace-members.html +++ b/6/d8/d9f/class_o_n___workspace-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/db1/opennurbs__hsort__template_8h_source.html b/6/d8/db1/opennurbs__hsort__template_8h_source.html index 19de70a9..ddc2a016 100644 --- a/6/d8/db1/opennurbs__hsort__template_8h_source.html +++ b/6/d8/db1/opennurbs__hsort__template_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_hsort_template.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_hsort_template.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 #if !defined(ON_COMPILING_OPENNURBS_HSORT_FUNCTIONS)
    2 /*
    3 See opennurbs_sort.cpp for examples of using openurbs_hsort_template.c
    4 to define type specific heap sort functions.
    5 */
    6 #error Do not compile openurbs_hsort_template.c directly.
    7 #endif
    8 
    9 // ON_SORT_TEMPLATE_TYPE -> double, int, ....
    10 #if !defined(ON_SORT_TEMPLATE_TYPE)
    11 #error Define ON_SORT_TEMPLATE_TYPE macro before including opennurbs_qsort_template.c
    12 #endif
    13 
    14 #if !defined(ON_HSORT_FNAME)
    15 #error Define ON_HSORT_FNAME macro before including opennurbs_qsort_template.c
    16 #endif
    17 
    18 #if defined(ON_SORT_TEMPLATE_COMPARE)
    19 // use a compare function like strcmp for char* strings
    20 #define ON_HSORT_GT(A,B) ON_SORT_TEMPLATE_COMPARE(A,B) > 0
    21 #define ON_HSORT_GT_TMP(A) ON_SORT_TEMPLATE_COMPARE(A,&tmp) > 0
    22 #else
    23 // use type compares
    24 #define ON_HSORT_GT(A,B) *A > *B
    25 #define ON_HSORT_GT_TMP(A) *A > tmp
    26 #endif
    27 
    28 #if defined(ON_SORT_TEMPLATE_USE_MEMCPY)
    29 #define ON_HSORT_TO_TMP(A) memcpy(&tmp,A,sizeof(tmp))
    30 #define ON_HSORT_FROM_TMP(A) memcpy(A,&tmp,sizeof(tmp))
    31 #define ON_HSORT_COPY(dst,src) memcpy(dst,src,sizeof(tmp))
    32 #else
    33 #define ON_HSORT_TO_TMP(A) tmp = *A
    34 #define ON_HSORT_FROM_TMP(A) *A = tmp
    35 #define ON_HSORT_COPY(dst,src) *dst = *src
    36 #endif
    37 
    38 #if defined(ON_SORT_TEMPLATE_STATIC_FUNCTION)
    39 static
    40 #endif
    41 void
    42 ON_HSORT_FNAME( ON_SORT_TEMPLATE_TYPE* base, size_t nel )
    43 {
    44  size_t i_end,k,i,j;
    45  ON_SORT_TEMPLATE_TYPE* e_end;
    46  ON_SORT_TEMPLATE_TYPE* e_i;
    47  ON_SORT_TEMPLATE_TYPE* e_j;
    48  ON_SORT_TEMPLATE_TYPE tmp;
    49 
    50  if (0 == base || nel < 2)
    51  return;
    52 
    53  k = nel >> 1;
    54  i_end = nel-1;
    55  e_end = base + i_end;
    56  for (;;)
    57  {
    58  if (k)
    59  {
    60  --k;
    61  ON_HSORT_TO_TMP((base+k)); /* e_tmp = e[k]; */
    62  }
    63  else
    64  {
    65  ON_HSORT_TO_TMP(e_end); /* e_tmp = e[i_end]; */
    66  ON_HSORT_COPY(e_end,base); /* e[i_end] = e[0]; */
    67  if (!(--i_end))
    68  {
    69  ON_HSORT_FROM_TMP(base); /* e[0] = e_tmp; */
    70  break;
    71  }
    72  e_end--;
    73  }
    74 
    75  i = k;
    76  j = (k<<1) + 1;
    77  e_i = base + i;
    78  while (j <= i_end)
    79  {
    80  e_j = base + j;
    81  if (j < i_end && ON_HSORT_GT((e_j+1),e_j) /*e[j] < e[j + 1] */)
    82  {
    83  j++;
    84  e_j++;
    85  }
    86  if (ON_HSORT_GT_TMP(e_j) /* tmp < e[j] */)
    87  {
    88  ON_HSORT_COPY(e_i,e_j); /* e[i] = e[j]; */
    89  i = j;
    90  e_i = e_j;
    91  j = (j<<1) + 1;
    92  }
    93  else
    94  j = i_end + 1;
    95  }
    96 
    97  ON_HSORT_FROM_TMP(e_i); /* e[i] = e_tmp; */
    98  }
    99 }
    100 
    101 #undef ON_HSORT_GT
    102 #undef ON_HSORT_GT_TMP
    103 #undef ON_HSORT_TO_TMP
    104 #undef ON_HSORT_FROM_TMP
    105 #undef ON_HSORT_COPY
    106 #undef ON_HSORT_FROM_TMP
    diff --git a/6/d8/db2/class_o_n___component_manifest-members.html b/6/d8/db2/class_o_n___component_manifest-members.html index 85328fe1..46ba4ffd 100644 --- a/6/d8/db2/class_o_n___component_manifest-members.html +++ b/6/d8/db2/class_o_n___component_manifest-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/db3/class_o_n___surface_properties.html b/6/d8/db3/class_o_n___surface_properties.html index 96ac4584..cfa73c6b 100644 --- a/6/d8/db3/class_o_n___surface_properties.html +++ b/6/d8/db3/class_o_n___surface_properties.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SurfaceProperties Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/db4/struct_o_n___u_u_i_d__struct.html b/6/d8/db4/struct_o_n___u_u_i_d__struct.html index 9367ea21..a8394903 100644 --- a/6/d8/db4/struct_o_n___u_u_i_d__struct.html +++ b/6/d8/db4/struct_o_n___u_u_i_d__struct.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UUID_struct Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/db7/class_o_n___poly_edge_segment.html b/6/d8/db7/class_o_n___poly_edge_segment.html index 15e202d7..af248752 100644 --- a/6/d8/db7/class_o_n___poly_edge_segment.html +++ b/6/d8/db7/class_o_n___poly_edge_segment.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_PolyEdgeSegment Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_CurveProxy.

    @@ -1048,10 +1046,7 @@ Additional Inherited Members

    When m_component_index refers to an ON_BrepTrim, there are four domains and 4 classes derived from ON_Curve that play a role in the polyedge segment. It is possible for all 4 of these domains to be different.

    "this" ON_PolyEdgeSegment is an ON_ProxyCurve. The evaluation domain of "this" is = this->Domain() = ON_ProxyCurve::m_this_domain

    ON_ProxyCurve::m_real_curve points to the curve in the c3 = ON_Brep::m_C3[edge.m_c3i]. "this" is a proxy for some sub-interval of c3. = this->ProxyCurveDomain() = ON_ProxyCurve::m_real_curve_domain

    -

    The edge, an ON_BrepEdge, is also a proxy based on c3, and the edge's evaluation domain is edge.m_this_domain.
    -
    -
    -ON_PolyEdgeSegment::m_edge_domain records the increasing subinterval of edge.m_this_domain that corresponds to the portion of c3 "this" is using.

    +

    The edge, an ON_BrepEdge, is also a proxy based on c3, and the edge's evaluation domain is edge.m_this_domain. ON_PolyEdgeSegment::m_edge_domain records the increasing subinterval of edge.m_this_domain that corresponds to the portion of c3 "this" is using.

    The trim, an ON_BrepTrim, is a proxy based on a curve in ON_Brep::m_C2[]. Some portion of the trim corresponds to the portion of the edge we are using. m_trim_domain is an increasing, possible subinterval, of the trim's domain ON_BrepTrim::m_this_domain.CRhinoBrepObject or CRhinoCurveObject

    @@ -1105,9 +1100,9 @@ Additional Inherited Members diff --git a/6/d8/db7/opennurbs__cpp__base_8h_source.html b/6/d8/db7/opennurbs__cpp__base_8h_source.html index dbc702fd..8e639cd3 100644 --- a/6/d8/db7/opennurbs__cpp__base_8h_source.html +++ b/6/d8/db7/opennurbs__cpp__base_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_cpp_base.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_cpp_base.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/dbb/class_o_n___curve_proxy-members.html b/6/d8/dbb/class_o_n___curve_proxy-members.html index bc646dd2..8c35d14c 100644 --- a/6/d8/dbb/class_o_n___curve_proxy-members.html +++ b/6/d8/dbb/class_o_n___curve_proxy-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/dc1/class_o_n___pick_point-members.html b/6/d8/dc1/class_o_n___pick_point-members.html index 7a0794d8..b21d24f7 100644 --- a/6/d8/dc1/class_o_n___pick_point-members.html +++ b/6/d8/dc1/class_o_n___pick_point-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/dc2/class_o_n___rtf_parser-members.html b/6/d8/dc2/class_o_n___rtf_parser-members.html index 5040ec76..2245bb0b 100644 --- a/6/d8/dc2/class_o_n___rtf_parser-members.html +++ b/6/d8/dc2/class_o_n___rtf_parser-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/dcc/class_o_n___content_hash-members.html b/6/d8/dcc/class_o_n___content_hash-members.html index a90dc5a2..12fbbc6b 100644 --- a/6/d8/dcc/class_o_n___content_hash-members.html +++ b/6/d8/dcc/class_o_n___content_hash-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/dd1/class_o_n___localizer-members.html b/6/d8/dd1/class_o_n___localizer-members.html index a5de3a5f..1ac8a36e 100644 --- a/6/d8/dd1/class_o_n___localizer-members.html +++ b/6/d8/dd1/class_o_n___localizer-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/dd2/class_o_n___leader-members.html b/6/d8/dd2/class_o_n___leader-members.html index ac2ca6df..252f9e9e 100644 --- a/6/d8/dd2/class_o_n___leader-members.html +++ b/6/d8/dd2/class_o_n___leader-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/dd2/opennurbs__dimensionstyle_8h_source.html b/6/d8/dd2/opennurbs__dimensionstyle_8h_source.html index 08668ebb..841577b4 100644 --- a/6/d8/dd2/opennurbs__dimensionstyle_8h_source.html +++ b/6/d8/dd2/opennurbs__dimensionstyle_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_dimensionstyle.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_dimensionstyle.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_dimensionstyle.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_DIMENSIONSTYLE_INC_)
    18 #define OPENNURBS_DIMENSIONSTYLE_INC_
    19 
    20 
    21 class ON_CLASS ON_Arrowhead
    22 {
    23 public:
    24  ON_Arrowhead() = default;
    25  ~ON_Arrowhead() = default;
    26  ON_Arrowhead(const ON_Arrowhead&) = default;
    27  ON_Arrowhead& operator=(const ON_Arrowhead&) = default;
    28 
    29  bool operator==(const ON_Arrowhead& other) const;
    30  bool operator!=(const ON_Arrowhead& other) const;
    31 
    32 
    33 #pragma region RH_C_SHARED_ENUM [ON_Arrowhead::arrow_type] [Rhino.DocObjects.DimensionStyle.ArrowType] [nested:int]
    34  /// <summary>
    35  /// Defines enumerated values for arrowhead shapes.
    36  /// </summary>
    37  enum class arrow_type : unsigned int
    38  {
    39  /// <summary> </summary>
    40  None = 0,
    41  /// <summary> </summary>
    42  UserBlock = 1,
    43  /// <summary> </summary>
    44  SolidTriangle = 2, // 2:1
    45  /// <summary> </summary>
    46  Dot = 3,
    47  /// <summary> </summary>
    48  Tick = 4,
    49  /// <summary> </summary>
    50  ShortTriangle = 5, // 1:1
    51  /// <summary> </summary>
    52  OpenArrow = 6,
    53  /// <summary> </summary>
    54  Rectangle = 7,
    55  /// <summary> </summary>
    56  LongTriangle = 8, // 4:1
    57  /// <summary> </summary>
    58  LongerTriangle = 9, // 6:1
    59  };
    60 #pragma endregion
    61 
    62  static ON_Arrowhead::arrow_type ArrowTypeFromUnsigned(
    63  unsigned int type_as_unsigned
    64  );
    65 
    66  arrow_type ArrowheadType() const;
    67  void SetArrowheadType(arrow_type type);
    68  ON_UUID ArrowBlockId() const;
    69  void SetArrowBlockId(ON_UUID id);
    70 
    71  static ON__UINT32 GetPoints(
    72  arrow_type type,
    73  const double*& points);
    74 
    75  static ON__UINT32 GetPoints(
    76  arrow_type type,
    77  ON_2dPointArray& points);
    78 
    79  static bool GetArrowheadBoundingBox(
    80  ON_Arrowhead::arrow_type arrow_type,
    81  ON_UUID arrow_block_id,
    82  ON_Xform xform,
    83  ON_BoundingBox& bbox,
    84  bool grow);
    85 
    86  static
    87  ON_Arrowhead::arrow_type DefaultArrowType();
    88 
    89 private:
    90  arrow_type m_arrowhead_type = ON_Arrowhead::arrow_type::SolidTriangle;
    91  ON_UUID m_arrow_block_id = ON_nil_uuid;
    92 
    93 };
    94 
    95 class ON_CLASS ON_TextMask
    96 {
    97 public:
    98 
    99 #pragma region RH_C_SHARED_ENUM [ON_TextMask::MaskType] [Rhino.DocObjects.DimensionStyle.MaskType] [nested:byte]
    100  /// <summary>
    101  /// Text mask drawn with background color or explicit color
    102  /// </summary>
    103  enum class MaskType : unsigned char
    104  {
    105  /// <summary>
    106  /// Text mask drawn with background color
    107  /// </summary>
    108  BackgroundColor = 0,
    109  /// <summary>
    110  /// Text mask drawn with explicit color
    111  /// </summary>
    112  MaskColor = 1,
    113  };
    114 #pragma endregion
    115 
    116  static ON_TextMask::MaskType MaskTypeFromUnsigned(
    117  unsigned int mask_type_as_unsigned
    118  );
    119 
    120 public:
    121 
    122  /*
    123  The default constructor content is idenical to ON_TextMask::None.
    124  */
    125  ON_TextMask() = default;
    126  ~ON_TextMask() = default;
    127  ON_TextMask(const ON_TextMask& src) = default;
    128  ON_TextMask& operator=(const ON_TextMask& src) = default;
    129 
    130 public:
    131 
    132  /*
    133  ON_TextMask::None has no effect on text appearance.
    134  */
    135  static const ON_TextMask None;
    136 
    137  /*
    138  Description:
    139  ON_TextMask::Compare() compares content in a repeatable
    140  and well ordered way.
    141  Returns:
    142  0: lhs and rhs have identical content.
    143  <0: lhs content is less than rhs content
    144  >0: lhs content is greater than rhs content
    145  */
    146  static int Compare(
    147  const ON_TextMask& lhs,
    148  const ON_TextMask& rhs
    149  );
    150 
    151  // Specifies whether or not to draw a Text Mask
    152  bool DrawTextMask() const;
    153  void SetDrawTextMask(bool bDraw);
    154 
    155  // Determines where to get the color to draw a Text Mask
    156  // Can be background color or a specific color
    157  ON_TextMask::MaskType MaskFillType() const;
    158  void SetMaskFillType(ON_TextMask::MaskType source);
    159 
    160  /*
    161  Returns:
    162  Mask color.
    163  Remarks:
    164  The mask color is applied only when MaskFillType() = ON_TextMask::MaskType::MaskColor
    165  */
    166  ON_Color MaskColor() const;
    167 
    168  void SetMaskColor(
    169  ON_Color color
    170  );
    171 
    172  /*
    173  Returns:
    174  Width of border area around text to be masked. The default value is 0.0.
    175  */
    176  double MaskBorder() const;
    177 
    178  void SetMaskBorder(double offset);
    179 
    180  bool Write(
    181  ON_BinaryArchive& archive
    182  ) const;
    183 
    184  bool Read(
    185  ON_BinaryArchive& archive
    186  );
    187 
    188  /*
    189  Returns:
    190  A SHA1 of the values defining the text mask.
    191  Two text masks have the same
    192  content if and only if they have identical content hash values.
    193  */
    194  const ON_SHA1_Hash& ContentHash() const;
    195 
    196 private:
    197  bool m_bDrawMask = false;
    199 
    200  unsigned char m_reserved1 = 0;
    201  unsigned char m_reserved2 = 0;
    202 
    203  ON_Color m_mask_color = ON_Color::White;
    204  double m_mask_border = 0.0;
    205 
    206  // At some point, the reserved fields may have the name changed and be
    207  // used to store additional informtion of how to draw the mask,
    208  // (feathered edges, rounded corners, etc.).
    209  unsigned int m_reserved3 = 0;
    210  mutable ON_SHA1_Hash m_content_hash = ON_SHA1_Hash::ZeroDigest;
    211 };
    212 
    213 bool operator==(
    214  const class ON_TextMask& lhs,
    215  const class ON_TextMask& rhs
    216  );
    217 
    218 bool operator!=(
    219  const class ON_TextMask& lhs,
    220  const class ON_TextMask& rhs
    221  );
    222 
    223 
    224 class ON_CLASS ON_DimStyle : public ON_ModelComponent
    225 {
    226  ON_OBJECT_DECLARE(ON_DimStyle);
    227 private:
    228  friend class ON_V5x_DimStyle;
    229 
    230 public:
    231  // Predefined default dimension styles always available
    232  static const ON_DimStyle Unset; // index = ON_UNSET_INT_INDEX, id = nil.
    233  static const ON_DimStyle Default; // index = -1, unique and persistent id.
    234  static const ON_DimStyle DefaultInchDecimal; // index = -2, unique and persistent id.
    235  static const ON_DimStyle DefaultInchFractional; // index = -3, unique and persistent id.
    236  static const ON_DimStyle DefaultFootInchArchitecture; // index = -4, unique and persistent id.
    237  static const ON_DimStyle DefaultMillimeterSmall; // index = -5, unique and persistent id.
    238  static const ON_DimStyle DefaultMillimeterLarge; // index = -6, unique and persistent id.
    239  static const ON_DimStyle DefaultMillimeterArchitecture; // index = -7, unique and persistent id.
    240 
    241 public:
    242  /*
    243  Parameters:
    244  dimstyle - [in]
    245  Returns:
    246  If dimstyle not nullptr, then dimstyle is returned.
    247  Otherwise a non-null pointer to a persistent dimstyle is returned.
    248  A null pointer is never returned.
    249  Remarks:
    250  This function is used when a dimension style is required.
    251  */
    252  static const class ON_DimStyle& DimStyleOrDefault(
    253  const class ON_DimStyle* dimstyle
    254  );
    255 
    256  /*
    257  Parameters:
    258  id - [in]
    259  Returns:
    260  If the id is not nil and identifies one of the above system dimstyles, that
    261  dimstyle is returned. Otherwise, ON_DimStyle::Unset is returned.
    262  */
    263  static const ON_DimStyle& SystemDimstyleFromId(
    264  ON_UUID id
    265  );
    266 
    267  /*
    268  Parameters:
    269  index - [in]
    270  Returns:
    271  If the id is not nil and identifies one of the above system dimstyles, that
    272  dimstyle is returned. Otherwise, ON_DimStyle::Unset is returned.
    273  */
    274  static const ON_DimStyle& SystemDimstyleFromIndex(
    275  int index
    276  );
    277 
    278  /*
    279  Parameters:
    280  name_hash - [in]
    281  Returns:
    282  If the id is not nil and identifies one of the above system dimstyles, that
    283  dimstyle is returned. Otherwise, ON_DimStyle::Unset is returned.
    284  */
    285  static const ON_DimStyle& SystemDimstyleFromName(
    286  const ON_NameHash& name_hash
    287  );
    288 
    289  /*
    290  Parameters:
    291  name_hash - [in]
    292  Returns:
    293  If the id is not nil and identifies one of the above system dimstyles, that
    294  dimstyle is returned. Otherwise, ON_DimStyle::Unset is returned.
    295  */
    297  const ON_SHA1_Hash& content_hash
    298  );
    299 
    300 private:
    301  /*
    302  Parameters:
    303  system_dimstyle_list - [out]
    304  Returns:
    305  Number of system dimstyles.
    306  Remarks:
    307  ON_DimStyle::Unset is not added system_dimstyle_list[].
    308  */
    309  static unsigned int Internal_GetSystemDimstyleList(
    310  ON_SimpleArray<const ON_DimStyle*>& system_dimstyle_list
    311  );
    312 
    313 public:
    314 
    315  /*
    316  Parameters:
    317  model_component_reference - [in]
    318  none_return_value - [in]
    319  value to return if ON_DimStyle::Cast(model_component_ref.ModelComponent())
    320  is nullptr
    321  Returns:
    322  If ON_DimStyle::Cast(model_component_ref.ModelComponent()) is not nullptr,
    323  that pointer is returned. Otherwise, none_return_value is returned.
    324  */
    325  static const ON_DimStyle* FromModelComponentRef(
    326  const class ON_ModelComponentReference& model_component_reference,
    327  const ON_DimStyle* none_return_value
    328  );
    329 
    330  /*
    331  Description:
    332  Create a clean dimension style that has the specified font.
    333  With the exception of the name, the resulting dimension style
    334  will have an unset ON_ModelComponent properties (id, index, ...).
    335  Parameters:
    336  font_characteristics - [in]
    337  If nullptr, then &ON_Font::Default is used.
    338  model_space_text_scale - [in]
    339  If model_space_text_scale is > 0.0, then it is used to set
    340  the DimScale() value.
    341  dimstyle_settings - [in]
    342  Setting for non-font dimstyle properties.
    343  If nullptr, then &ON_DimStyle::Default is used.
    344  manifest - [in]
    345  If manifest is not nullptr, then it is used to generate
    346  a unique name.
    347  destination - [in]
    348  If destination is not nullptr, the result is stored here.
    349  Otherwise operator new is used to construct an ON_DimStyle on the heap.
    350  */
    351  static ON_DimStyle* CreateFromFont(
    352  const ON_Font* font_characteristics,
    353  double model_space_text_scale,
    354  const ON_DimStyle* dimstyle_settings,
    355  const class ON_ComponentManifest* manifest,
    356  ON_DimStyle* destination
    357  );
    358 
    359 public:
    360  // Default constructor result is identical to ON_DimStyle::Unset;
    361  ON_DimStyle();
    362 
    363  ~ON_DimStyle() = default;
    364  ON_DimStyle(const ON_DimStyle& src) = default;
    365  ON_DimStyle& operator=(const ON_DimStyle&) = default;
    366 
    367 public:
    368  // Used when reading V5 and earlier archives
    369  ON_DimStyle(
    370  ON::LengthUnitSystem model_length_unit_system,
    371  const class ON_V5x_DimStyle& src
    372  );
    373 
    374 public:
    376 
    377  /*
    378  Returns:
    379  True:
    380  "this" and src have identical names, dimension style appearance attributes,
    381  and identical atttributes inherited from the same parent dimension style.
    382  ON_ModelComponent settings other than Name() and ParentId() are
    383  not compared.
    384  Remaraks:
    385  A better name for this function would be EqualForAllPracticalPurposes().
    386  */
    387  bool CompareDimstyle(const ON_DimStyle& src) const;
    388 
    389  /*
    390  Returns:
    391  True if this and src have identical dimension style appearance attributes
    392  and the same parent dimension style id.
    393  CompareFields() ignores Name, Index, Id() values.
    394  CompareFields() ignores differences in IsOverride(field_id) values.
    395  Remaraks:
    396  A better name for this function would be EqualAppearanceSettings().
    397  */
    398  bool CompareFields(const ON_DimStyle& src) const;
    399 
    400 private:
    401  /*
    402  Returns:
    403  True:
    404  If a.IsFieldOverride(field_id) == b.IsFieldOverride(field_id)
    405  for all ON_DimStyle::field enum values.
    406  */
    407  static bool Internal_EqualOverrideParentFields(
    408  const ON_DimStyle& a,
    409  const ON_DimStyle& b
    410  );
    411 public:
    412 
    413  //////////////////////////////////////////////////////////////////////
    414  //
    415  // ON_Object overrides
    416 
    417  // virtual
    418  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    419 
    420  // virtual
    421  void Dump(ON_TextLog&) const override; // for debugging
    422 
    423  // virtual
    424  bool Write(
    425  ON_BinaryArchive& // serialize definition to binary archive
    426  ) const override;
    427 
    428  // virtual
    429  bool Read(
    430  ON_BinaryArchive& // restore definition from binary archive
    431  ) override;
    432 
    433  //////////////////////////////////////////////////////////////////////
    434  // Interface
    435 
    436  void EmergencyDestroy();
    437 
    438  //////////////////////////////////////////////////////////////////////
    439  // Interface
    440 
    441 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::LengthDisplay] [Rhino.DocObjects.DimensionStyle.LengthDisplay] [nested:int]
    442  /// <summary>
    443  /// Dimension display length unit system and style
    444  /// </summary>
    445  enum class LengthDisplay : unsigned int
    446  {
    447  /// <summary>
    448  /// Decimal current model units
    449  /// </summary>
    450  ModelUnits = 0,
    451 
    452  /// <summary>
    453  /// Decimal Millimeters
    454  /// </summary>
    455  Millmeters = 3,
    456 
    457  /// <summary>
    458  /// Decimal Centimeters
    459  /// </summary>
    460  Centimeters = 4,
    461 
    462  /// <summary>
    463  /// Decimal Meters
    464  /// </summary>
    465  Meters = 5,
    466 
    467  /// <summary>
    468  /// Decimal Kilometers
    469  /// </summary>
    470  Kilometers = 6,
    471 
    472  /// <summary>
    473  /// Decimal Inches
    474  /// </summary>
    475  InchesDecimal = 7,
    476 
    477  /// <summary>
    478  /// Fractional Inches ( 1.75 inches displays as 1-3/4 )
    479  /// </summary>
    480  InchesFractional = 1,
    481 
    482  /// <summary>
    483  /// Decimal Feet
    484  /// </summary>
    485  FeetDecimal = 8,
    486 
    487  /// <summary>
    488  /// Feet and Inches ( 14.75 inches displays as 1&apos;-2-3/4&quot; )
    489  /// </summary>
    490  FeetAndInches = 2,
    491 
    492  /// <summary>
    493  /// Decimal Miles
    494  /// </summary>
    495  Miles = 9
    496  };
    497 
    498 #pragma endregion
    499 
    500  static ON_DimStyle::LengthDisplay LengthDisplayFromUnsigned(
    501  unsigned int length_display_as_unsigned
    502  );
    503 
    504  /*
    505  Returns:
    506  true if length_display selects a decimal format.
    507  false if length_display is ON_DimStyle::LengthDisplay::FeetAndInches
    508  or ON_DimStyle::LengthDisplay::InchesFractional.
    509  */
    510  static bool LengthDisplayIsDecimal(
    511  ON_DimStyle::LengthDisplay dimension_length_display
    512  );
    513 
    514  static ON::LengthUnitSystem LengthUnitSystemFromLengthDisplay(
    515  ON_DimStyle::LengthDisplay dimension_length_display
    516  );
    517 
    518 
    519 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::tolerance_format] [Rhino.DocObjects.DimensionStyle.ToleranceDisplayFormat] [nested:byte]
    520  /// <summary>
    521  /// Style of tolerance display for dimensions
    522  /// </summary>
    523  enum class tolerance_format : unsigned char
    524  {
    525  /// <summary>
    526  /// No tolerance display
    527  /// </summary>
    528  None = 0,
    529  /// <summary>
    530  /// Symmetrical +/- tolerance
    531  /// </summary>
    532  Symmetrical = 1,
    533  /// <summary>
    534  /// Distance +tol, -tol
    535  /// </summary>
    536  Deviation = 2,
    537  /// <summary>
    538  /// Distance upper and lower limits
    539  /// </summary>
    540  Limits = 3,
    541  };
    542 #pragma endregion
    543 
    544  static ON_DimStyle::tolerance_format ToleranceFormatFromUnsigned(
    545  unsigned int format_as_unsigned
    546  );
    547 
    548 
    549 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::ContentAngleStyle] [Rhino.DocObjects.DimensionStyle.LeaderContentAngleStyle] [nested:byte]
    550  /// <summary>
    551  /// Angle for text or other leader or dimension content
    552  /// </summary>
    553  enum class ContentAngleStyle : unsigned char
    554  {
    555  /// <summary>
    556  /// Annotation text is horizontal in annotation object's plane
    557  /// </summary>
    558  Horizontal = 0,
    559  /// <summary>
    560  /// Aligned with last leader direction or dimension line
    561  /// </summary>
    562  Aligned = 1,
    563  /// <summary>
    564  /// Explicit angle
    565  /// </summary>
    566  Rotated = 2,
    567  };
    568 #pragma endregion
    569 
    570  static ON_DimStyle::ContentAngleStyle ContentAngleStyleFromUnsigned(
    571  unsigned int alignment_as_unsigned
    572  );
    573 
    574 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::leader_curve_type] [Rhino.DocObjects.DimensionStyle.LeaderCurveStyle] [nested:byte]
    575  /// <summary>
    576  /// Type of leader curve
    577  /// </summary>
    578  enum class leader_curve_type : unsigned char
    579  {
    580  /// <summary>
    581  ///
    582  /// </summary>
    583  None = 0,
    584  /// <summary>
    585  ///
    586  /// </summary>
    587  Polyline = 1,
    588  /// <summary>
    589  ///
    590  /// </summary>
    591  Spline = 2
    592  };
    593 #pragma endregion
    594 
    595  static ON_DimStyle::leader_curve_type LeaderCurveTypeFromUnsigned(
    596  unsigned int type_as_unsigned
    597  );
    598 
    599 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::field] [Rhino.DocObjects.DimensionStyle.Field] [nested:int]
    600  // Don't change these enum values. They are used in file reading and writing.
    601  /// <summary>
    602  /// Field identifiers used for file i/o and getting/setting values
    603  /// </summary>
    604  enum class field : unsigned int
    605  {
    606  /// <summary></summary>
    607  Unset = 0,
    608 
    609  /// <summary>Dimension style Name property. Cannot be inherited from parent.</summary>
    610  Name = 1,
    611 
    612  /// <summary>Dimension style runtime model component index property. Cannot be inherited from parent.</summary>
    613  Index = 2,
    614 
    615  /// <summary></summary>
    616  ExtensionLineExtension = 3,
    617  /// <summary></summary>
    618  ExtensionLineOffset = 4,
    619  /// <summary></summary>
    620  Arrowsize = 5,
    621  /// <summary></summary>
    622  LeaderArrowsize = 6,
    623  /// <summary></summary>
    624  Centermark = 7,
    625  /// <summary></summary>
    626  TextGap = 8,
    627  /// <summary></summary>
    628  TextHeight = 9,
    629  /// <summary>Linear, angular, and ordinate dimension text location above/in/below</summary>
    630  DimTextLocation = 10,
    631 
    632  //OBSOLETE_LengthFormat_ = 11,
    633 
    634  /// <summary></summary>
    635  LengthResolution = 12,
    636  /// <summary></summary>
    637  AngleFormat = 13,
    638  /// <summary></summary>
    639  AngleResolution = 14,
    640  /// <summary></summary>
    641  Font = 15,
    642 
    643  /// <summary>
    644  /// LengthFactor is a rarely used. It applies when a model is being
    645  /// drawn to a scale and the dimension length values should be
    646  /// reverse scaled. For example, if a model is drawn at 1/4 scale,
    647  /// a line 5 units long indicates the real world line is 20 units
    648  /// long. In this case setting LengthFactor to 4 would cause
    649  /// a linear dimension applied to that line to display a value of 20.
    650  ///</summary>
    651  LengthFactor = 16,
    652 
    653  /// <summary></summary>
    654  Alternate = 17,
    655 
    656  /// <summary>
    657  /// AlternateLengthFactor is a rarely used. See Length factor for
    658  /// a discription of this property.
    659  ///</summary>
    660  AlternateLengthFactor = 18,
    661 
    662  //OBSOLETE_AlternateLengthFormat_ = 19,
    663 
    664  /// <summary></summary>
    665  AlternateLengthResolution = 20,
    666  /// <summary></summary>
    667  Prefix = 21,
    668  /// <summary></summary>
    669  Suffix = 22,
    670  /// <summary></summary>
    671  AlternatePrefix = 23,
    672  /// <summary></summary>
    673  AlternateSuffix = 24,
    674  /// <summary></summary>
    675  DimensionLineExtension = 25,
    676  /// <summary></summary>
    677  SuppressExtension1 = 26,
    678  /// <summary></summary>
    679  SuppressExtension2 = 27,
    680  /// <summary></summary>
    681  ExtLineColorSource = 28,
    682  /// <summary></summary>
    683  DimLineColorSource = 29,
    684  /// <summary></summary>
    685  ArrowColorSource = 30,
    686  /// <summary></summary>
    687  TextColorSource = 31,
    688  /// <summary></summary>
    689  ExtLineColor = 32,
    690  /// <summary></summary>
    691  DimLineColor = 33,
    692  /// <summary></summary>
    693  ArrowColor = 34,
    694  /// <summary></summary>
    695  TextColor = 35,
    696  /// <summary></summary>
    697  ExtLinePlotColorSource = 36,
    698  /// <summary></summary>
    699  DimLinePlotColorSource = 37,
    700  /// <summary></summary>
    701  ArrowPlotColorSource = 38,
    702  /// <summary></summary>
    703  TextPlotColorSource = 39,
    704  /// <summary></summary>
    705  ExtLinePlotColor = 40,
    706  /// <summary></summary>
    707  DimLinePlotColor = 41,
    708  /// <summary></summary>
    709  ArrowPlotColor = 42,
    710  /// <summary></summary>
    711  TextPlotColor = 43,
    712  /// <summary></summary>
    713  ExtLinePlotWeightSource = 44,
    714  /// <summary></summary>
    715  DimLinePlotWeightSource = 45,
    716  /// <summary></summary>
    717  ExtLinePlotWeight_mm = 46,
    718  /// <summary></summary>
    719  DimLinePlotWeight_mm = 47,
    720  /// <summary></summary>
    721  ToleranceFormat = 48,
    722  /// <summary></summary>
    723  ToleranceResolution = 49,
    724  /// <summary></summary>
    725  ToleranceUpperValue = 50,
    726  /// <summary></summary>
    727  ToleranceLowerValue = 51,
    728  /// <summary></summary>
    729  AltToleranceResolution = 52,
    730  /// <summary></summary>
    731  ToleranceHeightScale = 53,
    732  /// <summary></summary>
    733  BaselineSpacing = 54,
    734  /// <summary></summary>
    735  DrawMask = 55,
    736  /// <summary></summary>
    737  MaskColorSource = 56,
    738  /// <summary></summary>
    739  MaskColor = 57,
    740  /// <summary></summary>
    741  MaskBorder = 58,
    742  /// <summary></summary>
    743  DimensionScale = 59,
    744  /// <summary></summary>
    745  DimscaleSource = 60,
    746  /// <summary></summary>
    747  FixedExtensionLength = 61,
    748  /// <summary></summary>
    749  FixedExtensionOn = 62,
    750  /// <summary></summary>
    751  TextRotation = 63,
    752  /// <summary></summary>
    753  SuppressArrow1 = 64,
    754  /// <summary></summary>
    755  SuppressArrow2 = 65,
    756  /// <summary></summary>
    757  TextmoveLeader = 66,
    758  /// <summary></summary>
    759  ArclengthSymbol = 67,
    760  /// <summary></summary>
    761  StackTextheightScale = 68,
    762  /// <summary></summary>
    763  StackFormat = 69,
    764  /// <summary></summary>
    765  AltRound = 70,
    766  /// <summary></summary>
    767  Round = 71,
    768  /// <summary></summary>
    769  AngularRound = 72,
    770  /// <summary></summary>
    771  AltZeroSuppress = 73,
    772 
    773  //OBSOLETE ToleranceZeroSuppress = 74,
    774 
    775  /// <summary></summary>
    776  AngleZeroSuppress = 75,
    777  /// <summary></summary>
    778  ZeroSuppress = 76,
    779  /// <summary></summary>
    780  AltBelow = 77,
    781  /// <summary></summary>
    782  ArrowType1 = 78,
    783  /// <summary></summary>
    784  ArrowType2 = 79,
    785  /// <summary></summary>
    786  LeaderArrowType = 80,
    787  /// <summary></summary>
    788  ArrowBlockId1 = 81,
    789  /// <summary></summary>
    790  ArrowBlockId2 = 82,
    791  /// <summary></summary>
    792  LeaderArrowBlock = 83,
    793  /// <summary>Radial dimension text location above/in/below</summary>
    794  DimRadialTextLocation = 84,
    795  /// <summary></summary>
    796  TextVerticalAlignment = 85,
    797  /// <summary></summary>
    798  LeaderTextVerticalAlignment = 86,
    799  /// <summary></summary>
    800  LeaderContentAngleStyle = 87,
    801  /// <summary></summary>
    802  LeaderCurveType = 88,
    803  /// <summary></summary>
    804  LeaderContentAngle = 89,
    805  /// <summary></summary>
    806  LeaderHasLanding = 90,
    807  /// <summary></summary>
    808  LeaderLandingLength = 91,
    809  /// <summary></summary>
    810  MaskFlags = 92,
    811  /// <summary></summary>
    812  CentermarkStyle = 93,
    813  /// <summary></summary>
    814  TextHorizontalAlignment = 94,
    815  /// <summary></summary>
    816  LeaderTextHorizontalAlignment = 95,
    817  /// <summary></summary>
    818  DrawForward = 96,
    819  /// <summary></summary>
    820  SignedOrdinate = 97,
    821 
    822  /// <summary>
    823  /// Unit system for dimension rendering sizes like TextHeight, TextGap, ArrowSize, ExtOffset,
    824  /// and dozens of other properties that control the appearance and placement of the components
    825  /// used to render a dimension.
    826  ///</summary>
    827  UnitSystem = 98,
    828 
    829  /// <summary></summary>
    830  TextMask = 99,
    831  /// <summary></summary>
    832  TextOrientation = 100,
    833  /// <summary></summary>
    834  LeaderTextOrientation = 101,
    835  /// <summary></summary>
    836  DimTextOrientation = 102,
    837  /// <summary></summary>
    838  DimRadialTextOrientation = 103,
    839  /// <summary></summary>
    840  DimTextAngleStyle = 104,
    841  /// <summary></summary>
    842  DimRadialTextAngleStyle = 105,
    843  /// <summary></summary>
    844  TextUnderlined = 106,
    845 
    846  //OBSOLETE_DimensionUnitSystem_ = 107,
    847  //OBSOLETE_AlternateDimensionUnitSystem_ = 108,
    848 
    849  /// <summary>
    850  /// Dimension length display. See ON_DimStyle::DimensionLengthDisplay() for a descpription of this parameter.
    851  /// </summary>
    852  DimensionLengthDisplay = 109,
    853 
    854  /// <summary>
    855  /// Alternate dimension length display. See ON_DimStyle::AlternateDimensionLengthDisplay() for a descpription of this parameter.
    856  /// </summary>
    857  AlternateDimensionLengthDisplay = 110,
    858 
    859  /// <summary>Every enum UINT value that identifies a valid dimension style property is less than the UINT value of Count.</summary>
    860  Count = 111
    861  };
    862 
    863 #pragma endregion
    864 
    865  enum : unsigned int
    866  {
    867  // must be 1 + the maximum value of an ON_DimStyle::field enum value.
    868  FieldCount = (unsigned int)field::Count
    869  };
    870 
    871  static ON_DimStyle::field FieldFromUnsigned(
    872  unsigned int field_as_unsigned
    873  );
    874 
    875 
    876 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::angle_format] [Rhino.DocObjects.DimensionStyle.AngleDisplayFormat] [nested:byte]
    877  /// <summary>
    878  /// Display format for angles
    879  /// </summary>
    880  enum class angle_format : unsigned char
    881  {
    882  /// <summary> Decimal Degrees </summary>
    883  DecimalDegrees = 0,
    884  /// <summary> Degrees Minutes Seconds </summary>
    885  DegMinSec = 1,
    886  /// <summary> Decimal Radians </summary>
    887  Radians = 2,
    888  /// <summary> Decimal Gradians </summary>
    889  Grads = 3
    890  };
    891 #pragma endregion
    892 
    893  static ON_DimStyle::angle_format AngleFormatFromUnsigned(
    894  unsigned int format_as_unsigned
    895  );
    896 
    897 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::OBSOLETE_length_format] [Rhino.DocObjects.DimensionStyle.LengthDisplayFormat] [nested:byte]
    898  /// <summary>
    899  /// Obsolete format for length display - use ON_DimStyle::DimensionLengthDisplay instead
    900  /// </summary>
    901  enum class OBSOLETE_length_format : unsigned char
    902  {
    903  /// <summary>Obsolete - use ON_DimStyle::DimensionLengthDisplay::ModelUnits.</summary>
    904  Decimal = 0,
    905 
    906  /// <summary>Obsolete - use ON_DimStyle::DimensionLengthDisplay::InchesFractional</summary>
    907  Fractional = 1,
    908 
    909  /// <summary>Obsolete - use ON_DimStyle::DimensionLengthDisplay::FeetAndInches</summary>
    910  FeetInches = 2,
    911 
    912  /// <summary>Obsolete - use ON_DimStyle::DimensionLengthDisplay::FeetAndInches enum.</summary>
    913  FeetDecimalInches = 3
    914  };
    915 #pragma endregion
    916 
    917 
    918  static ON_DimStyle::OBSOLETE_length_format OBSOLETE_LengthFormatFromUnsigned(
    919  unsigned int format_as_unsigned
    920  );
    921 
    922  /*
    923  Parameters:
    924  dimension_length_display - [in]
    925  model_serial_number - [in]
    926  0: Ignore model settings
    927  >0: dimstyle.ModelSerialNumber()
    928  */
    929  static ON_DimStyle::OBSOLETE_length_format OBSOLETE_LengthFormatFromLengthDisplay(
    930  ON_DimStyle::LengthDisplay dimension_length_display,
    931  unsigned int model_serial_number
    932  );
    933 
    934  static ON_DimStyle::OBSOLETE_length_format OBSOLETE_LengthFormatFromLengthDisplay(
    935  ON_DimStyle::LengthDisplay dimension_length_display,
    936  ON::LengthUnitSystem model_unit_system
    937  );
    938 
    939 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::TextLocation] [Rhino.DocObjects.DimensionStyle.TextLocation] [nested:byte]
    940  /// <summary>
    941  /// The location of text in linear, angular, radial, and ordinate dimensions.
    942  /// </summary>
    943  enum class TextLocation : unsigned char
    944  {
    945  /// <summary>Text is above dimension line.</summary>
    946  AboveDimLine = 0,
    947  /// <summary>Text is centered in dimension line.</summary>
    948  InDimLine = 1,
    949  /// <summary>Text is below dimension line.</summary>
    950  BelowDimLine = 2
    951  };
    952 #pragma endregion
    953 
    954  static ON_DimStyle::TextLocation TextLocationFromUnsigned(
    955  unsigned int dim_text_location_as_unsigned
    956  );
    957 
    958  // convert ON_DimStyle::OBSOLETE_length_format enum to ON::OBSOLETE_DistanceDisplayMode enum
    959  static ON::OBSOLETE_DistanceDisplayMode DistanceDisplayModeFromLengthFormat(
    961  );
    962 
    963  // convert ON::OBSOLETE_DistanceDisplayMode enum to ON_DimStyle::OBSOLETE_length_format enum
    964  static ON_DimStyle::OBSOLETE_length_format LengthFormatFromDistanceDisplayMode(
    965  ON::OBSOLETE_DistanceDisplayMode
    966  );
    967 
    968 
    969 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::suppress_zero] [Rhino.DocObjects.DimensionStyle.ZeroSuppression] [nested:byte]
    970  /// <summary>
    971  /// Marks leading and trailing zeros for removal.
    972  /// </summary>
    973  enum class suppress_zero : unsigned char
    974  {
    975  /// <summary>No zero suppression.</summary>
    976  None = 0,
    977  /// <summary>Suppress leading zeros.</summary>
    978  SuppressLeading = 1,
    979  /// <summary>Suppress trailing zeros.</summary>
    980  SuppressTrailing = 2,
    981  /// <summary>Suppress leading and trailing zeros.</summary>
    982  SuppressLeadingAndTrailing = 3,
    983  /// <summary>Suppress zero feet.</summary>
    984  SuppressZeroFeet = 4,
    985  /// <summary>Suppress zero inches.</summary>
    986  SuppressZeroInches = 8,
    987  /// <summary>Suppress zero feet and zero inches.</summary>
    988  SuppressZeroFeetAndZeroInches = 12
    989  };
    990 #pragma endregion
    991 
    992  static ON_DimStyle::suppress_zero ZeroSuppressFromUnsigned(
    993  unsigned int suppress_ero_as_unsigned
    994  );
    995 
    996 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::stack_format] [Rhino.DocObjects.DimensionStyle.StackDisplayFormat] [nested:byte]
    997  /// <summary>
    998  /// Format of stacked fractions
    999  /// </summary>
    1000  enum class stack_format : unsigned char
    1001  {
    1002  /// <summary> No stacking </summary>
    1003  None = 0,
    1004  /// <summary> Stack with horizontal line </summary>
    1005  StackHorizontal = 1,
    1006  /// <summary> Stack with angled line </summary>
    1007  StackDiagonal = 2,
    1008  };
    1009 #pragma endregion
    1010 
    1011  static ON_DimStyle::stack_format StackFormatFromUnsigned(
    1012  unsigned int format_as_unsigned
    1013  );
    1014 
    1015 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::centermark_style] [Rhino.DocObjects.DimensionStyle.CenterMarkStyle] [nested:byte]
    1016  /// <summary>
    1017  /// Style for drawing centermark for Radial dimensions and Centermark objects
    1018  /// </summary>
    1019  enum class centermark_style : unsigned char
    1020  {
    1021  /// <summary>
    1022  /// No centermark display
    1023  /// </summary>
    1024  None = 0,
    1025  /// <summary>
    1026  /// + mark only
    1027  /// </summary>
    1028  Mark = 1,
    1029  /// <summary>
    1030  /// + mark and lines to radius
    1031  /// </summary>
    1032  MarkAndLines = 2,
    1033  };
    1034 #pragma endregion
    1035 
    1036  static ON_DimStyle::centermark_style CentermarkStyleFromUnsigned(
    1037  unsigned int centermark_as_unsigned
    1038  );
    1039 
    1040 
    1041  static ON_DimStyle::LengthDisplay LengthDisplayFromUnitsAndFormat(
    1042  ON::LengthUnitSystem units,
    1044  );
    1045 
    1046  /// <summary>
    1047  /// Dimension length units and format
    1048  ///</summary>
    1049  ON_DimStyle::LengthDisplay DimensionLengthDisplay() const;
    1050 
    1051  /// <summary>
    1052  /// Set dimension length units and format
    1053  ///</summary>
    1054  ON_DimStyle::LengthDisplay AlternateDimensionLengthDisplay() const;
    1055 
    1056  /// <summary>
    1057  /// Alternate dimension length units and format
    1058  ///</summary>
    1059  void SetDimensionLengthDisplay(ON_DimStyle::LengthDisplay length_display);
    1060 
    1061  /// <summary>
    1062  /// Set alternate dimension length units and format
    1063  ///</summary>
    1064  void SetAlternateDimensionLengthDisplay(ON_DimStyle::LengthDisplay length_display);
    1065 
    1066  /// <summary>
    1067  /// Parameters:
    1068  /// model_sn - 0, a model serial number, or ON_UNSET_UINT_INDEX to
    1069  /// use the dimstyle's ModelSerialNumber() value.
    1070  /// Returns
    1071  /// Unit system for dimension length display.
    1072  /// If DimensionLengthDisplay() == ON_DimStyle::LengthDisplay::ModelUnits
    1073  /// and model_sn > 0, then the value of ON::LengthUnitSystemFromModelSerialNumber(model_sn)
    1074  /// is returned.
    1075  /// If DimensionLengthDisplay() == ON_DimStyle::LengthDisplay::ModelUnits
    1076  /// and model_sn == 0, then ON::LengthUnitSystem::None is returned.
    1077  ///</summary>
    1078  ON::LengthUnitSystem DimensionLengthDisplayUnit(
    1079  unsigned int model_sn
    1080  ) const;
    1081 
    1082  /// <summary>
    1083  /// Parameters:
    1084  /// model_sn - 0, a model serial number, or ON_UNSET_UINT_INDEX to
    1085  /// use the dimstyle's ModelSerialNumber() value.
    1086  /// Returns
    1087  /// Unit system for dimension length display.
    1088  /// If DimensionLengthDisplay() == ON_DimStyle::LengthDisplay::ModelUnits
    1089  /// and model_sn > 0, then the value of ON::LengthUnitSystemFromModelSerialNumber(model_sn)
    1090  /// is returned.
    1091  /// If DimensionLengthDisplay() == ON_DimStyle::LengthDisplay::ModelUnits
    1092  /// and model_sn == 0, then ON::LengthUnitSystem::None is returned.
    1093  ///</summary>
    1094  ON::LengthUnitSystem AlternateDimensionLengthDisplayUnit(
    1095  unsigned int model_sn
    1096  ) const;
    1097 
    1098 private:
    1099  /*
    1100  Returns:
    1101  true if value was changed.
    1102  */
    1103  bool Internal_SetBoolMember(
    1104  ON_DimStyle::field field_id,
    1105  bool value,
    1106  bool& class_member
    1107  );
    1108  /*
    1109  Returns:
    1110  true if value was changed.
    1111  */
    1112  bool Internal_SetUnsignedCharMember(
    1113  ON_DimStyle::field field_id,
    1114  unsigned char value,
    1115  unsigned char& class_member
    1116  );
    1117  /*
    1118  Returns:
    1119  true if value was changed.
    1120  */
    1121  bool Internal_SetIntMember(
    1122  ON_DimStyle::field field_id,
    1123  int value,
    1124  int& class_member
    1125  );
    1126  /*
    1127  Returns:
    1128  true if value was changed.
    1129  */
    1130  bool Internal_SetColorMember(
    1131  ON_DimStyle::field field_id,
    1132  ON_Color value,
    1133  ON_Color& class_member
    1134  );
    1135  /*
    1136  Returns:
    1137  true if value was changed.
    1138  */
    1139  bool Internal_SetDoubleMember(
    1140  ON_DimStyle::field field_id,
    1141  double value,
    1142  double& class_member
    1143  );
    1144  /*
    1145  Returns:
    1146  true if value was changed.
    1147  */
    1148  bool Internal_SetIdMember(
    1149  ON_DimStyle::field field_id,
    1150  ON_UUID value,
    1151  ON_UUID& class_member
    1152  );
    1153  /*
    1154  Returns:
    1155  true if value was changed.
    1156  */
    1157  bool Internal_SetStringMember(
    1158  ON_DimStyle::field field_id,
    1159  const wchar_t* value,
    1160  ON_wString& class_member
    1161  );
    1162 
    1163  void Internal_SetOverrideDimStyleCandidateFieldOverride(ON_DimStyle::field field_id);
    1164 
    1165 public:
    1166  // Extension line extension
    1167  double ExtExtension() const;
    1168  void SetExtExtension(const double);
    1169 
    1170  // Extension line offset
    1171  double ExtOffset() const;
    1172  void SetExtOffset(const double);
    1173 
    1174  // Arrow size
    1175  double ArrowSize() const;
    1176  void SetArrowSize(const double);
    1177 
    1178  // Arrow size
    1179  double LeaderArrowSize() const;
    1180  void SetLeaderArrowSize(const double);
    1181 
    1182  // Centermark size
    1183  double CenterMark() const;
    1184  void SetCenterMark(const double);
    1185 
    1186  // Centermark style
    1187  ON_DimStyle::centermark_style CenterMarkStyle() const;
    1188  void SetCenterMarkStyle(ON_DimStyle::centermark_style style);
    1189 
    1190  // The location of text relative to the dimension line in linear, angular, and ordinate dimensions.
    1191  ON_DimStyle::TextLocation DimTextLocation() const;
    1192  void SetDimTextLocation(ON_DimStyle::TextLocation);
    1193 
    1194  // The location of text relative to the dimension line in radial dimensions.
    1195  ON_DimStyle::TextLocation DimRadialTextLocation() const;
    1196  void SetDimRadialTextLocation(ON_DimStyle::TextLocation);
    1197 
    1198  angle_format AngleFormat() const;
    1199  void SetAngleFormat(angle_format format);
    1200 
    1201  // Display resolution for distance measurements
    1202  int LengthResolution() const;
    1203  void SetLengthResolution(int);
    1204 
    1205  // Display resolution for angle measurements
    1206  int AngleResolution() const;
    1207  void SetAngleResolution(int);
    1208 
    1209 public:
    1210  /*
    1211  Description:
    1212  Set the font used to render text.
    1213  Parameters:
    1214  font_characteristics - [in]
    1215  This parameter does not have to be a managed font.
    1216  Remarks:
    1217  If the parameter is a managed font (font_characteristics.IsManagedFont() is true),
    1218  then the identical value is returned by ON_DimStyle.Font().
    1219  If the parameter is not a managed font (font_characteristics.IsManagedFont() is false),
    1220  then the ON_Font::GetManagedFont(font_characteristics) will be returned by
    1221  ON_DimStyle.Font().
    1222  */
    1223  void SetFont(
    1224  const class ON_Font& font_characteristics
    1225  );
    1226 
    1227  /*
    1228  Returns:
    1229  The managed font used to render text.
    1230  */
    1231  const class ON_Font& Font() const;
    1232 
    1233  /*
    1234  Returns:
    1235  A copy of the font_characteristics information.
    1236  Remarks:
    1237  You probably want to use Font(). This function is only useful
    1238  in isolated situations and is typically used to study font
    1239  substitutions when a model moves between computers or platforms.
    1240  */
    1241  const class ON_Font& FontCharacteristics() const;
    1242 
    1243  /*
    1244  Returns:
    1245  True if the font returned by Font() is a substitute
    1246  for the font passed to SetFont().
    1247  Remarks:
    1248  Font substitution can occur when a model is moved between
    1249  computers that have different fonts installed.
    1250  */
    1251  const bool FontSubstituted() const;
    1252 
    1253 public:
    1254  /*
    1255  Description:
    1256  Two dimension styles have identical text orientation, glyph content,
    1257  and size parameters if and only if the have identical values of
    1258  TextPositionPropertiesHash().
    1259  Returns:
    1260  A SHA-1 hash of the information that controls text position and size.
    1261  Remarks:
    1262  Independent of id, parent id, name, and index.
    1263  */
    1264  const class ON_SHA1_Hash TextPositionPropertiesHash() const;
    1265 
    1266  /*
    1267  Description:
    1268  Two dimension styles have identical content if and only
    1269  if they have identical values of ContentHash().
    1270  Returns:
    1271  A SHA-1 hash of the information that controls annotation appearance.
    1272  Remarks:
    1273  Independent of id, parent id, name, and index.
    1274  */
    1275  const class ON_SHA1_Hash& ContentHash() const;
    1276 
    1277 private:
    1278  void Internal_TextPositionPropertiesChange();
    1279 
    1280 public:
    1281 
    1282  // Distance from dimension lines to text
    1283  double TextGap() const;
    1284  void SetTextGap(double gap);
    1285 
    1286  // Height of dimension text
    1287  double TextHeight() const;
    1288  void SetTextHeight(double height);
    1289 
    1290  /// <summary>
    1291  /// LengthFactor is a rarely used. It applies when a model is being
    1292  /// drawn to a scale and the dimension length values should be
    1293  /// reverse scaled. For example, if a model is drawn at 1/4 scale,
    1294  /// a line 5 units long indicates the real world line is 20 units
    1295  /// long. In this case setting LengthFactor to 4 would cause
    1296  /// a linear dimension applied to that line to display a value of 20.
    1297  ///</summary>
    1298  double LengthFactor() const;
    1299 
    1300  /// <summary>
    1301  /// LengthFactor is a rarely used. It applies when a model is being
    1302  /// drawn to a scale and the dimension length values should be
    1303  /// reverse scaled. For example, if a model is drawn at 1/4 scale,
    1304  /// a line 5 units long indicates the real world line is 20 units
    1305  /// long. In this case setting LengthFactor to 4 would cause
    1306  /// a linear dimension applied to that line to display a value of 20.
    1307  ///</summary>
    1308  void SetLengthFactor(double);
    1309 
    1310  // Additional measurement display toggle
    1311  bool Alternate() const;
    1312  void SetAlternate(bool);
    1313 
    1314  // Distance scale factor for alternate display
    1315  /// <summary>
    1316  /// AlternateLengthFactor is a rarely used. See Length factor for
    1317  /// a discription of this property.
    1318  ///</summary>
    1319  double AlternateLengthFactor() const;
    1320 
    1321  /// <summary>
    1322  /// AlternateLengthFactor is a rarely used. See Length factor for
    1323  /// a discription of this property.
    1324  ///</summary>
    1325  void SetAlternateLengthFactor(double);
    1326 
    1327  // Display resolution for alternate length measurements
    1328  int AlternateLengthResolution() const;
    1329  void SetAlternateLengthResolution(int);
    1330 
    1331  // Dimension prefix text
    1332  const ON_wString& Prefix() const;
    1333  void SetPrefix(const wchar_t*);
    1334 
    1335  // Dimension suffix text
    1336  const ON_wString& Suffix() const;
    1337  void SetSuffix(const wchar_t*);
    1338 
    1339  // Dimension alternate prefix text
    1340  const ON_wString& AlternatePrefix() const;
    1341  void SetAlternatePrefix(const wchar_t*);
    1342 
    1343  // Dimension alternate suffix text
    1344  const ON_wString& AlternateSuffix() const;
    1345  void SetAlternateSuffix(const wchar_t*);
    1346 
    1347  // Suppress first dimension extension line
    1348  bool SuppressExtension1() const;
    1349  void SetSuppressExtension1(bool);
    1350 
    1351  // Suppress second dimension extension line
    1352  bool SuppressExtension2() const;
    1353  void SetSuppressExtension2(bool);
    1354 
    1355  // Extension of dimension line past extension lines
    1356  double DimExtension() const;
    1357  void SetDimExtension(const double e);
    1358 
    1359 
    1360  //// Colors of Text
    1361  //ON_Color TextColor() const;
    1362  //void SetTextColor(ON_Color color);
    1363  //
    1364  // Combines a field id and a field value
    1365  // Dimensions will have an array of DimstyleField's to record
    1366  // dimension style overrides for individual dimensions
    1368  {
    1369  public:
    1371  : m_next(nullptr)
    1372  , m_field_id(ON_DimStyle::field::Unset)
    1373  {
    1374  m_val.s_val = nullptr;
    1375  }
    1377  {
    1378  if (nullptr != m_next)
    1379  {
    1380  delete m_next;
    1381  m_next = nullptr;
    1382  }
    1383  if (nullptr != m_val.s_val)
    1384  {
    1385  delete m_val.s_val;
    1386  m_val.s_val = nullptr;
    1387  }
    1388  }
    1389 
    1392  union
    1393  {
    1394  bool b_val;
    1395  int i_val;
    1396  unsigned char uc_val;
    1397  double d_val;
    1398  unsigned int c_val;
    1400  } m_val;
    1401  };
    1402 
    1403  /*
    1404  Parameters:
    1405  field_id - [in]
    1406  Returns:
    1407  false: (default)
    1408  The setting identified by field_id is inherited from the parent dimension style identified by ParentId().
    1409  true:
    1410  The setting identified by field_id is independet of any parent dimension style.
    1411  */
    1412  bool IsFieldOverride(ON_DimStyle::field field_id) const;
    1413 
    1414  /*
    1415  Parameters:
    1416  field_id - [in]
    1417  bOverrideParent - [in]
    1418  false:
    1419  The setting identified by field_id is inherited from the parent dimension style identified by ParentId().
    1420  true:
    1421  The setting identified by field_id is independent of any parent dimension style.
    1422  */
    1423  void SetFieldOverride(ON_DimStyle::field field_id, bool bOverrideParent);
    1424 
    1425  /*
    1426  Parameters:
    1427  bOverrideParent - [in]
    1428  true - if a field permits overriding, set it to true.
    1429  false - set all field override values to false.
    1430  */
    1431  void SetFieldOverrideAll(bool bOverrideParent);
    1432 
    1433  /*
    1434  Description:
    1435  All dimension style settings identified the ON_DimStyle::field enum,
    1436  except Name and Id, are inherited from the parent dimension style.
    1437  */
    1438  void ClearAllFieldOverrides();
    1439 
    1440  /*
    1441  Returns:
    1442  false: (default)
    1443  Every setting identified by a ON_DimStyle::field enum value, except name and id,
    1444  is inherited from the parent dimension style identified by ParentId().
    1445  true:
    1446  At least one setting identified by a ON_DimStyle::field enum value is
    1447  is independent of any parent dimension style.
    1448  */
    1449  bool HasOverrides() const;
    1450 
    1451  /*
    1452  Returns:
    1453  The content hash of the parent dimstyle. If there is no parent dimstyle, then
    1454  ON_SHA1_Hash::EmptyContent is returned.
    1455  */
    1456  const ON_SHA1_Hash& ParentContentHash() const;
    1457 
    1458  /*
    1459  Description:
    1460  Create a dimstyle from this that is configured to be customized for use
    1461  in creating a new annotation object.
    1462  Example:
    1463  ON_DimStyleContext = dim_style_context = ...;
    1464  ON_DimStyle my_dim_style = dim_style_context.CurrentDimStyle().CreateOverrideCandidate().
    1465  // Customize my_dim_style
    1466  my_dim_style.Set...(...);
    1467  Returns:
    1468  An ON_DimStyle configured to be modified and used as an override dimstyle for annotation objects.
    1469  */
    1470  const ON_DimStyle CreateOverrideCandidate() const;
    1471 
    1472  /*
    1473  Description:
    1474  Get an ON_DimStyle with the specified properties.
    1475  Parameters:
    1476  parent_dim_style - [in]
    1477  If you are getting ready to modify and existing annotation object,
    1478  a good options for this paramter is the dimstyle returned by ON_Annotation.DimStyle();
    1479  If you are getting ready to create a new annotation object, then get
    1480  an ON_DimStyleContext class and pass ON_DimStyleContext.CurrentDimStyle().
    1481  In Rhino, use CRhinoDoc.DimStyleContext() to get an ON_DimStyleContext.
    1482  In an ONX_Model, use ONX_Model.DimStyleContext() to get an ON_DimStyleContext.
    1483  In other situations, you can pass on of the system dimstyles like
    1484  ON_DimStyle::DefaultMillimeterSmall or ON_DimStyle::DefaultMillimeterArchitecture.
    1485  The worst possible choices are ON_DimStyle::Default or ON_DimStyle::Unset.
    1486  annotation_type - [in]
    1487  ON::AnnotationType::Unset if style will be used for multiple types of annotation
    1488  or a specific type. For example, if you are making a text object, pass ON::AnnotationType::Text;
    1489  if you are making a leader, pass ON::AnnotationType::Leader, and so on.
    1490  font - [in]
    1491  nullptr for current default or specify the font you want.
    1492  When in doubt, pass nullptr
    1493  model_space_text_scale - [in]
    1494  If > 0, then ON_DimStyle.DimScale() is set, otherwise current default is used.
    1495  When in doubt, pass ON_UNSET_VALUE.
    1496  text_height - [in]
    1497  text_height_unit_system - [in]
    1498  If text_height > 0, then ON_DimStyle.TextHeight() is set, otherwise current default is used.
    1499  When in doubt, pass ON_UNSET_VALUE.
    1500  valign - [in]
    1501  halign - [in]
    1502  valign and halign control placement of text in text objects and leaders.
    1503  The value of the annotation_type parameter determines which objects use the
    1504  valign and halign settings.
    1505  text_orientation - [in]
    1506  dim_text_location - [in]
    1507  Controls placement of text in linear, angular, radial and ordinate dimensions.
    1508  When in doubt, pass parent_dim_style.DimTextLocation().
    1509  Returns:
    1510  A dimstyle with the specified text properties.
    1511  Remarks:
    1512  This is a useful tool for creating the dimension style parameters to
    1513  CRhinoDoc.AddTextObject() and CRhinoDoc.AddLeaderObject().
    1514  */
    1515  static const ON_DimStyle CreateFromProperties(
    1516  const ON_DimStyle& parent_dim_style,
    1517  ON::AnnotationType annotation_type,
    1518  const ON_Font* font,
    1519  double model_space_text_scale,
    1520  double text_height,
    1521  ON::LengthUnitSystem text_height_unit_system,
    1522  ON::TextVerticalAlignment valign,
    1523  ON::TextHorizontalAlignment halign
    1524  );
    1525 
    1526  static const ON_DimStyle CreateFromProperties(
    1527  const ON_DimStyle& parent_dim_style,
    1528  ON::AnnotationType annotation_type,
    1529  const ON_Font* font,
    1530  double model_space_text_scale,
    1531  double text_height,
    1532  ON::LengthUnitSystem text_height_unit_system,
    1533  ON::TextVerticalAlignment valign,
    1534  ON::TextHorizontalAlignment halign,
    1535  ON::TextOrientation orientation,
    1536  ON_DimStyle::TextLocation dim_text_location
    1537  );
    1538 
    1539  static const ON_DimStyle CreateFromProperties(
    1540  const ON_DimStyle& parent_dim_style,
    1541  ON::AnnotationType annotation_type,
    1542  const ON_Font* font,
    1543  double model_space_text_scale,
    1544  double text_height,
    1545  ON::LengthUnitSystem text_height_unit_system
    1546  );
    1547 
    1548 private:
    1549  static void Internal_CreateFromProperties(
    1550  const ON_DimStyle& parent_dim_style,
    1551  ON::AnnotationType annotation_type,
    1552  const ON_Font* font,
    1553  double model_space_text_scale,
    1554  double text_height,
    1555  ON::LengthUnitSystem text_height_unit_system,
    1556  bool bSetAlignment,
    1557  ON::TextVerticalAlignment valign,
    1558  ON::TextHorizontalAlignment halign,
    1559  bool bSetOrientation,
    1560  ON::TextOrientation orientation,
    1561  bool bSetLocation,
    1562  ON_DimStyle::TextLocation dim_text_location,
    1563  ON_DimStyle& destination
    1564  );
    1565 public:
    1566 
    1567  /*
    1568 
    1569  */
    1570  bool IsOverrideDimStyleCandidate(
    1571  ON_UUID parent_id,
    1572  bool bRequireSetOverrides,
    1573  ON_wString* error_description = nullptr
    1574  ) const;
    1575 
    1576 
    1577  /*
    1578  Description:
    1579  For every dimension style property identified by a field_id ON_DimStyle::field enum,
    1580  except Name and Index, do the following:
    1581 
    1582  if ( source.IsFieldOverride(field_id) )
    1583  copy corresponding value from source to this
    1584  else
    1585  copy corresponding value from parent to this
    1586 
    1587  Set this->ParentId() = parent.Id().
    1588  Parameters:
    1589  src - [in]
    1590  It is permitted for src to be this.
    1591  parent - [in]
    1592  It is permitted for parent to be this.
    1593  */
    1594  void OverrideFields(
    1595  const ON_DimStyle& source,
    1596  const ON_DimStyle& parent
    1597  );
    1598 
    1599  /*
    1600  Description:
    1601  For every dimension style property identified by a field_id ON_DimStyle::field enum,
    1602  except Name and Index, if source and parent have different values, then
    1603  set the field overide for that property to true.
    1604  Parameters:
    1605  src - [in]
    1606  It is permitted for src to be this.
    1607  parent - [in]
    1608  It is permitted for parent to be this.
    1609  */
    1610  void OverrideFieldsWithDifferentValues(
    1611  const ON_DimStyle& source,
    1612  const ON_DimStyle& parent
    1613  );
    1614 
    1615  /*
    1616  Descripton:
    1617  Set the parent dimension style id to parent.Id() and copies
    1618  all inherited appearance properties from parent.
    1619  Parameters:
    1620  parent - [in]
    1621  If this->IsFieldOverride(field_id) is false, then the dimension style
    1622  property value corresponding to field_id is copied from parent to "this".
    1623  Remarks:
    1624  Identical to calling this->OverrideFields(*this,parent).
    1625  */
    1626  void InheritFields(const ON_DimStyle& parent);
    1627 
    1628  // Test if this dimstyle is the child of any other dimstyle
    1629  bool IsChildDimstyle() const;
    1630 
    1631  /*
    1632  Returns:
    1633  True if parent_id is not nil and parent_id == this->ParentId().
    1634  */
    1635  bool IsChildOf(const ON_UUID& parent_id) const;
    1636 
    1637  tolerance_format ToleranceFormat() const;
    1638  int ToleranceResolution() const;
    1639  double ToleranceUpperValue() const;
    1640  double ToleranceLowerValue() const;
    1641  double ToleranceHeightScale() const;
    1642 
    1643  void SetToleranceFormat(ON_DimStyle::tolerance_format format);
    1644  void SetToleranceResolution(int resolution);
    1645  void SetToleranceUpperValue(double upper_value);
    1646  void SetToleranceLowerValue(double lower_value);
    1647  void SetToleranceHeightScale(double scale);
    1648 
    1649  double BaselineSpacing() const;
    1650  void SetBaselineSpacing(double spacing);
    1651 
    1652  // Determines whether or not to draw a Text Mask
    1653  bool DrawTextMask() const;
    1654  void SetDrawTextMask(bool bDraw);
    1655 
    1656  // Determines where to get the color to draw a Text Mask
    1657  ON_TextMask::MaskType MaskFillType() const;
    1658  void SetMaskFillType(ON_TextMask::MaskType source);
    1659 
    1660  ON_Color MaskColor() const; // Only works right if MaskColorSource returns 1.
    1661  // Does not return viewport background color
    1662  void SetMaskColor(ON_Color color);
    1663 
    1664  // Offset for the border around text to the rectangle used to draw the mask
    1665  // This number is the offset on each side of the tight rectangle around the
    1666  // text characters to the mask rectangle.
    1667  double MaskBorder() const;
    1668  void SetMaskBorder(double offset);
    1669 
    1670  // The ON_TextMask class contains the property values for
    1671  // DrawTextMask()
    1672  // MaskColor()
    1673  // MaskFillType()
    1674  // MaskBorder()
    1675  // Use the
    1676  // SetDrawTextMask()
    1677  // SetMaskColor()
    1678  // SetMaskFillType()
    1679  // SetMaskBorder()
    1680  // functions to modify text mask properties.
    1681  const ON_TextMask& TextMask() const;
    1682  void SetTextMask(const ON_TextMask& text_mask);
    1683 
    1684 private:
    1685  void Internal_SetTextMask(
    1686  const ON_TextMask& text_mask
    1687  );
    1688 public:
    1689 
    1690  void Scale(double scale);
    1691 
    1692  // UUID of the dimstyle this was originally copied from
    1693  // so Restore Defaults has some place to look
    1694  void SetSourceDimstyle(ON_UUID source_uuid);
    1695  ON_UUID SourceDimstyle() const;
    1696 
    1697  void SetExtensionLineColorSource(const ON::object_color_source src);
    1698  ON::object_color_source ExtensionLineColorSource() const;
    1699  void SetDimensionLineColorSource(const ON::object_color_source src);
    1700  ON::object_color_source DimensionLineColorSource() const;
    1701  void SetArrowColorSource(const ON::object_color_source src);
    1702  ON::object_color_source ArrowColorSource() const;
    1703  void SetTextColorSource(const ON::object_color_source src);
    1704  ON::object_color_source TextColorSource() const;
    1705  void SetExtensionLineColor(ON_Color c);
    1706  ON_Color ExtensionLineColor() const;
    1707  void SetDimensionLineColor(ON_Color c);
    1708  ON_Color DimensionLineColor() const;
    1709  void SetArrowColor(ON_Color c);
    1710  ON_Color ArrowColor() const;
    1711  void SetTextColor(ON_Color c);
    1712  ON_Color TextColor() const;
    1713 
    1714  void SetExtensionLinePlotColorSource(const ON::plot_color_source src);
    1715  ON::plot_color_source ExtensionLinePlotColorSource() const;
    1716  void SetDimensionLinePlotColorSource(const ON::plot_color_source src);
    1717  ON::plot_color_source DimensionLinePlotColorSource() const;
    1718  void SetArrowPlotColorSource(const ON::plot_color_source src);
    1719  ON::plot_color_source ArrowPlotColorSource() const;
    1720  void SetTextPlotColorSource(const ON::object_color_source src);
    1721  ON::object_color_source TextPlotColorSource() const;
    1722  void SetExtensionLinePlotColor(ON_Color c);
    1723  ON_Color ExtensionLinePlotColor() const;
    1724  void SetDimensionLinePlotColor(ON_Color c);
    1725  ON_Color DimensionLinePlotColor() const;
    1726  void SetArrowPlotColor(ON_Color c);
    1727  ON_Color ArrowPlotColor() const;
    1728  void SetTextPlotColor(ON_Color c);
    1729  ON_Color TextPlotColor() const;
    1730 
    1731  void SetExtensionLinePlotWeightSource(const ON::plot_weight_source src);
    1732  ON::plot_weight_source ExtensionLinePlotWeightSource() const;
    1733  void SetDimensionLinePlotWeightSource(const ON::plot_weight_source src);
    1734  ON::plot_weight_source DimensionLinePlotWeightSource() const;
    1735  void SetExtensionLinePlotWeight(double w);
    1736  double ExtensionLinePlotWeight() const;
    1737  void SetDimensionLinePlotWeight(double w);
    1738  double DimensionLinePlotWeight() const;
    1739 
    1740  void SetFixedExtensionLen(double l);
    1741  double FixedExtensionLen() const;
    1742  void SetFixedExtensionLenOn(bool on);
    1743  bool FixedExtensionLenOn() const;
    1744 
    1745  void SetTextRotation(double r);
    1746  double TextRotation() const;
    1747 
    1748  void SetAlternateToleranceResolution(int r);
    1749  int AlternateToleranceResolution() const;
    1750 
    1751  void SetSuppressArrow1(bool s);
    1752  bool SuppressArrow1() const;
    1753  void SetSuppressArrow2(bool s);
    1754  bool SuppressArrow2() const;
    1755  void SetTextMoveLeader(int m);
    1756 
    1757  int TextMoveLeader() const;
    1758  void SetArcLengthSymbol(int m);
    1759  int ArcLengthSymbol() const;
    1760 
    1761  void SetStackFractionFormat(ON_DimStyle::stack_format f);
    1762  ON_DimStyle::stack_format StackFractionFormat() const;
    1763  void SetStackHeightScale(double f);
    1764  double StackHeightScale() const;
    1765 
    1766  void SetRoundOff(double r);
    1767  double RoundOff() const;
    1768  void SetAlternateRoundOff(double r);
    1769  double AlternateRoundOff() const;
    1770  void SetAngleRoundOff(double r);
    1771  double AngleRoundOff() const;
    1772  void SetZeroSuppress(ON_DimStyle::suppress_zero s);
    1773  ON_DimStyle::suppress_zero ZeroSuppress() const;
    1774  void SetAlternateZeroSuppress(ON_DimStyle::suppress_zero s);
    1775  ON_DimStyle::suppress_zero AlternateZeroSuppress() const;
    1776 
    1777  // OBSOLETE - The ZeroSuppress() or AlternateZeroSuppress() property
    1778  // is used to format tolerance display. ToleranceZeroSuppress() is ignored.
    1779  void SetToleranceZeroSuppress(ON_DimStyle::suppress_zero s);
    1780 
    1781  // OBSOLETE - The ZeroSuppress() or AlternateZeroSuppress() property
    1782  // is used to format tolerance display. ToleranceZeroSuppress() is ignored.
    1783  ON_DimStyle::suppress_zero ToleranceZeroSuppress() const;
    1784 
    1785  void SetAngleZeroSuppress(ON_DimStyle::suppress_zero s);
    1786  ON_DimStyle::suppress_zero AngleZeroSuppress() const;
    1787  void SetAlternateBelow(bool below);
    1788 
    1789  /*
    1790  Description:
    1791  The valid choices for ON_DimStyle::suppress_zero depend on
    1792  the dimension length display.
    1793  Parameters:
    1794  zero_suppress - [in]
    1795  length_display - [in]
    1796  Returns:
    1797  True if zero_suppression is a valid setting when
    1798  DimensionLengthDiplay = dimension_length_display
    1799  Remarks:
    1800  LengthDisplay: Inch fractional – No zero suppression matches
    1801  LengthDisplay : FeetAndInches – Zero suppress can be
    1802  None,
    1803  Suppress zero feet,
    1804  Suppress zero inches or
    1805  Suppress zero feet and zero inches.
    1806  LengthDisplay : ModelUnits or any Decimal mode – Zero suppress can be
    1807  None,
    1808  Suppress leading,
    1809  Suppress trailing or
    1810  Suppress leading and trailing.
    1811  */
    1812  static bool ZeroSuppressMatchesLengthDisplay(
    1813  ON_DimStyle::suppress_zero zero_suppress,
    1814  ON_DimStyle::LengthDisplay length_display);
    1815 
    1816  bool AlternateBelow() const;
    1817 
    1818  ON_Arrowhead::arrow_type ArrowType1() const;
    1819  void SetArrowType1(ON_Arrowhead::arrow_type);
    1820  ON_Arrowhead::arrow_type ArrowType2() const;
    1821  void SetArrowType2(ON_Arrowhead::arrow_type);
    1822  void SetArrowType1And2(ON_Arrowhead::arrow_type);
    1823  ON_Arrowhead::arrow_type LeaderArrowType() const;
    1824  void SetLeaderArrowType(ON_Arrowhead::arrow_type);
    1825 
    1826  void SetArrowBlockId1(ON_UUID id);
    1827  ON_UUID ArrowBlockId1() const;
    1828  void SetArrowBlockId2(ON_UUID id);
    1829  ON_UUID ArrowBlockId2() const;
    1830  void SetLeaderArrowBlockId(ON_UUID id);
    1831  ON_UUID LeaderArrowBlockId() const;
    1832 
    1833  ON::TextVerticalAlignment TextVerticalAlignment() const;
    1834  void SetTextVerticalAlignment(ON::TextVerticalAlignment style);
    1835  ON::TextVerticalAlignment LeaderTextVerticalAlignment() const; // was attachstyle
    1836  void SetLeaderTextVerticalAlignment(ON::TextVerticalAlignment style);
    1837  ON_DimStyle::ContentAngleStyle LeaderContentAngleStyle() const; // was contentalignment
    1838  void SetLeaderContentAngleStyle(ON_DimStyle::ContentAngleStyle style);
    1839  ON_DimStyle::leader_curve_type LeaderCurveType() const;
    1840  void SetLeaderCurveType(ON_DimStyle::leader_curve_type type);
    1841  bool LeaderHasLanding() const;
    1842  void SetLeaderHasLanding(bool landing);
    1843  double LeaderLandingLength() const;
    1844  void SetLeaderLandingLength(double length);
    1845  double LeaderContentAngleRadians() const;
    1846  void SetLeaderContentAngleRadians(double angle_radians);
    1847  double LeaderContentAngleDegrees() const;
    1848  void SetLeaderContentAngleDegrees(double angle_degrees);
    1849  ON::TextHorizontalAlignment TextHorizontalAlignment() const;
    1850  void SetTextHorizontalAlignment(ON::TextHorizontalAlignment halign);
    1851  ON::TextHorizontalAlignment LeaderTextHorizontalAlignment() const;
    1852  void SetLeaderTextHorizontalAlignment(ON::TextHorizontalAlignment halign);
    1853  bool DrawForward() const;
    1854  void SetDrawForward(bool drawforward);
    1855  bool SignedOrdinate() const;
    1856  void SetSignedOrdinate(bool allowsigned);
    1857 
    1858  /// <summary>
    1859  /// Unit system for dimension rendering sizes like TextHeight, TextGap, ArrowSize, ExtOffset,
    1860  /// and dozens of other properties that control the appearance and placement of the components
    1861  /// used to render a dimension.
    1862  ///</summary>
    1863  ON::LengthUnitSystem UnitSystem() const;
    1864 
    1865  /// <summary>
    1866  /// Unit system for dimension rendering sizes like TextHeight, TextGap, ArrowSize, ExtOffset,
    1867  /// and dozens of other properties that control the appearance and placement of the components
    1868  /// used to render a dimension.
    1869  ///</summary>
    1870  void SetUnitSystem(ON::LengthUnitSystem us);
    1871 
    1872  /*
    1873  Description:
    1874  When a dimension style unit system is not set,
    1875  this function examines the context the dimension style is
    1876  being used in and sets the unit system.
    1877  Parameters:
    1878  bUseName - [in]
    1879  Consider the name when assinging a unit system.
    1880  For example, a dimension style name "Millimters Small" would
    1881  be assinged a unit system of millimeters.
    1882  source_unit_system - [in]
    1883  unit system in the model or file where the dimension
    1884  style originated.
    1885  destination_unit_system - [in]
    1886  unit system in the model or file where the dimension
    1887  style will be used.
    1888  */
    1889  void SetUnitSystemFromContext(
    1890  bool bUseName,
    1891  ON::LengthUnitSystem source_unit_system,
    1892  ON::LengthUnitSystem destination_unit_system
    1893  );
    1894 
    1895  /*
    1896  Returns:
    1897  true if the unit system is set to an explicit valid length unit.
    1898  */
    1899  bool UnitSystemIsSet() const;
    1900 
    1901  const ON_ScaleValue& ScaleValue() const;
    1902  void SetDimScale(ON_ScaleValue sv);
    1903  void SetDimScale(double left_val, ON::LengthUnitSystem left_us, double right_val, ON::LengthUnitSystem right_us);
    1904 
    1905  double ScaleLeftLength_mm() const;
    1906  double ScaleRightLength_mm() const;
    1907 
    1908  void SetDimScale(double scale);
    1909  double DimScale() const;
    1910 
    1911  void SetDimScaleSource(int source);
    1912  int DimScaleSource() const; // 0: Global DimScale, 1: DimStyle DimScale
    1913 
    1914  void SetTextOrientation(ON::TextOrientation);
    1915  ON::TextOrientation TextOrientation() const;
    1916 
    1917  void SetLeaderTextOrientation(ON::TextOrientation);
    1918  ON::TextOrientation LeaderTextOrientation() const;
    1919 
    1920  void SetDimTextOrientation(ON::TextOrientation);
    1921  ON::TextOrientation DimTextOrientation() const;
    1922 
    1923  void SetDimRadialTextOrientation(ON::TextOrientation);
    1924  ON::TextOrientation DimRadialTextOrientation() const;
    1925 
    1926  ON_DimStyle::ContentAngleStyle DimTextAngleStyle() const;
    1927  void SetDimTextAngleStyle(ON_DimStyle::ContentAngleStyle style);
    1928 
    1929  ON_DimStyle::ContentAngleStyle DimRadialTextAngleStyle() const;
    1930  void SetDimRadialTextAngleStyle(ON_DimStyle::ContentAngleStyle style);
    1931 
    1932  bool TextUnderlined() const;
    1933  void SetTextUnderlined(bool underlined);
    1934 
    1935  //double ModelSize() const;
    1936  //void SetModelSize(double size);
    1937  //double PaperSize() const;
    1938  //void SetPaperSize(double size);
    1939 
    1940  // For converting to and from V5 Dimstyles
    1941  static int V5ArrowType(ON_Arrowhead::arrow_type v6type);
    1942  static int V5LengthFormat(ON_DimStyle::OBSOLETE_length_format v6format);
    1943  static int V5AngleFormat(ON_DimStyle::angle_format v6format);
    1944  static int V5ToleranceFormat(ON_DimStyle::tolerance_format v6format);
    1945  static int V5MaskColorSourceFromV6MaskType(ON_TextMask::MaskType mask_type);
    1946  static ON_Arrowhead::arrow_type V6ArrowType(int v5type);
    1947  static ON_DimStyle::OBSOLETE_length_format V6LengthFormat(int v5format);
    1948  static ON_DimStyle::angle_format V6AngleFormat(int v5format);
    1949  static ON_DimStyle::tolerance_format V6ToleranceFormat(int v5format);
    1950  static ON_TextMask::MaskType V6MaskTypeFromV5MaskColorSource(int v5_mask_color_source);
    1951 
    1952 private:
    1953  double m_extextension = 0.5; // extension line extension
    1954  double m_extoffset = 0.5; // extension line offset
    1955  double m_arrowsize = 1.0; // length of an arrow - may mean different things to different arrows
    1956  double m_leaderarrowsize = 1.0; // length of an arrow for leader style dimensions
    1957  double m_centermark = 0.5; // size of the + at circle centers
    1958  ON_DimStyle::centermark_style m_centermark_style = ON_DimStyle::centermark_style::Mark; // Display style for centermarks
    1959  double m_textgap = 0.25; // gap around the text for clipping dim line
    1960  double m_textheight = 1.0; // model unit height of dimension text before applying dimscale
    1961 
    1962  //ON::OBSOLETE_V5_TextDisplayMode m_REMOVE_ME_dimstyle_textalign = ON::OBSOLETE_V5_TextDisplayMode::kAboveLine;
    1965 
    1967  int m_angleresolution = 2; // for decimal degrees, digits past decimal
    1968 
    1969  /// <summary>
    1970  /// The DimensionLengthDisplay is property controls the unit system and format
    1971  /// of for display of lengths in dimensions. For more information, see the
    1972  /// descriptions of the ON_DimStyle::LengthDisplay enum values.
    1973  ///</summary>
    1975 
    1976  /// <summary>
    1977  /// Alternate DimensionLengthDisplay property.
    1978  /// See the description of m_dimension_length_display for more information about this property.
    1979  ///</summary>
    1980  ON_DimStyle::LengthDisplay m_alternate_dimension_length_display = ON_DimStyle::LengthDisplay::ModelUnits;
    1981 
    1982  /// <summary>
    1983  /// The LengthResolution property controls the precision of dimension length display.
    1984  ///
    1985  /// DECIMAL LENGHT DISPLAY:
    1986  /// If m_dimension_length_display is any of the ON_DimStyle::LengthDisplay decimal formats,
    1987  /// then m_lengthresolution is the number of digits after the decimal point.
    1988  /// For example, if m_lengthresolution is 2, then dimension length display will be n.ff
    1989  /// If m_lengthresolution=7, then dimension length display will be n.fffffff.
    1990  ///
    1991  /// FRACTONAL LENGHT DISPLAY:
    1992  /// If m_dimension_length_display is ON_DimStyle::LengthDisplay::InchesFractional or
    1993  /// ON_DimStyle::LengthDisplay::FeetAndInches, then fractional length display is used.
    1994  /// In this case any fractional part will be rouded to the closest multiple
    1995  /// of 1/(2^m_alternate_lengthresolution).
    1996  /// Examples: If fractional length display is used and m_lengthresolution=2,
    1997  // then the possible fractions are 1/4, 1/2(=2/4), 3/4.
    1998  /// If fractional length display is used and m_lengthresolution=7,
    1999  // then any fractional part is rounded to the closest multipl of 1/128 (128=2^7).
    2000  /// </summary>
    2001  int m_lengthresolution = 2;
    2002 
    2003  /// <summary>
    2004  /// Alternate LengthResolution property.
    2005  /// See the description of m_lengthresolution for more information about this property.
    2006  ///</summary>
    2007  int m_alternate_lengthresolution = 2;
    2008 
    2009  /// <summary>
    2010  /// The LengthFactor is property a rarely used. It applies when a model is being
    2011  /// drawn to a scale and the dimension length values should be
    2012  /// reverse scaled. For example, if a model is drawn at 1/4 scale,
    2013  /// a line 5 units long indicates the real world line is 20 units
    2014  /// long. In this case setting LengthFactor to 4 would cause
    2015  /// a linear dimension applied to that line to display a value of 20.
    2016  /// Use the DimensionLengthDisplay property to control length unit system scaling.
    2017  ///</summary>
    2018  double m_lengthfactor = 1.0; // (dimlfac) model units multiplier for length display
    2019 
    2020  /// <summary>
    2021  /// Alternate LengthFactor property.
    2022  /// See the description of m_lengthfactor for more information about this property.
    2023  ///</summary>
    2024  double m_alternate_lengthfactor = 1.0; // (dimaltf) model units multiplier for alternate length display
    2025 
    2026 
    2027 private:
    2028  // A copy of the font_characteristics passed to SetFont.
    2029  // This information is saved in 3dm archives.
    2030  ON_Font m_font_characteristics = ON_Font::Default;
    2031 
    2032  // The managed font returned by ON_Font::GetManagedFont(m_font).
    2033  // This is the value returned by ON_DimStyle.Font().
    2034  const ON_Font* m_managed_font = &ON_Font::Default;
    2035 
    2036 private:
    2037  // all dim style content
    2038  mutable ON_SHA1_Hash m_content_hash = ON_SHA1_Hash::EmptyContentHash;
    2039 
    2040  // text position properties content
    2041  mutable ON_SHA1_Hash m_text_position_properties_hash = ON_SHA1_Hash::EmptyContentHash;
    2042 
    2043  mutable ON_SHA1_Hash m_reserved_hash2 = ON_SHA1_Hash::EmptyContentHash;
    2044 
    2045  // parent dim style content
    2046  // All code should use ParentContentHash() to inspect this value.
    2047  // Is is set by OverrideFields(). It may be cleared by a call to ParentContentHash().
    2048  mutable ON_SHA1_Hash m_parent_dim_style_content_hash = ON_SHA1_Hash::EmptyContentHash;
    2049 
    2050 private:
    2051 
    2052 
    2053  bool m_bAlternate = false; // (dimalt) display alternate dimension string (or not)
    2054 
    2055 
    2056  ON_wString m_prefix; // string preceding dimension value string
    2057  ON_wString m_suffix; // string following dimension value string
    2058  ON_wString m_alternate_prefix; // string preceding alternate value string (Default = " [")
    2059  ON_wString m_alternate_suffix; // string following alternate value string (Default = "]")
    2060 
    2061  double m_dimextension = 0.0; // (dimdle) dimension line extension past the "tip" location
    2062 
    2063  bool m_bSuppressExtension1 = false; // flag to not draw extension lines
    2064  bool m_bSuppressExtension2 = false; // flag to not draw extension lines
    2065  bool m_bReserved1 = false;
    2066  bool m_bReserved2 = false;
    2067 
    2068  // m_field_override_count
    2069  // number of ON_DimStyle::field settings that are independent of the parent dimension style.
    2070  // (not inherited from)
    2071  // A value of 0 indicates every possible setting is inherited from the parent dimension style.
    2072  // A value > 0 indicates at least one setting is independent of the parent dimension style.
    2073  ON__UINT32 m_field_override_parent_count = 0;
    2074 
    2075  // m_field_override_bitsN (Up to 128 true/false) values.
    2076  // Each ON_DimStyle::field enum value > ON_DimStyle::field::Unset and < ON_DimStyle::field::Count
    2077  // has a corresponding bit in on of the m_field_override_bitsN values.
    2078  // When the bit is clear (0), the corresponding override parent setting value = false and
    2079  // that setting is inheritied from the parent dimension style. 0 is the default setting.
    2080  // When the bit is set (1), the corresponding override parent setting value = true and
    2081  // that setting is independent of the parent dimension style.
    2082  ON__UINT32 m_field_override_parent_bits0 = 0;
    2083  ON__UINT32 m_field_override_parent_bits1 = 0;
    2084  ON__UINT32 m_field_override_parent_bits2 = 0;
    2085  ON__UINT32 m_field_override_parent_bits3 = 0;
    2086  // Please do not replace this bitfield with an array of bools.
    2087  // Using bools approach will change the size of this class when additional dimension style
    2088  // settings are added and makes construction code more complicated.
    2089 
    2090 
    2091  /*
    2092  Parameters:
    2093  mask - [out]
    2094  0: field_id is not valid
    2095  (Unset, Name, Index, >= Count)
    2096  Name and Index settings cannot be inherited from the parent dimension style
    2097  not 0:
    2098  mask identifies the bit in the
    2099  mask - [out]
    2100  0: field_id is not valid
    2101  (Unset, Name, Index, >= Count)
    2102  Name and Index settings cannot be inherited from the parent dimension style
    2103  not 0:
    2104  mask identifies the bit in the
    2105  Returns:
    2106  nullptr:
    2107  field_id is not valid
    2108  (Unset, Name, Index, >= Count)
    2109  Name and Index settings cannot be inherited from the parent dimension style.
    2110  not nullptr:
    2111  Address of the m_field_override_bitsN member that mask applies to.
    2112  */
    2113  ON__UINT32* Internal_GetOverrideParentBit(ON_DimStyle::field field_id, ON__UINT32* mask) const;
    2114 
    2116  int m_tolerance_resolution = 4;
    2117  double m_tolerance_upper_value = 0.0; // or both upper and lower in symmetrical style
    2118  double m_tolerance_lower_value = 0.0;
    2119  double m_tolerance_height_scale = 0.7; // relative to the main dimension text
    2120 
    2121  double m_baseline_spacing = 3.0;
    2122 
    2123  ON_TextMask m_text_mask = ON_TextMask::None;
    2124 
    2125  // m_dimscale replaced by m_scale_value.RightToLeftScale()
    2126  //double m_dimscale = 1.0;
    2127  int m_dimscale_source = 0;
    2128 
    2129  // Uuid of source dimstyle to restore defaults
    2130  ON_UUID m_source_dimstyle = ON_nil_uuid;
    2131 
    2132  // Sub-object draw colors
    2133  unsigned char m_ext_line_color_source = 0;
    2134  unsigned char m_dim_line_color_source = 0;
    2135  unsigned char m_arrow_color_source = 0;
    2136  unsigned char m_text_color_source = 0;
    2137  ON_Color m_ext_line_color = ON_Color::Black;
    2138  ON_Color m_dim_line_color = ON_Color::Black;
    2139  ON_Color m_arrow_color = ON_Color::Black;
    2140  ON_Color m_text_color = ON_Color::Black;
    2141  unsigned char m_ext_line_plot_color_source = 0;
    2142  unsigned char m_dim_line_plot_color_source = 0;
    2143  unsigned char m_arrow_plot_color_source = 0;
    2144  unsigned char m_text_plot_color_source = 0;
    2145  ON_Color m_ext_line_plot_color = ON_Color::Black;
    2146  ON_Color m_dim_line_plot_color = ON_Color::Black;
    2147  ON_Color m_arrow_plot_color = ON_Color::Black;
    2148  ON_Color m_text_plot_color = ON_Color::Black;
    2149  unsigned char m_ext_line_plot_weight_source = 0;
    2150  unsigned char m_dim_line_plot_weight_source = 0;
    2151  double m_ext_line_plot_weight_mm = 0.0;
    2152  double m_dim_line_plot_weight_mm = 0.0;
    2153 
    2154  double m_fixed_extension_len = 1.0; // Fixed extension line length if m_fixed_extension_len_on is true
    2155  bool m_fixed_extension_len_on = false; // true: use fixed_extension_len, false: don't use m_fixed_extension_len
    2156 
    2157  double m_text_rotation = 0.0; // Dimension text rotation around text point (radians)
    2158  int m_alternate_tolerance_resolution = 4; // for decimal, digits past the decimal point, fractions: 1/2^n
    2159  double m_tol_textheight_fraction = 0.6; // fraction of main text height
    2160 
    2161  bool m_suppress_arrow1 = false; // false: dont suppress, true: suppress
    2162  bool m_suppress_arrow2 = false; // false: dont suppress, true: suppress
    2163  int m_textmove_leader = 0; // 0: move text anywhere, 1: add leader when moving text
    2164  int m_arclength_sym = 0; // 0: symbol before dim text, 1: symbol above dim text, no symbol
    2165  double m_stack_textheight_fraction = 0.7; // fraction of main text height
    2167  double m_alt_round = 0.0; // rounds to nearest specified value
    2168  double m_round = 0.0;
    2169  double m_angular_round = 0.0;
    2170 
    2173 
    2175 
    2176  bool m_alt_below = false; // true: display alternate text below main text
    2177  // false: display alternate text after main text
    2178  ON_Arrowhead::arrow_type m_arrow_type_1 = ON_Arrowhead::arrow_type::SolidTriangle; // Arrow types for ON_Dimension derived dimensions
    2181  ON_UUID m_arrow_block_id_1 = ON_nil_uuid;
    2182  ON_UUID m_arrow_block_id_2 = ON_nil_uuid;
    2183  ON_UUID m_leader_arrow_block_id = ON_nil_uuid;
    2184 
    2185  // Text
    2186  ON::TextVerticalAlignment m_text_vertical_alignment = ON::TextVerticalAlignment::Top;
    2187  ON::TextHorizontalAlignment m_text_horizontal_alignment = ON::TextHorizontalAlignment::Left;
    2188 
    2189  // Leader
    2190  ON::TextVerticalAlignment m_leader_text_vertical_alignment = ON::TextVerticalAlignment::Middle;
    2191  ON::TextHorizontalAlignment m_leader_text_horizontal_alignment = ON::TextHorizontalAlignment::Left;
    2192 
    2195  double m_leader_content_angle = 0.0;
    2196  bool m_leader_has_landing = true;
    2197  double m_leader_landing_length = 1.0;
    2198 
    2199  bool m_draw_forward = true;
    2200  bool m_signed_ordinate = true;
    2201  ON_ScaleValue m_scale_value = ON_ScaleValue::OneToOne;
    2202 
    2203  // Unit system for dimension rendering sizes like text height, and arrow head length.
    2204  // m_textheight, m_textgap, m_arrowsize, m_extoffset, and dozens of other properties
    2205  // that control the appearance and placement of the components used to render
    2206  // a dimension.
    2207  ON::LengthUnitSystem m_unitsystem = ON::LengthUnitSystem::None;
    2208 
    2209  ON::TextOrientation m_text_orientation = ON::TextOrientation::InPlane;
    2210  ON::TextOrientation m_leader_text_orientation = ON::TextOrientation::InPlane;
    2211  ON::TextOrientation m_dim_text_orientation = ON::TextOrientation::InPlane;
    2212  ON::TextOrientation m_dimradial_text_orientation = ON::TextOrientation::InPlane;
    2213 
    2216 
    2217  bool m_text_underlined = false; // extra/extended line under text block in leaders and radial dimensions
    2218 
    2219 private:
    2220  ON__UINT_PTR m_reserved = 0;
    2221 
    2222 private:
    2223  void Internal_ContentChange() const;
    2224 };
    2225 
    2226 
    2227 /*
    2228 Description:
    2229  A general and portable interface to access a model's available dimension styles.
    2230 Remarks:
    2231  The Rhino C++ SDK function CRhinoDoc.DimStyleContext() will return an ON_DimStyleContext for the Rhino model.
    2232  The ONX_Model function ONX_Model.DimStyleContext() will return an ON_DimStyleContext for ONX_Model model.
    2233 */
    2234 class ON_CLASS ON_DimStyleContext
    2235 {
    2236 public:
    2237  ON_DimStyleContext() = default;
    2238  virtual ~ON_DimStyleContext();
    2239  ON_DimStyleContext(const ON_DimStyleContext&) = default;
    2240  ON_DimStyleContext& operator=(const ON_DimStyleContext&) = default;
    2241 
    2242 public:
    2243  virtual const ON_DimStyle& CurrentDimStyle() const;
    2244 
    2245  virtual const ON_DimStyle* DimStyleFromId(
    2246  ON_UUID id,
    2247  const ON_DimStyle* not_found_result = nullptr
    2248  ) const;
    2249 
    2250  virtual const ON_DimStyle* DimStyleFromName(
    2251  const ON_NameHash& name_hash,
    2252  const ON_DimStyle* not_found_result = nullptr
    2253  ) const;
    2254 
    2255  virtual const ON_DimStyle* DimStyleFromContentHash(
    2256  const ON_SHA1_Hash& content_hash,
    2257  const ON_DimStyle* not_found_result = nullptr
    2258  ) const;
    2259 
    2260  virtual const ON_DimStyle* DimStyleFromFont(
    2261  const ON_Font& font,
    2262  double model_space_text_scale,
    2263  double text_height,
    2264  ON::LengthUnitSystem text_height_unit_system,
    2265  bool bReturnClosestMatch = true,
    2266  const ON_DimStyle* not_found_result = nullptr
    2267  ) const;
    2268 
    2269  virtual bool AddDimStyle(
    2270  const ON_DimStyle& dim_style,
    2271  bool bResolveNameAndIdConflicts
    2272  );
    2273 
    2274  virtual bool ModifyDimStyle(
    2275  ON_UUID model_dim_style_id,
    2276  const ON_DimStyle& dim_style
    2277  );
    2278 
    2279  virtual const ON_DimStyle* FirstDimStyle(
    2280  bool bIncludeSystemDimStyles = false,
    2281  bool bIncludeDeletedDimStyles = false
    2282  ) const;
    2283 
    2284  virtual const ON_DimStyle* NextDimStyle(
    2285  ON_UUID id,
    2286  bool bIncludeSystemDimStyles = false,
    2287  bool bIncludeDeletedDimStyles = false
    2288  ) const;
    2289 
    2290  virtual const ON_DimStyle* PrevDimStyle(
    2291  ON_UUID id,
    2292  bool bIncludeSystemDimStyles = false,
    2293  bool bIncludeDeletedDimStyles = false
    2294  ) const;
    2295 
    2296  virtual ON::LengthUnitSystem ModelUnitSystem() const;
    2297 
    2298  virtual ON__UINT64 ModelSerialNumber() const;
    2299 
    2300 protected:
    2301  mutable ON::LengthUnitSystem m_unit_system = ON::LengthUnitSystem::Millimeters;
    2302  mutable ON__UINT64 m_model_serial_number = 0;
    2303 };
    2304 
    2305 
    2306 #if defined(ON_DLL_TEMPLATE)
    2307 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_DimStyle*>;
    2308 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_DimStyle>;
    2309 #endif
    2310 
    2311 #endif
    static ON_DimStyle * CreateFromFont(const ON_Font *font_characteristics, double model_space_text_scale, const ON_DimStyle *dimstyle_settings, const class ON_ComponentManifest *manifest, ON_DimStyle *destination)
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_DIMENSIONSTYLE_INC_)
    18 #define OPENNURBS_DIMENSIONSTYLE_INC_
    19 
    20 
    21 class ON_CLASS ON_Arrowhead
    22 {
    23 public:
    24  ON_Arrowhead() = default;
    25  ~ON_Arrowhead() = default;
    26  ON_Arrowhead(const ON_Arrowhead&) = default;
    27  ON_Arrowhead& operator=(const ON_Arrowhead&) = default;
    28 
    29  bool operator==(const ON_Arrowhead& other) const;
    30  bool operator!=(const ON_Arrowhead& other) const;
    31 
    32 
    33 #pragma region RH_C_SHARED_ENUM [ON_Arrowhead::arrow_type] [Rhino.DocObjects.DimensionStyle.ArrowType] [nested:int]
    34  /// <summary>
    35  /// Defines enumerated values for arrowhead shapes.
    36  /// </summary>
    37  enum class arrow_type : unsigned int
    38  {
    39  /// <summary> </summary>
    40  None = 0,
    41  /// <summary> </summary>
    42  UserBlock = 1,
    43  /// <summary> </summary>
    44  SolidTriangle = 2, // 2:1
    45  /// <summary> </summary>
    46  Dot = 3,
    47  /// <summary> </summary>
    48  Tick = 4,
    49  /// <summary> </summary>
    50  ShortTriangle = 5, // 1:1
    51  /// <summary> </summary>
    52  OpenArrow = 6,
    53  /// <summary> </summary>
    54  Rectangle = 7,
    55  /// <summary> </summary>
    56  LongTriangle = 8, // 4:1
    57  /// <summary> </summary>
    58  LongerTriangle = 9, // 6:1
    59  };
    60 #pragma endregion
    61 
    62  static ON_Arrowhead::arrow_type ArrowTypeFromUnsigned(
    63  unsigned int type_as_unsigned
    64  );
    65 
    66  arrow_type ArrowheadType() const;
    67  void SetArrowheadType(arrow_type type);
    68  ON_UUID ArrowBlockId() const;
    69  void SetArrowBlockId(ON_UUID id);
    70 
    71  static ON__UINT32 GetPoints(
    72  arrow_type type,
    73  const double*& points);
    74 
    75  static ON__UINT32 GetPoints(
    76  arrow_type type,
    77  ON_2dPointArray& points);
    78 
    79  static bool GetArrowheadBoundingBox(
    81  ON_UUID arrow_block_id,
    82  ON_Xform xform,
    83  ON_BoundingBox& bbox,
    84  bool grow);
    85 
    86  static
    87  ON_Arrowhead::arrow_type DefaultArrowType();
    88 
    89 private:
    90  arrow_type m_arrowhead_type = ON_Arrowhead::arrow_type::SolidTriangle;
    91  ON_UUID m_arrow_block_id = ON_nil_uuid;
    92 
    93 };
    94 
    95 class ON_CLASS ON_TextMask
    96 {
    97 public:
    98 
    99 #pragma region RH_C_SHARED_ENUM [ON_TextMask::MaskType] [Rhino.DocObjects.DimensionStyle.MaskType] [nested:byte]
    100  /// <summary>
    101  /// Text mask drawn with background color or explicit color
    102  /// </summary>
    103  enum class MaskType : unsigned char
    104  {
    105  /// <summary>
    106  /// Text mask drawn with background color
    107  /// </summary>
    108  BackgroundColor = 0,
    109  /// <summary>
    110  /// Text mask drawn with explicit color
    111  /// </summary>
    112  MaskColor = 1,
    113  };
    114 #pragma endregion
    115 
    116  static ON_TextMask::MaskType MaskTypeFromUnsigned(
    117  unsigned int mask_type_as_unsigned
    118  );
    119 
    120 public:
    121 
    122  /*
    123  The default constructor content is idenical to ON_TextMask::None.
    124  */
    125  ON_TextMask() = default;
    126  ~ON_TextMask() = default;
    127  ON_TextMask(const ON_TextMask& src) = default;
    128  ON_TextMask& operator=(const ON_TextMask& src) = default;
    129 
    130 public:
    131 
    132  /*
    133  ON_TextMask::None has no effect on text appearance.
    134  */
    135  static const ON_TextMask None;
    136 
    137  /*
    138  Description:
    139  ON_TextMask::Compare() compares content in a repeatable
    140  and well ordered way.
    141  Returns:
    142  0: lhs and rhs have identical content.
    143  <0: lhs content is less than rhs content
    144  >0: lhs content is greater than rhs content
    145  */
    146  static int Compare(
    147  const ON_TextMask& lhs,
    148  const ON_TextMask& rhs
    149  );
    150 
    151  // Specifies whether or not to draw a Text Mask
    152  bool DrawTextMask() const;
    153  void SetDrawTextMask(bool bDraw);
    154 
    155  // Determines where to get the color to draw a Text Mask
    156  // Can be background color or a specific color
    157  ON_TextMask::MaskType MaskFillType() const;
    158  void SetMaskFillType(ON_TextMask::MaskType source);
    159 
    160  /*
    161  Returns:
    162  Mask color.
    163  Remarks:
    164  The mask color is applied only when MaskFillType() = ON_TextMask::MaskType::MaskColor
    165  */
    166  ON_Color MaskColor() const;
    167 
    168  void SetMaskColor(
    169  ON_Color color
    170  );
    171 
    172  /*
    173  Returns:
    174  Width of border area around text to be masked. The default value is 0.0.
    175  */
    176  double MaskBorder() const;
    177 
    178  void SetMaskBorder(double offset);
    179 
    180  bool Write(
    181  ON_BinaryArchive& archive
    182  ) const;
    183 
    184  bool Read(
    185  ON_BinaryArchive& archive
    186  );
    187 
    188  /*
    189  Returns:
    190  A SHA1 of the values defining the text mask.
    191  Two text masks have the same
    192  content if and only if they have identical content hash values.
    193  */
    194  const ON_SHA1_Hash& ContentHash() const;
    195 
    196 private:
    197  bool m_bDrawMask = false;
    199 
    200  unsigned char m_reserved1 = 0;
    201  unsigned char m_reserved2 = 0;
    202 
    203  ON_Color m_mask_color = ON_Color::White;
    204  double m_mask_border = 0.0;
    205 
    206  // At some point, the reserved fields may have the name changed and be
    207  // used to store additional informtion of how to draw the mask,
    208  // (feathered edges, rounded corners, etc.).
    209  unsigned int m_reserved3 = 0;
    210  mutable ON_SHA1_Hash m_content_hash = ON_SHA1_Hash::ZeroDigest;
    211 };
    212 
    213 bool operator==(
    214  const class ON_TextMask& lhs,
    215  const class ON_TextMask& rhs
    216  );
    217 
    218 bool operator!=(
    219  const class ON_TextMask& lhs,
    220  const class ON_TextMask& rhs
    221  );
    222 
    223 
    224 class ON_CLASS ON_DimStyle : public ON_ModelComponent
    225 {
    226  ON_OBJECT_DECLARE(ON_DimStyle);
    227 private:
    228  friend class ON_V5x_DimStyle;
    229 
    230 public:
    231  // Predefined default dimension styles always available
    232  static const ON_DimStyle Unset; // index = ON_UNSET_INT_INDEX, id = nil.
    233  static const ON_DimStyle Default; // index = -1, unique and persistent id.
    234  static const ON_DimStyle DefaultInchDecimal; // index = -2, unique and persistent id.
    235  static const ON_DimStyle DefaultInchFractional; // index = -3, unique and persistent id.
    236  static const ON_DimStyle DefaultFootInchArchitecture; // index = -4, unique and persistent id.
    237  static const ON_DimStyle DefaultMillimeterSmall; // index = -5, unique and persistent id.
    238  static const ON_DimStyle DefaultMillimeterLarge; // index = -6, unique and persistent id.
    239  static const ON_DimStyle DefaultMillimeterArchitecture; // index = -7, unique and persistent id.
    240 
    241 public:
    242  /*
    243  Parameters:
    244  dimstyle - [in]
    245  Returns:
    246  If dimstyle not nullptr, then dimstyle is returned.
    247  Otherwise a non-null pointer to a persistent dimstyle is returned.
    248  A null pointer is never returned.
    249  Remarks:
    250  This function is used when a dimension style is required.
    251  */
    252  static const class ON_DimStyle& DimStyleOrDefault(
    253  const class ON_DimStyle* dimstyle
    254  );
    255 
    256  /*
    257  Parameters:
    258  id - [in]
    259  Returns:
    260  If the id is not nil and identifies one of the above system dimstyles, that
    261  dimstyle is returned. Otherwise, ON_DimStyle::Unset is returned.
    262  */
    263  static const ON_DimStyle& SystemDimstyleFromId(
    264  ON_UUID id
    265  );
    266 
    267  /*
    268  Parameters:
    269  index - [in]
    270  Returns:
    271  If the id is not nil and identifies one of the above system dimstyles, that
    272  dimstyle is returned. Otherwise, ON_DimStyle::Unset is returned.
    273  */
    274  static const ON_DimStyle& SystemDimstyleFromIndex(
    275  int index
    276  );
    277 
    278  /*
    279  Parameters:
    280  name_hash - [in]
    281  Returns:
    282  If the id is not nil and identifies one of the above system dimstyles, that
    283  dimstyle is returned. Otherwise, ON_DimStyle::Unset is returned.
    284  */
    285  static const ON_DimStyle& SystemDimstyleFromName(
    286  const ON_NameHash& name_hash
    287  );
    288 
    289  /*
    290  Parameters:
    291  name_hash - [in]
    292  Returns:
    293  If the id is not nil and identifies one of the above system dimstyles, that
    294  dimstyle is returned. Otherwise, ON_DimStyle::Unset is returned.
    295  */
    297  const ON_SHA1_Hash& content_hash
    298  );
    299 
    300 private:
    301  /*
    302  Parameters:
    303  system_dimstyle_list - [out]
    304  Returns:
    305  Number of system dimstyles.
    306  Remarks:
    307  ON_DimStyle::Unset is not added system_dimstyle_list[].
    308  */
    309  static unsigned int Internal_GetSystemDimstyleList(
    310  ON_SimpleArray<const ON_DimStyle*>& system_dimstyle_list
    311  );
    312 
    313 public:
    314 
    315  /*
    316  Parameters:
    317  model_component_reference - [in]
    318  none_return_value - [in]
    319  value to return if ON_DimStyle::Cast(model_component_ref.ModelComponent())
    320  is nullptr
    321  Returns:
    322  If ON_DimStyle::Cast(model_component_ref.ModelComponent()) is not nullptr,
    323  that pointer is returned. Otherwise, none_return_value is returned.
    324  */
    325  static const ON_DimStyle* FromModelComponentRef(
    326  const class ON_ModelComponentReference& model_component_reference,
    327  const ON_DimStyle* none_return_value
    328  );
    329 
    330  /*
    331  Description:
    332  Create a clean dimension style that has the specified font.
    333  With the exception of the name, the resulting dimension style
    334  will have an unset ON_ModelComponent properties (id, index, ...).
    335  Parameters:
    336  font_characteristics - [in]
    337  If nullptr, then &ON_Font::Default is used.
    338  model_space_text_scale - [in]
    339  If model_space_text_scale is > 0.0, then it is used to set
    340  the DimScale() value.
    341  dimstyle_settings - [in]
    342  Setting for non-font dimstyle properties.
    343  If nullptr, then &ON_DimStyle::Default is used.
    344  manifest - [in]
    345  If manifest is not nullptr, then it is used to generate
    346  a unique name.
    347  destination - [in]
    348  If destination is not nullptr, the result is stored here.
    349  Otherwise operator new is used to construct an ON_DimStyle on the heap.
    350  */
    351  static ON_DimStyle* CreateFromFont(
    352  const ON_Font* font_characteristics,
    353  double model_space_text_scale,
    354  const ON_DimStyle* dimstyle_settings,
    355  const class ON_ComponentManifest* manifest,
    356  ON_DimStyle* destination
    357  );
    358 
    359 public:
    360  // Default constructor result is identical to ON_DimStyle::Unset;
    361  ON_DimStyle();
    362 
    363  ~ON_DimStyle() = default;
    364  ON_DimStyle(const ON_DimStyle& src) = default;
    365  ON_DimStyle& operator=(const ON_DimStyle&) = default;
    366 
    367 public:
    368  // Used when reading V5 and earlier archives
    369  ON_DimStyle(
    370  ON::LengthUnitSystem model_length_unit_system,
    371  const class ON_V5x_DimStyle& src
    372  );
    373 
    374 public:
    376 
    377  /*
    378  Returns:
    379  True:
    380  "this" and src have identical names, dimension style appearance attributes,
    381  and identical atttributes inherited from the same parent dimension style.
    382  ON_ModelComponent settings other than Name() and ParentId() are
    383  not compared.
    384  Remaraks:
    385  A better name for this function would be EqualForAllPracticalPurposes().
    386  */
    387  bool CompareDimstyle(const ON_DimStyle& src) const;
    388 
    389  /*
    390  Returns:
    391  True if this and src have identical dimension style appearance attributes
    392  and the same parent dimension style id.
    393  CompareFields() ignores Name, Index, Id() values.
    394  CompareFields() ignores differences in IsOverride(field_id) values.
    395  Remaraks:
    396  A better name for this function would be EqualAppearanceSettings().
    397  */
    398  bool CompareFields(const ON_DimStyle& src) const;
    399 
    400 private:
    401  /*
    402  Returns:
    403  True:
    404  If a.IsFieldOverride(field_id) == b.IsFieldOverride(field_id)
    405  for all ON_DimStyle::field enum values.
    406  */
    407  static bool Internal_EqualOverrideParentFields(
    408  const ON_DimStyle& a,
    409  const ON_DimStyle& b
    410  );
    411 public:
    412 
    413  //////////////////////////////////////////////////////////////////////
    414  //
    415  // ON_Object overrides
    416 
    417  // virtual
    418  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    419 
    420  // virtual
    421  void Dump(ON_TextLog&) const override; // for debugging
    422 
    423  // virtual
    424  bool Write(
    425  ON_BinaryArchive& // serialize definition to binary archive
    426  ) const override;
    427 
    428  // virtual
    429  bool Read(
    430  ON_BinaryArchive& // restore definition from binary archive
    431  ) override;
    432 
    433  //////////////////////////////////////////////////////////////////////
    434  // Interface
    435 
    436  void EmergencyDestroy();
    437 
    438  //////////////////////////////////////////////////////////////////////
    439  // Interface
    440 
    441 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::LengthDisplay] [Rhino.DocObjects.DimensionStyle.LengthDisplay] [nested:int]
    442  /// <summary>
    443  /// Dimension display length unit system and style
    444  /// </summary>
    445  enum class LengthDisplay : unsigned int
    446  {
    447  /// <summary>
    448  /// Decimal current model units
    449  /// </summary>
    450  ModelUnits = 0,
    451 
    452  /// <summary>
    453  /// Decimal Millimeters
    454  /// </summary>
    455  Millmeters = 3,
    456 
    457  /// <summary>
    458  /// Decimal Centimeters
    459  /// </summary>
    460  Centimeters = 4,
    461 
    462  /// <summary>
    463  /// Decimal Meters
    464  /// </summary>
    465  Meters = 5,
    466 
    467  /// <summary>
    468  /// Decimal Kilometers
    469  /// </summary>
    470  Kilometers = 6,
    471 
    472  /// <summary>
    473  /// Decimal Inches
    474  /// </summary>
    475  InchesDecimal = 7,
    476 
    477  /// <summary>
    478  /// Fractional Inches ( 1.75 inches displays as 1-3/4 )
    479  /// </summary>
    480  InchesFractional = 1,
    481 
    482  /// <summary>
    483  /// Decimal Feet
    484  /// </summary>
    485  FeetDecimal = 8,
    486 
    487  /// <summary>
    488  /// Feet and Inches ( 14.75 inches displays as 1&apos;-2-3/4&quot; )
    489  /// </summary>
    490  FeetAndInches = 2,
    491 
    492  /// <summary>
    493  /// Decimal Miles
    494  /// </summary>
    495  Miles = 9
    496  };
    497 
    498 #pragma endregion
    499 
    500  static ON_DimStyle::LengthDisplay LengthDisplayFromUnsigned(
    501  unsigned int length_display_as_unsigned
    502  );
    503 
    504  /*
    505  Returns:
    506  true if length_display selects a decimal format.
    507  false if length_display is ON_DimStyle::LengthDisplay::FeetAndInches
    508  or ON_DimStyle::LengthDisplay::InchesFractional.
    509  */
    510  static bool LengthDisplayIsDecimal(
    511  ON_DimStyle::LengthDisplay dimension_length_display
    512  );
    513 
    514  static ON::LengthUnitSystem LengthUnitSystemFromLengthDisplay(
    515  ON_DimStyle::LengthDisplay dimension_length_display
    516  );
    517 
    518 
    519 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::tolerance_format] [Rhino.DocObjects.DimensionStyle.ToleranceDisplayFormat] [nested:byte]
    520  /// <summary>
    521  /// Style of tolerance display for dimensions
    522  /// </summary>
    523  enum class tolerance_format : unsigned char
    524  {
    525  /// <summary>
    526  /// No tolerance display
    527  /// </summary>
    528  None = 0,
    529  /// <summary>
    530  /// Symmetrical +/- tolerance
    531  /// </summary>
    532  Symmetrical = 1,
    533  /// <summary>
    534  /// Distance +tol, -tol
    535  /// </summary>
    536  Deviation = 2,
    537  /// <summary>
    538  /// Distance upper and lower limits
    539  /// </summary>
    540  Limits = 3,
    541  };
    542 #pragma endregion
    543 
    544  static ON_DimStyle::tolerance_format ToleranceFormatFromUnsigned(
    545  unsigned int format_as_unsigned
    546  );
    547 
    548 
    549 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::ContentAngleStyle] [Rhino.DocObjects.DimensionStyle.LeaderContentAngleStyle] [nested:byte]
    550  /// <summary>
    551  /// Angle for text or other leader or dimension content
    552  /// </summary>
    553  enum class ContentAngleStyle : unsigned char
    554  {
    555  /// <summary>
    556  /// Annotation text is horizontal in annotation object's plane
    557  /// </summary>
    558  Horizontal = 0,
    559  /// <summary>
    560  /// Aligned with last leader direction or dimension line
    561  /// </summary>
    562  Aligned = 1,
    563  /// <summary>
    564  /// Explicit angle
    565  /// </summary>
    566  Rotated = 2,
    567  };
    568 #pragma endregion
    569 
    570  static ON_DimStyle::ContentAngleStyle ContentAngleStyleFromUnsigned(
    571  unsigned int alignment_as_unsigned
    572  );
    573 
    574 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::leader_curve_type] [Rhino.DocObjects.DimensionStyle.LeaderCurveStyle] [nested:byte]
    575  /// <summary>
    576  /// Type of leader curve
    577  /// </summary>
    578  enum class leader_curve_type : unsigned char
    579  {
    580  /// <summary>
    581  ///
    582  /// </summary>
    583  None = 0,
    584  /// <summary>
    585  ///
    586  /// </summary>
    587  Polyline = 1,
    588  /// <summary>
    589  ///
    590  /// </summary>
    591  Spline = 2
    592  };
    593 #pragma endregion
    594 
    595  static ON_DimStyle::leader_curve_type LeaderCurveTypeFromUnsigned(
    596  unsigned int type_as_unsigned
    597  );
    598 
    599 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::field] [Rhino.DocObjects.DimensionStyle.Field] [nested:int]
    600  // Don't change these enum values. They are used in file reading and writing.
    601  /// <summary>
    602  /// Field identifiers used for file i/o and getting/setting values
    603  /// </summary>
    604  enum class field : unsigned int
    605  {
    606  /// <summary></summary>
    607  Unset = 0,
    608 
    609  /// <summary>Dimension style Name property. Cannot be inherited from parent.</summary>
    610  Name = 1,
    611 
    612  /// <summary>Dimension style runtime model component index property. Cannot be inherited from parent.</summary>
    613  Index = 2,
    614 
    615  /// <summary></summary>
    616  ExtensionLineExtension = 3,
    617  /// <summary></summary>
    618  ExtensionLineOffset = 4,
    619  /// <summary></summary>
    620  Arrowsize = 5,
    621  /// <summary></summary>
    622  LeaderArrowsize = 6,
    623  /// <summary></summary>
    624  Centermark = 7,
    625  /// <summary></summary>
    626  TextGap = 8,
    627  /// <summary></summary>
    628  TextHeight = 9,
    629  /// <summary>Linear, angular, and ordinate dimension text location above/in/below</summary>
    630  DimTextLocation = 10,
    631 
    632  //OBSOLETE_LengthFormat_ = 11,
    633 
    634  /// <summary></summary>
    635  LengthResolution = 12,
    636  /// <summary></summary>
    637  AngleFormat = 13,
    638  /// <summary></summary>
    639  AngleResolution = 14,
    640  /// <summary></summary>
    641  Font = 15,
    642 
    643  /// <summary>
    644  /// LengthFactor is a rarely used. It applies when a model is being
    645  /// drawn to a scale and the dimension length values should be
    646  /// reverse scaled. For example, if a model is drawn at 1/4 scale,
    647  /// a line 5 units long indicates the real world line is 20 units
    648  /// long. In this case setting LengthFactor to 4 would cause
    649  /// a linear dimension applied to that line to display a value of 20.
    650  ///</summary>
    651  LengthFactor = 16,
    652 
    653  /// <summary></summary>
    654  Alternate = 17,
    655 
    656  /// <summary>
    657  /// AlternateLengthFactor is a rarely used. See Length factor for
    658  /// a discription of this property.
    659  ///</summary>
    660  AlternateLengthFactor = 18,
    661 
    662  //OBSOLETE_AlternateLengthFormat_ = 19,
    663 
    664  /// <summary></summary>
    665  AlternateLengthResolution = 20,
    666  /// <summary></summary>
    667  Prefix = 21,
    668  /// <summary></summary>
    669  Suffix = 22,
    670  /// <summary></summary>
    671  AlternatePrefix = 23,
    672  /// <summary></summary>
    673  AlternateSuffix = 24,
    674  /// <summary></summary>
    675  DimensionLineExtension = 25,
    676  /// <summary></summary>
    677  SuppressExtension1 = 26,
    678  /// <summary></summary>
    679  SuppressExtension2 = 27,
    680  /// <summary></summary>
    681  ExtLineColorSource = 28,
    682  /// <summary></summary>
    683  DimLineColorSource = 29,
    684  /// <summary></summary>
    685  ArrowColorSource = 30,
    686  /// <summary></summary>
    687  TextColorSource = 31,
    688  /// <summary></summary>
    689  ExtLineColor = 32,
    690  /// <summary></summary>
    691  DimLineColor = 33,
    692  /// <summary></summary>
    693  ArrowColor = 34,
    694  /// <summary></summary>
    695  TextColor = 35,
    696  /// <summary></summary>
    697  ExtLinePlotColorSource = 36,
    698  /// <summary></summary>
    699  DimLinePlotColorSource = 37,
    700  /// <summary></summary>
    701  ArrowPlotColorSource = 38,
    702  /// <summary></summary>
    703  TextPlotColorSource = 39,
    704  /// <summary></summary>
    705  ExtLinePlotColor = 40,
    706  /// <summary></summary>
    707  DimLinePlotColor = 41,
    708  /// <summary></summary>
    709  ArrowPlotColor = 42,
    710  /// <summary></summary>
    711  TextPlotColor = 43,
    712  /// <summary></summary>
    713  ExtLinePlotWeightSource = 44,
    714  /// <summary></summary>
    715  DimLinePlotWeightSource = 45,
    716  /// <summary></summary>
    717  ExtLinePlotWeight_mm = 46,
    718  /// <summary></summary>
    719  DimLinePlotWeight_mm = 47,
    720  /// <summary></summary>
    721  ToleranceFormat = 48,
    722  /// <summary></summary>
    723  ToleranceResolution = 49,
    724  /// <summary></summary>
    725  ToleranceUpperValue = 50,
    726  /// <summary></summary>
    727  ToleranceLowerValue = 51,
    728  /// <summary></summary>
    729  AltToleranceResolution = 52,
    730  /// <summary></summary>
    731  ToleranceHeightScale = 53,
    732  /// <summary></summary>
    733  BaselineSpacing = 54,
    734  /// <summary></summary>
    735  DrawMask = 55,
    736  /// <summary></summary>
    737  MaskColorSource = 56,
    738  /// <summary></summary>
    739  MaskColor = 57,
    740  /// <summary></summary>
    741  MaskBorder = 58,
    742  /// <summary></summary>
    743  DimensionScale = 59,
    744  /// <summary></summary>
    745  DimscaleSource = 60,
    746  /// <summary></summary>
    747  FixedExtensionLength = 61,
    748  /// <summary></summary>
    749  FixedExtensionOn = 62,
    750  /// <summary></summary>
    751  TextRotation = 63,
    752  /// <summary></summary>
    753  SuppressArrow1 = 64,
    754  /// <summary></summary>
    755  SuppressArrow2 = 65,
    756  /// <summary></summary>
    757  TextmoveLeader = 66,
    758  /// <summary></summary>
    759  ArclengthSymbol = 67,
    760  /// <summary></summary>
    761  StackTextheightScale = 68,
    762  /// <summary></summary>
    763  StackFormat = 69,
    764  /// <summary></summary>
    765  AltRound = 70,
    766  /// <summary></summary>
    767  Round = 71,
    768  /// <summary></summary>
    769  AngularRound = 72,
    770  /// <summary></summary>
    771  AltZeroSuppress = 73,
    772 
    773  //OBSOLETE ToleranceZeroSuppress = 74,
    774 
    775  /// <summary></summary>
    776  AngleZeroSuppress = 75,
    777  /// <summary></summary>
    778  ZeroSuppress = 76,
    779  /// <summary></summary>
    780  AltBelow = 77,
    781  /// <summary></summary>
    782  ArrowType1 = 78,
    783  /// <summary></summary>
    784  ArrowType2 = 79,
    785  /// <summary></summary>
    786  LeaderArrowType = 80,
    787  /// <summary></summary>
    788  ArrowBlockId1 = 81,
    789  /// <summary></summary>
    790  ArrowBlockId2 = 82,
    791  /// <summary></summary>
    792  LeaderArrowBlock = 83,
    793  /// <summary>Radial dimension text location above/in/below</summary>
    794  DimRadialTextLocation = 84,
    795  /// <summary></summary>
    796  TextVerticalAlignment = 85,
    797  /// <summary></summary>
    798  LeaderTextVerticalAlignment = 86,
    799  /// <summary></summary>
    800  LeaderContentAngleStyle = 87,
    801  /// <summary></summary>
    802  LeaderCurveType = 88,
    803  /// <summary></summary>
    804  LeaderContentAngle = 89,
    805  /// <summary></summary>
    806  LeaderHasLanding = 90,
    807  /// <summary></summary>
    808  LeaderLandingLength = 91,
    809  /// <summary></summary>
    810  MaskFlags = 92,
    811  /// <summary></summary>
    812  CentermarkStyle = 93,
    813  /// <summary></summary>
    814  TextHorizontalAlignment = 94,
    815  /// <summary></summary>
    816  LeaderTextHorizontalAlignment = 95,
    817  /// <summary></summary>
    818  DrawForward = 96,
    819  /// <summary></summary>
    820  SignedOrdinate = 97,
    821 
    822  /// <summary>
    823  /// Unit system for dimension rendering sizes like TextHeight, TextGap, ArrowSize, ExtOffset,
    824  /// and dozens of other properties that control the appearance and placement of the components
    825  /// used to render a dimension.
    826  ///</summary>
    827  UnitSystem = 98,
    828 
    829  /// <summary></summary>
    830  TextMask = 99,
    831  /// <summary></summary>
    832  TextOrientation = 100,
    833  /// <summary></summary>
    834  LeaderTextOrientation = 101,
    835  /// <summary></summary>
    836  DimTextOrientation = 102,
    837  /// <summary></summary>
    838  DimRadialTextOrientation = 103,
    839  /// <summary></summary>
    840  DimTextAngleStyle = 104,
    841  /// <summary></summary>
    842  DimRadialTextAngleStyle = 105,
    843  /// <summary></summary>
    844  TextUnderlined = 106,
    845 
    846  //OBSOLETE_DimensionUnitSystem_ = 107,
    847  //OBSOLETE_AlternateDimensionUnitSystem_ = 108,
    848 
    849  /// <summary>
    850  /// Dimension length display. See ON_DimStyle::DimensionLengthDisplay() for a descpription of this parameter.
    851  /// </summary>
    852  DimensionLengthDisplay = 109,
    853 
    854  /// <summary>
    855  /// Alternate dimension length display. See ON_DimStyle::AlternateDimensionLengthDisplay() for a descpription of this parameter.
    856  /// </summary>
    857  AlternateDimensionLengthDisplay = 110,
    858 
    859  /// <summary>Every enum UINT value that identifies a valid dimension style property is less than the UINT value of Count.</summary>
    860  Count = 111
    861  };
    862 
    863 #pragma endregion
    864 
    865  enum : unsigned int
    866  {
    867  // must be 1 + the maximum value of an ON_DimStyle::field enum value.
    868  FieldCount = (unsigned int)field::Count
    869  };
    870 
    871  static ON_DimStyle::field FieldFromUnsigned(
    872  unsigned int field_as_unsigned
    873  );
    874 
    875 
    876 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::angle_format] [Rhino.DocObjects.DimensionStyle.AngleDisplayFormat] [nested:byte]
    877  /// <summary>
    878  /// Display format for angles
    879  /// </summary>
    880  enum class angle_format : unsigned char
    881  {
    882  /// <summary> Decimal Degrees </summary>
    883  DecimalDegrees = 0,
    884  /// <summary> Degrees Minutes Seconds </summary>
    885  DegMinSec = 1,
    886  /// <summary> Decimal Radians </summary>
    887  Radians = 2,
    888  /// <summary> Decimal Gradians </summary>
    889  Grads = 3
    890  };
    891 #pragma endregion
    892 
    893  static ON_DimStyle::angle_format AngleFormatFromUnsigned(
    894  unsigned int format_as_unsigned
    895  );
    896 
    897 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::OBSOLETE_length_format] [Rhino.DocObjects.DimensionStyle.LengthDisplayFormat] [nested:byte]
    898  /// <summary>
    899  /// Obsolete format for length display - use ON_DimStyle::DimensionLengthDisplay instead
    900  /// </summary>
    901  enum class OBSOLETE_length_format : unsigned char
    902  {
    903  /// <summary>Obsolete - use ON_DimStyle::DimensionLengthDisplay::ModelUnits.</summary>
    904  Decimal = 0,
    905 
    906  /// <summary>Obsolete - use ON_DimStyle::DimensionLengthDisplay::InchesFractional</summary>
    907  Fractional = 1,
    908 
    909  /// <summary>Obsolete - use ON_DimStyle::DimensionLengthDisplay::FeetAndInches</summary>
    910  FeetInches = 2,
    911 
    912  /// <summary>Obsolete - use ON_DimStyle::DimensionLengthDisplay::FeetAndInches enum.</summary>
    913  FeetDecimalInches = 3
    914  };
    915 #pragma endregion
    916 
    917 
    918  static ON_DimStyle::OBSOLETE_length_format OBSOLETE_LengthFormatFromUnsigned(
    919  unsigned int format_as_unsigned
    920  );
    921 
    922  /*
    923  Parameters:
    924  dimension_length_display - [in]
    925  model_serial_number - [in]
    926  0: Ignore model settings
    927  >0: dimstyle.ModelSerialNumber()
    928  */
    929  static ON_DimStyle::OBSOLETE_length_format OBSOLETE_LengthFormatFromLengthDisplay(
    930  ON_DimStyle::LengthDisplay dimension_length_display,
    931  unsigned int model_serial_number
    932  );
    933 
    934  static ON_DimStyle::OBSOLETE_length_format OBSOLETE_LengthFormatFromLengthDisplay(
    935  ON_DimStyle::LengthDisplay dimension_length_display,
    936  ON::LengthUnitSystem model_unit_system
    937  );
    938 
    939 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::TextLocation] [Rhino.DocObjects.DimensionStyle.TextLocation] [nested:byte]
    940  /// <summary>
    941  /// The location of text in linear, angular, radial, and ordinate dimensions.
    942  /// </summary>
    943  enum class TextLocation : unsigned char
    944  {
    945  /// <summary>Text is above dimension line.</summary>
    946  AboveDimLine = 0,
    947  /// <summary>Text is centered in dimension line.</summary>
    948  InDimLine = 1,
    949  /// <summary>Text is below dimension line.</summary>
    950  BelowDimLine = 2
    951  };
    952 #pragma endregion
    953 
    954  static ON_DimStyle::TextLocation TextLocationFromUnsigned(
    955  unsigned int dim_text_location_as_unsigned
    956  );
    957 
    958  // convert ON_DimStyle::OBSOLETE_length_format enum to ON::OBSOLETE_DistanceDisplayMode enum
    959  static ON::OBSOLETE_DistanceDisplayMode DistanceDisplayModeFromLengthFormat(
    961  );
    962 
    963  // convert ON::OBSOLETE_DistanceDisplayMode enum to ON_DimStyle::OBSOLETE_length_format enum
    964  static ON_DimStyle::OBSOLETE_length_format LengthFormatFromDistanceDisplayMode(
    965  ON::OBSOLETE_DistanceDisplayMode
    966  );
    967 
    968 
    969 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::suppress_zero] [Rhino.DocObjects.DimensionStyle.ZeroSuppression] [nested:byte]
    970  /// <summary>
    971  /// Marks leading and trailing zeros for removal.
    972  /// </summary>
    973  enum class suppress_zero : unsigned char
    974  {
    975  /// <summary>No zero suppression.</summary>
    976  None = 0,
    977  /// <summary>Suppress leading zeros.</summary>
    978  SuppressLeading = 1,
    979  /// <summary>Suppress trailing zeros.</summary>
    980  SuppressTrailing = 2,
    981  /// <summary>Suppress leading and trailing zeros.</summary>
    982  SuppressLeadingAndTrailing = 3,
    983  /// <summary>Suppress zero feet.</summary>
    984  SuppressZeroFeet = 4,
    985  /// <summary>Suppress zero inches.</summary>
    986  SuppressZeroInches = 8,
    987  /// <summary>Suppress zero feet and zero inches.</summary>
    988  SuppressZeroFeetAndZeroInches = 12
    989  };
    990 #pragma endregion
    991 
    992  static ON_DimStyle::suppress_zero ZeroSuppressFromUnsigned(
    993  unsigned int suppress_ero_as_unsigned
    994  );
    995 
    996 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::stack_format] [Rhino.DocObjects.DimensionStyle.StackDisplayFormat] [nested:byte]
    997  /// <summary>
    998  /// Format of stacked fractions
    999  /// </summary>
    1000  enum class stack_format : unsigned char
    1001  {
    1002  /// <summary> No stacking </summary>
    1003  None = 0,
    1004  /// <summary> Stack with horizontal line </summary>
    1005  StackHorizontal = 1,
    1006  /// <summary> Stack with angled line </summary>
    1007  StackDiagonal = 2,
    1008  };
    1009 #pragma endregion
    1010 
    1011  static ON_DimStyle::stack_format StackFormatFromUnsigned(
    1012  unsigned int format_as_unsigned
    1013  );
    1014 
    1015 #pragma region RH_C_SHARED_ENUM [ON_DimStyle::centermark_style] [Rhino.DocObjects.DimensionStyle.CenterMarkStyle] [nested:byte]
    1016  /// <summary>
    1017  /// Style for drawing centermark for Radial dimensions and Centermark objects
    1018  /// </summary>
    1019  enum class centermark_style : unsigned char
    1020  {
    1021  /// <summary>
    1022  /// No centermark display
    1023  /// </summary>
    1024  None = 0,
    1025  /// <summary>
    1026  /// + mark only
    1027  /// </summary>
    1028  Mark = 1,
    1029  /// <summary>
    1030  /// + mark and lines to radius
    1031  /// </summary>
    1032  MarkAndLines = 2,
    1033  };
    1034 #pragma endregion
    1035 
    1036  static ON_DimStyle::centermark_style CentermarkStyleFromUnsigned(
    1037  unsigned int centermark_as_unsigned
    1038  );
    1039 
    1040 
    1041  static ON_DimStyle::LengthDisplay LengthDisplayFromUnitsAndFormat(
    1042  ON::LengthUnitSystem units,
    1044  );
    1045 
    1046  /// <summary>
    1047  /// Dimension length units and format
    1048  ///</summary>
    1049  ON_DimStyle::LengthDisplay DimensionLengthDisplay() const;
    1050 
    1051  /// <summary>
    1052  /// Set dimension length units and format
    1053  ///</summary>
    1054  ON_DimStyle::LengthDisplay AlternateDimensionLengthDisplay() const;
    1055 
    1056  /// <summary>
    1057  /// Alternate dimension length units and format
    1058  ///</summary>
    1059  void SetDimensionLengthDisplay(ON_DimStyle::LengthDisplay length_display);
    1060 
    1061  /// <summary>
    1062  /// Set alternate dimension length units and format
    1063  ///</summary>
    1064  void SetAlternateDimensionLengthDisplay(ON_DimStyle::LengthDisplay length_display);
    1065 
    1066  /// <summary>
    1067  /// Parameters:
    1068  /// model_sn - 0, a model serial number, or ON_UNSET_UINT_INDEX to
    1069  /// use the dimstyle's ModelSerialNumber() value.
    1070  /// Returns
    1071  /// Unit system for dimension length display.
    1072  /// If DimensionLengthDisplay() == ON_DimStyle::LengthDisplay::ModelUnits
    1073  /// and model_sn > 0, then the value of ON::LengthUnitSystemFromModelSerialNumber(model_sn)
    1074  /// is returned.
    1075  /// If DimensionLengthDisplay() == ON_DimStyle::LengthDisplay::ModelUnits
    1076  /// and model_sn == 0, then ON::LengthUnitSystem::None is returned.
    1077  ///</summary>
    1078  ON::LengthUnitSystem DimensionLengthDisplayUnit(
    1079  unsigned int model_sn
    1080  ) const;
    1081 
    1082  /// <summary>
    1083  /// Parameters:
    1084  /// model_sn - 0, a model serial number, or ON_UNSET_UINT_INDEX to
    1085  /// use the dimstyle's ModelSerialNumber() value.
    1086  /// Returns
    1087  /// Unit system for dimension length display.
    1088  /// If DimensionLengthDisplay() == ON_DimStyle::LengthDisplay::ModelUnits
    1089  /// and model_sn > 0, then the value of ON::LengthUnitSystemFromModelSerialNumber(model_sn)
    1090  /// is returned.
    1091  /// If DimensionLengthDisplay() == ON_DimStyle::LengthDisplay::ModelUnits
    1092  /// and model_sn == 0, then ON::LengthUnitSystem::None is returned.
    1093  ///</summary>
    1094  ON::LengthUnitSystem AlternateDimensionLengthDisplayUnit(
    1095  unsigned int model_sn
    1096  ) const;
    1097 
    1098 private:
    1099  /*
    1100  Returns:
    1101  true if value was changed.
    1102  */
    1103  bool Internal_SetBoolMember(
    1104  ON_DimStyle::field field_id,
    1105  bool value,
    1106  bool& class_member
    1107  );
    1108  /*
    1109  Returns:
    1110  true if value was changed.
    1111  */
    1112  bool Internal_SetUnsignedCharMember(
    1113  ON_DimStyle::field field_id,
    1114  unsigned char value,
    1115  unsigned char& class_member
    1116  );
    1117  /*
    1118  Returns:
    1119  true if value was changed.
    1120  */
    1121  bool Internal_SetIntMember(
    1122  ON_DimStyle::field field_id,
    1123  int value,
    1124  int& class_member
    1125  );
    1126  /*
    1127  Returns:
    1128  true if value was changed.
    1129  */
    1130  bool Internal_SetColorMember(
    1131  ON_DimStyle::field field_id,
    1132  ON_Color value,
    1133  ON_Color& class_member
    1134  );
    1135  /*
    1136  Returns:
    1137  true if value was changed.
    1138  */
    1139  bool Internal_SetDoubleMember(
    1140  ON_DimStyle::field field_id,
    1141  double value,
    1142  double& class_member
    1143  );
    1144  /*
    1145  Returns:
    1146  true if value was changed.
    1147  */
    1148  bool Internal_SetIdMember(
    1149  ON_DimStyle::field field_id,
    1150  ON_UUID value,
    1151  ON_UUID& class_member
    1152  );
    1153  /*
    1154  Returns:
    1155  true if value was changed.
    1156  */
    1157  bool Internal_SetStringMember(
    1158  ON_DimStyle::field field_id,
    1159  const wchar_t* value,
    1160  ON_wString& class_member
    1161  );
    1162 
    1163  void Internal_SetOverrideDimStyleCandidateFieldOverride(ON_DimStyle::field field_id);
    1164 
    1165 public:
    1166  // Extension line extension
    1167  double ExtExtension() const;
    1168  void SetExtExtension(const double);
    1169 
    1170  // Extension line offset
    1171  double ExtOffset() const;
    1172  void SetExtOffset(const double);
    1173 
    1174  // Arrow size
    1175  double ArrowSize() const;
    1176  void SetArrowSize(const double);
    1177 
    1178  // Arrow size
    1179  double LeaderArrowSize() const;
    1180  void SetLeaderArrowSize(const double);
    1181 
    1182  // Centermark size
    1183  double CenterMark() const;
    1184  void SetCenterMark(const double);
    1185 
    1186  // Centermark style
    1187  ON_DimStyle::centermark_style CenterMarkStyle() const;
    1188  void SetCenterMarkStyle(ON_DimStyle::centermark_style style);
    1189 
    1190  // The location of text relative to the dimension line in linear, angular, and ordinate dimensions.
    1191  ON_DimStyle::TextLocation DimTextLocation() const;
    1192  void SetDimTextLocation(ON_DimStyle::TextLocation);
    1193 
    1194  // The location of text relative to the dimension line in radial dimensions.
    1195  ON_DimStyle::TextLocation DimRadialTextLocation() const;
    1196  void SetDimRadialTextLocation(ON_DimStyle::TextLocation);
    1197 
    1198  angle_format AngleFormat() const;
    1199  void SetAngleFormat(angle_format format);
    1200 
    1201  // Display resolution for distance measurements
    1202  int LengthResolution() const;
    1203  void SetLengthResolution(int);
    1204 
    1205  // Display resolution for angle measurements
    1206  int AngleResolution() const;
    1207  void SetAngleResolution(int);
    1208 
    1209 public:
    1210  /*
    1211  Description:
    1212  Set the font used to render text.
    1213  Parameters:
    1214  font_characteristics - [in]
    1215  This parameter does not have to be a managed font.
    1216  Remarks:
    1217  If the parameter is a managed font (font_characteristics.IsManagedFont() is true),
    1218  then the identical value is returned by ON_DimStyle.Font().
    1219  If the parameter is not a managed font (font_characteristics.IsManagedFont() is false),
    1220  then the ON_Font::GetManagedFont(font_characteristics) will be returned by
    1221  ON_DimStyle.Font().
    1222  */
    1223  void SetFont(
    1224  const class ON_Font& font_characteristics
    1225  );
    1226 
    1227  /*
    1228  Returns:
    1229  The managed font used to render text.
    1230  */
    1231  const class ON_Font& Font() const;
    1232 
    1233  /*
    1234  Returns:
    1235  A copy of the font_characteristics information.
    1236  Remarks:
    1237  You probably want to use Font(). This function is only useful
    1238  in isolated situations and is typically used to study font
    1239  substitutions when a model moves between computers or platforms.
    1240  */
    1241  const class ON_Font& FontCharacteristics() const;
    1242 
    1243  /*
    1244  Returns:
    1245  True if the font returned by Font() is a substitute
    1246  for the font passed to SetFont().
    1247  Remarks:
    1248  Font substitution can occur when a model is moved between
    1249  computers that have different fonts installed.
    1250  */
    1251  const bool FontSubstituted() const;
    1252 
    1253 public:
    1254  /*
    1255  Description:
    1256  Two dimension styles have identical text orientation, glyph content,
    1257  and size parameters if and only if the have identical values of
    1258  TextPositionPropertiesHash().
    1259  Returns:
    1260  A SHA-1 hash of the information that controls text position and size.
    1261  Remarks:
    1262  Independent of id, parent id, name, and index.
    1263  */
    1264  const class ON_SHA1_Hash TextPositionPropertiesHash() const;
    1265 
    1266  /*
    1267  Description:
    1268  Two dimension styles have identical content if and only
    1269  if they have identical values of ContentHash().
    1270  Returns:
    1271  A SHA-1 hash of the information that controls annotation appearance.
    1272  Remarks:
    1273  Independent of id, parent id, name, and index.
    1274  */
    1275  const class ON_SHA1_Hash& ContentHash() const;
    1276 
    1277 private:
    1278  void Internal_TextPositionPropertiesChange();
    1279 
    1280 public:
    1281 
    1282  // Distance from dimension lines to text
    1283  double TextGap() const;
    1284  void SetTextGap(double gap);
    1285 
    1286  // Height of dimension text
    1287  double TextHeight() const;
    1288  void SetTextHeight(double height);
    1289 
    1290  /// <summary>
    1291  /// LengthFactor is a rarely used. It applies when a model is being
    1292  /// drawn to a scale and the dimension length values should be
    1293  /// reverse scaled. For example, if a model is drawn at 1/4 scale,
    1294  /// a line 5 units long indicates the real world line is 20 units
    1295  /// long. In this case setting LengthFactor to 4 would cause
    1296  /// a linear dimension applied to that line to display a value of 20.
    1297  ///</summary>
    1298  double LengthFactor() const;
    1299 
    1300  /// <summary>
    1301  /// LengthFactor is a rarely used. It applies when a model is being
    1302  /// drawn to a scale and the dimension length values should be
    1303  /// reverse scaled. For example, if a model is drawn at 1/4 scale,
    1304  /// a line 5 units long indicates the real world line is 20 units
    1305  /// long. In this case setting LengthFactor to 4 would cause
    1306  /// a linear dimension applied to that line to display a value of 20.
    1307  ///</summary>
    1308  void SetLengthFactor(double);
    1309 
    1310  // Additional measurement display toggle
    1311  bool Alternate() const;
    1312  void SetAlternate(bool);
    1313 
    1314  // Distance scale factor for alternate display
    1315  /// <summary>
    1316  /// AlternateLengthFactor is a rarely used. See Length factor for
    1317  /// a discription of this property.
    1318  ///</summary>
    1319  double AlternateLengthFactor() const;
    1320 
    1321  /// <summary>
    1322  /// AlternateLengthFactor is a rarely used. See Length factor for
    1323  /// a discription of this property.
    1324  ///</summary>
    1325  void SetAlternateLengthFactor(double);
    1326 
    1327  // Display resolution for alternate length measurements
    1328  int AlternateLengthResolution() const;
    1329  void SetAlternateLengthResolution(int);
    1330 
    1331  // Dimension prefix text
    1332  const ON_wString& Prefix() const;
    1333  void SetPrefix(const wchar_t*);
    1334 
    1335  // Dimension suffix text
    1336  const ON_wString& Suffix() const;
    1337  void SetSuffix(const wchar_t*);
    1338 
    1339  // Dimension alternate prefix text
    1340  const ON_wString& AlternatePrefix() const;
    1341  void SetAlternatePrefix(const wchar_t*);
    1342 
    1343  // Dimension alternate suffix text
    1344  const ON_wString& AlternateSuffix() const;
    1345  void SetAlternateSuffix(const wchar_t*);
    1346 
    1347  // Suppress first dimension extension line
    1348  bool SuppressExtension1() const;
    1349  void SetSuppressExtension1(bool);
    1350 
    1351  // Suppress second dimension extension line
    1352  bool SuppressExtension2() const;
    1353  void SetSuppressExtension2(bool);
    1354 
    1355  // Extension of dimension line past extension lines
    1356  double DimExtension() const;
    1357  void SetDimExtension(const double e);
    1358 
    1359 
    1360  //// Colors of Text
    1361  //ON_Color TextColor() const;
    1362  //void SetTextColor(ON_Color color);
    1363  //
    1364  // Combines a field id and a field value
    1365  // Dimensions will have an array of DimstyleField's to record
    1366  // dimension style overrides for individual dimensions
    1368  {
    1369  public:
    1371  : m_next(nullptr)
    1372  , m_field_id(ON_DimStyle::field::Unset)
    1373  {
    1374  m_val.s_val = nullptr;
    1375  }
    1377  {
    1378  if (nullptr != m_next)
    1379  {
    1380  delete m_next;
    1381  m_next = nullptr;
    1382  }
    1383  if (nullptr != m_val.s_val)
    1384  {
    1385  delete m_val.s_val;
    1386  m_val.s_val = nullptr;
    1387  }
    1388  }
    1389 
    1392  union
    1393  {
    1394  bool b_val;
    1395  int i_val;
    1396  unsigned char uc_val;
    1397  double d_val;
    1398  unsigned int c_val;
    1400  } m_val;
    1401  };
    1402 
    1403  /*
    1404  Parameters:
    1405  field_id - [in]
    1406  Returns:
    1407  false: (default)
    1408  The setting identified by field_id is inherited from the parent dimension style identified by ParentId().
    1409  true:
    1410  The setting identified by field_id is independet of any parent dimension style.
    1411  */
    1412  bool IsFieldOverride(ON_DimStyle::field field_id) const;
    1413 
    1414  /*
    1415  Parameters:
    1416  field_id - [in]
    1417  bOverrideParent - [in]
    1418  false:
    1419  The setting identified by field_id is inherited from the parent dimension style identified by ParentId().
    1420  true:
    1421  The setting identified by field_id is independent of any parent dimension style.
    1422  */
    1423  void SetFieldOverride(ON_DimStyle::field field_id, bool bOverrideParent);
    1424 
    1425  /*
    1426  Parameters:
    1427  bOverrideParent - [in]
    1428  true - if a field permits overriding, set it to true.
    1429  false - set all field override values to false.
    1430  */
    1431  void SetFieldOverrideAll(bool bOverrideParent);
    1432 
    1433  /*
    1434  Description:
    1435  All dimension style settings identified the ON_DimStyle::field enum,
    1436  except Name and Id, are inherited from the parent dimension style.
    1437  */
    1438  void ClearAllFieldOverrides();
    1439 
    1440  /*
    1441  Returns:
    1442  false: (default)
    1443  Every setting identified by a ON_DimStyle::field enum value, except name and id,
    1444  is inherited from the parent dimension style identified by ParentId().
    1445  true:
    1446  At least one setting identified by a ON_DimStyle::field enum value is
    1447  is independent of any parent dimension style.
    1448  */
    1449  bool HasOverrides() const;
    1450 
    1451  /*
    1452  Returns:
    1453  The content hash of the parent dimstyle. If there is no parent dimstyle, then
    1454  ON_SHA1_Hash::EmptyContent is returned.
    1455  */
    1456  const ON_SHA1_Hash& ParentContentHash() const;
    1457 
    1458  /*
    1459  Description:
    1460  Create a dimstyle from this that is configured to be customized for use
    1461  in creating a new annotation object.
    1462  Example:
    1463  ON_DimStyleContext = dim_style_context = ...;
    1464  ON_DimStyle my_dim_style = dim_style_context.CurrentDimStyle().CreateOverrideCandidate().
    1465  // Customize my_dim_style
    1466  my_dim_style.Set...(...);
    1467  Returns:
    1468  An ON_DimStyle configured to be modified and used as an override dimstyle for annotation objects.
    1469  */
    1470  const ON_DimStyle CreateOverrideCandidate() const;
    1471 
    1472  /*
    1473  Description:
    1474  Get an ON_DimStyle with the specified properties.
    1475  Parameters:
    1476  parent_dim_style - [in]
    1477  If you are getting ready to modify and existing annotation object,
    1478  a good options for this paramter is the dimstyle returned by ON_Annotation.DimStyle();
    1479  If you are getting ready to create a new annotation object, then get
    1480  an ON_DimStyleContext class and pass ON_DimStyleContext.CurrentDimStyle().
    1481  In Rhino, use CRhinoDoc.DimStyleContext() to get an ON_DimStyleContext.
    1482  In an ONX_Model, use ONX_Model.DimStyleContext() to get an ON_DimStyleContext.
    1483  In other situations, you can pass on of the system dimstyles like
    1484  ON_DimStyle::DefaultMillimeterSmall or ON_DimStyle::DefaultMillimeterArchitecture.
    1485  The worst possible choices are ON_DimStyle::Default or ON_DimStyle::Unset.
    1486  annotation_type - [in]
    1487  ON::AnnotationType::Unset if style will be used for multiple types of annotation
    1488  or a specific type. For example, if you are making a text object, pass ON::AnnotationType::Text;
    1489  if you are making a leader, pass ON::AnnotationType::Leader, and so on.
    1490  font - [in]
    1491  nullptr for current default or specify the font you want.
    1492  When in doubt, pass nullptr
    1493  model_space_text_scale - [in]
    1494  If > 0, then ON_DimStyle.DimScale() is set, otherwise current default is used.
    1495  When in doubt, pass ON_UNSET_VALUE.
    1496  text_height - [in]
    1497  text_height_unit_system - [in]
    1498  If text_height > 0, then ON_DimStyle.TextHeight() is set, otherwise current default is used.
    1499  When in doubt, pass ON_UNSET_VALUE.
    1500  valign - [in]
    1501  halign - [in]
    1502  valign and halign control placement of text in text objects and leaders.
    1503  The value of the annotation_type parameter determines which objects use the
    1504  valign and halign settings.
    1505  text_orientation - [in]
    1506  dim_text_location - [in]
    1507  Controls placement of text in linear, angular, radial and ordinate dimensions.
    1508  When in doubt, pass parent_dim_style.DimTextLocation().
    1509  Returns:
    1510  A dimstyle with the specified text properties.
    1511  Remarks:
    1512  This is a useful tool for creating the dimension style parameters to
    1513  CRhinoDoc.AddTextObject() and CRhinoDoc.AddLeaderObject().
    1514  */
    1515  static const ON_DimStyle CreateFromProperties(
    1516  const ON_DimStyle& parent_dim_style,
    1517  ON::AnnotationType annotation_type,
    1518  const ON_Font* font,
    1519  double model_space_text_scale,
    1520  double text_height,
    1521  ON::LengthUnitSystem text_height_unit_system,
    1522  ON::TextVerticalAlignment valign,
    1523  ON::TextHorizontalAlignment halign
    1524  );
    1525 
    1526  static const ON_DimStyle CreateFromProperties(
    1527  const ON_DimStyle& parent_dim_style,
    1528  ON::AnnotationType annotation_type,
    1529  const ON_Font* font,
    1530  double model_space_text_scale,
    1531  double text_height,
    1532  ON::LengthUnitSystem text_height_unit_system,
    1533  ON::TextVerticalAlignment valign,
    1534  ON::TextHorizontalAlignment halign,
    1535  ON::TextOrientation orientation,
    1536  ON_DimStyle::TextLocation dim_text_location
    1537  );
    1538 
    1539  static const ON_DimStyle CreateFromProperties(
    1540  const ON_DimStyle& parent_dim_style,
    1541  ON::AnnotationType annotation_type,
    1542  const ON_Font* font,
    1543  double model_space_text_scale,
    1544  double text_height,
    1545  ON::LengthUnitSystem text_height_unit_system
    1546  );
    1547 
    1548 private:
    1549  static void Internal_CreateFromProperties(
    1550  const ON_DimStyle& parent_dim_style,
    1551  ON::AnnotationType annotation_type,
    1552  const ON_Font* font,
    1553  double model_space_text_scale,
    1554  double text_height,
    1555  ON::LengthUnitSystem text_height_unit_system,
    1556  bool bSetAlignment,
    1557  ON::TextVerticalAlignment valign,
    1558  ON::TextHorizontalAlignment halign,
    1559  bool bSetOrientation,
    1560  ON::TextOrientation orientation,
    1561  bool bSetLocation,
    1562  ON_DimStyle::TextLocation dim_text_location,
    1563  ON_DimStyle& destination
    1564  );
    1565 public:
    1566 
    1567  /*
    1568 
    1569  */
    1570  bool IsOverrideDimStyleCandidate(
    1571  ON_UUID parent_id,
    1572  bool bRequireSetOverrides,
    1573  ON_wString* error_description = nullptr
    1574  ) const;
    1575 
    1576 
    1577  /*
    1578  Description:
    1579  For every dimension style property identified by a field_id ON_DimStyle::field enum,
    1580  except Name and Index, do the following:
    1581 
    1582  if ( source.IsFieldOverride(field_id) )
    1583  copy corresponding value from source to this
    1584  else
    1585  copy corresponding value from parent to this
    1586 
    1587  Set this->ParentId() = parent.Id().
    1588  Parameters:
    1589  src - [in]
    1590  It is permitted for src to be this.
    1591  parent - [in]
    1592  It is permitted for parent to be this.
    1593  */
    1594  void OverrideFields(
    1595  const ON_DimStyle& source,
    1596  const ON_DimStyle& parent
    1597  );
    1598 
    1599  /*
    1600  Description:
    1601  For every dimension style property identified by a field_id ON_DimStyle::field enum,
    1602  except Name and Index, if source and parent have different values, then
    1603  set the field overide for that property to true.
    1604  Parameters:
    1605  src - [in]
    1606  It is permitted for src to be this.
    1607  parent - [in]
    1608  It is permitted for parent to be this.
    1609  */
    1610  void OverrideFieldsWithDifferentValues(
    1611  const ON_DimStyle& source,
    1612  const ON_DimStyle& parent
    1613  );
    1614 
    1615  /*
    1616  Descripton:
    1617  Set the parent dimension style id to parent.Id() and copies
    1618  all inherited appearance properties from parent.
    1619  Parameters:
    1620  parent - [in]
    1621  If this->IsFieldOverride(field_id) is false, then the dimension style
    1622  property value corresponding to field_id is copied from parent to "this".
    1623  Remarks:
    1624  Identical to calling this->OverrideFields(*this,parent).
    1625  */
    1626  void InheritFields(const ON_DimStyle& parent);
    1627 
    1628  // Test if this dimstyle is the child of any other dimstyle
    1629  bool IsChildDimstyle() const;
    1630 
    1631  /*
    1632  Returns:
    1633  True if parent_id is not nil and parent_id == this->ParentId().
    1634  */
    1635  bool IsChildOf(const ON_UUID& parent_id) const;
    1636 
    1637  tolerance_format ToleranceFormat() const;
    1638  int ToleranceResolution() const;
    1639  double ToleranceUpperValue() const;
    1640  double ToleranceLowerValue() const;
    1641  double ToleranceHeightScale() const;
    1642 
    1643  void SetToleranceFormat(ON_DimStyle::tolerance_format format);
    1644  void SetToleranceResolution(int resolution);
    1645  void SetToleranceUpperValue(double upper_value);
    1646  void SetToleranceLowerValue(double lower_value);
    1647  void SetToleranceHeightScale(double scale);
    1648 
    1649  double BaselineSpacing() const;
    1650  void SetBaselineSpacing(double spacing);
    1651 
    1652  // Determines whether or not to draw a Text Mask
    1653  bool DrawTextMask() const;
    1654  void SetDrawTextMask(bool bDraw);
    1655 
    1656  // Determines where to get the color to draw a Text Mask
    1657  ON_TextMask::MaskType MaskFillType() const;
    1658  void SetMaskFillType(ON_TextMask::MaskType source);
    1659 
    1660  ON_Color MaskColor() const; // Only works right if MaskColorSource returns 1.
    1661  // Does not return viewport background color
    1662  void SetMaskColor(ON_Color color);
    1663 
    1664  // Offset for the border around text to the rectangle used to draw the mask
    1665  // This number is the offset on each side of the tight rectangle around the
    1666  // text characters to the mask rectangle.
    1667  double MaskBorder() const;
    1668  void SetMaskBorder(double offset);
    1669 
    1670  // The ON_TextMask class contains the property values for
    1671  // DrawTextMask()
    1672  // MaskColor()
    1673  // MaskFillType()
    1674  // MaskBorder()
    1675  // Use the
    1676  // SetDrawTextMask()
    1677  // SetMaskColor()
    1678  // SetMaskFillType()
    1679  // SetMaskBorder()
    1680  // functions to modify text mask properties.
    1681  const ON_TextMask& TextMask() const;
    1682  void SetTextMask(const ON_TextMask& text_mask);
    1683 
    1684 private:
    1685  void Internal_SetTextMask(
    1686  const ON_TextMask& text_mask
    1687  );
    1688 public:
    1689 
    1690  void Scale(double scale);
    1691 
    1692  // UUID of the dimstyle this was originally copied from
    1693  // so Restore Defaults has some place to look
    1694  void SetSourceDimstyle(ON_UUID source_uuid);
    1695  ON_UUID SourceDimstyle() const;
    1696 
    1697  void SetExtensionLineColorSource(const ON::object_color_source src);
    1698  ON::object_color_source ExtensionLineColorSource() const;
    1699  void SetDimensionLineColorSource(const ON::object_color_source src);
    1700  ON::object_color_source DimensionLineColorSource() const;
    1701  void SetArrowColorSource(const ON::object_color_source src);
    1702  ON::object_color_source ArrowColorSource() const;
    1703  void SetTextColorSource(const ON::object_color_source src);
    1704  ON::object_color_source TextColorSource() const;
    1705  void SetExtensionLineColor(ON_Color c);
    1706  ON_Color ExtensionLineColor() const;
    1707  void SetDimensionLineColor(ON_Color c);
    1708  ON_Color DimensionLineColor() const;
    1709  void SetArrowColor(ON_Color c);
    1710  ON_Color ArrowColor() const;
    1711  void SetTextColor(ON_Color c);
    1712  ON_Color TextColor() const;
    1713 
    1714  void SetExtensionLinePlotColorSource(const ON::plot_color_source src);
    1715  ON::plot_color_source ExtensionLinePlotColorSource() const;
    1716  void SetDimensionLinePlotColorSource(const ON::plot_color_source src);
    1717  ON::plot_color_source DimensionLinePlotColorSource() const;
    1718  void SetArrowPlotColorSource(const ON::plot_color_source src);
    1719  ON::plot_color_source ArrowPlotColorSource() const;
    1720  void SetTextPlotColorSource(const ON::object_color_source src);
    1721  ON::object_color_source TextPlotColorSource() const;
    1722  void SetExtensionLinePlotColor(ON_Color c);
    1723  ON_Color ExtensionLinePlotColor() const;
    1724  void SetDimensionLinePlotColor(ON_Color c);
    1725  ON_Color DimensionLinePlotColor() const;
    1726  void SetArrowPlotColor(ON_Color c);
    1727  ON_Color ArrowPlotColor() const;
    1728  void SetTextPlotColor(ON_Color c);
    1729  ON_Color TextPlotColor() const;
    1730 
    1731  void SetExtensionLinePlotWeightSource(const ON::plot_weight_source src);
    1732  ON::plot_weight_source ExtensionLinePlotWeightSource() const;
    1733  void SetDimensionLinePlotWeightSource(const ON::plot_weight_source src);
    1734  ON::plot_weight_source DimensionLinePlotWeightSource() const;
    1735  void SetExtensionLinePlotWeight(double w);
    1736  double ExtensionLinePlotWeight() const;
    1737  void SetDimensionLinePlotWeight(double w);
    1738  double DimensionLinePlotWeight() const;
    1739 
    1740  void SetFixedExtensionLen(double l);
    1741  double FixedExtensionLen() const;
    1742  void SetFixedExtensionLenOn(bool on);
    1743  bool FixedExtensionLenOn() const;
    1744 
    1745  void SetTextRotation(double r);
    1746  double TextRotation() const;
    1747 
    1748  void SetAlternateToleranceResolution(int r);
    1749  int AlternateToleranceResolution() const;
    1750 
    1751  void SetSuppressArrow1(bool s);
    1752  bool SuppressArrow1() const;
    1753  void SetSuppressArrow2(bool s);
    1754  bool SuppressArrow2() const;
    1755  void SetTextMoveLeader(int m);
    1756 
    1757  int TextMoveLeader() const;
    1758  void SetArcLengthSymbol(int m);
    1759  int ArcLengthSymbol() const;
    1760 
    1761  void SetStackFractionFormat(ON_DimStyle::stack_format f);
    1762  ON_DimStyle::stack_format StackFractionFormat() const;
    1763  void SetStackHeightScale(double f);
    1764  double StackHeightScale() const;
    1765 
    1766  void SetRoundOff(double r);
    1767  double RoundOff() const;
    1768  void SetAlternateRoundOff(double r);
    1769  double AlternateRoundOff() const;
    1770  void SetAngleRoundOff(double r);
    1771  double AngleRoundOff() const;
    1772  void SetZeroSuppress(ON_DimStyle::suppress_zero s);
    1773  ON_DimStyle::suppress_zero ZeroSuppress() const;
    1774  void SetAlternateZeroSuppress(ON_DimStyle::suppress_zero s);
    1775  ON_DimStyle::suppress_zero AlternateZeroSuppress() const;
    1776 
    1777  // OBSOLETE - The ZeroSuppress() or AlternateZeroSuppress() property
    1778  // is used to format tolerance display. ToleranceZeroSuppress() is ignored.
    1779  void SetToleranceZeroSuppress(ON_DimStyle::suppress_zero s);
    1780 
    1781  // OBSOLETE - The ZeroSuppress() or AlternateZeroSuppress() property
    1782  // is used to format tolerance display. ToleranceZeroSuppress() is ignored.
    1783  ON_DimStyle::suppress_zero ToleranceZeroSuppress() const;
    1784 
    1785  void SetAngleZeroSuppress(ON_DimStyle::suppress_zero s);
    1786  ON_DimStyle::suppress_zero AngleZeroSuppress() const;
    1787  void SetAlternateBelow(bool below);
    1788 
    1789  /*
    1790  Description:
    1791  The valid choices for ON_DimStyle::suppress_zero depend on
    1792  the dimension length display.
    1793  Parameters:
    1794  zero_suppress - [in]
    1795  length_display - [in]
    1796  Returns:
    1797  True if zero_suppression is a valid setting when
    1798  DimensionLengthDiplay = dimension_length_display
    1799  Remarks:
    1800  LengthDisplay: Inch fractional – No zero suppression matches
    1801  LengthDisplay : FeetAndInches – Zero suppress can be
    1802  None,
    1803  Suppress zero feet,
    1804  Suppress zero inches or
    1805  Suppress zero feet and zero inches.
    1806  LengthDisplay : ModelUnits or any Decimal mode – Zero suppress can be
    1807  None,
    1808  Suppress leading,
    1809  Suppress trailing or
    1810  Suppress leading and trailing.
    1811  */
    1812  static bool ZeroSuppressMatchesLengthDisplay(
    1813  ON_DimStyle::suppress_zero zero_suppress,
    1814  ON_DimStyle::LengthDisplay length_display);
    1815 
    1816  bool AlternateBelow() const;
    1817 
    1818  ON_Arrowhead::arrow_type ArrowType1() const;
    1819  void SetArrowType1(ON_Arrowhead::arrow_type);
    1820  ON_Arrowhead::arrow_type ArrowType2() const;
    1821  void SetArrowType2(ON_Arrowhead::arrow_type);
    1822  void SetArrowType1And2(ON_Arrowhead::arrow_type);
    1823  ON_Arrowhead::arrow_type LeaderArrowType() const;
    1824  void SetLeaderArrowType(ON_Arrowhead::arrow_type);
    1825 
    1826  void SetArrowBlockId1(ON_UUID id);
    1827  ON_UUID ArrowBlockId1() const;
    1828  void SetArrowBlockId2(ON_UUID id);
    1829  ON_UUID ArrowBlockId2() const;
    1830  void SetLeaderArrowBlockId(ON_UUID id);
    1831  ON_UUID LeaderArrowBlockId() const;
    1832 
    1833  ON::TextVerticalAlignment TextVerticalAlignment() const;
    1834  void SetTextVerticalAlignment(ON::TextVerticalAlignment style);
    1835  ON::TextVerticalAlignment LeaderTextVerticalAlignment() const; // was attachstyle
    1836  void SetLeaderTextVerticalAlignment(ON::TextVerticalAlignment style);
    1837  ON_DimStyle::ContentAngleStyle LeaderContentAngleStyle() const; // was contentalignment
    1838  void SetLeaderContentAngleStyle(ON_DimStyle::ContentAngleStyle style);
    1839  ON_DimStyle::leader_curve_type LeaderCurveType() const;
    1840  void SetLeaderCurveType(ON_DimStyle::leader_curve_type type);
    1841  bool LeaderHasLanding() const;
    1842  void SetLeaderHasLanding(bool landing);
    1843  double LeaderLandingLength() const;
    1844  void SetLeaderLandingLength(double length);
    1845  double LeaderContentAngleRadians() const;
    1846  void SetLeaderContentAngleRadians(double angle_radians);
    1847  double LeaderContentAngleDegrees() const;
    1848  void SetLeaderContentAngleDegrees(double angle_degrees);
    1849  ON::TextHorizontalAlignment TextHorizontalAlignment() const;
    1850  void SetTextHorizontalAlignment(ON::TextHorizontalAlignment halign);
    1851  ON::TextHorizontalAlignment LeaderTextHorizontalAlignment() const;
    1852  void SetLeaderTextHorizontalAlignment(ON::TextHorizontalAlignment halign);
    1853  bool DrawForward() const;
    1854  void SetDrawForward(bool drawforward);
    1855  bool SignedOrdinate() const;
    1856  void SetSignedOrdinate(bool allowsigned);
    1857 
    1858  /// <summary>
    1859  /// Unit system for dimension rendering sizes like TextHeight, TextGap, ArrowSize, ExtOffset,
    1860  /// and dozens of other properties that control the appearance and placement of the components
    1861  /// used to render a dimension.
    1862  ///</summary>
    1863  ON::LengthUnitSystem UnitSystem() const;
    1864 
    1865  /// <summary>
    1866  /// Unit system for dimension rendering sizes like TextHeight, TextGap, ArrowSize, ExtOffset,
    1867  /// and dozens of other properties that control the appearance and placement of the components
    1868  /// used to render a dimension.
    1869  ///</summary>
    1870  void SetUnitSystem(ON::LengthUnitSystem us);
    1871 
    1872  /*
    1873  Description:
    1874  When a dimension style unit system is not set,
    1875  this function examines the context the dimension style is
    1876  being used in and sets the unit system.
    1877  Parameters:
    1878  bUseName - [in]
    1879  Consider the name when assinging a unit system.
    1880  For example, a dimension style name "Millimters Small" would
    1881  be assinged a unit system of millimeters.
    1882  source_unit_system - [in]
    1883  unit system in the model or file where the dimension
    1884  style originated.
    1885  destination_unit_system - [in]
    1886  unit system in the model or file where the dimension
    1887  style will be used.
    1888  */
    1889  void SetUnitSystemFromContext(
    1890  bool bUseName,
    1891  ON::LengthUnitSystem source_unit_system,
    1892  ON::LengthUnitSystem destination_unit_system
    1893  );
    1894 
    1895  /*
    1896  Returns:
    1897  true if the unit system is set to an explicit valid length unit.
    1898  */
    1899  bool UnitSystemIsSet() const;
    1900 
    1901  const ON_ScaleValue& ScaleValue() const;
    1902  void SetDimScale(ON_ScaleValue sv);
    1903  void SetDimScale(double left_val, ON::LengthUnitSystem left_us, double right_val, ON::LengthUnitSystem right_us);
    1904 
    1905  double ScaleLeftLength_mm() const;
    1906  double ScaleRightLength_mm() const;
    1907 
    1908  void SetDimScale(double scale);
    1909  double DimScale() const;
    1910 
    1911  void SetDimScaleSource(int source);
    1912  int DimScaleSource() const; // 0: Global DimScale, 1: DimStyle DimScale
    1913 
    1914  void SetTextOrientation(ON::TextOrientation);
    1915  ON::TextOrientation TextOrientation() const;
    1916 
    1917  void SetLeaderTextOrientation(ON::TextOrientation);
    1918  ON::TextOrientation LeaderTextOrientation() const;
    1919 
    1920  void SetDimTextOrientation(ON::TextOrientation);
    1921  ON::TextOrientation DimTextOrientation() const;
    1922 
    1923  void SetDimRadialTextOrientation(ON::TextOrientation);
    1924  ON::TextOrientation DimRadialTextOrientation() const;
    1925 
    1926  ON_DimStyle::ContentAngleStyle DimTextAngleStyle() const;
    1927  void SetDimTextAngleStyle(ON_DimStyle::ContentAngleStyle style);
    1928 
    1929  ON_DimStyle::ContentAngleStyle DimRadialTextAngleStyle() const;
    1930  void SetDimRadialTextAngleStyle(ON_DimStyle::ContentAngleStyle style);
    1931 
    1932  bool TextUnderlined() const;
    1933  void SetTextUnderlined(bool underlined);
    1934 
    1935  //double ModelSize() const;
    1936  //void SetModelSize(double size);
    1937  //double PaperSize() const;
    1938  //void SetPaperSize(double size);
    1939 
    1940  // For converting to and from V5 Dimstyles
    1941  static int V5ArrowType(ON_Arrowhead::arrow_type v6type);
    1942  static int V5LengthFormat(ON_DimStyle::OBSOLETE_length_format v6format);
    1943  static int V5AngleFormat(ON_DimStyle::angle_format v6format);
    1944  static int V5ToleranceFormat(ON_DimStyle::tolerance_format v6format);
    1945  static int V5MaskColorSourceFromV6MaskType(ON_TextMask::MaskType mask_type);
    1946  static ON_Arrowhead::arrow_type V6ArrowType(int v5type);
    1947  static ON_DimStyle::OBSOLETE_length_format V6LengthFormat(int v5format);
    1948  static ON_DimStyle::angle_format V6AngleFormat(int v5format);
    1949  static ON_DimStyle::tolerance_format V6ToleranceFormat(int v5format);
    1950  static ON_TextMask::MaskType V6MaskTypeFromV5MaskColorSource(int v5_mask_color_source);
    1951 
    1952 private:
    1953  double m_extextension = 0.5; // extension line extension
    1954  double m_extoffset = 0.5; // extension line offset
    1955  double m_arrowsize = 1.0; // length of an arrow - may mean different things to different arrows
    1956  double m_leaderarrowsize = 1.0; // length of an arrow for leader style dimensions
    1957  double m_centermark = 0.5; // size of the + at circle centers
    1958  ON_DimStyle::centermark_style m_centermark_style = ON_DimStyle::centermark_style::Mark; // Display style for centermarks
    1959  double m_textgap = 0.25; // gap around the text for clipping dim line
    1960  double m_textheight = 1.0; // model unit height of dimension text before applying dimscale
    1961 
    1962  //ON::OBSOLETE_V5_TextDisplayMode m_REMOVE_ME_dimstyle_textalign = ON::OBSOLETE_V5_TextDisplayMode::kAboveLine;
    1965 
    1967  int m_angleresolution = 2; // for decimal degrees, digits past decimal
    1968 
    1969  /// <summary>
    1970  /// The DimensionLengthDisplay is property controls the unit system and format
    1971  /// of for display of lengths in dimensions. For more information, see the
    1972  /// descriptions of the ON_DimStyle::LengthDisplay enum values.
    1973  ///</summary>
    1975 
    1976  /// <summary>
    1977  /// Alternate DimensionLengthDisplay property.
    1978  /// See the description of m_dimension_length_display for more information about this property.
    1979  ///</summary>
    1980  ON_DimStyle::LengthDisplay m_alternate_dimension_length_display = ON_DimStyle::LengthDisplay::ModelUnits;
    1981 
    1982  /// <summary>
    1983  /// The LengthResolution property controls the precision of dimension length display.
    1984  ///
    1985  /// DECIMAL LENGHT DISPLAY:
    1986  /// If m_dimension_length_display is any of the ON_DimStyle::LengthDisplay decimal formats,
    1987  /// then m_lengthresolution is the number of digits after the decimal point.
    1988  /// For example, if m_lengthresolution is 2, then dimension length display will be n.ff
    1989  /// If m_lengthresolution=7, then dimension length display will be n.fffffff.
    1990  ///
    1991  /// FRACTONAL LENGHT DISPLAY:
    1992  /// If m_dimension_length_display is ON_DimStyle::LengthDisplay::InchesFractional or
    1993  /// ON_DimStyle::LengthDisplay::FeetAndInches, then fractional length display is used.
    1994  /// In this case any fractional part will be rouded to the closest multiple
    1995  /// of 1/(2^m_alternate_lengthresolution).
    1996  /// Examples: If fractional length display is used and m_lengthresolution=2,
    1997  // then the possible fractions are 1/4, 1/2(=2/4), 3/4.
    1998  /// If fractional length display is used and m_lengthresolution=7,
    1999  // then any fractional part is rounded to the closest multipl of 1/128 (128=2^7).
    2000  /// </summary>
    2001  int m_lengthresolution = 2;
    2002 
    2003  /// <summary>
    2004  /// Alternate LengthResolution property.
    2005  /// See the description of m_lengthresolution for more information about this property.
    2006  ///</summary>
    2007  int m_alternate_lengthresolution = 2;
    2008 
    2009  /// <summary>
    2010  /// The LengthFactor is property a rarely used. It applies when a model is being
    2011  /// drawn to a scale and the dimension length values should be
    2012  /// reverse scaled. For example, if a model is drawn at 1/4 scale,
    2013  /// a line 5 units long indicates the real world line is 20 units
    2014  /// long. In this case setting LengthFactor to 4 would cause
    2015  /// a linear dimension applied to that line to display a value of 20.
    2016  /// Use the DimensionLengthDisplay property to control length unit system scaling.
    2017  ///</summary>
    2018  double m_lengthfactor = 1.0; // (dimlfac) model units multiplier for length display
    2019 
    2020  /// <summary>
    2021  /// Alternate LengthFactor property.
    2022  /// See the description of m_lengthfactor for more information about this property.
    2023  ///</summary>
    2024  double m_alternate_lengthfactor = 1.0; // (dimaltf) model units multiplier for alternate length display
    2025 
    2026 
    2027 private:
    2028  // A copy of the font_characteristics passed to SetFont.
    2029  // This information is saved in 3dm archives.
    2030  ON_Font m_font_characteristics = ON_Font::Default;
    2031 
    2032  // The managed font returned by ON_Font::GetManagedFont(m_font).
    2033  // This is the value returned by ON_DimStyle.Font().
    2034  const ON_Font* m_managed_font = &ON_Font::Default;
    2035 
    2036 private:
    2037  // all dim style content
    2038  mutable ON_SHA1_Hash m_content_hash = ON_SHA1_Hash::EmptyContentHash;
    2039 
    2040  // text position properties content
    2041  mutable ON_SHA1_Hash m_text_position_properties_hash = ON_SHA1_Hash::EmptyContentHash;
    2042 
    2043  mutable ON_SHA1_Hash m_reserved_hash2 = ON_SHA1_Hash::EmptyContentHash;
    2044 
    2045  // parent dim style content
    2046  // All code should use ParentContentHash() to inspect this value.
    2047  // Is is set by OverrideFields(). It may be cleared by a call to ParentContentHash().
    2048  mutable ON_SHA1_Hash m_parent_dim_style_content_hash = ON_SHA1_Hash::EmptyContentHash;
    2049 
    2050 private:
    2051 
    2052 
    2053  bool m_bAlternate = false; // (dimalt) display alternate dimension string (or not)
    2054 
    2055 
    2056  ON_wString m_prefix; // string preceding dimension value string
    2057  ON_wString m_suffix; // string following dimension value string
    2058  ON_wString m_alternate_prefix; // string preceding alternate value string (Default = " [")
    2059  ON_wString m_alternate_suffix; // string following alternate value string (Default = "]")
    2060 
    2061  double m_dimextension = 0.0; // (dimdle) dimension line extension past the "tip" location
    2062 
    2063  bool m_bSuppressExtension1 = false; // flag to not draw extension lines
    2064  bool m_bSuppressExtension2 = false; // flag to not draw extension lines
    2065  bool m_bReserved1 = false;
    2066  bool m_bReserved2 = false;
    2067 
    2068  // m_field_override_count
    2069  // number of ON_DimStyle::field settings that are independent of the parent dimension style.
    2070  // (not inherited from)
    2071  // A value of 0 indicates every possible setting is inherited from the parent dimension style.
    2072  // A value > 0 indicates at least one setting is independent of the parent dimension style.
    2073  ON__UINT32 m_field_override_parent_count = 0;
    2074 
    2075  // m_field_override_bitsN (Up to 128 true/false) values.
    2076  // Each ON_DimStyle::field enum value > ON_DimStyle::field::Unset and < ON_DimStyle::field::Count
    2077  // has a corresponding bit in on of the m_field_override_bitsN values.
    2078  // When the bit is clear (0), the corresponding override parent setting value = false and
    2079  // that setting is inheritied from the parent dimension style. 0 is the default setting.
    2080  // When the bit is set (1), the corresponding override parent setting value = true and
    2081  // that setting is independent of the parent dimension style.
    2082  ON__UINT32 m_field_override_parent_bits0 = 0;
    2083  ON__UINT32 m_field_override_parent_bits1 = 0;
    2084  ON__UINT32 m_field_override_parent_bits2 = 0;
    2085  ON__UINT32 m_field_override_parent_bits3 = 0;
    2086  // Please do not replace this bitfield with an array of bools.
    2087  // Using bools approach will change the size of this class when additional dimension style
    2088  // settings are added and makes construction code more complicated.
    2089 
    2090 
    2091  /*
    2092  Parameters:
    2093  mask - [out]
    2094  0: field_id is not valid
    2095  (Unset, Name, Index, >= Count)
    2096  Name and Index settings cannot be inherited from the parent dimension style
    2097  not 0:
    2098  mask identifies the bit in the
    2099  mask - [out]
    2100  0: field_id is not valid
    2101  (Unset, Name, Index, >= Count)
    2102  Name and Index settings cannot be inherited from the parent dimension style
    2103  not 0:
    2104  mask identifies the bit in the
    2105  Returns:
    2106  nullptr:
    2107  field_id is not valid
    2108  (Unset, Name, Index, >= Count)
    2109  Name and Index settings cannot be inherited from the parent dimension style.
    2110  not nullptr:
    2111  Address of the m_field_override_bitsN member that mask applies to.
    2112  */
    2113  ON__UINT32* Internal_GetOverrideParentBit(ON_DimStyle::field field_id, ON__UINT32* mask) const;
    2114 
    2116  int m_tolerance_resolution = 4;
    2117  double m_tolerance_upper_value = 0.0; // or both upper and lower in symmetrical style
    2118  double m_tolerance_lower_value = 0.0;
    2119  double m_tolerance_height_scale = 0.7; // relative to the main dimension text
    2120 
    2121  double m_baseline_spacing = 3.0;
    2122 
    2123  ON_TextMask m_text_mask = ON_TextMask::None;
    2124 
    2125  // m_dimscale replaced by m_scale_value.RightToLeftScale()
    2126  //double m_dimscale = 1.0;
    2127  int m_dimscale_source = 0;
    2128 
    2129  // Uuid of source dimstyle to restore defaults
    2130  ON_UUID m_source_dimstyle = ON_nil_uuid;
    2131 
    2132  // Sub-object draw colors
    2133  unsigned char m_ext_line_color_source = 0;
    2134  unsigned char m_dim_line_color_source = 0;
    2135  unsigned char m_arrow_color_source = 0;
    2136  unsigned char m_text_color_source = 0;
    2137  ON_Color m_ext_line_color = ON_Color::Black;
    2138  ON_Color m_dim_line_color = ON_Color::Black;
    2139  ON_Color m_arrow_color = ON_Color::Black;
    2140  ON_Color m_text_color = ON_Color::Black;
    2141  unsigned char m_ext_line_plot_color_source = 0;
    2142  unsigned char m_dim_line_plot_color_source = 0;
    2143  unsigned char m_arrow_plot_color_source = 0;
    2144  unsigned char m_text_plot_color_source = 0;
    2145  ON_Color m_ext_line_plot_color = ON_Color::Black;
    2146  ON_Color m_dim_line_plot_color = ON_Color::Black;
    2147  ON_Color m_arrow_plot_color = ON_Color::Black;
    2148  ON_Color m_text_plot_color = ON_Color::Black;
    2149  unsigned char m_ext_line_plot_weight_source = 0;
    2150  unsigned char m_dim_line_plot_weight_source = 0;
    2151  double m_ext_line_plot_weight_mm = 0.0;
    2152  double m_dim_line_plot_weight_mm = 0.0;
    2153 
    2154  double m_fixed_extension_len = 1.0; // Fixed extension line length if m_fixed_extension_len_on is true
    2155  bool m_fixed_extension_len_on = false; // true: use fixed_extension_len, false: don't use m_fixed_extension_len
    2156 
    2157  double m_text_rotation = 0.0; // Dimension text rotation around text point (radians)
    2158  int m_alternate_tolerance_resolution = 4; // for decimal, digits past the decimal point, fractions: 1/2^n
    2159  double m_tol_textheight_fraction = 0.6; // fraction of main text height
    2160 
    2161  bool m_suppress_arrow1 = false; // false: dont suppress, true: suppress
    2162  bool m_suppress_arrow2 = false; // false: dont suppress, true: suppress
    2163  int m_textmove_leader = 0; // 0: move text anywhere, 1: add leader when moving text
    2164  int m_arclength_sym = 0; // 0: symbol before dim text, 1: symbol above dim text, no symbol
    2165  double m_stack_textheight_fraction = 0.7; // fraction of main text height
    2167  double m_alt_round = 0.0; // rounds to nearest specified value
    2168  double m_round = 0.0;
    2169  double m_angular_round = 0.0;
    2170 
    2173 
    2175 
    2176  bool m_alt_below = false; // true: display alternate text below main text
    2177  // false: display alternate text after main text
    2178  ON_Arrowhead::arrow_type m_arrow_type_1 = ON_Arrowhead::arrow_type::SolidTriangle; // Arrow types for ON_Dimension derived dimensions
    2181  ON_UUID m_arrow_block_id_1 = ON_nil_uuid;
    2182  ON_UUID m_arrow_block_id_2 = ON_nil_uuid;
    2183  ON_UUID m_leader_arrow_block_id = ON_nil_uuid;
    2184 
    2185  // Text
    2186  ON::TextVerticalAlignment m_text_vertical_alignment = ON::TextVerticalAlignment::Top;
    2187  ON::TextHorizontalAlignment m_text_horizontal_alignment = ON::TextHorizontalAlignment::Left;
    2188 
    2189  // Leader
    2190  ON::TextVerticalAlignment m_leader_text_vertical_alignment = ON::TextVerticalAlignment::Middle;
    2191  ON::TextHorizontalAlignment m_leader_text_horizontal_alignment = ON::TextHorizontalAlignment::Left;
    2192 
    2195  double m_leader_content_angle = 0.0;
    2196  bool m_leader_has_landing = true;
    2197  double m_leader_landing_length = 1.0;
    2198 
    2199  bool m_draw_forward = true;
    2200  bool m_signed_ordinate = true;
    2201  ON_ScaleValue m_scale_value = ON_ScaleValue::OneToOne;
    2202 
    2203  // Unit system for dimension rendering sizes like text height, and arrow head length.
    2204  // m_textheight, m_textgap, m_arrowsize, m_extoffset, and dozens of other properties
    2205  // that control the appearance and placement of the components used to render
    2206  // a dimension.
    2207  ON::LengthUnitSystem m_unitsystem = ON::LengthUnitSystem::None;
    2208 
    2209  ON::TextOrientation m_text_orientation = ON::TextOrientation::InPlane;
    2210  ON::TextOrientation m_leader_text_orientation = ON::TextOrientation::InPlane;
    2211  ON::TextOrientation m_dim_text_orientation = ON::TextOrientation::InPlane;
    2212  ON::TextOrientation m_dimradial_text_orientation = ON::TextOrientation::InPlane;
    2213 
    2216 
    2217  bool m_text_underlined = false; // extra/extended line under text block in leaders and radial dimensions
    2218 
    2219 private:
    2220  ON__UINT_PTR m_reserved = 0;
    2221 
    2222 private:
    2223  void Internal_ContentChange() const;
    2224 };
    2225 
    2226 
    2227 /*
    2228 Description:
    2229  A general and portable interface to access a model's available dimension styles.
    2230 Remarks:
    2231  The Rhino C++ SDK function CRhinoDoc.DimStyleContext() will return an ON_DimStyleContext for the Rhino model.
    2232  The ONX_Model function ONX_Model.DimStyleContext() will return an ON_DimStyleContext for ONX_Model model.
    2233 */
    2234 class ON_CLASS ON_DimStyleContext
    2235 {
    2236 public:
    2237  ON_DimStyleContext() = default;
    2238  virtual ~ON_DimStyleContext();
    2239  ON_DimStyleContext(const ON_DimStyleContext&) = default;
    2240  ON_DimStyleContext& operator=(const ON_DimStyleContext&) = default;
    2241 
    2242 public:
    2243  virtual const ON_DimStyle& CurrentDimStyle() const;
    2244 
    2245  virtual const ON_DimStyle* DimStyleFromId(
    2246  ON_UUID id,
    2247  const ON_DimStyle* not_found_result = nullptr
    2248  ) const;
    2249 
    2250  virtual const ON_DimStyle* DimStyleFromName(
    2251  const ON_NameHash& name_hash,
    2252  const ON_DimStyle* not_found_result = nullptr
    2253  ) const;
    2254 
    2255  virtual const ON_DimStyle* DimStyleFromContentHash(
    2256  const ON_SHA1_Hash& content_hash,
    2257  const ON_DimStyle* not_found_result = nullptr
    2258  ) const;
    2259 
    2260  virtual const ON_DimStyle* DimStyleFromFont(
    2261  const ON_Font& font,
    2262  double model_space_text_scale,
    2263  double text_height,
    2264  ON::LengthUnitSystem text_height_unit_system,
    2265  bool bReturnClosestMatch = true,
    2266  const ON_DimStyle* not_found_result = nullptr
    2267  ) const;
    2268 
    2269  virtual bool AddDimStyle(
    2270  const ON_DimStyle& dim_style,
    2271  bool bResolveNameAndIdConflicts
    2272  );
    2273 
    2274  virtual bool ModifyDimStyle(
    2275  ON_UUID model_dim_style_id,
    2276  const ON_DimStyle& dim_style
    2277  );
    2278 
    2279  virtual const ON_DimStyle* FirstDimStyle(
    2280  bool bIncludeSystemDimStyles = false,
    2281  bool bIncludeDeletedDimStyles = false
    2282  ) const;
    2283 
    2284  virtual const ON_DimStyle* NextDimStyle(
    2285  ON_UUID id,
    2286  bool bIncludeSystemDimStyles = false,
    2287  bool bIncludeDeletedDimStyles = false
    2288  ) const;
    2289 
    2290  virtual const ON_DimStyle* PrevDimStyle(
    2291  ON_UUID id,
    2292  bool bIncludeSystemDimStyles = false,
    2293  bool bIncludeDeletedDimStyles = false
    2294  ) const;
    2295 
    2296  virtual ON::LengthUnitSystem ModelUnitSystem() const;
    2297 
    2298  virtual ON__UINT64 ModelSerialNumber() const;
    2299 
    2300 protected:
    2301  mutable ON::LengthUnitSystem m_unit_system = ON::LengthUnitSystem::Millimeters;
    2302  mutable ON__UINT64 m_model_serial_number = 0;
    2303 };
    2304 
    2305 
    2306 #if defined(ON_DLL_TEMPLATE)
    2307 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_DimStyle*>;
    2308 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_DimStyle>;
    2309 #endif
    2310 
    2311 #endif
    static ON_DimStyle * CreateFromFont(const ON_Font *font_characteristics, double model_space_text_scale, const ON_DimStyle *dimstyle_settings, const class ON_ComponentManifest *manifest, ON_DimStyle *destination)
    ON_DimStyle::field m_field_id
    Definition: opennurbs_dimensionstyle.h:1391
    static const ON_DimStyle DefaultInchFractional
    index = -3, unique and persistent id.
    Definition: opennurbs_dimensionstyle.h:235
    bool b_val
    Definition: opennurbs_dimensionstyle.h:1394
    @@ -85,8 +83,8 @@ $(function() {
    Definition: opennurbs_model_component.h:25
    field
    Field identifiers used for file i/o and getting/setting values
    Definition: opennurbs_dimensionstyle.h:604
    Definition: opennurbs_dimensionstyle.h:21
    -
    void Dump(ON_TextLog &) const override
    unsigned int c_val
    Definition: opennurbs_dimensionstyle.h:1398
    +
    ON_DimStyle & operator=(const ON_DimStyle &)=default
    static const class ON_DimStyle & DimStyleOrDefault(const class ON_DimStyle *dimstyle)
    static const ON_DimStyle * FromModelComponentRef(const class ON_ModelComponentReference &model_component_reference, const ON_DimStyle *none_return_value)
    Definition: opennurbs_array.h:36
    @@ -95,7 +93,7 @@ $(function() {
    Definition: opennurbs_sha1.h:19
    Definition: opennurbs_dimensionstyle.h:1367
    stack_format
    Format of stacked fractions
    Definition: opennurbs_dimensionstyle.h:1000
    -
    bool IsValid(class ON_TextLog *text_log=nullptr) const override
    +
    void EmergencyDestroy()
    Interface.
    LengthDisplay
    Interface.
    Definition: opennurbs_dimensionstyle.h:445
    static const ON_DimStyle Unset
    Predefined default dimension styles always available.
    Definition: opennurbs_dimensionstyle.h:232
    Definition: opennurbs_array.h:732
    @@ -107,11 +105,14 @@ $(function() {
    TextLocation
    The location of text in linear, angular, radial, and ordinate dimensions.
    Definition: opennurbs_dimensionstyle.h:943
    Definition: opennurbs_color.h:24
    Text is above dimension line.
    +
    bool IsValid(class ON_TextLog *text_log=nullptr) const override
    virtual
    static const ON_DimStyle & SystemDimstyleFromIndex(int index)
    MaskType
    Text mask drawn with background color or explicit color
    Definition: opennurbs_dimensionstyle.h:103
    Definition: opennurbs_3dm_settings.h:108
    Definition: opennurbs_dimensionstyle.h:95
    +
    bool Read(ON_BinaryArchive &) override
    virtual
    +
    void Dump(ON_TextLog &) const override
    virtual
    static const ON_TextMask None
    Definition: opennurbs_dimensionstyle.h:135
    Text is centered in dimension line.
    Definition: opennurbs_bounding_box.h:25
    @@ -123,7 +124,6 @@ $(function() {
    Definition: opennurbs_dimensionstyle.h:2234
    An ON_Font is a face in a font family. It corresponds to a Windows LOGFONT, a .NET System...
    Definition: opennurbs_font.h:225
    Definition: opennurbs_archive.h:487
    -
    void EmergencyDestroy()
    static const ON_DimStyle Default
    index = -1, unique and persistent id.
    Definition: opennurbs_dimensionstyle.h:233
    static const ON_Color White
    0x00FFFFFFu on little endan, 0xFFFFFF00u on big endian
    Definition: opennurbs_color.h:34
    OBSOLETE_length_format
    Obsolete format for length display - use ON_DimStyle::DimensionLengthDisplay instead ...
    Definition: opennurbs_dimensionstyle.h:901
    @@ -139,16 +139,14 @@ $(function() {
    Definition: opennurbs_string_value.h:444
    Definition: opennurbs_textlog.h:20
    < use for generic serialization of binary data
    Definition: opennurbs_archive.h:1866
    -
    ON_ModelComponent & operator=(const ON_ModelComponent &source)
    leader_curve_type
    Type of leader curve
    Definition: opennurbs_dimensionstyle.h:578
    -
    virtual bool Read(ON_BinaryArchive &binary_archive)
    ON_DimStyle()
    Default constructor result is identical to ON_DimStyle::Unset;.
    Definition: opennurbs_model_component.h:1686
    static const ON_DimStyle DefaultMillimeterSmall
    index = -5, unique and persistent id.
    Definition: opennurbs_dimensionstyle.h:237
    ContentAngleStyle
    Angle for text or other leader or dimension content
    Definition: opennurbs_dimensionstyle.h:553
    static const ON_DimStyle & SystemDimstyleFromName(const ON_NameHash &name_hash)
    static const ON_Font Default
    Definition: opennurbs_font.h:512
    -
    virtual bool Write(ON_BinaryArchive &binary_archive) const
    +
    bool Write(ON_BinaryArchive &) const override
    virtual
    int i_val
    Definition: opennurbs_dimensionstyle.h:1395
    @@ -164,9 +162,9 @@ $(function() {
    diff --git a/6/d8/dd4/class_o_n___locale.html b/6/d8/dd4/class_o_n___locale.html index d214c69c..a1600cb9 100644 --- a/6/d8/dd4/class_o_n___locale.html +++ b/6/d8/dd4/class_o_n___locale.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Locale Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    -

    The ordinal locale.
    -String compares use ordinal element values. The decimal point is a period.

    +

    The ordinal locale. String compares use ordinal element values. The decimal point is a period.

    diff --git a/6/d8/de3/class_o_n___glyph_map-members.html b/6/d8/de3/class_o_n___glyph_map-members.html index 40dbfe02..65b68e55 100644 --- a/6/d8/de3/class_o_n___glyph_map-members.html +++ b/6/d8/de3/class_o_n___glyph_map-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/de3/opennurbs__system__runtime_8h_source.html b/6/d8/de3/opennurbs__system__runtime_8h_source.html index 885e49e3..a374bde2 100644 --- a/6/d8/de3/opennurbs__system__runtime_8h_source.html +++ b/6/d8/de3/opennurbs__system__runtime_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_system_runtime.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_system_runtime.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /*
    2 // Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved.
    3 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    4 // McNeel & Associates.
    5 //
    6 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    7 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    8 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    9 //
    10 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    11 //
    12 ////////////////////////////////////////////////////////////////
    13 */
    14 
    15 #if !defined(OPENNURBS_SYSTEM_RUNTIME_INC_)
    16 #define OPENNURBS_SYSTEM_RUNTIME_INC_
    17 
    18 /*
    19 ////////////////////////////////////////////////////////////////
    20 //
    21 // Determines the runtime environment where the code is executed.
    22 //
    23 ////////////////////////////////////////////////////////////////
    24 */
    25 
    26 
    27 /*
    28 ////////////////////////////////////////////////////////////
    29 //
    30 // BEGIN - ON_RUNTIME_APPLE / ON_RUNTIME_WIN / ON_RUNTIME_ANDROID defines
    31 //
    32 // ON_RUNTIME_* specifies the runtime C/C++ SDK being used
    33 // At most one the ON_RUNTIME_* should be defined
    34 //
    35 // ON_RUNTIME_APPLE / ON_RUNTIME_WIN / ON_RUNTIME_ANDROID
    36 //
    37 */
    38 #if (defined(__APPLE__) || defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR) || defined(__IOS__))
    39 
    40 #if !defined(ON_RUNTIME_APPLE)
    41 #define ON_RUNTIME_APPLE
    42 #endif
    43 
    44 #elif defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) || defined(WINDOWS) || defined(_WINDOWS_) || defined(__WINDOWS__)
    45 
    46 #if !defined(ON_RUNTIME_WIN)
    47 #define ON_RUNTIME_WIN
    48 #endif
    49 
    50 #elif defined(__ANDROID__)
    51 
    52 #if !defined(ON_RUNTIME_ANDROID)
    53 #define ON_RUNTIME_ANDROID
    54 #endif
    55 
    56 #endif
    57 /*
    58 //
    59 // END - ON_RUNTIME_APPLE / ON_RUNTIME_WIN / ON_RUNTIME_ANDROID defines
    60 //
    61 ////////////////////////////////////////////////////////////
    62 */
    63 
    64 /*
    65 ////////////////////////////////////////////////////////////
    66 //
    67 // BEGIN - Additional platform defines
    68 //
    69 // ON_64BIT_RUNTIME / ON_32BIT_RUNTIME
    70 // ON_LITTLE_ENDIAN / ON_BIG_ENDIAN
    71 // ON_SIZEOF_WCHAR_T
    72 // ON_RUNTIME_<PLATFORM>_<SUBPLATFORM>
    73 //
    74 */
    75 #if defined(ON_RUNTIME_APPLE)
    76 
    77 #if (defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR) || defined(__IOS__))
    78 #define ON_RUNTIME_APPLE_IOS
    79 #else
    80 #define ON_RUNTIME_APPLE_MACOS
    81 #endif
    82 
    83 #if (defined(__LP64__) || defined(__ppc64__))
    84 #define ON_64BIT_RUNTIME
    85 #elif defined(__LP32__)
    86 #define ON_32BIT_RUNTIME
    87 #else
    88 #error Add code to detect sizeof pointer on this Apple platform
    89 #endif
    90 
    91 #define ON_SIZEOF_WCHAR_T 4
    92 
    93 #if (defined(__ppc__) || defined(__ppc64__))
    94 #define ON_BIG_ENDIAN
    95 #else
    96 #define ON_LITTLE_ENDIAN
    97 #endif
    98 
    99 #elif defined(ON_RUNTIME_WIN)
    100 
    101 #define ON_SIZEOF_WCHAR_T 2
    102 
    103 #if defined(WINDOWS_PHONE)
    104 #define ON_RUNTIME_WIN_MOBILE
    105 #else
    106 #define ON_RUNTIME_WIN_WINOS
    107 #endif
    108 
    109 #if defined(_M_X64) || defined(_WIN64)
    110 #define ON_64BIT_RUNTIME
    111 #elif defined(_M_X86) || defined(_WIN32)
    112 #define ON_32BIT_RUNTIME
    113 #else
    114 #error Add code to detect sizeof pointer on this Windows platform
    115 #endif
    116 
    117 #if !defined(ON_LITTLE_ENDIAN)
    118 #if (defined(_M_X64) || defined(_M_IX86) || defined (__i386__) || defined( __x86_64__ ))
    119 #define ON_LITTLE_ENDIAN
    120 #endif
    121 #endif
    122 
    123 #elif defined(ON_RUNTIME_ANDROID)
    124 
    125 #if !defined(ON_SIZEOF_WCHAR_T)
    126 #define ON_SIZEOF_WCHAR_T 4
    127 #endif
    128 
    129 #endif
    130 
    131 #if !defined(ON_64BIT_RUNTIME) && !defined(ON_32BIT_RUNTIME)
    132 /* Attempt to determing runtime pointer size */
    133 #if (defined(_M_X64) || defined(__LP64__) || defined(__ppc64__))
    134 #define ON_64BIT_RUNTIME
    135 #elif (defined(_M_X86) || defined(__LP32__))
    136 #define ON_32BIT_RUNTIME
    137 #endif
    138 #endif
    139 
    140 #if defined(ON_64BIT_RUNTIME) && defined(ON_32BIT_RUNTIME)
    141 #error Exactly one of ON_64BIT_RUNTIME or ON_32BIT_RUNTIME must be defined.
    142 #endif
    143 
    144 #if !defined(ON_64BIT_RUNTIME) && !defined(ON_32BIT_RUNTIME)
    145 #error Exactly one of ON_64BIT_RUNTIME or ON_32BIT_RUNTIME must be defined.
    146 #endif
    147 
    148 #if defined(ON_BIG_ENDIAN) && defined(ON_LITTLE_ENDIAN)
    149 #error Exactly one of ON_LITTLE_ENDIAN or ON_BIG_ENDIAN should be defined.
    150 #endif
    151 
    152 #if !defined(ON_BIG_ENDIAN) && !defined(ON_LITTLE_ENDIAN)
    153 #error Exactly one of ON_LITTLE_ENDIAN or ON_BIG_ENDIAN should be defined.
    154 #endif
    155 
    156 /*
    157 //
    158 // END - Additional platform defines
    159 //
    160 ////////////////////////////////////////////////////////////
    161 */
    162 
    163 #endif
    diff --git a/6/d8/de6/opennurbs__qsort__template_8h_source.html b/6/d8/de6/opennurbs__qsort__template_8h_source.html index a0440fae..bd0b6d39 100644 --- a/6/d8/de6/opennurbs__qsort__template_8h_source.html +++ b/6/d8/de6/opennurbs__qsort__template_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_qsort_template.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_qsort_template.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 // NOTE: 14 April 2011 Dale Lear:
    2 // Replace this code with Mikko's "quacksort", once "quacksort" is fully debugged
    3 // This code is based ont the VC 2010 crt qsort.c file and must not be released
    4 // with public opennurbs.
    5 
    6 #if !defined(ON_COMPILING_OPENNURBS_QSORT_FUNCTIONS)
    7 /*
    8 See opennurbs_sort.cpp for examples of using openurbs_qsort_template.c
    9 to define type specific quick sort functions.
    10 */
    11 #error Do not compile openurbs_qsort_template.c directly.
    12 #endif
    13 
    14 #define ON_QSORT_CUTOFF 8 /* testing shows that this is good value */
    15 
    16 /* Note: the theoretical number of stack entries required is
    17  no more than 1 + log2(num). But we switch to insertion
    18  sort for CUTOFF elements or less, so we really only need
    19  1 + log2(num) - log2(CUTOFF) stack entries. For a CUTOFF
    20  of 8, that means we need no more than 30 stack entries for
    21  32 bit platforms, and 62 for 64-bit platforms. */
    22 #define ON_QSORT_STKSIZ (8*sizeof(void*) - 2)
    23 
    24 
    25 // ON_SORT_TEMPLATE_TYPE -> double, int, ....
    26 #if !defined(ON_SORT_TEMPLATE_TYPE)
    27 #error Define ON_SORT_TEMPLATE_TYPE macro before including opennurbs_qsort_template.c
    28 #endif
    29 
    30 #if !defined(ON_QSORT_FNAME)
    31 #error Define ON_QSORT_FNAME macro before including opennurbs_qsort_template.c
    32 #endif
    33 
    34 #if !defined(ON_QSORT_GT) && !defined(ON_QSORT_LE) && !defined(ON_QSORT_EQ)
    35 
    36 #if defined(ON_SORT_TEMPLATE_COMPARE)
    37 // use a compare function like strcmp for char* strings
    38 #define ON_QSORT_GT(A,B) ON_SORT_TEMPLATE_COMPARE(A,B) > 0
    39 #define ON_QSORT_LE(A,B) ON_SORT_TEMPLATE_COMPARE(A,B) <= 0
    40 #define ON_QSORT_EQ(A,B) ON_SORT_TEMPLATE_COMPARE(A,B) == 0
    41 #else
    42 // use type compares
    43 #define ON_QSORT_GT(A,B) *A > *B
    44 #define ON_QSORT_LE(A,B) *A <= *B
    45 #define ON_QSORT_EQ(A,B) *A == *B
    46 #endif
    47 
    48 #endif
    49 
    50 #if defined(ON_SORT_TEMPLATE_SWAP)
    51 #define ON_QSORT_SWAP ON_SORT_TEMPLATE_SWAP
    52 #elif defined(ON_SORT_TEMPLATE_USE_MEMCPY)
    53 #define ON_QSORT_SWAP(A,B) memcpy(&tmp,A,sizeof(tmp));memcpy(A,B,sizeof(tmp));memcpy(B,&tmp,sizeof(tmp))
    54 #else
    55 #define ON_QSORT_SWAP(A,B) tmp = *A; *A = *B; *B = tmp
    56 #endif
    57 
    58 
    59 // When opennurbs_qsort_template.h is included more than once
    60 // in the same file for sorting the same type with different
    61 // compare functions, then either
    62 // 1) After the first include, define ON_SORT_TEMPLATE_HAVE_SHORT_SORT
    63 // to prevent generation of an identical short-sort function
    64 // or
    65 // 2) Define different values of ON_QSORT_SHORT_SORT_FNAME to generate
    66 // different short-sort helper functions.
    67 #if !defined(ON_SORT_TEMPLATE_HAVE_SHORT_SORT)
    68 
    69 #if !defined(ON_QSORT_SHORT_SORT_FNAME)
    70 // The default name for the short sort helper function is ON__shortsort
    71 #define ON_QSORT_SHORT_SORT_FNAME ON__shortsort
    72 #endif
    73 
    74 static void ON_QSORT_SHORT_SORT_FNAME(ON_SORT_TEMPLATE_TYPE *, ON_SORT_TEMPLATE_TYPE *);
    75 static void ON_QSORT_SHORT_SORT_FNAME(ON_SORT_TEMPLATE_TYPE *lo, ON_SORT_TEMPLATE_TYPE *hi)
    76 {
    77  ON_SORT_TEMPLATE_TYPE *p;
    78  ON_SORT_TEMPLATE_TYPE *max;
    79  ON_SORT_TEMPLATE_TYPE tmp;
    80 
    81  /* Note: in assertions below, i and j are alway inside original bound of
    82  array to sort. */
    83 
    84  while (hi > lo)
    85  {
    86  /* A[i] <= A[j] for i <= j, j > hi */
    87  max = lo;
    88  for (p = lo+1; p <= hi; p++)
    89  {
    90  /* A[i] <= A[max] for lo <= i < p */
    91  if ( ON_QSORT_GT(p,max) )
    92  {
    93  max = p;
    94  }
    95  /* A[i] <= A[max] for lo <= i <= p */
    96  }
    97 
    98  /* A[i] <= A[max] for lo <= i <= hi */
    99 
    100  ON_QSORT_SWAP(max,hi);
    101 
    102  /* A[i] <= A[hi] for i <= hi, so A[i] <= A[j] for i <= j, j >= hi */
    103 
    104  hi--;
    105 
    106  /* A[i] <= A[j] for i <= j, j > hi, loop top condition established */
    107  }
    108  /* A[i] <= A[j] for i <= j, j > lo, which implies A[i] <= A[j] for i < j,
    109  so array is sorted */
    110 }
    111 #endif
    112 
    113 /* this parameter defines the cutoff between using quick sort and
    114  insertion sort for arrays; arrays with lengths shorter or equal to the
    115  below value use insertion sort */
    116 
    117 #if defined(ON_SORT_TEMPLATE_STATIC_FUNCTION)
    118 static
    119 #endif
    120 void
    121 ON_QSORT_FNAME (
    122  ON_SORT_TEMPLATE_TYPE *base,
    123  size_t num
    124  )
    125 {
    126  ON_SORT_TEMPLATE_TYPE *lo; /* start of sub-array currently sorting */
    127  ON_SORT_TEMPLATE_TYPE *hi; /* end of sub-array currently sorting */
    128  ON_SORT_TEMPLATE_TYPE *mid; /* points to middle of subarray */
    129  ON_SORT_TEMPLATE_TYPE *loguy; /* traveling pointers for partition step */
    130  ON_SORT_TEMPLATE_TYPE *higuy; /* traveling pointers for partition step */
    131  ON_SORT_TEMPLATE_TYPE *lostk[ON_QSORT_STKSIZ];
    132  ON_SORT_TEMPLATE_TYPE *histk[ON_QSORT_STKSIZ];
    133  size_t size; /* size of the sub-array */
    134  int stkptr; /* stack for saving sub-array to be processed */
    135  ON_SORT_TEMPLATE_TYPE tmp;
    136 
    137  if ( 0 == base || num < 2 )
    138  return;
    139 
    140  stkptr = 0; /* initialize stack */
    141 
    142  lo = base;
    143  hi = base + (num-1); /* initialize limits */
    144 
    145  /* this entry point is for pseudo-recursion calling: setting
    146  lo and hi and jumping to here is like recursion, but stkptr is
    147  preserved, locals aren't, so we preserve stuff on the stack */
    148 recurse:
    149 
    150  size = (hi - lo) + 1; /* number of el's to sort */
    151 
    152  /* below a certain size, it is faster to use a O(n^2) sorting method */
    153  if (size <= ON_QSORT_CUTOFF)
    154  {
    155  ON_QSORT_SHORT_SORT_FNAME(lo, hi);
    156  }
    157  else {
    158  /* First we pick a partitioning element. The efficiency of the
    159  algorithm demands that we find one that is approximately the median
    160  of the values, but also that we select one fast. We choose the
    161  median of the first, middle, and last elements, to avoid bad
    162  performance in the face of already sorted data, or data that is made
    163  up of multiple sorted runs appended together. Testing shows that a
    164  median-of-three algorithm provides better performance than simply
    165  picking the middle element for the latter case. */
    166 
    167  mid = lo + (size / 2); /* find middle element */
    168 
    169  /* Sort the first, middle, last elements into order */
    170  if ( ON_QSORT_GT(lo,mid) ) {ON_QSORT_SWAP(lo,mid);}
    171  if ( ON_QSORT_GT(lo,hi) ) {ON_QSORT_SWAP(lo,hi);}
    172  if ( ON_QSORT_GT(mid,hi) ) {ON_QSORT_SWAP(mid,hi);}
    173 
    174  /* We now wish to partition the array into three pieces, one consisting
    175  of elements <= partition element, one of elements equal to the
    176  partition element, and one of elements > than it. This is done
    177  below; comments indicate conditions established at every step. */
    178 
    179  loguy = lo;
    180  higuy = hi;
    181 
    182  /* Note that higuy decreases and loguy increases on every iteration,
    183  so loop must terminate. */
    184  for (;;)
    185  {
    186  /* lo <= loguy < hi, lo < higuy <= hi,
    187  A[i] <= A[mid] for lo <= i <= loguy,
    188  A[i] > A[mid] for higuy <= i < hi,
    189  A[hi] >= A[mid] */
    190 
    191  /* The doubled loop is to avoid calling comp(mid,mid), since some
    192  existing comparison funcs don't work when passed the same
    193  value for both pointers. */
    194 
    195  if (mid > loguy)
    196  {
    197  do {
    198  loguy++;
    199  } while (loguy < mid && ON_QSORT_LE(loguy,mid));
    200  }
    201  if (mid <= loguy)
    202  {
    203  do {
    204  loguy++;
    205  } while (loguy <= hi && ON_QSORT_LE(loguy,mid));
    206  }
    207 
    208  /* lo < loguy <= hi+1, A[i] <= A[mid] for lo <= i < loguy,
    209  either loguy > hi or A[loguy] > A[mid] */
    210 
    211  do {
    212  higuy--;
    213  } while (higuy > mid && ON_QSORT_GT(higuy,mid));
    214 
    215  /* lo <= higuy < hi, A[i] > A[mid] for higuy < i < hi,
    216  either higuy == lo or A[higuy] <= A[mid] */
    217 
    218  if (higuy < loguy)
    219  break;
    220 
    221  /* if loguy > hi or higuy == lo, then we would have exited, so
    222  A[loguy] > A[mid], A[higuy] <= A[mid],
    223  loguy <= hi, higuy > lo */
    224 
    225  ON_QSORT_SWAP(loguy,higuy);
    226 
    227  /* If the partition element was moved, follow it. Only need
    228  to check for mid == higuy, since before the swap,
    229  A[loguy] > A[mid] implies loguy != mid. */
    230 
    231  if (mid == higuy)
    232  mid = loguy;
    233 
    234  /* A[loguy] <= A[mid], A[higuy] > A[mid]; so condition at top
    235  of loop is re-established */
    236  }
    237 
    238  /* A[i] <= A[mid] for lo <= i < loguy,
    239  A[i] > A[mid] for higuy < i < hi,
    240  A[hi] >= A[mid]
    241  higuy < loguy
    242  implying:
    243  higuy == loguy-1
    244  or higuy == hi - 1, loguy == hi + 1, A[hi] == A[mid] */
    245 
    246  /* Find adjacent elements equal to the partition element. The
    247  doubled loop is to avoid calling comp(mid,mid), since some
    248  existing comparison funcs don't work when passed the same value
    249  for both pointers. */
    250 
    251  higuy++;
    252  if (mid < higuy) {
    253  do {
    254  higuy--;
    255  } while (higuy > mid && ON_QSORT_EQ(higuy,mid));
    256  }
    257  if (mid >= higuy) {
    258  do {
    259  higuy--;
    260  } while (higuy > lo && ON_QSORT_EQ(higuy,mid));
    261  }
    262 
    263  /* OK, now we have the following:
    264  higuy < loguy
    265  lo <= higuy <= hi
    266  A[i] <= A[mid] for lo <= i <= higuy
    267  A[i] == A[mid] for higuy < i < loguy
    268  A[i] > A[mid] for loguy <= i < hi
    269  A[hi] >= A[mid] */
    270 
    271  /* We've finished the partition, now we want to sort the subarrays
    272  [lo, higuy] and [loguy, hi].
    273  We do the smaller one first to minimize stack usage.
    274  We only sort arrays of length 2 or more.*/
    275 
    276  if ( higuy - lo >= hi - loguy ) {
    277  if (lo < higuy) {
    278  lostk[stkptr] = lo;
    279  histk[stkptr] = higuy;
    280  ++stkptr;
    281  } /* save big recursion for later */
    282 
    283  if (loguy < hi) {
    284  lo = loguy;
    285  goto recurse; /* do small recursion */
    286  }
    287  }
    288  else {
    289  if (loguy < hi) {
    290  lostk[stkptr] = loguy;
    291  histk[stkptr] = hi;
    292  ++stkptr; /* save big recursion for later */
    293  }
    294 
    295  if (lo < higuy) {
    296  hi = higuy;
    297  goto recurse; /* do small recursion */
    298  }
    299  }
    300  }
    301 
    302  /* We have sorted the array, except for any pending sorts on the stack.
    303  Check if there are any, and do them. */
    304 
    305  --stkptr;
    306  if (stkptr >= 0) {
    307  lo = lostk[stkptr];
    308  hi = histk[stkptr];
    309  goto recurse; /* pop subarray from stack */
    310  }
    311  else
    312  return; /* all subarrays done */
    313 }
    314 
    315 #undef ON_QSORT_GT
    316 #undef ON_QSORT_LE
    317 #undef ON_QSORT_EQ
    318 #undef ON_QSORT_SWAP
    319 #undef ON_QSORT_CUTOFF
    320 #undef ON_QSORT_STKSIZ
    321 
    322 
    diff --git a/6/d8/dea/class_o_n__2dex_map-members.html b/6/d8/dea/class_o_n__2dex_map-members.html index 7d5bcd4b..0ba9c844 100644 --- a/6/d8/dea/class_o_n__2dex_map-members.html +++ b/6/d8/dea/class_o_n__2dex_map-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/deb/class_o_n__3f_vector_array.html b/6/d8/deb/class_o_n__3f_vector_array.html index 25ca7b8e..6d676c76 100644 --- a/6/d8/deb/class_o_n__3f_vector_array.html +++ b/6/d8/deb/class_o_n__3f_vector_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3fVectorArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/deb/class_o_n___file_reference-members.html b/6/d8/deb/class_o_n___file_reference-members.html index 3407107e..f00baba1 100644 --- a/6/d8/deb/class_o_n___file_reference-members.html +++ b/6/d8/deb/class_o_n___file_reference-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/df2/class_o_n___dim_ordinate.html b/6/d8/df2/class_o_n___dim_ordinate.html index 277a2187..59fe319d 100644 --- a/6/d8/df2/class_o_n___dim_ordinate.html +++ b/6/d8/df2/class_o_n___dim_ordinate.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_DimOrdinate Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    enum  MeasuredDirection : unsigned char { MeasuredDirection::Unset = 0, MeasuredDirection::Xaxis = 1, MeasuredDirection::Yaxis = 2 - } - Ordinate dimension measures x or y direction More...
    + } Ordinate dimension measures x or y direction More...
    +   - Public Types inherited from ON_Dimension enum  ForceArrow : unsigned int { ForceArrow::Auto = 0, ForceArrow::Inside = 1, ForceArrow::Outside = 2 - } - Arrowheads forced Inside, or Outside of extension lines, or moved to fit. More...
    + } Arrowheads forced Inside, or Outside of extension lines, or moved to fit. More...
    +   enum  ForceText : unsigned int { ForceText::Auto = 0, ForceText::Inside = 1, ForceText::Right = 2, ForceText::Left = 3 - } - Text forced Inside, Right or Left of extension lines, or moved to fit (Auto). More...
    + } Text forced Inside, Right or Left of extension lines, or moved to fit (Auto). More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -990,14 +988,15 @@ Additional Inherited Members

    Detailed Description


      -
    • dimpt - - - - +
    • dimpt
    • + + + +
      -
    • -
    • kinkpt2 \ \ kinkoffset2 \
        + +
        +kinkpt2 \ \ kinkoffset2 \
        • kinkpt1 | | kinkoffset1 |
        • ldrpt 1 2 3
        @@ -2132,8 +2131,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -2280,9 +2279,9 @@ Additional Inherited Members
    diff --git a/6/d8/df5/class_o_n___font.html b/6/d8/df5/class_o_n___font.html index df573a60..8b6740d1 100644 --- a/6/d8/df5/class_o_n___font.html +++ b/6/d8/df5/class_o_n___font.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Font Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +

    Public Types

    enum  Constants : int { AnnotationFontCellHeight = 256, -AnnotationFontApplePointSize = 36, MetricsGlyphCodePoint = 'I' - } - miscellaneous constants use to initialize Windows LOGFONT fields More...
    + } miscellaneous constants use to initialize Windows LOGFONT fields More...
    +   typedef void(* ON_GetFontMetricsFuncType) (const ON_Font *font, ON_FontMetrics &font_unit_font_metrics)   @@ -104,15 +101,15 @@ Public Types   Stretch::Extraexpanded = 8, Stretch::Ultraexpanded = 9
    - } - Horizontal expansion or contraction of font More...
    + } Horizontal expansion or contraction of font More...
    +   enum  Style : unsigned char { Style::Unset = 0, Style::Upright = 1, Style::Italic = 2, Style::Oblique = 3 - } - Vertical angle of font Upright, Italic, or Oblique More...
    + } Vertical angle of font Upright, Italic, or Oblique More...
    +   enum  Weight : unsigned char {
      Weight::Unset = 0, @@ -128,8 +125,8 @@ Public Types   Weight::Ultrabold = 8, Weight::Heavy = 9
    - } - Weight enum values Avoid casting these values to int. Use ON_Font::WindowsLogfontWeightFromWeight() or ON_Font::AppleWeightOfFontFromWeight() or add another converter. More...
    + } Weight enum values Avoid casting these values to int. Use ON_Font::WindowsLogfontWeightFromWeight() or ON_Font::AppleWeightOfFontFromWeight() or add another converter. More...
    +   enum  WindowsConstants : unsigned char {
      logfont_ansi_charset = 0, @@ -272,8 +269,6 @@ Public Member Functions   bool SetFromAppleFontName (const wchar_t *apple_font_name)   -bool SetFromAppleFontName (const wchar_t *apple_font_name, double point_size) -  bool SetFromFontDescription (const wchar_t *font_description)   bool SetFromFontDescription (const wchar_t *font_description, const wchar_t *apple_font_name) @@ -305,8 +300,6 @@ Static Public Member Functions   static int CompareFontCharacteristics (const ON_Font &a, const ON_Font &b)   -static int ComparePlatformIndependentFontCharacteristics (const ON_Font &a, const ON_Font &b) -  static int CompareWeight (ON_Font::Weight weight_a, ON_Font::Weight weight_b)   static void DumpFreeTypeFace (ON__UINT_PTR free_type_face_ptr, ON_TextLog &text_log) @@ -343,8 +336,6 @@ Static Public Member Functions   static const ON_FontGetManagedFont (const ON_Font &font_characteristics, bool bCreateIfNotFound)   -static const ON_FontGetManagedFontFromAppleFontName (const char *apple_font_name) -  static const ON_FontGetManagedFontFromAppleFontName (const wchar_t *apple_font_name)   static const ON_FontGetManagedFontFromFontDescription (const wchar_t *font_description) @@ -435,12 +426,10 @@ Friends

    miscellaneous constants use to initialize Windows LOGFONT fields

    - -
    Enumerator
    AnnotationFontCellHeight 

    Windows LOGFONT.lfHeight value (NOT A POINT SIZE)

    +
    Enumerator
    AnnotationFontCellHeight 

    LOGFONT.lfHeight value.

    1995 - 2015: Windows fonts have variations in glyph size, design and kerning for different point sizes. Text in Rhino is generally placed around geometry and the relative spatial relationships between the text and the geometry must remain constant on all devices and at all "zoom" levels. We have to choose a point size and then apply appropriate scaling during display, printing, and in other rendering calculations. After many experiments and 20 years of commercial use, (1995-2015) we have found 256 works best. This value is used on all platforms because the calculations it is used in occur on all platforms. These calculations must return consistent results so models exchanged between platforms maintain spatial relationships between text and geometry.

    2017: (switching to freetype) The value ON_Font::Constants::AnnotationFontCellHeight is used to define "opennurbs normalized font coordinates". The scale ((double)ON_Font::Constants::AnnotationFontCellHeight)/(font definition grid height) is used to convert bounding information and outlines from a native font definition to opennurbs normalized font coordinates. Many TrueType fonts have font definition grid height = 2048. Many PostScript fonts have font definition grid height = 1000.

    AnnotationFontApplePointSize 

    This value is used on Apple platforms to get fonts used for rendering annotation. NSFont* apple_font = [NSFont fontWithName : <name> size : ON_Font::Constants::AnnotationFontApplePointSize]

    -
    MetricsGlyphCodePoint 

    ON_Font::Constants::metric_char is the unicode code point value for the glpyh used to calculate critical glyph metrics. It must be an 'I' or 'H', but we have not tested 'H'. There are problems with any other upper case latin letter in common fonts. In particular, the standard 'M' does not work. We have used 'I' for 22 years (1995 - 2017). This value is used on all platforms because the calculations it is used in occur on all platforms. These calculations must return consistent results so models exchanged between platforms maintain spatial relationships between text and geometry.

    @@ -670,7 +659,6 @@ Friends
    -

    Returns: The Apple Font Name. Remarks: The "Apple Font Name" is sometimes called the PostScript font name in the Mac OS "Font Book" application and in some other Apple documentation. It is NSFont.fontName or the "fontManagerName" string in this for loop: for (NSString* fontManagerName in[NSFontManager.sharedFontManager availableFonts]) { ... } It is the best choice of a string to pass as the "fontWithName" parameter in the following call: NSFont* apple_font = [NSFont fontWithName : fontName size : pointSize];

    @@ -688,7 +676,6 @@ Friends
    -

    Returns: The Apple Font Name. Remarks: The "Apple Font Name" is sometimes called the PostScript font name in the Mac OS "Font Book" application and in some other Apple documentation. It is NSFont.fontName or the "fontManagerName" string in this for loop: for (NSString* fontManagerName in[NSFontManager.sharedFontManager availableFonts]) { ... } It is the best choice of a string to pass as the "fontWithName" parameter in the following call: NSFont* apple_font = [NSFont fontWithName : fontName size : pointSize];

    @@ -776,8 +763,7 @@ Friends
    -

    Description: The correspondence between Apple "weight of font" values and ON_Font::Weight enum values is ON_Font::Weight::Thin = 1 ON_Font::Weight::Ultralight = 2 ON_Font::Weight::Light = 3 ON_Font::Weight::Normal = 4
    - ON_Font::Weight::Medium = 5 ON_Font::Weight::Semibold = 6 ON_Font::Weight::Bold = 7 ON_Font::Weight::Ultrabold = 8 ON_Font::Weight::Heavy = 9 Returns: The Apple "weight of font" value that corresponds to the ON_Font::Weight enum value.

    +

    Description: The correspondence between Apple "weight of font" values and ON_Font::Weight enum values is ON_Font::Weight::Thin = 1 ON_Font::Weight::Ultralight = 2 ON_Font::Weight::Light = 3 ON_Font::Weight::Normal = 4 ON_Font::Weight::Medium = 5 ON_Font::Weight::Semibold = 6 ON_Font::Weight::Bold = 7 ON_Font::Weight::Ultrabold = 8 ON_Font::Weight::Heavy = 9 Returns: The Apple "weight of font" value that corresponds to the ON_Font::Weight enum value.

    @@ -836,45 +822,7 @@ Friends
    -

    Description: Compares the font weight, style, stretch, underline, strikethrough, linefeed_ratio, facename, point size, and platform specific characteristics. Returns: -1: a characteristics < b characteristics 0: a characteristics = b characteristics +1: a characteristics > b characteristics Remarks: This is a legacy function and to preserve past behavior, some platform specific characteristics are not checked. Use FontCharacteristicsHash() when every characteristic needs to be compared.

    - -
    - - -

    ◆ ComparePlatformIndependentFontCharacteristics()

    - -
    -
    - - - - - -
    - - - - - - - - - - - - - - - - - - -
    static int ON_Font::ComparePlatformIndependentFontCharacteristics (const ON_Fonta,
    const ON_Fontb 
    )
    -
    -static
    -
    -

    Description: Compares the font weight, style, stretch, underline, strikethrough, linefeed_ratio, facename, and point size characteristics.

    -

    Does not compare platform specific characteristics like m_logfont_charset or m_apple_font_name. Returns: -1: a characteristics < b characteristics 0: a characteristics = b characteristics +1: a characteristics > b characteristics Remarks: This is a legacy function and to preserve past behavior, some platform specific characteristics are not checked. Use FontCharacteristicsHash() when every characteristic needs to be compared.

    +

    Description: Compares the font weight, style, stretch, underline, strikethrough, linefeed_ratio and facename characteristics. Returns: -1: a characteristics < b characteristics 0: a characteristics = b characteristics +1: a characteristics > b characteristics Remarks: This is a legacy function and to preserve past behavior, some platform specific characteristics are not checked. Use FontCharacteristicsHash() when every characteristic needs to be compared.

    @@ -1859,36 +1807,10 @@ Friends
    -
    - - -

    ◆ GetManagedFontFromAppleFontName() [1/2]

    - -
    -
    - - - - - -
    - - - - - - - - -
    static const ON_Font* ON_Font::GetManagedFontFromAppleFontName (const char * apple_font_name)
    -
    -static
    -
    -
    -

    ◆ GetManagedFontFromAppleFontName() [2/2]

    +

    ◆ GetManagedFontFromAppleFontName()

    @@ -3116,7 +3038,7 @@ Friends
    -

    ◆ SetFromAppleFontName() [1/2]

    +

    ◆ SetFromAppleFontName()

    @@ -3130,36 +3052,6 @@ Friends
    -

    Parameters: apple_font_name - [in] Remarks: The "Apple Font Name" is sometimes called the PostScript font name in the Mac OS "Font Book" application and in some other Apple documentation. It is NSFont.fontName or the "fontManagerName" string in this for loop: for (NSString* fontManagerName in[NSFontManager.sharedFontManager availableFonts]) { ... } It is the best choice of a string to pass as the "fontWithName" parameter in the following call: NSFont* apple_font = [NSFont fontWithName : apple_font_name size : pointSize];

    - -
    -
    - -

    ◆ SetFromAppleFontName() [2/2]

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    bool ON_Font::SetFromAppleFontName (const wchar_t * apple_font_name,
    double point_size 
    )
    -
    -

    Parameters: apple_font_name - [in] point_size - [in] Pass 0.0 for annotation fonts Remarks: The "Apple Font Name" is sometimes called the PostScript font name in the Mac OS "Font Book" application and in some other Apple documentation. It is NSFont.fontName or the "fontManagerName" string in this for loop: for (NSString* fontManagerName in[NSFontManager.sharedFontManager availableFonts]) { ... } It is the best choice of a string to pass as the "fontWithName" parameter in the following call: NSFont* apple_font = [NSFont fontWithName : apple_font_name size : pointSize];

    @@ -3377,8 +3269,7 @@ Friends
    -

    Description: The correspondence between Apple "weight of font" values and ON_Font::Weight enum values is ON_Font::Weight::Thin = 1 ON_Font::Weight::Ultralight = 2 ON_Font::Weight::Light = 3 ON_Font::Weight::Normal = 4
    - ON_Font::Weight::Medium = 5 ON_Font::Weight::Semibold = 6 ON_Font::Weight::Bold = 7 ON_Font::Weight::Ultrabold = 8 ON_Font::Weight::Heavy = 9 Returns: The best ON_Font::Weight enum value for the Apple weight of font.

    +

    Description: The correspondence between Apple "weight of font" values and ON_Font::Weight enum values is ON_Font::Weight::Thin = 1 ON_Font::Weight::Ultralight = 2 ON_Font::Weight::Light = 3 ON_Font::Weight::Normal = 4 ON_Font::Weight::Medium = 5 ON_Font::Weight::Semibold = 6 ON_Font::Weight::Bold = 7 ON_Font::Weight::Ultrabold = 8 ON_Font::Weight::Heavy = 9 Returns: The best ON_Font::Weight enum value for the Apple weight of font.

    @@ -3459,8 +3350,7 @@ Friends
    -

    Parameters: face_name - [in]
    -Returns: If the code is running on Windows: The appropriate value of LOGFONT.lfCharSet for the input facename. If the code is not running on Windows: ON_Font::WindowsConstants::logfont_default_charset.

    +

    Parameters: face_name - [in] Returns: If the code is running on Windows: The appropriate value of LOGFONT.lfCharSet for the input facename. If the code is not running on Windows: ON_Font::WindowsConstants::logfont_default_charset.

    @@ -3635,9 +3525,9 @@ Returns: If the code is running on Windows: The appropriate value of LOGFONT.lfC diff --git a/6/d8/df7/class_o_n___s_h_a1.html b/6/d8/df7/class_o_n___s_h_a1.html index f5c390d0..9f5f89ab 100644 --- a/6/d8/df7/class_o_n___s_h_a1.html +++ b/6/d8/df7/class_o_n___s_h_a1.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SHA1 Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
     

    Detailed Description

    -

    Description: ON_SHA1 is a small class for calculating the SHA-1 hash of a sequence of bytes. It may be use incrementally (the bytes do not have to be in a contiguous array in memory at one time).
    - Remarks: The ON_SHA1 class cannot be used for cryptographic or security applications. The SHA-1 hash algorithm is not suitable for cryptographic or security applications. The ON_SHA1 class does not "wipe" intermediate results.

    +

    Description: ON_SHA1 is a small class for calculating the SHA-1 hash of a sequence of bytes. It may be use incrementally (the bytes do not have to be in a contiguous array in memory at one time).

    +

    Remarks: The ON_SHA1 class cannot be used for cryptographic or security applications. The SHA-1 hash algorithm is not suitable for cryptographic or security applications. The ON_SHA1 class does not "wipe" intermediate results.

    If you have two different seqences of N bytes storing information (lower entropy than a random sequence) are you are not intentionally calculating the information to create a SHA-1 hash collision, then the probability that the sequences have the same SHA-1 hash is approximately 2^-80 ~ 10^-24.

    Constructor & Destructor Documentation

    @@ -965,9 +963,9 @@ Static Public Member Functions
    diff --git a/6/d8/df7/class_o_n___scale_value.html b/6/d8/df7/class_o_n___scale_value.html index f4346359..3dd48091 100644 --- a/6/d8/df7/class_o_n___scale_value.html +++ b/6/d8/df7/class_o_n___scale_value.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ScaleValue Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +

      ScaleStringFormat::Unset = 0xFF
    - } - Specifies prefered formats for automatically created string descriptions of a scale value. More...
    + } Specifies prefered formats for automatically created string descriptions of a scale value. More...
    +   diff --git a/6/d8/df7/struct_o_n___windows_b_i_t_m_a_p_f_i_l_e_h_e_a_d_e_r-members.html b/6/d8/df7/struct_o_n___windows_b_i_t_m_a_p_f_i_l_e_h_e_a_d_e_r-members.html index 07de3669..58f5faa9 100644 --- a/6/d8/df7/struct_o_n___windows_b_i_t_m_a_p_f_i_l_e_h_e_a_d_e_r-members.html +++ b/6/d8/df7/struct_o_n___windows_b_i_t_m_a_p_f_i_l_e_h_e_a_d_e_r-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@

    @@ -777,9 +775,9 @@ Static Public Attributes

    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/d8/df8/class_o_n___dim_style.html b/6/d8/df8/class_o_n___dim_style.html index 5b990606..f3c46bc6 100644 --- a/6/d8/df8/class_o_n___dim_style.html +++ b/6/d8/df8/class_o_n___dim_style.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_DimStyle Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    angle_format::DegMinSec = 1, angle_format::Radians = 2, angle_format::Grads = 3 - } - Display format for angles More...
    + } Display format for angles More...
    +   enum  centermark_style : unsigned char { centermark_style::None = 0, centermark_style::Mark = 1, centermark_style::MarkAndLines = 2 - } - Style for drawing centermark for Radial dimensions and Centermark objects More...
    + } Style for drawing centermark for Radial dimensions and Centermark objects More...
    +   enum  ContentAngleStyle : unsigned char { ContentAngleStyle::Horizontal = 0, ContentAngleStyle::Aligned = 1, ContentAngleStyle::Rotated = 2 - } - Angle for text or other leader or dimension content More...
    + } Angle for text or other leader or dimension content More...
    +   enum  field : unsigned int {
      field::Unset = 0, @@ -250,14 +248,14 @@ Public Types field::AlternateDimensionLengthDisplay = 110, field::Count = 111
    - } - Field identifiers used for file i/o and getting/setting values More...
    + } Field identifiers used for file i/o and getting/setting values More...
    +   enum  leader_curve_type : unsigned char { leader_curve_type::None = 0, leader_curve_type::Polyline = 1, leader_curve_type::Spline = 2 - } - Type of leader curve More...
    + } Type of leader curve More...
    +   enum  LengthDisplay : unsigned int {
      LengthDisplay::ModelUnits = 0, @@ -273,21 +271,21 @@ Public Types   LengthDisplay::FeetAndInches = 2, LengthDisplay::Miles = 9
    - } - Interface. More...
    + } Interface. More...
    +   enum  OBSOLETE_length_format : unsigned char { OBSOLETE_length_format::Decimal = 0, OBSOLETE_length_format::Fractional = 1, OBSOLETE_length_format::FeetInches = 2, OBSOLETE_length_format::FeetDecimalInches = 3 - } - Obsolete format for length display - use ON_DimStyle::DimensionLengthDisplay instead More...
    + } Obsolete format for length display - use ON_DimStyle::DimensionLengthDisplay instead More...
    +   enum  stack_format : unsigned char { stack_format::None = 0, stack_format::StackHorizontal = 1, stack_format::StackDiagonal = 2 - } - Format of stacked fractions More...
    + } Format of stacked fractions More...
    +   enum  suppress_zero : unsigned char {
      suppress_zero::None = 0, @@ -299,21 +297,21 @@ Public Types suppress_zero::SuppressZeroInches = 8, suppress_zero::SuppressZeroFeetAndZeroInches = 12
    - } - Marks leading and trailing zeros for removal. More...
    + } Marks leading and trailing zeros for removal. More...
    +   enum  TextLocation : unsigned char { TextLocation::AboveDimLine = 0, TextLocation::InDimLine = 1, TextLocation::BelowDimLine = 2 - } - The location of text in linear, angular, radial, and ordinate dimensions. More...
    + } The location of text in linear, angular, radial, and ordinate dimensions. More...
    +   enum  tolerance_format : unsigned char { tolerance_format::None = 0, tolerance_format::Symmetrical = 1, tolerance_format::Deviation = 2, tolerance_format::Limits = 3 - } - Style of tolerance display for dimensions More...
    + } Style of tolerance display for dimensions More...
    +   - Public Types inherited from ON_ModelComponent enum  Attributes : unsigned int {
    @@ -356,8 +354,8 @@ Public Types Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -3743,8 +3741,7 @@ Additional Inherited Members
    -

    Descripton: Set the parent dimension style id to parent.Id() and copies all inherited appearance properties from parent. Parameters: parent - [in] If this->IsFieldOverride(field_id) is false, then the dimension style property value corresponding to field_id is copied from parent to "this".
    -Remarks: Identical to calling this->OverrideFields(*this,parent).

    +

    Descripton: Set the parent dimension style id to parent.Id() and copies all inherited appearance properties from parent. Parameters: parent - [in] If this->IsFieldOverride(field_id) is false, then the dimension style property value corresponding to field_id is copied from parent to "this". Remarks: Identical to calling this->OverrideFields(*this,parent).

    @@ -8066,9 +8063,9 @@ Remarks: Identical to calling this->OverrideFields(*this,parent).

    diff --git a/6/d8/dfd/class_o_n___brep_loop-members.html b/6/d8/dfd/class_o_n___brep_loop-members.html index a25ac0bd..56393cfe 100644 --- a/6/d8/dfd/class_o_n___brep_loop-members.html +++ b/6/d8/dfd/class_o_n___brep_loop-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d8/dfd/class_o_n___file_reference.html b/6/d8/dfd/class_o_n___file_reference.html index 23aa9188..b5c58b07 100644 --- a/6/d8/dfd/class_o_n___file_reference.html +++ b/6/d8/dfd/class_o_n___file_reference.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_FileReference Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Returns: Parameters: recent_time - [in] The time, in number of seconds since January 1, 1970 UTC, to use when deciding what content hashes can be considered recent. If recent_time is 0 or in the future, then the current value of ON_SecondsSinceJanOne1970UTC() is used. Typically this parameter is the value of ON_SecondsSinceJanOne1970UTC() at the beginning of a calculation durint which any referenced files will not be changed.
    -Returns: A file content hash value calculated on or after a specified time in the current instance of the application. This value is used to detect changed files in the current instance of the application. It is cached for performance reasons. This value is never saved in 3dm files.

    +

    Returns: Parameters: recent_time - [in] The time, in number of seconds since January 1, 1970 UTC, to use when deciding what content hashes can be considered recent. If recent_time is 0 or in the future, then the current value of ON_SecondsSinceJanOne1970UTC() is used. Typically this parameter is the value of ON_SecondsSinceJanOne1970UTC() at the beginning of a calculation durint which any referenced files will not be changed. Returns: A file content hash value calculated on or after a specified time in the current instance of the application. This value is used to detect changed files in the current instance of the application. It is cached for performance reasons. This value is never saved in 3dm files.

    @@ -1363,9 +1360,9 @@ Returns: A file content hash value calculated on or after a specified time in th diff --git a/6/d9/d0d/opennurbs__point_8h_source.html b/6/d9/d0d/opennurbs__point_8h_source.html index 3b7a7116..cf4ae65a 100644 --- a/6/d9/d0d/opennurbs__point_8h_source.html +++ b/6/d9/d0d/opennurbs__point_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_point.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_point.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_point.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // defines double precision point, vector, and array classes
    20 //
    21 ////////////////////////////////////////////////////////////////
    22 #if !defined(ON_POINT_INC_)
    23 #define ON_POINT_INC_
    24 
    25 class ON_BoundingBox;
    26 class ON_Xform;
    27 class ON_Line;
    28 class ON_Plane;
    29 
    30 class ON_2dPoint;
    31 class ON_3dPoint;
    32 class ON_4dPoint;
    33 
    34 class ON_2dVector;
    35 class ON_3dVector;
    36 
    37 class ON_2fVector;
    38 class ON_3fVector;
    39 
    40 class ON_Interval;
    41 
    42 ////////////////////////////////////////////////////////////////
    43 //
    44 // ON_Interval
    45 //
    46 class ON_CLASS ON_Interval
    47 {
    48 public:
    49  static const ON_Interval EmptyInterval; // (ON_UNSET_VALUE,ON_UNSET_VALUE)
    50  static const ON_Interval ZeroToOne; // (0.0, 1.0)
    51  static const ON_Interval ZeroToTwoPi; // (0.0, 2.0*ON_PI)
    52  static const ON_Interval Nan; // (ON_DBL_QNAN,ON_DBL_QNAN)
    53 
    54 public:
    55  // The default constructor creates ON_Interval::EmptyInterval (ON_UNSET_VALUE,ON_UNSET_VALUE)
    56  ON_Interval();
    57  ~ON_Interval() = default;
    58  ON_Interval(const ON_Interval&) = default;
    59  ON_Interval& operator=(const ON_Interval&) = default;
    60 
    61  ON_Interval(double t0,double t1);
    62 
    63 public:
    64  // Interval = (m_t[0], m_t[1])
    65  double m_t[2];
    66 
    67 #if defined(OPENNURBS_WALL)
    68  // Goal is to eventually require = as the only way to modify ON_Interval values.
    69  ON_DEPRECATED_MSG("Use interval = ON_Interval::EmptyInterval;")
    70 #endif
    71  void Destroy();
    72 
    73  /*
    74  Description:
    75  Sets interval to [t0,t1]
    76  Parameters:
    77  t0 - [in]
    78  t1 - [in]
    79  See Also:
    80  ON_Interval::ON_Interval( double, double )
    81  */
    82  void Set(
    83  double t0,
    84  double t1
    85  );
    86 
    87  /*
    88  Description:
    89  Convert normalized parameter to interval value, or pair of values.
    90  Parameters:
    91  normalized_parameter - [in]
    92  Returns:
    93  Interval parameter
    94  min*(1.0-normalized_parameter) + max*normalized_parameter
    95  See Also:
    96  ON_Interval::NormalizedParameterAt
    97  */
    98  double ParameterAt (
    99  double normalized_parameter
    100  ) const;
    101  ON_Interval ParameterAt (
    102  ON_Interval normalized_interval
    103  ) const;
    104 
    105  /*
    106  Description:
    107  Convert interval value, or pair of values, to normalized parameter.
    108  Parameters:
    109  interval_parameter - [in] value in interval
    110  Returns:
    111  Normalized parameter x so that
    112  min*(1.0-x) + max*x = interval_parameter.
    113  See Also:
    114  ON_Interval::ParameterAt
    115  */
    116  double NormalizedParameterAt (
    117  double interval_parameter
    118  ) const;
    119  ON_Interval NormalizedParameterAt (
    120  ON_Interval interval_parameter
    121  ) const;
    122 
    123  double& operator[](int); // returns (index<=0) ? m_t[0] : m_t[1]
    124  double operator[](int) const; // returns (index<=0) ? m_t[0] : m_t[1]
    125  double& operator[](unsigned int); // returns (index<=0) ? m_t[0] : m_t[1]
    126  double operator[](unsigned int) const; // returns (index<=0) ? m_t[0] : m_t[1]
    127 
    128  double Min() const; // returns smaller of m_t[0] and m_t[1]
    129  double Max() const; // returns larger of m_t[0] and m_t[1]
    130  double Mid() const; // returns 0.5*(m_t[0] + m_t[1])
    131  double Length() const; // returns signed length, m_t[1]-m_t[0]
    132 
    133  bool IsIncreasing() const; // returns true if m_t[0] < m_t[1]
    134  bool IsDecreasing() const; // returns true if m_t[0] > m_t[0];
    135  bool IsInterval() const; // returns truc if m_t[0] != m_t[1]
    136  bool IsSingleton() const; // returns true if m_t[0] == m_t[1] != ON_UNSET_VALUE
    137  bool IsEmptyInterval() const; // returns true if m_t[0] == m_t[1] == ON_UNSET_VALUE
    138  bool IsValid() const; // returns ON_IsValid(m_t[0]) && ON_IsValid(m_t[1])
    139 
    140 #if defined(OPENNURBS_WALL)
    141  ON_DEPRECATED_MSG("Use IsEmptyInterval()")
    142 #endif
    143  bool IsEmptySet() const; // returns true if m_t[0] == m_t[1] == ON_UNSET_VALUE
    144 
    145  bool MakeIncreasing(); // returns true if resulting interval IsIncreasing()
    146 
    147  /*
    148  Description:
    149  A well ordered dictionary compare function that is nan aware and can
    150  be used for robust sorting.
    151  */
    152  static int Compare(
    153  const ON_Interval& lhs,
    154  const ON_Interval& rhs
    155  );
    156 
    157 
    158  /*
    159  Returns:
    160  True if (lhs.m_t[0] != rhs.m_t[0]) or (lhs.m_t[1] != rhs.m_t[1]) and
    161  no values are nans.
    162  */
    163  bool operator!=(const ON_Interval& rhs) const;
    164 
    165  /*
    166  Returns:
    167  True if (lhs.m_t[0] == rhs.m_t[0]) and (lhs.m_t[1] === rhs.m_t[1]).
    168  */
    169  bool operator==(const ON_Interval& rhs) const;
    170 
    171  /*
    172  Description:
    173  Test a value t to see if it is inside the interval.
    174  Parameters:
    175  t - [in] value to test
    176  bTestOpenInterval - [in]
    177  If false, t is tested to see if it satisfies min <= t <= max.
    178  If true, t is tested to see if it satisfies min < t < max.
    179  Returns:
    180  true if t is in the interval and false if t is not
    181  in the interval.
    182  */
    183  bool Includes(
    184  double t,
    185  bool bTestOpenInterval = false
    186  ) const;
    187 
    188  /*
    189  Description:
    190  Test an interval to see if it is contained in this interval.
    191  Parameters:
    192  other - [in] interval to test
    193  bProperSubSet - [in] if true, then the test is for a proper subinterval.
    194  Returns:
    195  If bProperSubSet is false, then the result is true when
    196  this->Min() <= other.Min() and other.Max() <= this->Max().
    197  If bProperSubSet is true, then the result is true when
    198  this->Min() <= other.Min() and other.Max() <= this->Max()
    199  and at least one of the inequalites is strict.
    200  */
    201  bool Includes(
    202  const ON_Interval& other,
    203  bool bProperSubSet = false
    204  ) const;
    205 
    206  /*
    207  Description:
    208  Test a pair of interval to see if they have a non-empty intersection.
    209  Parameters:
    210  A - [in] interval to test
    211  B - [in] interval to test
    212  Returns:
    213  true if the intersection is non-empty,
    214  including if the intersection is a single point.
    215  false otherwise.
    216  */
    217  static bool IntervalsOverlap(const ON_Interval& A, const ON_Interval& B);
    218 
    219  /*
    220  Description:
    221  Changes interval to [-m_t[1],-m_t[0]].
    222  */
    223  void Reverse();
    224 
    225  /*
    226  Description:
    227  Swaps m_t[0] and m_t[1].
    228  */
    229  void Swap();
    230 
    231  //////////
    232  // If the intersection is not empty, then
    233  // intersection = [max(this.Min(),arg.Min()), min(this.Max(),arg.Max())]
    234  // Intersection() returns true if the intersection is not empty.
    235  // The interval [ON_UNSET_VALUE,ON_UNSET_VALUE] is considered to be
    236  // the empty set interval. The result of any intersection involving an
    237  // empty set interval or disjoint intervals is the empty set interval.
    238  bool Intersection( // this = this intersect arg
    239  const ON_Interval&
    240  );
    241 
    242  //////////
    243  // If the intersection is not empty, then
    244  // intersection = [max(argA.Min(),argB.Min()), min(argA.Max(),argB.Max())]
    245  // Intersection() returns true if the intersection is not empty.
    246  // The interval [ON_UNSET_VALUE,ON_UNSET_VALUE] is considered to be
    247  // the empty set interval. The result of any intersection involving an
    248  // empty set interval or disjoint intervals is the empty set interval.
    249  bool Intersection( // this = intersection of two args
    250  const ON_Interval&,
    251  const ON_Interval&
    252  );
    253 
    254  //////////
    255  // The union of an empty set and an increasing interval is the increasing
    256  // interval. The union of two empty sets is empty. The union of an empty
    257  // set an a non-empty interval is the non-empty interval.
    258  // The union of two non-empty intervals is
    259  // union = [min(this.Min(),arg.Min()), max(this.Max(),arg.Max()),]
    260  // Union() returns true if the union is not empty.
    261  bool Union( // this = this union arg
    262  const ON_Interval&
    263  );
    264 
    265  bool Union( // this = this union arg
    266  double t
    267  );
    268 
    269  bool Union( // this = this union arg
    270  int count,
    271  const double* t
    272  );
    273 
    274  //////////
    275  // The union of an empty set and an increasing interval is the increasing
    276  // interval. The union of two empty sets is empty. The union of an empty
    277  // set an a non-empty interval is the non-empty interval.
    278  // The union of two non-empty intervals is
    279  // union = [min(argA.Min(),argB.Min()), max(argA.Max(),argB.Max()),]
    280  // Union() returns true if the union is not empty.
    281  bool Union( // this = union of two args
    282  const ON_Interval&,
    283  const ON_Interval&
    284  );
    285 };
    286 
    287 
    288 ////////////////////////////////////////////////////////////////
    289 //
    290 // ON_2dPoint
    291 //
    292 class ON_CLASS ON_2dPoint
    293 {
    294 public:
    295  double x, y;
    296 
    297 public:
    298  // x,y not initialized
    299  ON_2dPoint() = default;
    300  ~ON_2dPoint() = default;
    301  ON_2dPoint(const ON_2dPoint&) = default;
    302  ON_2dPoint& operator=(const ON_2dPoint&) = default;
    303 
    304 public:
    305  static const ON_2dPoint Origin; // (0.0,0.0)
    306  static const ON_2dPoint UnsetPoint; // (ON_UNSET_VALUE,ON_UNSET_VALUE)
    307  static const ON_2dPoint NanPoint; // (ON_DBL_QNAN,ON_DBL_QNAN)
    308 
    309  /*
    310  Description:
    311  A well ordered dictionary compare function that is nan aware and can
    312  be used for robust sorting.
    313  */
    314  static int Compare(
    315  const ON_2dPoint& lhs,
    316  const ON_2dPoint& rhs
    317  );
    318 
    319  explicit ON_2dPoint(double x,double y);
    320 #if defined(OPENNURBS_WALL)
    321  // Goal is to eventually have all constructors that discard informtion be explicit.
    322  explicit
    323 #endif
    324  ON_2dPoint(const ON_3dPoint& ); // from 3d point
    325 
    326  explicit ON_2dPoint(const ON_4dPoint& h); // from 4d point - h.w must be non-zero
    327  ON_2dPoint(const ON_2dVector& ); // from 2d vector
    328  explicit ON_2dPoint(const ON_3dVector& ); // from 3d vector
    329 
    330  explicit ON_2dPoint(const double*); // from double[2] array
    331 
    332  ON_2dPoint(const class ON_2fPoint&); // from 2f point
    333  explicit ON_2dPoint(const class ON_3fPoint&); // from 3f point
    334  explicit ON_2dPoint(const class ON_4fPoint& h); // from 4f point - h.w must be non-zero
    335  explicit ON_2dPoint(const class ON_2fVector&); // from 2f vector
    336  explicit ON_2dPoint(const class ON_3fVector&); // from 3f vector
    337 
    338  explicit ON_2dPoint(const float*); // from float[2] array
    339 
    340  // (double*) conversion operators
    341  operator double*();
    342  operator const double*() const;
    343 
    344  // use implicit operator=(const ON_2dPoint&)
    345  ON_2dPoint& operator=(const ON_3dPoint&);
    346  ON_2dPoint& operator=(const ON_4dPoint&);
    347  ON_2dPoint& operator=(const ON_2dVector&);
    348  ON_2dPoint& operator=(const ON_3dVector&);
    349  ON_2dPoint& operator=(const double*); // point = double[2] support
    350 
    351  ON_2dPoint& operator=(const ON_2fPoint&);
    352  ON_2dPoint& operator=(const ON_3fPoint&);
    353  ON_2dPoint& operator=(const ON_4fPoint&);
    354  ON_2dPoint& operator=(const ON_2fVector&);
    355  ON_2dPoint& operator=(const ON_3fVector&);
    356  ON_2dPoint& operator=(const float*); // point = float[2] support
    357 
    358  ON_2dPoint& operator*=(double);
    359  ON_2dPoint& operator/=(double);
    360  ON_2dPoint& operator+=(const ON_2dVector&);
    361  ON_2dPoint& operator-=(const ON_2dVector&);
    362 
    363  ON_2dPoint operator*(int) const;
    364  ON_2dPoint operator/(int) const;
    365  ON_2dPoint operator*(float) const;
    366  ON_2dPoint operator/(float) const;
    367  ON_2dPoint operator*(double) const;
    368  ON_2dPoint operator/(double) const;
    369 
    370  ON_2dPoint operator+(const ON_2dPoint&) const;
    371  ON_2dPoint operator+(const ON_2dVector&) const;
    372  ON_2dVector operator-(const ON_2dPoint&) const;
    373  ON_2dPoint operator-(const ON_2dVector&) const;
    374  ON_3dPoint operator+(const ON_3dPoint&) const;
    375  ON_3dPoint operator+(const ON_3dVector&) const;
    376  ON_3dVector operator-(const ON_3dPoint&) const;
    377  ON_3dPoint operator-(const ON_3dVector&) const;
    378 
    379  ON_2dPoint operator+(const ON_2fPoint&) const;
    380  ON_2dPoint operator+(const ON_2fVector&) const;
    381  ON_2dVector operator-(const ON_2fPoint&) const;
    382  ON_2dPoint operator-(const ON_2fVector&) const;
    383  ON_3dPoint operator+(const ON_3fPoint&) const;
    384  ON_3dPoint operator+(const ON_3fVector&) const;
    385  ON_3dVector operator-(const ON_3fPoint&) const;
    386  ON_3dPoint operator-(const ON_3fVector&) const;
    387 
    388  double operator*(const ON_2dPoint&) const; // dot product for points acting as vectors
    389  double operator*(const ON_2dVector&) const; // dot product for points acting as vectors
    390 
    391  ON_2dPoint operator*(const ON_Xform&) const;
    392 
    393  bool operator==(const ON_2dPoint&) const;
    394  bool operator!=(const ON_2dPoint&) const;
    395 
    396  // dictionary order comparisons
    397  bool operator<=(const ON_2dPoint&) const;
    398  bool operator>=(const ON_2dPoint&) const;
    399  bool operator<(const ON_2dPoint&) const;
    400  bool operator>(const ON_2dPoint&) const;
    401 
    402  // index operators mimic double[2] behavior
    403  double& operator[](int);
    404  double operator[](int) const;
    405  double& operator[](unsigned int);
    406  double operator[](unsigned int) const;
    407 
    408  /*
    409  Returns:
    410  False if any coordinate is infinte, a nan, or ON_UNSET_VALUE.
    411  */
    412  bool IsValid() const;
    413 
    414  /*
    415  Returns:
    416  True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    417  */
    418  bool IsUnset() const;
    419 
    420  // set 2d point value
    421  void Set(double x,double y);
    422 
    423  double DistanceTo( const ON_2dPoint& ) const;
    424 
    425  int MaximumCoordinateIndex() const;
    426  double MaximumCoordinate() const; // absolute value of maximum coordinate
    427 
    428  int MinimumCoordinateIndex() const;
    429  double MinimumCoordinate() const; // absolute value of minimum coordinate
    430 
    431  ON_DEPRECATED_MSG("Use p = ON_2dPoint::Origin;")
    432  void Zero(); // set all coordinates to zero;
    433 
    434  /*
    435  Returns:
    436  true if all coordinates are not zero and no coordinates are nans.
    437  false otherwise.
    438  */
    439  bool IsZero() const;
    440 
    441  /*
    442  Returns:
    443  true if at lease one coordinate is not zero and no coordinates are nans.
    444  */
    445  bool IsNotZero() const;
    446 
    447  // These transform the point in place. The transformation matrix acts on
    448  // the left of the point; i.e., result = transformation*point
    449  void Transform(
    450  const ON_Xform&
    451  );
    452 
    453  void Rotate( // rotatation in XY plane
    454  double angle, // angle in radians
    455  const ON_2dPoint& center // center of rotation
    456  );
    457 
    458  void Rotate( // rotatation in XY plane
    459  double sin_angle, // sin(angle)
    460  double cos_angle, // cos(angle)
    461  const ON_2dPoint& center // center of rotation
    462  );
    463 
    464  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    465 };
    466 
    467 ON_DECL
    468 ON_2dPoint operator*(int, const ON_2dPoint&);
    469 
    470 ON_DECL
    471 ON_2dPoint operator*(float, const ON_2dPoint&);
    472 
    473 ON_DECL
    474 ON_2dPoint operator*(double, const ON_2dPoint&);
    475 
    476 ////////////////////////////////////////////////////////////////
    477 //
    478 // ON_3dPoint
    479 //
    480 class ON_CLASS ON_3dPoint
    481 {
    482 public:
    483  double x, y, z;
    484 
    485 public:
    486  // x,y,z not initialized
    487  ON_3dPoint() = default;
    488  ~ON_3dPoint() = default;
    489  ON_3dPoint(const ON_3dPoint&) = default;
    490  ON_3dPoint& operator=(const ON_3dPoint&) = default;
    491 
    492 public:
    493  static const ON_3dPoint Origin; // (0.0,0.0,0.0)
    494  static const ON_3dPoint UnsetPoint; // (ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE)
    495  static const ON_3dPoint NanPoint; // (ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN)
    496 
    497  /*
    498  Description:
    499  A well ordered dictionary compare function that is nan aware and can
    500  be used for robust sorting.
    501  */
    502  static int Compare(
    503  const ON_3dPoint& lhs,
    504  const ON_3dPoint& rhs
    505  );
    506 
    507 public:
    508  explicit ON_3dPoint(double x,double y,double z);
    509 #if defined(OPENNURBS_WALL)
    510  // Goal is to eventually have all constructors that discard informtion be explicit.
    511  explicit
    512 #endif
    513  ON_3dPoint(const ON_2dPoint& ); // from 2d point
    514  explicit ON_3dPoint(const ON_4dPoint& h); // from 4d point - h.w must be non-zero
    515  explicit ON_3dPoint(const ON_2dVector& ); // from 2d vector
    516  ON_3dPoint(const ON_3dVector& ); // from 3d vector
    517  explicit ON_3dPoint(const double*); // from double[3] array
    518 
    519  explicit ON_3dPoint(const class ON_2fPoint&); // from 2f point
    520  ON_3dPoint(const class ON_3fPoint&); // from 3f point
    521  explicit ON_3dPoint(const class ON_4fPoint& h ); // from 4f point- h.w must be non-zero
    522  explicit ON_3dPoint(const class ON_2fVector&); // from 2f point
    523  explicit ON_3dPoint(const class ON_3fVector&); // from 3f point
    524  explicit ON_3dPoint(const float*); // from float[3] array
    525 
    526  // (double*) conversion operators
    527  operator double*();
    528  operator const double*() const;
    529 
    530  // use implicit operator=(const ON_3dPoint&)
    531  ON_3dPoint& operator=(const ON_2dPoint&);
    532  ON_3dPoint& operator=(const ON_4dPoint&);
    533  ON_3dPoint& operator=(const ON_2dVector&);
    534  ON_3dPoint& operator=(const ON_3dVector&);
    535  ON_3dPoint& operator=(const double*); // point = double[3] support
    536 
    537  ON_3dPoint& operator=(const class ON_2fPoint&);
    538  ON_3dPoint& operator=(const class ON_3fPoint&);
    539  ON_3dPoint& operator=(const class ON_4fPoint&);
    540  ON_3dPoint& operator=(const class ON_2fVector&);
    541  ON_3dPoint& operator=(const class ON_3fVector&);
    542  ON_3dPoint& operator=(const float*); // point = float[3] support
    543 
    544  ON_3dPoint& operator*=(double);
    545  ON_3dPoint& operator/=(double);
    546  ON_3dPoint& operator+=(const ON_3dVector&);
    547  ON_3dPoint& operator-=(const ON_3dVector&);
    548 
    549  ON_3dPoint operator*(int) const;
    550  ON_3dPoint operator/(int) const;
    551  ON_3dPoint operator*(float) const;
    552  ON_3dPoint operator/(float) const;
    553  ON_3dPoint operator*(double) const;
    554  ON_3dPoint operator/(double) const;
    555 
    556  ON_3dPoint operator+(const ON_3dPoint&) const;
    557  ON_3dPoint operator+(const ON_3dVector&) const;
    558  ON_3dVector operator-(const ON_3dPoint&) const;
    559  ON_3dPoint operator-(const ON_3dVector&) const;
    560  ON_3dPoint operator+(const ON_2dPoint&) const;
    561  ON_3dPoint operator+(const ON_2dVector&) const;
    562  ON_3dVector operator-(const ON_2dPoint&) const;
    563  ON_3dPoint operator-(const ON_2dVector&) const;
    564 
    565  ON_3dPoint operator+(const ON_3fPoint&) const;
    566  ON_3dPoint operator+(const ON_3fVector&) const;
    567  ON_3dVector operator-(const ON_3fPoint&) const;
    568  ON_3dPoint operator-(const ON_3fVector&) const;
    569  ON_3dPoint operator+(const ON_2fPoint&) const;
    570  ON_3dPoint operator+(const ON_2fVector&) const;
    571  ON_3dVector operator-(const ON_2fPoint&) const;
    572  ON_3dPoint operator-(const ON_2fVector&) const;
    573 
    574  double operator*(const ON_3dPoint&) const; // dot product for points acting as vectors
    575  double operator*(const ON_3dVector&) const; // dot product for points acting as vectors
    576 
    577  ON_3dPoint operator*(const ON_Xform&) const;
    578 
    579  bool operator==(const ON_3dPoint&) const;
    580  bool operator!=(const ON_3dPoint&) const;
    581 
    582  // dictionary order comparisons
    583  bool operator<=(const ON_3dPoint&) const;
    584  bool operator>=(const ON_3dPoint&) const;
    585  bool operator<(const ON_3dPoint&) const;
    586  bool operator>(const ON_3dPoint&) const;
    587 
    588  // index operators mimic double[3] behavior
    589  double& operator[](int);
    590  double operator[](int) const;
    591  double& operator[](unsigned int);
    592  double operator[](unsigned int) const;
    593 
    594  /*
    595  Returns:
    596  False if any coordinate is infinte, a nan, or ON_UNSET_VALUE.
    597  */
    598  bool IsValid() const;
    599 
    600  /*
    601  Returns:
    602  True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    603  */
    604  bool IsUnset() const;
    605 
    606  // set 3d point value
    607  void Set(double x,double y,double z);
    608 
    609  double DistanceTo( const ON_3dPoint& ) const;
    610 
    611  int MaximumCoordinateIndex() const;
    612  double MaximumCoordinate() const; // absolute value of maximum coordinate
    613 
    614  int MinimumCoordinateIndex() const;
    615  double MinimumCoordinate() const; // absolute value of minimum coordinate
    616 
    617  double Fuzz( double tolerance = ON_ZERO_TOLERANCE ) const; // tolerance to use when comparing 3d points
    618 
    619 #if defined(OPENNURBS_WALL)
    620  // Goal is to eventually remove all functions that modify points in place.
    621  ON_DEPRECATED_MSG("Use p = ON_3dPoint::Origin;")
    622 #endif
    623  void Zero(); // set all coordinates to zero;
    624 
    625  /*
    626  Returns:
    627  true if all coordinates are not zero and no coordinates are nans.
    628  false otherwise.
    629  */
    630  bool IsZero() const;
    631 
    632  /*
    633  Returns:
    634  true if at lease one coordinate is not zero and no coordinates are nans.
    635  */
    636  bool IsNotZero() const;
    637 
    638  // These transform the point in place. The transformation matrix acts on
    639  // the left of the point; i.e., result = transformation*point
    640  void Transform(
    641  const ON_Xform&
    642  );
    643 
    644  void Rotate(
    645  double angle, // angle in radians
    646  const ON_3dVector& axis, // axis of rotation
    647  const ON_3dPoint& center // center of rotation
    648  );
    649 
    650  void Rotate(
    651  double sin_angle, // sin(angle)
    652  double cos_angle, // cos(angle)
    653  const ON_3dVector& axis, // axis of rotation
    654  const ON_3dPoint& center // center of rotation
    655  );
    656 
    657  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    658 };
    659 
    660 ON_DECL
    661 ON_3dPoint operator*(int, const ON_3dPoint&);
    662 
    663 ON_DECL
    664 ON_3dPoint operator*(float, const ON_3dPoint&);
    665 
    666 ON_DECL
    667 ON_3dPoint operator*(double, const ON_3dPoint&);
    668 
    669 ////////////////////////////////////////////////////////////////
    670 //
    671 // ON_4dPoint (homogeneous coordinates)
    672 //
    673 class ON_CLASS ON_4dPoint
    674 {
    675 public:
    676  double x, y, z, w;
    677 
    678  /*
    679  Returns:
    680  ON_UNSET_VALUE, if x or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    681  and neither x nor w is a nan.
    682  x/w, otherwise
    683  Remarks:
    684  If w is 0.0 or nan, the result will be a nan.
    685  */
    686  double EuclideanX() const;
    687 
    688  /*
    689  Returns:
    690  ON_UNSET_VALUE, if y or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    691  and neither y nor w is a nan.
    692  y/w, otherwise
    693  Remarks:
    694  If w is 0.0 or nan, the result will be a nan.
    695  */
    696  double EuclideanY() const;
    697 
    698  /*
    699  Returns:
    700  ON_UNSET_VALUE, if z or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    701  and neither z nor w is a nan.
    702  z/w, otherwise
    703  Remarks:
    704  If w is 0.0 or nan, the result will be a nan.
    705  */
    706  double EuclideanZ() const;
    707 
    708 public:
    709  // x,y,z,w not initialized
    710  ON_4dPoint() = default;
    711  ~ON_4dPoint() = default;
    712  ON_4dPoint(const ON_4dPoint&) = default;
    713  ON_4dPoint& operator=(const ON_4dPoint&) = default;
    714 
    715 public:
    716  static const ON_4dPoint Zero; // (0,0,0,0)
    717  static const ON_4dPoint Nan; // (ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN)
    718 
    719  explicit ON_4dPoint(double x,double y,double z,double w);
    720 
    721  // These constructors are not explicit because no informtion is lost.
    722  ON_4dPoint(const ON_2dPoint& ); // from 2d point (z,y,0,1)
    723  ON_4dPoint(const ON_3dPoint& ); // from 3d point (x,y,z,1)
    724  ON_4dPoint(const ON_2dVector& ); // from 2d vector (x,y,0,0)
    725  ON_4dPoint(const ON_3dVector& ); // from 3d vector (x,y,z,0)
    726 
    727  explicit ON_4dPoint(const double*); // from double[4] array
    728 
    729  // These constructors are not explicit because no informtion is lost.
    730  ON_4dPoint(const ON_2fPoint& ); // from 2f point (z,y,0,1)
    731  ON_4dPoint(const ON_3fPoint& ); // from 3f point (x,y,z,1)
    732  ON_4dPoint(const ON_4fPoint& ); // from 4f point
    733  ON_4dPoint(const ON_2fVector& ); // from 2f vector (z,y,0,0)
    734  ON_4dPoint(const ON_3fVector& ); // from 3f vector (x,y,z,0)
    735 
    736  explicit ON_4dPoint(const float*); // from float[4] array
    737 
    738  /*
    739  Description:
    740  This function is provided because in rare cases it makes sense.
    741  If you are not certian why you want this value, think carefully
    742  or work with vectors and points in Euclidean coordinates.
    743  Returns:
    744  lhs.x*rhs.x + lhs.y*rhs.y + lhs.z*rhs.z + lhs.w*rhs.w;
    745  Remark:
    746  It is intentional that there is no operator* override for ON_4dPoint.
    747  This intentional omission helps people pause and think before calling
    748  ON_4dPoint::InnerProduct().
    749  */
    750  static double InnerProduct(
    751  const ON_4dPoint& lhs,
    752  const ON_4dPoint& rhs
    753  );
    754 
    755  // (double*) conversion operators
    756  operator double*();
    757  operator const double*() const;
    758 
    759  // use implicit operator=(const ON_4dPoint&)
    760  ON_4dPoint& operator=(const ON_2dPoint&);
    761  ON_4dPoint& operator=(const ON_3dPoint&);
    762  ON_4dPoint& operator=(const ON_2dVector&);
    763  ON_4dPoint& operator=(const ON_3dVector&);
    764  ON_4dPoint& operator=(const double*); // point = double[4] support
    765 
    766  ON_4dPoint& operator=(const class ON_2fPoint&);
    767  ON_4dPoint& operator=(const class ON_3fPoint&);
    768  ON_4dPoint& operator=(const class ON_4fPoint&);
    769  ON_4dPoint& operator=(const class ON_2fVector&);
    770  ON_4dPoint& operator=(const class ON_3fVector&);
    771  ON_4dPoint& operator=(const float*); // point = float[4] support
    772 
    773  ON_4dPoint& operator*=(double);
    774  ON_4dPoint& operator/=(double);
    775  ON_4dPoint& operator+=(const ON_4dPoint&); // sum w = sqrt(|w1*w2|)
    776  ON_4dPoint& operator-=(const ON_4dPoint&); // difference w = sqrt(|w1*w2|)
    777 
    778  ON_4dPoint operator*(double) const;
    779  ON_4dPoint operator/(double) const;
    780  ON_4dPoint operator+(const ON_4dPoint&) const; // sum w = sqrt(|w1*w2|)
    781  ON_4dPoint operator-(const ON_4dPoint&) const; // difference w = sqrt(|w1*w2|)
    782 
    783  ON_4dPoint operator*(const ON_Xform&) const;
    784 
    785  /*
    786  Description:
    787  A well ordered projective compare function that is nan aware and can
    788  be used for robust sorting.
    789  Remarks:
    790  double c = non-nan value.
    791  ON_4dPoint h0 = ...;
    792  ON_4dPoint h1(c*h0.x,c*h0.x,c*h0.x,c*h0.x);
    793  0 == ON_4dPoint::ProjectiveCompare(h0,ha);
    794  */
    795  static int ProjectiveCompare(
    796  const ON_4dPoint& lhs,
    797  const ON_4dPoint& rhs
    798  );
    799 
    800  /*
    801  Description:
    802  A well ordered dictionary compare function that is nan aware and can
    803  be used for robust sorting.
    804  */
    805  static int DictionaryCompare(
    806  const ON_4dPoint& lhs,
    807  const ON_4dPoint& rhs
    808  );
    809 
    810  /*
    811  Returns:
    812  True if (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z && lhs.w == rhs.w).
    813  */
    814  bool operator==(const ON_4dPoint& rhs) const;
    815 
    816  /*
    817  Returns:
    818  True if lhs.* != rhs.* for some coordinate and no values are nans.
    819  */
    820  bool operator!=(const ON_4dPoint& rhs) const;
    821 
    822 public:
    823  // index operators mimic double[4] behavior
    824  double& operator[](int);
    825  double operator[](int) const;
    826  double& operator[](unsigned int);
    827  double operator[](unsigned int) const;
    828 
    829  /*
    830  Returns:
    831  False if any coordinate is infinte, a nan, or ON_UNSET_VALUE.
    832  */
    833  bool IsValid() const;
    834 
    835  /*
    836  Returns:
    837  True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    838  */
    839  bool IsUnset() const;
    840 
    841  // set 4d point value
    842  void Set(double x,double y,double z,double w);
    843 
    844  int MaximumCoordinateIndex() const;
    845  double MaximumCoordinate() const; // absolute value of maximum coordinate
    846 
    847  int MinimumCoordinateIndex() const;
    848  double MinimumCoordinate() const; // absolute value of minimum coordinate
    849 
    850  bool Normalize(); // set so x^2 + y^2 + z^2 + w^2 = 1
    851 
    852  // These transform the point in place. The transformation matrix acts on
    853  // the left of the point; i.e., result = transformation*point
    854  void Transform(
    855  const ON_Xform&
    856  );
    857 
    858  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    859 };
    860 
    861 ON_DECL
    862 ON_4dPoint operator*(double, const ON_4dPoint&);
    863 
    864 ////////////////////////////////////////////////////////////////
    865 //
    866 // ON_2dVector
    867 //
    868 class ON_CLASS ON_2dVector
    869 {
    870 public:
    871  double x, y;
    872 
    873 public:
    874  // x,y not initialized
    875  ON_2dVector() = default;
    876  ~ON_2dVector() = default;
    877  ON_2dVector(const ON_2dVector&) = default;
    878  ON_2dVector& operator=(const ON_2dVector&) = default;
    879 
    880 public:
    881  static const ON_2dVector ZeroVector; // (0.0,0.0)
    882  static const ON_2dVector XAxis; // (1.0,0.0)
    883  static const ON_2dVector YAxis; // (0.0,1.0)
    884  static const ON_2dVector UnsetVector; // (ON_UNSET_VALUE,ON_UNSET_VALUE)
    885  static const ON_2dVector NanVector; // (ON_DBL_QNAN,ON_DBL_QNAN)
    886 
    887  /*
    888  Description:
    889  A well ordered dictionary compare function that is nan aware and can
    890  be used for robust sorting.
    891  */
    892  static int Compare(
    893  const ON_2dVector& lhs,
    894  const ON_2dVector& rhs
    895  );
    896 
    897  // Description:
    898  // A index driven function to get unit axis vectors.
    899  // Parameters:
    900  // index - [in] 0 returns (1,0), 1 returns (0,1)
    901  // Returns:
    902  // Unit 2d vector with vector[i] = (i==index)?1:0;
    903  static const ON_2dVector& UnitVector(
    904  int // index
    905  );
    906 
    907  explicit ON_2dVector(double x,double y);
    908 
    909  explicit ON_2dVector(const ON_3dVector& ); // from 3d vector
    910  ON_2dVector(const ON_2dPoint& ); // from 2d point
    911  explicit ON_2dVector(const ON_3dPoint& ); // from 3d point
    912  explicit ON_2dVector(const double*); // from double[2] array
    913 
    914  ON_2dVector(const ON_2fVector& ); // from 2f vector
    915  explicit ON_2dVector(const ON_3fVector& ); // from 3f vector
    916  explicit ON_2dVector(const ON_2fPoint& ); // from 2f point
    917  explicit ON_2dVector(const ON_3fPoint& ); // from 3f point
    918  explicit ON_2dVector(const float*); // from double[2] array
    919 
    920  // (double*) conversion operators
    921  operator double*();
    922  operator const double*() const;
    923 
    924  // use implicit operator=(const ON_2dVector&)
    925  ON_2dVector& operator=(const ON_3dVector&);
    926  ON_2dVector& operator=(const ON_2dPoint&);
    927  ON_2dVector& operator=(const ON_3dPoint&);
    928  ON_2dVector& operator=(const double*); // vector = double[2] support
    929 
    930  ON_2dVector& operator=(const ON_2fVector&);
    931  ON_2dVector& operator=(const ON_3fVector&);
    932  ON_2dVector& operator=(const ON_2fPoint&);
    933  ON_2dVector& operator=(const ON_3fPoint&);
    934  ON_2dVector& operator=(const float*); // vector = float[2] support
    935 
    936  ON_2dVector operator-() const;
    937 
    938  ON_2dVector& operator*=(double);
    939  ON_2dVector& operator/=(double);
    940  ON_2dVector& operator+=(const ON_2dVector&);
    941  ON_2dVector& operator-=(const ON_2dVector&);
    942  // DO NOT ADD ANY MORE overrides of += or -=
    943 
    944  double operator*(const ON_2dVector&) const; // inner (dot) product
    945  double operator*(const ON_2dPoint&) const; // inner (dot) product (point acting as vector)
    946  double operator*(const ON_2fVector&) const; // inner (dot) product
    947 
    948  ON_2dVector operator*(int) const;
    949  ON_2dVector operator/(int) const;
    950  ON_2dVector operator*(float) const;
    951  ON_2dVector operator/(float) const;
    952  ON_2dVector operator*(double) const;
    953  ON_2dVector operator/(double) const;
    954 
    955  ON_2dVector operator+(const ON_2dVector&) const;
    956  ON_2dPoint operator+(const ON_2dPoint&) const;
    957  ON_2dVector operator-(const ON_2dVector&) const;
    958  ON_2dPoint operator-(const ON_2dPoint&) const;
    959  ON_3dVector operator+(const ON_3dVector&) const;
    960  ON_3dPoint operator+(const ON_3dPoint&) const;
    961  ON_3dVector operator-(const ON_3dVector&) const;
    962  ON_3dPoint operator-(const ON_3dPoint&) const;
    963 
    964  ON_2dVector operator+(const ON_2fVector&) const;
    965  ON_2dPoint operator+(const ON_2fPoint&) const;
    966  ON_2dVector operator-(const ON_2fVector&) const;
    967  ON_2dPoint operator-(const ON_2fPoint&) const;
    968  ON_3dVector operator+(const ON_3fVector&) const;
    969  ON_3dPoint operator+(const ON_3fPoint&) const;
    970  ON_3dVector operator-(const ON_3fVector&) const;
    971  ON_3dPoint operator-(const ON_3fPoint&) const;
    972 
    973  ON_2dVector operator*(const ON_Xform&) const;
    974 
    975  bool operator==(const ON_2dVector&) const;
    976  bool operator!=(const ON_2dVector&) const;
    977 
    978  // dictionary order comparisons
    979  bool operator<=(const ON_2dVector&) const;
    980  bool operator>=(const ON_2dVector&) const;
    981  bool operator<(const ON_2dVector&) const;
    982  bool operator>(const ON_2dVector&) const;
    983 
    984  // index operators mimic double[2] behavior
    985  double& operator[](int);
    986  double operator[](int) const;
    987  double& operator[](unsigned int);
    988  double operator[](unsigned int) const;
    989 
    990  /*
    991  Returns:
    992  False if any coordinate is infinte, a nan, or ON_UNSET_VALUE.
    993  */
    994  bool IsValid() const;
    995 
    996  /*
    997  Returns:
    998  True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    999  */
    1000  bool IsUnset() const;
    1001 
    1002  // set 2d vector value
    1003  void Set(double x,double y);
    1004 
    1005  int MaximumCoordinateIndex() const;
    1006  double MaximumCoordinate() const; // absolute value of maximum coordinate
    1007 
    1008  int MinimumCoordinateIndex() const;
    1009  double MinimumCoordinate() const; // absolute value of minimum coordinate
    1010 
    1011  double LengthSquared() const;
    1012  double Length() const;
    1013 
    1014  // Signed area of the parallelagram. The volume element.
    1015  // returns x*B.y - y*B.x
    1016  double WedgeProduct(const ON_2dVector& B) const;
    1017 
    1018  bool Decompose( // Computes a, b such that this vector = a*X + b*Y
    1019  // Returns false if unable to solve for a,b. This happens
    1020  // when X,Y is not really a basis.
    1021  //
    1022  // If X,Y is known to be an orthonormal frame,
    1023  // then a = V*X, b = V*Y will compute
    1024  // the same result more quickly.
    1025  const ON_2dVector&, // X
    1026  const ON_2dVector&, // Y
    1027  double*, // a
    1028  double* // b
    1029  ) const;
    1030 
    1031  int IsParallelTo(
    1032  // returns 1: this and other vectors are parallel
    1033  // -1: this and other vectors are anti-parallel
    1034  // 0: this and other vectors are not parallel
    1035  // or at least one of the vectors is zero
    1036  const ON_2dVector& other, // other vector
    1037  double angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    1038  ) const;
    1039 
    1040  bool IsPerpendicularTo(
    1041  // returns true: this and other vectors are perpendicular
    1042  // false: this and other vectors are not perpendicular
    1043  // or at least one of the vectors is zero
    1044  const ON_2dVector& other, // other vector
    1045  double angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    1046  ) const;
    1047 
    1048  ON_DEPRECATED_MSG("Use v = ON_2dVector::ZeroVector;")
    1049  void Zero(); // set all coordinates to zero;
    1050 
    1051  ON_DEPRECATED_MSG("Use v = -v;")
    1052  void Reverse(); // negate all coordinates
    1053 
    1054  bool Unitize(); // returns false if vector has zero length
    1055 
    1056  /*
    1057  Returns:
    1058  If this is a valid non-zero vector, a unit vector parallel to this is returned.
    1059  Otherwise the zero vector is returned.
    1060  */
    1061  ON_2dVector UnitVector() const;
    1062 
    1063 
    1064  // Description:
    1065  // Test a vector to see if it is very short
    1066  //
    1067  // Parameters:
    1068  // tiny_tol - [in] (default = ON_ZERO_TOLERANCE) a nonzero
    1069  // value used as the coordinate zero tolerance.
    1070  //
    1071  // Returns:
    1072  // ( fabs(x) <= tiny_tol && fabs(y) <= tiny_tol )
    1073  //
    1074  bool IsTiny(
    1075  double tiny_tol = ON_ZERO_TOLERANCE // tiny_tol
    1076  ) const;
    1077 
    1078  // Returns:
    1079  // true if vector is the zero vector.
    1080  bool IsZero() const;
    1081 
    1082  /*
    1083  Returns:
    1084  true if at lease one coordinate is not zero and no coordinates are nans.
    1085  */
    1086  bool IsNotZero() const;
    1087 
    1088  // Returns:
    1089  // true if vector is valid and has length 1.
    1090  bool IsUnitVector() const;
    1091 
    1092  // set this vector to be perpendicular to another vector
    1093  bool PerpendicularTo( // Result is not unitized.
    1094  // returns false if input vector is zero
    1095  const ON_2dVector&
    1096  );
    1097 
    1098  // set this vector to be perpendicular to a line defined by 2 points
    1099  bool PerpendicularTo(
    1100  const ON_2dPoint&,
    1101  const ON_2dPoint&
    1102  );
    1103 
    1104  // These transform the vector in place. The transformation matrix acts on
    1105  // the left of the vector; i.e., result = transformation*vector
    1106  void Transform(
    1107  const ON_Xform& // can use ON_Xform here
    1108  );
    1109 
    1110  void Rotate(
    1111  double angle // angle in radians
    1112  );
    1113 
    1114  void Rotate(
    1115  double sin_angle, // sin(angle)
    1116  double cos_angle // cos(angle)
    1117  );
    1118 
    1119  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    1120 };
    1121 
    1122 ON_DECL
    1123 ON_2dVector operator*(int, const ON_2dVector&);
    1124 
    1125 ON_DECL
    1126 ON_2dVector operator*(float, const ON_2dVector&);
    1127 
    1128 ON_DECL
    1129 ON_2dVector operator*(double, const ON_2dVector&);
    1130 
    1131 ///////////////////////////////////////////////////////////////
    1132 //
    1133 // ON_2dVector utilities
    1134 //
    1135 
    1136 ON_DECL
    1137 double
    1138 ON_DotProduct(
    1139  const ON_2dVector&,
    1140  const ON_2dVector&
    1141  );
    1142 
    1143 ON_DECL
    1144 ON_3dVector
    1145 ON_CrossProduct(
    1146  const ON_2dVector&,
    1147  const ON_2dVector&
    1148  );
    1149 
    1150 ON_DECL
    1151 double
    1152 ON_WedgeProduct( // signed area of the parallelagram. Volume element.
    1153  const ON_2dVector& A, // returns A.x * B.y - A.y * B.x
    1154  const ON_2dVector& B
    1155  );
    1156 
    1157 ON_DECL
    1158 bool
    1159 ON_IsOrthogonalFrame( // true if X, Y are nonzero and mutually perpendicular
    1160  const ON_2dVector&, // X
    1161  const ON_2dVector& // Y
    1162  );
    1163 
    1164 ON_DECL
    1165 bool
    1166 ON_IsOrthonormalFrame( // true if X, Y are orthogonal and unit length
    1167  const ON_2dVector&, // X
    1168  const ON_2dVector& // Y
    1169  );
    1170 
    1171 ON_DECL
    1172 bool
    1173 ON_IsRightHandFrame( // true if X, Y are orthonormal and right handed
    1174  const ON_2dVector&, // X
    1175  const ON_2dVector& // Y
    1176  );
    1177 
    1178 ////////////////////////////////////////////////////////////////
    1179 //
    1180 // ON_3dVector
    1181 //
    1182 class ON_CLASS ON_3dVector
    1183 {
    1184 public:
    1185  double x, y, z;
    1186 
    1187 public:
    1188  // x,y,z not initialized
    1189  ON_3dVector() = default;
    1190  ~ON_3dVector() = default;
    1191  ON_3dVector(const ON_3dVector&) = default;
    1192  ON_3dVector& operator=(const ON_3dVector&) = default;
    1193 
    1194 public:
    1195  static const ON_3dVector ZeroVector; // (0.0,0.0,0.0)
    1196  static const ON_3dVector XAxis; // (1.0,0.0,0.0)
    1197  static const ON_3dVector YAxis; // (0.0,1.0,0.0)
    1198  static const ON_3dVector ZAxis; // (0.0,0.0,1.0)
    1199  static const ON_3dVector UnsetVector; // (ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE)
    1200  static const ON_3dVector NanVector; // (ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN)
    1201 
    1202  /*
    1203  Description:
    1204  A well ordered dictionary compare function that is nan aware and can
    1205  be used for robust sorting.
    1206  */
    1207  static int Compare(
    1208  const ON_3dVector& lhs,
    1209  const ON_3dVector& rhs
    1210  );
    1211 
    1212  // Description:
    1213  // A index driven function to get unit axis vectors.
    1214  // Parameters:
    1215  // index - [in] 0 returns (1,0,0), 1 returns (0,1,0),
    1216  // 2 returns (0,0,1)
    1217  // Returns:
    1218  // Unit 3d vector with vector[i] = (i==index)?1:0;
    1219  static const ON_3dVector& UnitVector(
    1220  int // index
    1221  );
    1222 
    1223  explicit ON_3dVector(double x,double y,double z);
    1224 #if defined(OPENNURBS_WALL)
    1225  // Goal is to eventually have all constructors that change dimension be explicit.
    1226  explicit
    1227 #endif
    1228  ON_3dVector(const ON_2dVector& ); // from 2d vector
    1229  explicit ON_3dVector(const ON_2dPoint& ); // from 2d point
    1230  ON_3dVector(const ON_3dPoint& ); // from 3d point
    1231  explicit ON_3dVector(const double*); // from double[3] array
    1232 
    1233  explicit ON_3dVector(const ON_2fVector& ); // from 2f vector
    1234  ON_3dVector(const ON_3fVector& ); // from 3f vector
    1235  explicit ON_3dVector(const ON_2fPoint& ); // from 2f point
    1236  explicit ON_3dVector(const ON_3fPoint& ); // from 3f point
    1237  explicit ON_3dVector(const float*); // from float[3] array
    1238 
    1239  // (double*) conversion operators
    1240  operator double*();
    1241  operator const double*() const;
    1242 
    1243  // use implicit operator=(const ON_3dVector&)
    1244  ON_3dVector& operator=(const ON_2dVector&);
    1245  ON_3dVector& operator=(const ON_2dPoint&);
    1246  ON_3dVector& operator=(const ON_3dPoint&);
    1247  ON_3dVector& operator=(const double*); // vector = double[3] support
    1248 
    1249  ON_3dVector& operator=(const ON_2fVector&);
    1250  ON_3dVector& operator=(const ON_3fVector&);
    1251  ON_3dVector& operator=(const ON_2fPoint&);
    1252  ON_3dVector& operator=(const ON_3fPoint&);
    1253  ON_3dVector& operator=(const float*); // vector = float[3] support
    1254 
    1255  ON_3dVector operator-() const;
    1256 
    1257  ON_3dVector& operator*=(double);
    1258  ON_3dVector& operator/=(double);
    1259  ON_3dVector& operator+=(const ON_3dVector&);
    1260  ON_3dVector& operator-=(const ON_3dVector&);
    1261  // DO NOT ADD ANY MORE overrides of += or -=
    1262 
    1263  double operator*(const ON_3dVector&) const; // inner (dot) product
    1264  double operator*(const ON_3dPoint&) const; // inner (dot) product
    1265  double operator*(const ON_3fVector&) const; // inner (dot) product
    1266 
    1267  ON_3dVector operator*(int) const;
    1268  ON_3dVector operator/(int) const;
    1269  ON_3dVector operator*(float) const;
    1270  ON_3dVector operator/(float) const;
    1271  ON_3dVector operator*(double) const;
    1272  ON_3dVector operator/(double) const;
    1273 
    1274  ON_3dVector operator+(const ON_3dVector&) const;
    1275  ON_3dPoint operator+(const ON_3dPoint&) const;
    1276  ON_3dVector operator-(const ON_3dVector&) const;
    1277  ON_3dPoint operator-(const ON_3dPoint&) const;
    1278  ON_3dVector operator+(const ON_2dVector&) const;
    1279  ON_3dPoint operator+(const ON_2dPoint&) const;
    1280  ON_3dVector operator-(const ON_2dVector&) const;
    1281  ON_3dPoint operator-(const ON_2dPoint&) const;
    1282 
    1283  ON_3dVector operator+(const ON_3fVector&) const;
    1284  ON_3dPoint operator+(const ON_3fPoint&) const;
    1285  ON_3dVector operator-(const ON_3fVector&) const;
    1286  ON_3dPoint operator-(const ON_3fPoint&) const;
    1287  ON_3dVector operator+(const ON_2fVector&) const;
    1288  ON_3dPoint operator+(const ON_2fPoint&) const;
    1289  ON_3dVector operator-(const ON_2fVector&) const;
    1290  ON_3dPoint operator-(const ON_2fPoint&) const;
    1291 
    1292  ON_3dVector operator*(const ON_Xform&) const;
    1293 
    1294  bool operator==(const ON_3dVector&) const;
    1295  bool operator!=(const ON_3dVector&) const;
    1296 
    1297  // dictionary order comparisons
    1298  bool operator<=(const ON_3dVector&) const;
    1299  bool operator>=(const ON_3dVector&) const;
    1300  bool operator<(const ON_3dVector&) const;
    1301  bool operator>(const ON_3dVector&) const;
    1302 
    1303  // index operators mimic double[3] behavior
    1304  double& operator[](int);
    1305  double operator[](int) const;
    1306  double& operator[](unsigned int);
    1307  double operator[](unsigned int) const;
    1308 
    1309  /*
    1310  Returns:
    1311  False if any coordinate is infinte, a nan, or ON_UNSET_VALUE.
    1312  */
    1313  bool IsValid() const;
    1314 
    1315  /*
    1316  Returns:
    1317  True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    1318  */
    1319  bool IsUnset() const;
    1320 
    1321  // set 3d vector value
    1322  void Set(double x,double y,double z);
    1323 
    1324  int MaximumCoordinateIndex() const;
    1325  double MaximumCoordinate() const; // absolute value of maximum coordinate
    1326 
    1327  int MinimumCoordinateIndex() const;
    1328  double MinimumCoordinate() const; // absolute value of minimum coordinate
    1329 
    1330  double LengthSquared() const;
    1331  double Length() const;
    1332 
    1333  bool Decompose( // Computes a, b, c such that this vector = a*X + b*Y + c*Z
    1334  // Returns false if unable to solve for a,b,c. This happens
    1335  // when X,Y,Z is not really a basis.
    1336  //
    1337  // If X,Y,Z is known to be an orthonormal frame,
    1338  // then a = V*X, b = V*Y, c = V*Z will compute
    1339  // the same result more quickly.
    1340  const ON_3dVector&, // X
    1341  const ON_3dVector&, // Y
    1342  const ON_3dVector&, // Z
    1343  double*, // a
    1344  double*, // b
    1345  double* // c
    1346  ) const;
    1347 
    1348  int IsParallelTo(
    1349  // returns 1: this and other vectors are parallel
    1350  // -1: this and other vectors are anti-parallel
    1351  // 0: this and other vectors are not parallel
    1352  // or at least one of the vectors is zero
    1353  const ON_3dVector& other, // other vector
    1354  double angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    1355  ) const;
    1356 
    1357  bool IsPerpendicularTo(
    1358  // returns true: this and other vectors are perpendicular
    1359  // false: this and other vectors are not perpendicular
    1360  // or at least one of the vectors is zero
    1361  const ON_3dVector& other, // other vector
    1362  double angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    1363  ) const;
    1364 
    1365  double Fuzz( double tolerance = ON_ZERO_TOLERANCE ) const; // tolerance to use when comparing 3d vectors
    1366 
    1367 #if defined(OPENNURBS_WALL)
    1368  // Goal is to eventually remove all functions that modify vectors in place.
    1369  ON_DEPRECATED_MSG("Use v = ON_3dVector::ZeroVector;")
    1370 #endif
    1371  void Zero(); // set all coordinates to zero;
    1372 
    1373 #if defined(OPENNURBS_WALL)
    1374  // Goal is to eventually remove all functions that modify vectors in place.
    1375  ON_DEPRECATED_MSG("Use v = -v;")
    1376 #endif
    1377  void Reverse(); // negate all coordinates
    1378 
    1379  bool Unitize(); // returns false if vector has zero length
    1380  double LengthAndUnitize(); // unitizes and returns initial length
    1381 
    1382  /*
    1383  Returns:
    1384  If this is a valid non-zero vector, a unit vector parallel to this is returned.
    1385  Otherwise the zero vector is returned.
    1386  */
    1387  ON_3dVector UnitVector() const;
    1388 
    1389  // Description:
    1390  // Test a vector to see if it is very short
    1391  //
    1392  // Parameters:
    1393  // tiny_tol - [in] (default = ON_ZERO_TOLERANCE) a nonzero
    1394  // value used as the coordinate zero tolerance.
    1395  //
    1396  // Returns:
    1397  // ( fabs(x) <= tiny_tol && fabs(y) <= tiny_tol && fabs(z) <= tiny_tol )
    1398  //
    1399  bool IsTiny(
    1400  double tiny_tol = ON_ZERO_TOLERANCE // tiny_tol
    1401  ) const;
    1402 
    1403  // Returns:
    1404  // true if vector is the zero vector.
    1405  bool IsZero() const;
    1406 
    1407  /*
    1408  Returns:
    1409  true if at lease one coordinate is not zero and no coordinates are nans.
    1410  */
    1411  bool IsNotZero() const;
    1412 
    1413 
    1414  // Returns:
    1415  // true if vector is valid and has length 1.
    1416  bool IsUnitVector() const;
    1417 
    1418  // set this vector to be perpendicular to another vector
    1419  bool PerpendicularTo( // Result is not unitized.
    1420  // returns false if input vector is zero
    1421  const ON_3dVector&
    1422  );
    1423 
    1424  // set this vector to be perpendicular to a plane defined by 3 points
    1425  bool PerpendicularTo(
    1426  // about 3 times slower than
    1427  // ON_3dVector N = ON_CrossProduct(P1-P0,P2-P0);
    1428  // N.Unitize();
    1429  // returns false if points are coincident or collinear
    1430  const ON_3dPoint&, const ON_3dPoint&, const ON_3dPoint&
    1431  );
    1432 
    1433  // These transform the vector in place. The transformation matrix acts on
    1434  // the left of the vector; i.e., result = transformation*vector
    1435  void Transform(
    1436  const ON_Xform& // can use ON_Xform here
    1437  );
    1438 
    1439  void Rotate(
    1440  double angle, // angle in radians
    1441  const ON_3dVector& axis // axis of rotation
    1442  );
    1443 
    1444  void Rotate(
    1445  double sin_angle, // sin(angle)
    1446  double cos_angle, // cos(angle)
    1447  const ON_3dVector& axis // axis of rotation
    1448  );
    1449 
    1450  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    1451 };
    1452 
    1453 class ON_CLASS ON_3dRay
    1454 {
    1455 public:
    1458 };
    1459 
    1460 /*
    1461 Description:
    1462  Typically the vector portion is a unit vector and
    1463  m_d = -(x*P.x + y*P.y + z*P.z) for a point P on the plane.
    1464 */
    1465 class ON_CLASS ON_PlaneEquation
    1466 {
    1467 public:
    1468  // C++ defaults for construction, destruction, copys, and operator=
    1469  // work fine.
    1470 
    1471  static const ON_PlaneEquation UnsetPlaneEquation; // (ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE)
    1472  static const ON_PlaneEquation ZeroPlaneEquation; // (0.0,0.0,0.0,0.0)
    1473 
    1474  ON_PlaneEquation();
    1475 
    1477  double xx, double yy, double zz, double dd
    1478  );
    1479 
    1480  static void Set(
    1481  ON_PlaneEquation& plane_equation,
    1482  double x, double y, double z, double d
    1483  );
    1484 
    1485  double MaximumCoefficient() const;
    1486 
    1487  /*
    1488  Returns:
    1489  The plane equation whose coefficient values are
    1490  the negative of the coefficent values in this,
    1491  provided the coeffient value is valid. Any invalid
    1492  coefficent values are copied.
    1493  */
    1494  ON_PlaneEquation NegatedPlaneEquation() const;
    1495 
    1496 
    1497  /*
    1498  Returns:
    1499  The plane equation whose first three coefficient values
    1500  are a unit vector.
    1501  */
    1502  ON_PlaneEquation UnitizedPlaneEquation() const;
    1503 
    1504 
    1505 
    1506  /*
    1507  Description:
    1508  returns true if x, y, z, d are valid, finite doubles.
    1509  Remarks:
    1510  this function will return true if x, y and z are all zero.
    1511  See Also:
    1512  ON_PlaneEquation::IsSet().
    1513  */
    1514  bool IsValid() const;
    1515 
    1516  /*
    1517  Description:
    1518  returns true if x, y, z, d are valid, finite doubles and
    1519  at least one of x, y or z is not zero.
    1520  */
    1521  bool IsSet() const;
    1522 
    1523  /*
    1524  Description:
    1525  Sets (x,y,z) to a unitized N and then sets
    1526  d = -(x*P.x + y*P.y + z*P.z).
    1527  Parameters:
    1528  P - [in] point on the plane
    1529  N - [in] vector perpendicular to the plane
    1530  Returns:
    1531  true if input is valid.
    1532  */
    1533  bool Create( ON_3dPoint P, ON_3dVector N );
    1534 
    1535  // index operators mimic double[4] behavior
    1536  // Return null refs or ON_UNSET_VALUE for out-of-range indices
    1537  double& operator[](int);
    1538  double& operator[](unsigned int);
    1539  double operator[](int) const;
    1540  double operator[](unsigned int) const;
    1541 
    1542  /*
    1543  Returns:
    1544  Direction (x,y,z)
    1545  */
    1546  ON_3dVector Direction() const;
    1547 
    1548  double DirectionLength() const;
    1549 
    1550  /*
    1551  Returns:
    1552  Unitized direction or zero vector if not set.
    1553  */
    1554  ON_3dVector UnitNormal() const;
    1555 
    1556  /*
    1557  Returns 1: this and other vectors are parallel
    1558  -1: this and other vectors are anti-parallel
    1559  0: this and other vectors are not parallel
    1560  or at least one of the vectors is zero
    1561  */
    1562  int IsParallelTo(
    1563  const ON_PlaneEquation& other, // other plane equation
    1564  double angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    1565  ) const;
    1566 
    1567  /*
    1568  Description:
    1569  Evaluate the plane at a point.
    1570  Parameters:
    1571  P - [in]
    1572  Returns:
    1573  x*P.x + y*P.y + z*P.z + d;
    1574  */
    1575  double ValueAt(ON_3dPoint P) const;
    1576  double ValueAt(ON_4dPoint P) const;
    1577  double ValueAt(ON_3dVector P) const;
    1578  double ValueAt(double x, double y, double z) const;
    1579 
    1580  /*
    1581  Returns:
    1582  ON_Interval::EmptyInterval if input is not valid.
    1583  */
    1584  ON_Interval ValueRange(
    1585  size_t point_list_count,
    1586  const ON_3dPoint* point_list
    1587  ) const;
    1588 
    1589  /*
    1590  Returns:
    1591  ON_Interval::EmptyInterval if input is not valid.
    1592  */
    1593  ON_Interval ValueRange(
    1594  const ON_SimpleArray< ON_3dPoint >& point_list
    1595  ) const;
    1596 
    1597  /*
    1598  Returns:
    1599  ON_Interval::EmptyInterval if input is not valid.
    1600  */
    1601  ON_Interval ValueRange(
    1602  size_t point_list_count,
    1603  const ON_3fPoint* point_list
    1604  ) const;
    1605 
    1606  /*
    1607  Returns:
    1608  ON_Interval::EmptyInterval if input is not valid.
    1609  */
    1610  ON_Interval ValueRange(
    1611  const ON_SimpleArray< ON_3fPoint >& point_list
    1612  ) const;
    1613 
    1614  /*
    1615  Returns:
    1616  ON_Interval::EmptyInterval if input is not valid.
    1617  */
    1618  ON_Interval ValueRange(
    1619  const class ON_3dPointListRef& point_list
    1620  ) const;
    1621 
    1622  /*
    1623  Returns:
    1624  ON_Interval::EmptyInterval if input is not valid.
    1625  */
    1626  ON_Interval ValueRange(
    1627  size_t point_index_count,
    1628  const unsigned int* point_index_list,
    1629  const class ON_3dPointListRef& point_list
    1630  ) const;
    1631 
    1632  ON_Interval ValueRange(
    1633  size_t point_index_count,
    1634  size_t point_index_stride,
    1635  const unsigned int* point_index_list,
    1636  const class ON_3dPointListRef& point_list
    1637  ) const;
    1638 
    1639  /*
    1640  Description:
    1641  Evaluate the plane at a list of point values.
    1642  Parameters:
    1643  Pcount - [in]
    1644  number of points
    1645  P - [in]
    1646  points
    1647  value - [in]
    1648  If not null, value[] must be an array of length at least Pcount.
    1649  The values will be stored in this array. If null, the an array
    1650  will be allocated with onmalloc() and returned.
    1651  value_range - [out]
    1652  If not null, the range of values will be returned here.
    1653  Returns:
    1654  An array of Pcount values. If the input parameter value was null,
    1655  then the array is allocated on the heap using onmalloc() and the
    1656  caller is responsible for calling onfree() when finished. If the
    1657  input is not valid, null is returned.
    1658  */
    1659  double* ValueAt(
    1660  int Pcount,
    1661  const ON_3fPoint* P,
    1662  double* value,
    1663  double value_range[2]
    1664  ) const;
    1665 
    1666  double* ValueAt(
    1667  int Pcount,
    1668  const ON_3dPoint* P,
    1669  double* value,
    1670  double value_range[2]
    1671  ) const;
    1672 
    1673  /*
    1674  Description:
    1675  This function calculates and evalutes points that
    1676  would be exactly on the plane if double precision
    1677  aritmetic were mathematically perfect and returns
    1678  the largest value of the evaluations.
    1679  */
    1680  double ZeroTolerance() const;
    1681 
    1682  /*
    1683  Description:
    1684  Transform the plane equation so that, if e0 is the initial
    1685  equation, e1 is transformed equation and P is a point,
    1686  then e0.ValueAt(P) = e1.ValueAt(xform*P).
    1687  Parameters:
    1688  xform - [in]
    1689  Invertable transformation.
    1690  Returns:
    1691  True if the plane equation was successfully transformed.
    1692  False if xform is not invertable or the equation is not
    1693  valid.
    1694  Remarks:
    1695  This function has to invert xform. If you have apply the
    1696  same transformation to a bunch of planes, then it will be
    1697  more efficient to calculate xform's inverse transpose
    1698  and apply the resultingt transformation to the equation's
    1699  coefficients as if they were 4d point coordinates.
    1700  */
    1701  bool Transform( const ON_Xform& xform );
    1702 
    1703  /*
    1704  Description:
    1705  Get point on plane that is closest to a given point.
    1706  Parameters:
    1707  point - [in]
    1708  Returns:
    1709  A 3d point on the plane that is closest to the input point.
    1710  */
    1711  ON_3dPoint ClosestPointTo( ON_3dPoint point ) const;
    1712 
    1713  /*
    1714  Description:
    1715  Get the minimum value of the plane equation
    1716  on a bounding box.
    1717  Parameters:
    1718  bbox - [in]
    1719  Returns:
    1720  Minimum value of the plane equation on the bounding box.
    1721  */
    1722  double MinimumValueAt(const ON_BoundingBox& bbox) const;
    1723 
    1724  /*
    1725  Description:
    1726  Get the maximum value of the plane equation
    1727  on a bounding box.
    1728  Parameters:
    1729  bbox - [in]
    1730  Returns:
    1731  Maximum value of the plane equation on the bounding box.
    1732  */
    1733  double MaximumValueAt(const ON_BoundingBox& bbox) const;
    1734 
    1735 
    1736  /*
    1737  Description:
    1738  Get the maximum value of the plane equation on a set of 3d points.
    1739  Parameters:
    1740  bRational - [in]
    1741  False if the points are euclidean (x,y,z)
    1742  True if the points are homogenous rational (x,y,z,w)
    1743  (x/w,y/w,z/w) is used to evaluate the value.
    1744  point_count - [in]
    1745  point_stride - [in]
    1746  i-th point's x coordinate = points[i*point_stride]
    1747  points - [in]
    1748  coordinates of points
    1749  stop_value - [in]
    1750  If stop_value is valid and not ON_UNSET_VALUE, then the
    1751  evaulation stops if a value > stop_value is found.
    1752  If stop_value = ON_UNSET_VALUE, then stop_value is ignored.
    1753  Returns:
    1754  Maximum value of the plane equation on the point list.
    1755  If the input is not valid, then ON_UNSET_VALUE is returned.
    1756  */
    1757  double MaximumValueAt(
    1758  bool bRational,
    1759  int point_count,
    1760  int point_stride,
    1761  const double* points,
    1762  double stop_value
    1763  ) const;
    1764 
    1765  /*
    1766  Description:
    1767  Get the minimum value of the plane equation on a set of 3d points.
    1768  Parameters:
    1769  bRational - [in]
    1770  False if the points are euclidean (x,y,z)
    1771  True if the points are homogenous rational (x,y,z,w)
    1772  (x/w,y/w,z/w) is used to evaluate the value.
    1773  point_count - [in]
    1774  point_stride - [in]
    1775  i-th point's x coordinate = points[i*point_stride]
    1776  points - [in]
    1777  coordinates of points
    1778  stop_value - [in]
    1779  If stop_value is valid and not ON_UNSET_VALUE, then the
    1780  evaulation stops if a value < stop_value is found.
    1781  If stop_value = ON_UNSET_VALUE, then stop_value is ignored.
    1782  Returns:
    1783  Maximum value of the plane equation on the point list.
    1784  If the input is not valid, then ON_UNSET_VALUE is returned.
    1785  */
    1786  double MinimumValueAt(
    1787  bool bRational,
    1788  int point_count,
    1789  int point_stride,
    1790  const double* points,
    1791  double stop_value
    1792  ) const;
    1793 
    1794  /*
    1795  Description:
    1796  Get the maximum absolute value of the plane equation
    1797  on a set of 3d points.
    1798  Parameters:
    1799  bRational - [in]
    1800  False if the points are euclidean (x,y,z)
    1801  True if the points are homogenous rational (x,y,z,w)
    1802  (x/w,y/w,z/w) is used to evaluate the value.
    1803  point_count - [in]
    1804  point_stride - [in]
    1805  i-th point's x coordinate = points[i*point_stride]
    1806  points - [in]
    1807  coordinates of points
    1808  stop_value - [in]
    1809  If stop_value >= 0.0, then the evaulation stops if an
    1810  absolute value > stop_value is found. If stop_value < 0.0
    1811  or stop_value is invalid, then stop_value is ignored.
    1812  Returns:
    1813  Maximum value of the plane equation on the point list.
    1814  If the input is not valid, then ON_UNSET_VALUE is returned.
    1815  */
    1816  double MaximumAbsoluteValueAt(
    1817  bool bRational,
    1818  int point_count,
    1819  int point_stride,
    1820  const double* points,
    1821  double stop_value
    1822  ) const;
    1823 
    1824  /*
    1825  Description:
    1826  Test points on a bezier curve to see if they are near the plane.
    1827  Parameters:
    1828  bezcrv - [in]
    1829  s0 - [in]
    1830  s1 - [in] the interval from s0 to s1 is tested (s0 < s1)
    1831  sample_count - [in] number of interior points to test.
    1832  Numbers like 1, 3, 7, 15, ... work best.
    1833  endpoint_tolerance - [in] If >= 0, then the end points are
    1834  tested to see if the distance from the endpoints
    1835  is <= endpoint_tolerance.
    1836  interior_tolerance - [in] (>=0 and >=endpoint_tolerance)
    1837  This tolerance is used to test the interior sample points.
    1838  smin - [put] If not nullptr, *smin = bezier parameter of nearest
    1839  test point.
    1840  smax - [put] If not nullptr, *smax = bezier parameter of farthest
    1841  test point. If false is returned, this is the
    1842  parameter of the test point that failed.
    1843  Returns:
    1844  True if all the tested points passed the tolerance test.
    1845  False if at least one tested point failed the tolerance test.
    1846  (The test terminates when the first failure is encountered.)
    1847  */
    1848  bool IsNearerThan(
    1849  const class ON_BezierCurve& bezcrv,
    1850  double s0,
    1851  double s1,
    1852  int sample_count,
    1853  double endpoint_tolerance,
    1854  double interior_tolerance,
    1855  double* smin,
    1856  double* smax
    1857  ) const;
    1858 
    1859  bool operator==(const ON_PlaneEquation&) const;
    1860  bool operator!=(const ON_PlaneEquation&) const;
    1861 
    1862  double x;
    1863  double y;
    1864  double z;
    1865  double d; // 4th coefficient of the plane equation.
    1866 };
    1867 
    1868 #if defined(ON_DLL_TEMPLATE)
    1869 
    1870 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_PlaneEquation>;
    1871 
    1872 #endif
    1873 
    1874 ON_DECL
    1875 ON_3dVector operator*(int, const ON_3dVector&);
    1876 
    1877 ON_DECL
    1878 ON_3dVector operator*(float, const ON_3dVector&);
    1879 
    1880 ON_DECL
    1881 ON_3dVector operator*(double, const ON_3dVector&);
    1882 
    1883 ///////////////////////////////////////////////////////////////
    1884 //
    1885 // ON_3dVector utilities
    1886 //
    1887 
    1888 ON_DECL
    1889 double
    1890 ON_DotProduct(
    1891  const ON_3dVector&,
    1892  const ON_3dVector&
    1893  );
    1894 
    1895 
    1896 ON_DECL
    1897 ON_3dVector
    1898 ON_CrossProduct(
    1899  const ON_3dVector&,
    1900  const ON_3dVector&
    1901  );
    1902 
    1903 ON_DECL
    1904 ON_3dVector
    1905 ON_CrossProduct( // 3d cross product for old fashioned arrays
    1906  const double*, // array of 3d doubles
    1907  const double* // array of 3d doubles
    1908  );
    1909 
    1910 ON_DECL
    1911 double
    1912 ON_TripleProduct(
    1913  const ON_3dVector&,
    1914  const ON_3dVector&,
    1915  const ON_3dVector&
    1916  );
    1917 
    1918 ON_DECL
    1919 double
    1920 ON_TripleProduct( // 3d triple product for old fashioned arrays
    1921  const double*, // array of 3d doubles
    1922  const double*, // array of 3d doubles
    1923  const double* // array of 3d doubles
    1924  );
    1925 
    1926 ON_DECL
    1927 bool
    1928 ON_IsOrthogonalFrame( // true if X, Y, Z are nonzero and mutually perpendicular
    1929  const ON_3dVector&, // X
    1930  const ON_3dVector&, // Y
    1931  const ON_3dVector& // Z
    1932  );
    1933 
    1934 ON_DECL
    1935 bool
    1936 ON_IsOrthonormalFrame( // true if X, Y, Z are orthogonal and unit length
    1937  const ON_3dVector&, // X
    1938  const ON_3dVector&, // Y
    1939  const ON_3dVector& // Z
    1940  );
    1941 
    1942 ON_DECL
    1943 bool
    1944 ON_IsRightHandFrame( // true if X, Y, Z are orthonormal and right handed
    1945  const ON_3dVector&, // X
    1946  const ON_3dVector&, // Y
    1947  const ON_3dVector& // Z
    1948  );
    1949 
    1950 ///////////////////////////////////////////////////////////////
    1951 //
    1952 // common points and vectors
    1953 //
    1954 // ON_unset_point is obsolete - use ON_3dPoint::UnsetPoint
    1955 #if !defined(OPENNURBS_WALL)
    1956 
    1957 // OBSOLETE - use ON_3dPoint::UnsetPoint
    1958 #define ON_unset_point ON_3dPoint::UnsetPoint
    1959 // OBSOLETE - use ON_3dPoint::UnsetPoint
    1960 #define ON_UNSET_POINT ON_3dPoint::UnsetPoint
    1961 // OBSOLETE - use ON_3dPoint::UnsetVector
    1962 #define ON_UNSET_VECTOR ON_3dVector::UnsetVector
    1963 // OBSOLETE - use ON_3dPoint::Origin
    1964 #define ON_origin ON_3dPoint::Origin
    1965 // OBSOLETE - use ON_3dVector::XAxis
    1966 #define ON_xaxis ON_3dVector::XAxis
    1967 // OBSOLETE - use ON_3dVector::YAxis
    1968 #define ON_yaxis ON_3dVector::YAxis
    1969 // OBSOLETE - use ON_3dVector::ZAxis
    1970 #define ON_zaxis ON_3dVector::ZAxis
    1971 // OBSOLETE - use ON_3fPoint::Origin
    1972 #define ON_forigin ON_3fPoint::Origin
    1973 // OBSOLETE - use ON_3fVector::XAxis
    1974 #define ON_fxaxis ON_3fVector::XAxis
    1975 // OBSOLETE - use ON_3fVector::YAxis
    1976 #define ON_fyaxis ON_3fVector::YAxis
    1977 // OBSOLETE - use ON_3fVector::ZAxis
    1978 #define ON_fzaxis ON_3fVector::ZAxis
    1979 
    1980 #endif
    1981 
    1982 #include "opennurbs_fpoint.h"
    1983 
    1984 ////////////////////////////////////////////////////////////////
    1985 //
    1986 // ON_SurfaceCurvature
    1987 //
    1988 class ON_CLASS ON_SurfaceCurvature
    1989 {
    1990 public:
    1991  double k1, k2; // principal curvatures
    1992 
    1993  double GaussianCurvature() const;
    1994  double MeanCurvature() const;
    1995  double MinimumRadius() const;
    1996  double MaximumRadius() const;
    1997 };
    1998 
    1999 
    2000 #if defined(ON_DLL_TEMPLATE)
    2001 
    2002 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_2dPoint>;
    2003 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_3dPoint>;
    2004 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_4dPoint>;
    2005 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_2dVector>;
    2006 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_3dVector>;
    2007 
    2008 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_2fPoint>;
    2009 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_3fPoint>;
    2010 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_4fPoint>;
    2011 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_2fVector>;
    2012 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_3fVector>;
    2013 
    2014 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Color>;
    2015 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_SurfaceCurvature>;
    2016 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Interval>;
    2017 
    2018 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_2dex>;
    2019 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_3dex>;
    2020 
    2021 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_COMPONENT_INDEX>;
    2022 
    2023 #endif
    2024 
    2025 /////////////////////////////////////////////////////////////////
    2026 //
    2027 
    2029 {
    2030 public:
    2031  // see ON_SimpleArray class definition comments for constructor documentation
    2032  ON_2dPointArray();
    2033  ON_2dPointArray(int);
    2034  ON_2dPointArray( const ON_2dPointArray& );
    2035  ON_2dPointArray& operator=( const ON_2dPointArray& );
    2036 
    2037  bool GetBBox( // returns true if successful
    2038  double boxmin[2],
    2039  double boxmax[2],
    2040  bool bGrowBox = false // true means grow box
    2041  ) const;
    2042 
    2043  bool Transform( const ON_Xform& );
    2044  bool SwapCoordinates(int,int);
    2045 };
    2046 
    2047 
    2048 /////////////////////////////////////////////////////////////////
    2049 //
    2050 
    2052 {
    2053 public:
    2054  // see ON_SimpleArray class definition comments for constructor documentation
    2055  ON_2fPointArray();
    2056  ON_2fPointArray(int);
    2058  ON_2fPointArray& operator=( const ON_2fPointArray& );
    2059 
    2060  bool GetBBox( // returns true if successful
    2061  float boxmin[2],
    2062  float boxmax[2],
    2063  bool bGrowBox = false // true means grow box
    2064  ) const;
    2065  bool Transform( const ON_Xform& );
    2066  bool SwapCoordinates(int,int);
    2067 };
    2068 
    2069 
    2070 /////////////////////////////////////////////////////////////////
    2071 //
    2072 
    2074 {
    2075 public:
    2076  // see ON_SimpleArray class definition comments for constructor documentation
    2077  ON_3dPointArray();
    2078  ON_3dPointArray(int);
    2080  ON_3dPointArray& operator=( const ON_3dPointArray& );
    2082  ON_3dPointArray& operator=( const ON_SimpleArray<ON_3fPoint>& );
    2083 
    2084  // Description:
    2085  // Create 3d point list
    2086  // Parameters:
    2087  // point_dimension - [in] dimension of input points (2 or 3)
    2088  // bRational - [in] true if points are in homogenous rational form
    2089  // point_count - [in] number of points
    2090  // point_stride - [in] number of doubles to skip between points
    2091  // points - [in] array of point coordinates
    2092  bool Create(
    2093  int point_dimension,
    2094  int bRational,
    2095  int point_count,
    2096  int point_stride,
    2097  const double* points
    2098  );
    2099 
    2100  // Description:
    2101  // Create 3d point list
    2102  // Parameters:
    2103  // point_dimension - [in] dimension of input points (2 or 3)
    2104  // bRational - [in] true if points are in homogenous rational form
    2105  // point_count - [in] number of points
    2106  // point_stride - [in] number of doubles to skip between points
    2107  // points - [in] array of point coordinates
    2108  bool Create(
    2109  int point_dimension,
    2110  int bRational,
    2111  int point_count,
    2112  int point_stride,
    2113  const float* points
    2114  );
    2115 
    2116  // Description:
    2117  // Get 3d axis aligned bounding box.
    2118  // Returns:
    2119  // 3d bounding box of point list.
    2120  ON_BoundingBox BoundingBox() const;
    2121 
    2122  // Description:
    2123  // Get 3d axis aligned bounding box or the union
    2124  // of the input box with the point list's bounding box.
    2125  // Parameters:
    2126  // bbox - [in/out] 3d axis aligned bounding box
    2127  // bGrowBox - [in] (default=false)
    2128  // If true, then the union of the input bbox and the
    2129  // point list's bounding box is returned in bbox.
    2130  // If false, the point list's bounding box is returned in bbox.
    2131  // Returns:
    2132  // true if successful.
    2133  bool GetBoundingBox(
    2134  ON_BoundingBox& bbox,
    2135  int bGrowBox = false
    2136  ) const;
    2137 
    2138  // Description:
    2139  // Get axis aligned bounding box.
    2140  // Parameters:
    2141  // boxmin - [in/out] array of 3 doubles
    2142  // boxmax - [in/out] array of 3 doubles
    2143  // bGrowBox - [in] (default=false)
    2144  // If true, then the union of the input bounding box and the
    2145  // object's bounding box is returned.
    2146  // If false, the object's bounding box is returned.
    2147  // Returns:
    2148  // true if object has bounding box and calculation was successful
    2149  bool GetBBox(
    2150  double boxmin[3],
    2151  double boxmax[3],
    2152  bool bGrowBox = false
    2153  ) const;
    2154 
    2155  /*
    2156  Description:
    2157  Get tight bounding box of the point list.
    2158  Parameters:
    2159  tight_bbox - [in/out] tight bounding box
    2160  bGrowBox -[in] (default=false)
    2161  If true and the input tight_bbox is valid, then returned
    2162  tight_bbox is the union of the input tight_bbox and the
    2163  tight bounding box of the point list.
    2164  xform -[in] (default=nullptr)
    2165  If not nullptr, the tight bounding box of the transformed
    2166  point list is calculated. The point list is not modified.
    2167  Returns:
    2168  True if the returned tight_bbox is set to a valid
    2169  bounding box.
    2170  */
    2171  bool GetTightBoundingBox(
    2172  ON_BoundingBox& tight_bbox,
    2173  bool bGrowBox = false,
    2174  const ON_Xform* xform = nullptr
    2175  ) const;
    2176 
    2177  // Description:
    2178  // Transform points by applying xform to each point.
    2179  // Parameters:
    2180  // xform - [in] transformation matrix
    2181  // Returns:
    2182  // true if successful.
    2183  bool Transform(
    2184  const ON_Xform& xform
    2185  );
    2186 
    2187  // Description:
    2188  // Swaps point coordinate values with indices i and j.
    2189  // Parameters:
    2190  // i - [in] coordinate index
    2191  // j - [in] coordinate index
    2192  // Returns:
    2193  // true if successful.
    2194  // Example:
    2195  // The call SwapCoordinates(0,2) would swap the x and z
    2196  // coordinates of each point in the array.
    2197  bool SwapCoordinates(
    2198  int i,
    2199  int j
    2200  );
    2201 
    2202  // Description:
    2203  // Rotate points about a center and axis. A positive angle
    2204  // results in a counter-clockwise rotation about the axis
    2205  // of rotation.
    2206  // Parameters:
    2207  // sin_angle - [in] sine of rotation angle
    2208  // cos_angle - [in] cosine of rotation angle
    2209  // axis_of_rotation - [in] axis of rotation
    2210  // center_of_rotation - [in] center (fixed point) of rotation
    2211  // Returns:
    2212  // true if successful.
    2213  bool Rotate(
    2214  double sin_angle,
    2215  double cos_angle,
    2216  const ON_3dVector& axis_of_rotation,
    2217  const ON_3dPoint& center_of_rotation
    2218  );
    2219 
    2220  // Description:
    2221  // Rotate points about a center and axis. A positive angle
    2222  // results in a counter-clockwise rotation about the axis
    2223  // of rotation.
    2224  // Parameters:
    2225  // angle - [in] angle in radians. Polsine of rotation angle
    2226  // cos_angle - [in] cosine of rotation angle
    2227  // axis_of_rotation - [in] axis of rotation
    2228  // center_of_rotation - [in] center (fixed point) of rotation
    2229  // Returns:
    2230  // true if successful.
    2231  bool Rotate(
    2232  double angle_in_radians,
    2233  const ON_3dVector& axis_of_rotation,
    2234  const ON_3dPoint& center_of_rotation
    2235  );
    2236 
    2237  // Description:
    2238  // Translate a polyline
    2239  // Parameters:
    2240  // delta - [in] translation vectorsine of rotation angle
    2241  // Returns:
    2242  // true if successful.
    2243  bool Translate(
    2244  const ON_3dVector& delta
    2245  );
    2246 
    2247  /*
    2248  Description:
    2249  Get the index of the point in the array that is closest
    2250  to P.
    2251  Parameters:
    2252  P - [in]
    2253  closest_point_index - [out]
    2254  maximum_distance - [in] optional distance constraint.
    2255  If maximum_distance > 0, then only points Q with
    2256  |P-Q| <= maximum_distance are returned.
    2257  Returns:
    2258  True if a point is found; in which case *closest_point_index
    2259  is the index of the point. False if no point is found
    2260  or the input is not valid.
    2261  See Also:
    2262  ON_GetClosestPointInPointList
    2263  ON_PointCloud::GetClosestPoint
    2264  */
    2265  bool GetClosestPoint(
    2266  ON_3dPoint P,
    2267  int* closest_point_index,
    2268  double maximum_distance = 0.0
    2269  ) const;
    2270 
    2271 };
    2272 
    2273 
    2274 /////////////////////////////////////////////////////////////////
    2275 //
    2276 
    2278 {
    2279 public:
    2280  // see ON_SimpleArray class definition comments for constructor documentation
    2281  ON_3fPointArray();
    2282  ON_3fPointArray(int);
    2284  ON_3fPointArray& operator=( const ON_3fPointArray& );
    2285 
    2286  bool GetBBox(
    2287  float boxmin[3],
    2288  float boxmax[3],
    2289  bool bGrowBox = false
    2290  ) const;
    2291 
    2292  bool Transform( const ON_Xform& );
    2293 
    2294  bool SwapCoordinates(int,int);
    2295 };
    2296 
    2297 
    2298 /////////////////////////////////////////////////////////////////
    2299 //
    2300 
    2302 {
    2303 public:
    2304  // see ON_SimpleArray class definition comments for constructor documentation
    2305  ON_4dPointArray();
    2306  ON_4dPointArray(int);
    2308  ON_4dPointArray& operator=( const ON_4dPointArray& );
    2309 
    2310  bool Transform( const ON_Xform& );
    2311  bool SwapCoordinates(int,int);
    2312 };
    2313 
    2314 
    2315 /////////////////////////////////////////////////////////////////
    2316 //
    2317 
    2319 {
    2320 public:
    2321  // see ON_SimpleArray class definition comments for constructor documentation
    2322  ON_4fPointArray();
    2323  ON_4fPointArray(int);
    2325  ON_4fPointArray& operator=( const ON_4fPointArray& );
    2326 
    2327  bool Transform( const ON_Xform& );
    2328  bool SwapCoordinates(int,int);
    2329 };
    2330 
    2331 
    2332 /////////////////////////////////////////////////////////////////
    2333 //
    2334 
    2336 {
    2337 public:
    2338  // see ON_SimpleArray class definition comments for constructor documentation
    2339  ON_2dVectorArray();
    2340  ON_2dVectorArray(int);
    2342  ON_2dVectorArray& operator=( const ON_2dVectorArray& );
    2343 
    2344  bool GetBBox(
    2345  double boxmin[2],
    2346  double boxmax[2],
    2347  bool bGrowBox = false
    2348  ) const;
    2349 
    2350  bool Transform( const ON_Xform& );
    2351  bool SwapCoordinates(int,int);
    2352 };
    2353 
    2354 
    2355 /////////////////////////////////////////////////////////////////
    2356 //
    2357 
    2359 {
    2360 public:
    2361  // see ON_SimpleArray class definition comments for constructor documentation
    2362  ON_2fVectorArray();
    2363  ON_2fVectorArray(int);
    2365  ON_2fVectorArray& operator=( const ON_2fVectorArray& );
    2366 
    2367  bool GetBBox(
    2368  float boxmin[2],
    2369  float boxmax[2],
    2370  bool = false
    2371  ) const;
    2372 
    2373  bool Transform( const ON_Xform& );
    2374  bool SwapCoordinates(int,int);
    2375 };
    2376 
    2377 
    2378 /////////////////////////////////////////////////////////////////
    2379 //
    2380 
    2382 {
    2383 public:
    2384  ON_3dVectorArray();
    2385  ON_3dVectorArray(int);
    2387  ON_3dVectorArray& operator=( const ON_3dVectorArray& );
    2388 
    2389  bool GetBBox(
    2390  double boxmin[3],
    2391  double boxmax[3],
    2392  bool bGrowBow = false
    2393  ) const;
    2394 
    2395  bool Transform( const ON_Xform& );
    2396  bool SwapCoordinates(int,int);
    2397 };
    2398 
    2399 /////////////////////////////////////////////////////////////////
    2400 //
    2401 
    2403 {
    2404 public:
    2405  ON_3fVectorArray();
    2406  ON_3fVectorArray(int);
    2408  ON_3fVectorArray& operator=( const ON_3fVectorArray& );
    2409 
    2410  bool GetBBox(
    2411  float boxmin[3],
    2412  float boxmax[3],
    2413  bool bGrowBox = false
    2414  ) const;
    2415 
    2416  bool Transform( const ON_Xform& );
    2417  bool SwapCoordinates(int,int);
    2418 };
    2419 
    2420 class ON_CLASS ON_3dPointListRef
    2421 {
    2422 public:
    2423 
    2424 
    2426  : m_point_count(0)
    2427  , m_point_stride(0)
    2428  , m_dP(0)
    2429  , m_fP(0)
    2430  {}
    2431 
    2432  /*
    2433  Description:
    2434  Construct a point list that references the mesh vertex list.
    2435  Remarks:
    2436  If the mesh has double precision vertices, then the point
    2437  list will refer to them; otherwise, the point list will
    2438  refer to the single precision vertices.
    2439  */
    2441  const class ON_Mesh* mesh
    2442  );
    2443 
    2444  /*
    2445  Description:
    2446  Construct a point list that references the points
    2447  in a simple array of ON_3dPoint objects.
    2448  */
    2450  const class ON_SimpleArray<ON_3dPoint>& point_array
    2451  );
    2452 
    2453  /*
    2454  Description:
    2455  Construct a point list that references the points
    2456  in a simple array of ON_3fPoint objects.
    2457  */
    2459  const class ON_SimpleArray<ON_3fPoint>& point_array
    2460  );
    2461 
    2463 
    2464  static
    2465  ON_3dPointListRef FromDoubleArray(
    2466  size_t point_count,
    2467  size_t point_stride,
    2468  const double* point_array
    2469  );
    2470 
    2471  static
    2472  ON_3dPointListRef FromFloatArray(
    2473  size_t point_count,
    2474  size_t point_stride,
    2475  const float* point_array
    2476  );
    2477 
    2478  static
    2479  ON_3dPointListRef FromPointArray(
    2480  const class ON_SimpleArray<ON_3dPoint>& point_array
    2481  );
    2482 
    2483  static
    2484  ON_3dPointListRef FromPointArray(
    2485  const class ON_SimpleArray<ON_3fPoint>& point_array
    2486  );
    2487 
    2488  static
    2489  ON_3dPointListRef FromMesh(
    2490  const class ON_Mesh* mesh
    2491  );
    2492 
    2493  /*
    2494  Returns:
    2495  A copy of the refenced points in an ON_SimpleArray<ON_3dPoint>.
    2496  */
    2497  ON_SimpleArray<ON_3dPoint> To3dPointArray() const;
    2498 
    2499  /*
    2500  Returns:
    2501  A copy of the refenced points in an ON_SimpleArray<ON_3fPoint>.
    2502  */
    2503  ON_SimpleArray<ON_3fPoint> To3fPointArray() const;
    2504 
    2505  /*
    2506  Description:
    2507  Set this point list to reference points with double coordinates.
    2508  Parameters:
    2509  point_count - [in]
    2510  number of points
    2511  point_stride - [in] (>= 3)
    2512  number of doubles between points.
    2513  point_array - [in]
    2514  pointer to the first coordinate of the first point.
    2515  Returns:
    2516  Number of points in the list.
    2517  */
    2518  unsigned int SetFromDoubleArray(
    2519  size_t point_count,
    2520  size_t point_stride,
    2521  const double* point_array
    2522  );
    2523 
    2524  /*
    2525  Description:
    2526  Set this point list to reference points with float coordinates.
    2527  Parameters:
    2528  point_count - [in]
    2529  number of points
    2530  point_stride - [in] (>= 3)
    2531  number of floats between points.
    2532  point_array - [in]
    2533  pointer to the first coordinate of the first point.
    2534  Returns:
    2535  Number of points in the list.
    2536  */
    2537  unsigned int SetFromFloatArray(
    2538  size_t point_count,
    2539  size_t point_stride,
    2540  const float* point_array
    2541  );
    2542 
    2543  /*
    2544  Description:
    2545  Set this point list to reference a mesh vertex list.
    2546  Parameters:
    2547  mesh - [in]
    2548  Returns:
    2549  Number of points in the list.
    2550  */
    2551  unsigned int SetFromMesh(
    2552  const class ON_Mesh* mesh
    2553  );
    2554 
    2555  /*
    2556  Returns:
    2557  0: no points
    2558  1: single precison points (float coordinates)
    2559  2: double precison points (double coordinates)
    2560  */
    2561  unsigned int Precision() const;
    2562 
    2563  /*
    2564  Returns:
    2565  true if the points are double precision
    2566  */
    2567  bool DoublePrecision() const;
    2568 
    2569  /*
    2570  Returns:
    2571  true if the points are single precision
    2572  */
    2573  bool SinglePrecision() const;
    2574 
    2575  /*
    2576  Description:
    2577  Copy point location into buffer and return it as an ON_3dPoint.
    2578  Parameters:
    2579  point_index - [in]
    2580  buffer - [out]
    2581  If point_index is a valid index, the point coordinates
    2582  are copied to buffer[]; oherwise the buffer coordinates
    2583  are set to ON_UNSET_VALUE.
    2584  You must insure buffer is not null, has proper alignment
    2585  for storing doubles, and is large enough to store three
    2586  doubles.
    2587  Returns:
    2588  A reference to an ON_3dPoint which is a cast of buffer.
    2589  Remarks:
    2590  This is the fastest and most efficient way to get a the
    2591  location of a point into memory you are managing.
    2592  */
    2593  inline const class ON_3dPoint& GetPoint(
    2594  unsigned int point_index,
    2595  double buffer[3]
    2596  ) const
    2597  {
    2598  if ( point_index < m_point_count )
    2599  {
    2600  if ( m_dP )
    2601  {
    2602  const double* p = m_dP + (point_index*m_point_stride);
    2603  buffer[0] = *p++;
    2604  buffer[1] = *p++;
    2605  buffer[2] = *p;
    2606  }
    2607  else
    2608  {
    2609  const float* p = m_fP + (point_index*m_point_stride);
    2610  buffer[0] = *p++;
    2611  buffer[1] = *p++;
    2612  buffer[2] = *p;
    2613  }
    2614  }
    2615  else
    2616  {
    2617  buffer[0] = buffer[1] = buffer[2] = ON_UNSET_VALUE;
    2618  }
    2619  return *((const ON_3dPoint*)buffer);
    2620  }
    2621 
    2622  /*
    2623  Parameters:
    2624  point_index - [in]
    2625  Returns:
    2626  If point_index is a valid index, the point location is returned.
    2627  Otherwise ON_3dPoint::UnsetPoint is returned.
    2628  */
    2630  unsigned int point_index
    2631  ) const
    2632  {
    2633  double buffer[3];
    2634  if ( point_index < m_point_count )
    2635  {
    2636  if ( m_dP )
    2637  {
    2638  const double* p = m_dP + (point_index*m_point_stride);
    2639  buffer[0] = *p++;
    2640  buffer[1] = *p++;
    2641  buffer[2] = *p;
    2642  }
    2643  else
    2644  {
    2645  const float* p = m_fP + (point_index*m_point_stride);
    2646  buffer[0] = *p++;
    2647  buffer[1] = *p++;
    2648  buffer[2] = *p;
    2649  }
    2650  }
    2651  else
    2652  {
    2653  buffer[0] = buffer[1] = buffer[2] = ON_UNSET_VALUE;
    2654  }
    2655  return *((const ON_3dPoint*)buffer);
    2656  }
    2657 
    2658  inline ON_3dPoint operator[](int point_index) const
    2659  {
    2660  double buffer[3];
    2661  if ( point_index >= 0 && ((unsigned int)point_index) < m_point_count )
    2662  {
    2663  if ( m_dP )
    2664  {
    2665  const double* p = m_dP + (point_index*m_point_stride);
    2666  buffer[0] = *p++;
    2667  buffer[1] = *p++;
    2668  buffer[2] = *p;
    2669  }
    2670  else
    2671  {
    2672  const float* p = m_fP + (point_index*m_point_stride);
    2673  buffer[0] = *p++;
    2674  buffer[1] = *p++;
    2675  buffer[2] = *p;
    2676  }
    2677  }
    2678  else
    2679  {
    2680  buffer[0] = buffer[1] = buffer[2] = ON_UNSET_VALUE;
    2681  }
    2682  return *((const ON_3dPoint*)buffer);
    2683  }
    2684 
    2685  inline ON_3dPoint operator[](unsigned int point_index) const
    2686  {
    2687  double buffer[3];
    2688  if ( point_index < m_point_count )
    2689  {
    2690  if ( m_dP )
    2691  {
    2692  const double* p = m_dP + (point_index*m_point_stride);
    2693  buffer[0] = *p++;
    2694  buffer[1] = *p++;
    2695  buffer[2] = *p;
    2696  }
    2697  else
    2698  {
    2699  const float* p = m_fP + (point_index*m_point_stride);
    2700  buffer[0] = *p++;
    2701  buffer[1] = *p++;
    2702  buffer[2] = *p;
    2703  }
    2704  }
    2705  else
    2706  {
    2707  buffer[0] = buffer[1] = buffer[2] = ON_UNSET_VALUE;
    2708  }
    2709  return *((const ON_3dPoint*)buffer);
    2710  }
    2711 
    2712  inline ON_3dPoint operator[](ON__INT64 point_index) const
    2713  {
    2714  double buffer[3];
    2715  if ( point_index >= 0 && ((ON__UINT64)point_index) < m_point_count )
    2716  {
    2717  if ( m_dP )
    2718  {
    2719  const double* p = m_dP + (point_index*m_point_stride);
    2720  buffer[0] = *p++;
    2721  buffer[1] = *p++;
    2722  buffer[2] = *p;
    2723  }
    2724  else
    2725  {
    2726  const float* p = m_fP + (point_index*m_point_stride);
    2727  buffer[0] = *p++;
    2728  buffer[1] = *p++;
    2729  buffer[2] = *p;
    2730  }
    2731  }
    2732  else
    2733  {
    2734  buffer[0] = buffer[1] = buffer[2] = ON_UNSET_VALUE;
    2735  }
    2736  return *((const ON_3dPoint*)buffer);
    2737  }
    2738 
    2739  inline ON_3dPoint operator[](ON__UINT64 point_index) const
    2740  {
    2741  double buffer[3];
    2742  if ( point_index < m_point_count )
    2743  {
    2744  if ( m_dP )
    2745  {
    2746  const double* p = m_dP + (point_index*m_point_stride);
    2747  buffer[0] = *p++;
    2748  buffer[1] = *p++;
    2749  buffer[2] = *p;
    2750  }
    2751  else
    2752  {
    2753  const float* p = m_fP + (point_index*m_point_stride);
    2754  buffer[0] = *p++;
    2755  buffer[1] = *p++;
    2756  buffer[2] = *p;
    2757  }
    2758  }
    2759  else
    2760  {
    2761  buffer[0] = buffer[1] = buffer[2] = ON_UNSET_VALUE;
    2762  }
    2763  return *((const ON_3dPoint*)buffer);
    2764  }
    2765 
    2766  inline unsigned int PointCount() const
    2767  {
    2768  return m_point_count;
    2769  }
    2770 
    2771  inline unsigned int PointStride() const
    2772  {
    2773  return m_point_stride;
    2774  }
    2775 
    2776  inline const double* PointDoubleArray() const
    2777  {
    2778  return m_dP;
    2779  }
    2780 
    2781  inline const float* PointFloatArray() const
    2782  {
    2783  return m_fP;
    2784  }
    2785 
    2786  /*
    2787  Returns:
    2788  Number of points copied to face_points[] array.
    2789  */
    2790  unsigned int GetMeshFacePoints(
    2791  const class ON_MeshFace* mesh_face,
    2792  ON_3dPoint face_points[4]
    2793  ) const;
    2794 
    2795  /*
    2796  Returns:
    2797  Number of points copied to ngon_points[] array.
    2798  */
    2799  unsigned int GetMeshNgonPoints(
    2800  const class ON_MeshNgon* mesh_ngon,
    2801  size_t ngon_points_capacity,
    2802  class ON_3dPoint* ngon_points
    2803  ) const;
    2804 
    2805  /*
    2806  Returns:
    2807  Number of points copied to ngon_points[] array.
    2808  */
    2809  unsigned int GetMeshNgonPoints(
    2810  const class ON_MeshNgon* mesh_ngon,
    2811  ON_SimpleArray<ON_3dPoint>& ngon_points
    2812  ) const;
    2813 
    2814  /*
    2815  Returns:
    2816  Number of points copied to quad_points[] array.
    2817  */
    2818  unsigned int GetQuadPoints(
    2819  const int quad_point_indices[4],
    2820  class ON_3dPoint quad_points[4]
    2821  ) const;
    2822 
    2823  /*
    2824  Returns:
    2825  Number of points copied to quad_points[] array.
    2826  */
    2827  unsigned int GetQuadPoints(
    2828  const unsigned int quad_point_indices[4],
    2829  class ON_3dPoint quad_points[4]
    2830  ) const;
    2831 
    2832  /*
    2833  Returns:
    2834  Number of points copied to triangle_points[] array.
    2835  */
    2836  unsigned int GetTrianglePoints(
    2837  const int triangle_point_indices[3],
    2838  class ON_3dPoint triangle_points[3]
    2839  ) const;
    2840 
    2841  /*
    2842  Returns:
    2843  Number of points copied to triangle_points[] array.
    2844  */
    2845  unsigned int GetTrianglePoints(
    2846  const unsigned int triangle_point_indices[3],
    2847  class ON_3dPoint triangle_points[3]
    2848  ) const;
    2849 
    2850  /*
    2851  Returns:
    2852  Number of points copied to points[] array.
    2853  */
    2854  unsigned int GetPoints(
    2855  int point_index_count,
    2856  const int* point_index_list,
    2857  class ON_3dPoint* points
    2858  ) const;
    2859 
    2860  /*
    2861  Returns:
    2862  Number of points copied to points[] array.
    2863  */
    2864  unsigned int GetPoints(
    2865  unsigned int point_index_count,
    2866  const unsigned int* point_index_list,
    2867  class ON_3dPoint* points
    2868  ) const;
    2869 
    2870  /*
    2871  Returns:
    2872  Number of points copied to points[] array.
    2873  */
    2874  unsigned int GetPoints(
    2875  const ON_SimpleArray<int>& point_index_list,
    2877  ) const;
    2878 
    2879  /*
    2880  Returns:
    2881  Number of points copied to points[] array.
    2882  */
    2883  unsigned int GetPoints(
    2884  int point_index_count,
    2885  const int* point_index_list,
    2887  ) const;
    2888 
    2889  /*
    2890  Returns:
    2891  Number of points copied to points[] array.
    2892  */
    2893  unsigned int GetPoints(
    2894  unsigned int point_index_count,
    2895  const unsigned int* point_index_list,
    2897  ) const;
    2898 
    2899 private:
    2900  unsigned int m_point_count;
    2901  unsigned int m_point_stride;
    2902  const double* m_dP;
    2903  const float* m_fP;
    2904 };
    2905 
    2906 
    2907 
    2908 
    2909 
    2910 
    2911 
    2912 
    2913 /*
    2914 Class ON_2dSize
    2915 */
    2916 class ON_CLASS ON_2dSize
    2917 {
    2918 public:
    2919  // Default construction intentionally leaves x and y uninitialized.
    2920  // Use something like
    2921  // ON_2dSize pt(1.0,2.0);
    2922  // or
    2923  // ON_2dSize pt = ON_2dSize::Zero;
    2924  // when you need an initialized ON_2dSize.
    2925  ON_2dSize() = default;
    2926 
    2927  ~ON_2dSize() = default;
    2928  ON_2dSize(const ON_2dSize& ) = default;
    2929  ON_2dSize& operator=(const ON_2dSize& ) = default;
    2930 
    2931  ON_2dSize(
    2932  double cx,
    2933  double cy
    2934  );
    2935 
    2936  /*
    2937  Dictionary compare.
    2938  Returns:
    2939  -1: lhs < rhs
    2940  0: lsh == rsh
    2941  +1: lhs > rhs
    2942  */
    2943  static int Compare(
    2944  const ON_2dSize& lhs,
    2945  const ON_2dSize& rhs
    2946  );
    2947 
    2948  /*
    2949  Dictionary compare.
    2950  Returns:
    2951  -1: lhs < rhs
    2952  0: lsh == rsh
    2953  +1: lhs > rhs
    2954  */
    2955  static int ComparePointer(
    2956  const ON_2dSize* lhs,
    2957  const ON_2dSize* rhs
    2958  );
    2959 
    2960 public:
    2961  static const ON_2dSize Zero; // (0.0,0.0)
    2962  static const ON_2dSize Unset; // (ON_UNSET_DOUBLE,ON_UNSET_DOUBLE)
    2963 
    2964 public:
    2965  /*
    2966  Returns:
    2967  true if both cx and cy are 0.0
    2968  */
    2969  bool IsZero() const;
    2970 
    2971  /*
    2972  Returns:
    2973  true if neither cx nor cy are ON_UNSET_DOUBLE.
    2974  */
    2975  bool IsSet() const;
    2976 
    2977 public:
    2978  double cx;
    2979  double cy;
    2980 };
    2981 
    2982 ON_DECL
    2983 bool operator==(
    2984  const ON_2dSize& lhs,
    2985  const ON_2dSize& rhs
    2986  );
    2987 
    2988 ON_DECL
    2989 bool operator!=(
    2990  const ON_2dSize& lhs,
    2991  const ON_2dSize& rhs
    2992  );
    2993 
    2994 #if defined(ON_DLL_TEMPLATE)
    2995 
    2996 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_2dSize>;
    2997 
    2998 #endif
    2999 
    3000 /*
    3001 Class ON_4iRect
    3002  For those situations where a Windows SDK RECT or MFC CRect
    3003  value needs to be used in code that does not link with MFC.
    3004  If you want a traditional bounding box, use ON_2dBoundingBox.
    3005 */
    3006 class ON_CLASS ON_4dRect
    3007 {
    3008 public:
    3009  // Default construction intentionally leaves x and y uninitialized.
    3010  // Use something like
    3011  // ON_4dRect pt(1.0,2.0,3.0,4.0);
    3012  // or
    3013  // ON_4dRect pt = ON_4dRect::Zero;
    3014  // when you need an initialized ON_4dRect.
    3015  ON_4dRect() = default;
    3016 
    3017  ~ON_4dRect() = default;
    3018  ON_4dRect(const ON_4dRect& ) = default;
    3019  ON_4dRect& operator=(const ON_4dRect& ) = default;
    3020 
    3021  ON_4dRect(
    3022  double left,
    3023  double top,
    3024  double right,
    3025  double bottom
    3026  );
    3027 
    3028  ON_4dRect(const ON_2dPoint topLeft, const ON_2dPoint& bottomRight);
    3029  ON_4dRect(const ON_2dPoint& point, const ON_2dSize& size);
    3030 
    3031 public:
    3032  static const ON_4dRect Zero; // (0.0,0.0,0.0,0.0)
    3033  static const ON_4dRect Unset; // (ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX)
    3034 
    3035 public:
    3036  /*
    3037  Returns:
    3038  true if all of left, top, right, and bottom are set to 0.
    3039  */
    3040  bool IsZero() const;
    3041 
    3042  void SetZero();
    3043 
    3044  /*
    3045  Returns:
    3046  true if none of left, top, right, or bottom is set to ON_UNSET_INT_INDEX
    3047  */
    3048  bool IsSet() const;
    3049 
    3050  double Width(void) const;
    3051  double Height(void) const;
    3052 
    3053  const ON_2dSize Size(void) const;
    3054 
    3055  const ON_2dPoint CenterPoint(void) const;
    3056  const ON_2dPoint TopLeft(void) const;
    3057  const ON_2dPoint BottomRight(void) const;
    3058 
    3059  bool IntersectRect(const ON_4dRect* r1, const ON_4dRect* r2);
    3060  bool IntersectRect(const ON_4dRect& r1, const ON_4dRect& r2);
    3061 
    3062  bool IsRectEmpty(void) const;
    3063  bool IsRectNull(void) const;
    3064  void SetRectEmpty(void) { *this = Zero; }
    3065  void SetRect(double l, double t, double r, double b);
    3066 
    3067  bool PtInRect(const ON_2dPoint& pt) const;
    3068 
    3069  void OffsetRect(double, double);
    3070  void OffsetRect(const ON_2dVector&);
    3071  void InflateRect(double, double);
    3072  void InflateRect(double, double, double, double);
    3073  void DeflateRect(double, double);
    3074  bool SubtractRect(const ON_4dRect* rect1, const ON_4dRect* rect2);
    3075 
    3076  void NormalizeRect();
    3077 
    3078 public:
    3079  double left;
    3080  double top;
    3081  double right;
    3082  double bottom;
    3083 };
    3084 
    3085 #if defined(ON_DLL_TEMPLATE)
    3086 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_4dRect>;
    3087 #endif
    3088 
    3089 
    3090 ON_DECL
    3091 bool operator==(const ON_4dRect&, const ON_4dRect&);
    3092 
    3093 ON_DECL
    3094 bool operator!=(const ON_4dRect&, const ON_4dRect&);
    3095 
    3096 
    3097 
    3098 
    3099 
    3100 
    3101 
    3102 
    3103 
    3104 #endif
    3105 
    const class ON_3dPoint & GetPoint(unsigned int point_index, double buffer[3]) const
    Definition: opennurbs_point.h:2593
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // defines double precision point, vector, and array classes
    20 //
    21 ////////////////////////////////////////////////////////////////
    22 #if !defined(ON_POINT_INC_)
    23 #define ON_POINT_INC_
    24 
    25 class ON_BoundingBox;
    26 class ON_Xform;
    27 class ON_Line;
    28 class ON_Plane;
    29 
    30 class ON_2dPoint;
    31 class ON_3dPoint;
    32 class ON_4dPoint;
    33 
    34 class ON_2dVector;
    35 class ON_3dVector;
    36 
    37 class ON_2fVector;
    38 class ON_3fVector;
    39 
    40 class ON_Interval;
    41 
    42 ////////////////////////////////////////////////////////////////
    43 //
    44 // ON_Interval
    45 //
    46 class ON_CLASS ON_Interval
    47 {
    48 public:
    49  static const ON_Interval EmptyInterval; // (ON_UNSET_VALUE,ON_UNSET_VALUE)
    50  static const ON_Interval ZeroToOne; // (0.0, 1.0)
    51  static const ON_Interval ZeroToTwoPi; // (0.0, 2.0*ON_PI)
    52  static const ON_Interval Nan; // (ON_DBL_QNAN,ON_DBL_QNAN)
    53 
    54 public:
    55  // The default constructor creates ON_Interval::EmptyInterval (ON_UNSET_VALUE,ON_UNSET_VALUE)
    56  ON_Interval();
    57  ~ON_Interval() = default;
    58  ON_Interval(const ON_Interval&) = default;
    59  ON_Interval& operator=(const ON_Interval&) = default;
    60 
    61  ON_Interval(double t0,double t1);
    62 
    63 public:
    64  // Interval = (m_t[0], m_t[1])
    65  double m_t[2];
    66 
    67 #if defined(OPENNURBS_WALL)
    68  // Goal is to eventually require = as the only way to modify ON_Interval values.
    69  ON_DEPRECATED_MSG("Use interval = ON_Interval::EmptyInterval;")
    70 #endif
    71  void Destroy();
    72 
    73  /*
    74  Description:
    75  Sets interval to [t0,t1]
    76  Parameters:
    77  t0 - [in]
    78  t1 - [in]
    79  See Also:
    80  ON_Interval::ON_Interval( double, double )
    81  */
    82  void Set(
    83  double t0,
    84  double t1
    85  );
    86 
    87  /*
    88  Description:
    89  Convert normalized parameter to interval value, or pair of values.
    90  Parameters:
    91  normalized_parameter - [in]
    92  Returns:
    93  Interval parameter
    94  min*(1.0-normalized_parameter) + max*normalized_parameter
    95  See Also:
    96  ON_Interval::NormalizedParameterAt
    97  */
    98  double ParameterAt (
    99  double normalized_parameter
    100  ) const;
    101  ON_Interval ParameterAt (
    102  ON_Interval normalized_interval
    103  ) const;
    104 
    105  /*
    106  Description:
    107  Convert interval value, or pair of values, to normalized parameter.
    108  Parameters:
    109  interval_parameter - [in] value in interval
    110  Returns:
    111  Normalized parameter x so that
    112  min*(1.0-x) + max*x = interval_parameter.
    113  See Also:
    114  ON_Interval::ParameterAt
    115  */
    116  double NormalizedParameterAt (
    117  double interval_parameter
    118  ) const;
    119  ON_Interval NormalizedParameterAt (
    120  ON_Interval interval_parameter
    121  ) const;
    122 
    123  double& operator[](int); // returns (index<=0) ? m_t[0] : m_t[1]
    124  double operator[](int) const; // returns (index<=0) ? m_t[0] : m_t[1]
    125  double& operator[](unsigned int); // returns (index<=0) ? m_t[0] : m_t[1]
    126  double operator[](unsigned int) const; // returns (index<=0) ? m_t[0] : m_t[1]
    127 
    128  double Min() const; // returns smaller of m_t[0] and m_t[1]
    129  double Max() const; // returns larger of m_t[0] and m_t[1]
    130  double Mid() const; // returns 0.5*(m_t[0] + m_t[1])
    131  double Length() const; // returns signed length, m_t[1]-m_t[0]
    132 
    133  bool IsIncreasing() const; // returns true if m_t[0] < m_t[1]
    134  bool IsDecreasing() const; // returns true if m_t[0] > m_t[0];
    135  bool IsInterval() const; // returns truc if m_t[0] != m_t[1]
    136  bool IsSingleton() const; // returns true if m_t[0] == m_t[1] != ON_UNSET_VALUE
    137  bool IsEmptyInterval() const; // returns true if m_t[0] == m_t[1] == ON_UNSET_VALUE
    138  bool IsValid() const; // returns ON_IsValid(m_t[0]) && ON_IsValid(m_t[1])
    139 
    140 #if defined(OPENNURBS_WALL)
    141  ON_DEPRECATED_MSG("Use IsEmptyInterval()")
    142 #endif
    143  bool IsEmptySet() const; // returns true if m_t[0] == m_t[1] == ON_UNSET_VALUE
    144 
    145  bool MakeIncreasing(); // returns true if resulting interval IsIncreasing()
    146 
    147  /*
    148  Description:
    149  A well ordered dictionary compare function that is nan aware and can
    150  be used for robust sorting.
    151  */
    152  static int Compare(
    153  const ON_Interval& lhs,
    154  const ON_Interval& rhs
    155  );
    156 
    157 
    158  /*
    159  Returns:
    160  True if (lhs.m_t[0] != rhs.m_t[0]) or (lhs.m_t[1] != rhs.m_t[1]) and
    161  no values are nans.
    162  */
    163  bool operator!=(const ON_Interval& rhs) const;
    164 
    165  /*
    166  Returns:
    167  True if (lhs.m_t[0] == rhs.m_t[0]) and (lhs.m_t[1] === rhs.m_t[1]).
    168  */
    169  bool operator==(const ON_Interval& rhs) const;
    170 
    171  /*
    172  Description:
    173  Test a value t to see if it is inside the interval.
    174  Parameters:
    175  t - [in] value to test
    176  bTestOpenInterval - [in]
    177  If false, t is tested to see if it satisfies min <= t <= max.
    178  If true, t is tested to see if it satisfies min < t < max.
    179  Returns:
    180  true if t is in the interval and false if t is not
    181  in the interval.
    182  */
    183  bool Includes(
    184  double t,
    185  bool bTestOpenInterval = false
    186  ) const;
    187 
    188  /*
    189  Description:
    190  Test an interval to see if it is contained in this interval.
    191  Parameters:
    192  other - [in] interval to test
    193  bProperSubSet - [in] if true, then the test is for a proper subinterval.
    194  Returns:
    195  If bProperSubSet is false, then the result is true when
    196  this->Min() <= other.Min() and other.Max() <= this->Max().
    197  If bProperSubSet is true, then the result is true when
    198  this->Min() <= other.Min() and other.Max() <= this->Max()
    199  and at least one of the inequalites is strict.
    200  */
    201  bool Includes(
    202  const ON_Interval& other,
    203  bool bProperSubSet = false
    204  ) const;
    205 
    206  /*
    207  Description:
    208  Test a pair of interval to see if they have a non-empty intersection.
    209  Parameters:
    210  A - [in] interval to test
    211  B - [in] interval to test
    212  Returns:
    213  true if the intersection is non-empty,
    214  including if the intersection is a single point.
    215  false otherwise.
    216  */
    217  static bool IntervalsOverlap(const ON_Interval& A, const ON_Interval& B);
    218 
    219  /*
    220  Description:
    221  Changes interval to [-m_t[1],-m_t[0]].
    222  */
    223  void Reverse();
    224 
    225  /*
    226  Description:
    227  Swaps m_t[0] and m_t[1].
    228  */
    229  void Swap();
    230 
    231  //////////
    232  // If the intersection is not empty, then
    233  // intersection = [max(this.Min(),arg.Min()), min(this.Max(),arg.Max())]
    234  // Intersection() returns true if the intersection is not empty.
    235  // The interval [ON_UNSET_VALUE,ON_UNSET_VALUE] is considered to be
    236  // the empty set interval. The result of any intersection involving an
    237  // empty set interval or disjoint intervals is the empty set interval.
    238  bool Intersection( // this = this intersect arg
    239  const ON_Interval&
    240  );
    241 
    242  //////////
    243  // If the intersection is not empty, then
    244  // intersection = [max(argA.Min(),argB.Min()), min(argA.Max(),argB.Max())]
    245  // Intersection() returns true if the intersection is not empty.
    246  // The interval [ON_UNSET_VALUE,ON_UNSET_VALUE] is considered to be
    247  // the empty set interval. The result of any intersection involving an
    248  // empty set interval or disjoint intervals is the empty set interval.
    249  bool Intersection( // this = intersection of two args
    250  const ON_Interval&,
    251  const ON_Interval&
    252  );
    253 
    254  //////////
    255  // The union of an empty set and an increasing interval is the increasing
    256  // interval. The union of two empty sets is empty. The union of an empty
    257  // set an a non-empty interval is the non-empty interval.
    258  // The union of two non-empty intervals is
    259  // union = [min(this.Min(),arg.Min()), max(this.Max(),arg.Max()),]
    260  // Union() returns true if the union is not empty.
    261  bool Union( // this = this union arg
    262  const ON_Interval&
    263  );
    264 
    265  bool Union( // this = this union arg
    266  double t
    267  );
    268 
    269  bool Union( // this = this union arg
    270  int count,
    271  const double* t
    272  );
    273 
    274  //////////
    275  // The union of an empty set and an increasing interval is the increasing
    276  // interval. The union of two empty sets is empty. The union of an empty
    277  // set an a non-empty interval is the non-empty interval.
    278  // The union of two non-empty intervals is
    279  // union = [min(argA.Min(),argB.Min()), max(argA.Max(),argB.Max()),]
    280  // Union() returns true if the union is not empty.
    281  bool Union( // this = union of two args
    282  const ON_Interval&,
    283  const ON_Interval&
    284  );
    285 };
    286 
    287 
    288 ////////////////////////////////////////////////////////////////
    289 //
    290 // ON_2dPoint
    291 //
    292 class ON_CLASS ON_2dPoint
    293 {
    294 public:
    295  double x, y;
    296 
    297 public:
    298  // x,y not initialized
    299  ON_2dPoint() = default;
    300  ~ON_2dPoint() = default;
    301  ON_2dPoint(const ON_2dPoint&) = default;
    302  ON_2dPoint& operator=(const ON_2dPoint&) = default;
    303 
    304 public:
    305  static const ON_2dPoint Origin; // (0.0,0.0)
    306  static const ON_2dPoint UnsetPoint; // (ON_UNSET_VALUE,ON_UNSET_VALUE)
    307  static const ON_2dPoint NanPoint; // (ON_DBL_QNAN,ON_DBL_QNAN)
    308 
    309  /*
    310  Description:
    311  A well ordered dictionary compare function that is nan aware and can
    312  be used for robust sorting.
    313  */
    314  static int Compare(
    315  const ON_2dPoint& lhs,
    316  const ON_2dPoint& rhs
    317  );
    318 
    319  explicit ON_2dPoint(double x,double y);
    320 #if defined(OPENNURBS_WALL)
    321  // Goal is to eventually have all constructors that discard informtion be explicit.
    322  explicit
    323 #endif
    324  ON_2dPoint(const ON_3dPoint& ); // from 3d point
    325 
    326  explicit ON_2dPoint(const ON_4dPoint& h); // from 4d point - h.w must be non-zero
    327  ON_2dPoint(const ON_2dVector& ); // from 2d vector
    328  explicit ON_2dPoint(const ON_3dVector& ); // from 3d vector
    329 
    330  explicit ON_2dPoint(const double*); // from double[2] array
    331 
    332  ON_2dPoint(const class ON_2fPoint&); // from 2f point
    333  explicit ON_2dPoint(const class ON_3fPoint&); // from 3f point
    334  explicit ON_2dPoint(const class ON_4fPoint& h); // from 4f point - h.w must be non-zero
    335  explicit ON_2dPoint(const class ON_2fVector&); // from 2f vector
    336  explicit ON_2dPoint(const class ON_3fVector&); // from 3f vector
    337 
    338  explicit ON_2dPoint(const float*); // from float[2] array
    339 
    340  // (double*) conversion operators
    341  operator double*();
    342  operator const double*() const;
    343 
    344  // use implicit operator=(const ON_2dPoint&)
    345  ON_2dPoint& operator=(const ON_3dPoint&);
    346  ON_2dPoint& operator=(const ON_4dPoint&);
    347  ON_2dPoint& operator=(const ON_2dVector&);
    348  ON_2dPoint& operator=(const ON_3dVector&);
    349  ON_2dPoint& operator=(const double*); // point = double[2] support
    350 
    351  ON_2dPoint& operator=(const ON_2fPoint&);
    352  ON_2dPoint& operator=(const ON_3fPoint&);
    353  ON_2dPoint& operator=(const ON_4fPoint&);
    354  ON_2dPoint& operator=(const ON_2fVector&);
    355  ON_2dPoint& operator=(const ON_3fVector&);
    356  ON_2dPoint& operator=(const float*); // point = float[2] support
    357 
    358  ON_2dPoint& operator*=(double);
    359  ON_2dPoint& operator/=(double);
    360  ON_2dPoint& operator+=(const ON_2dVector&);
    361  ON_2dPoint& operator-=(const ON_2dVector&);
    362 
    363  ON_2dPoint operator*(int) const;
    364  ON_2dPoint operator/(int) const;
    365  ON_2dPoint operator*(float) const;
    366  ON_2dPoint operator/(float) const;
    367  ON_2dPoint operator*(double) const;
    368  ON_2dPoint operator/(double) const;
    369 
    370  ON_2dPoint operator+(const ON_2dPoint&) const;
    371  ON_2dPoint operator+(const ON_2dVector&) const;
    372  ON_2dVector operator-(const ON_2dPoint&) const;
    373  ON_2dPoint operator-(const ON_2dVector&) const;
    374  ON_3dPoint operator+(const ON_3dPoint&) const;
    375  ON_3dPoint operator+(const ON_3dVector&) const;
    376  ON_3dVector operator-(const ON_3dPoint&) const;
    377  ON_3dPoint operator-(const ON_3dVector&) const;
    378 
    379  ON_2dPoint operator+(const ON_2fPoint&) const;
    380  ON_2dPoint operator+(const ON_2fVector&) const;
    381  ON_2dVector operator-(const ON_2fPoint&) const;
    382  ON_2dPoint operator-(const ON_2fVector&) const;
    383  ON_3dPoint operator+(const ON_3fPoint&) const;
    384  ON_3dPoint operator+(const ON_3fVector&) const;
    385  ON_3dVector operator-(const ON_3fPoint&) const;
    386  ON_3dPoint operator-(const ON_3fVector&) const;
    387 
    388  double operator*(const ON_2dPoint&) const; // dot product for points acting as vectors
    389  double operator*(const ON_2dVector&) const; // dot product for points acting as vectors
    390 
    391  ON_2dPoint operator*(const ON_Xform&) const;
    392 
    393  bool operator==(const ON_2dPoint&) const;
    394  bool operator!=(const ON_2dPoint&) const;
    395 
    396  // dictionary order comparisons
    397  bool operator<=(const ON_2dPoint&) const;
    398  bool operator>=(const ON_2dPoint&) const;
    399  bool operator<(const ON_2dPoint&) const;
    400  bool operator>(const ON_2dPoint&) const;
    401 
    402  // index operators mimic double[2] behavior
    403  double& operator[](int);
    404  double operator[](int) const;
    405  double& operator[](unsigned int);
    406  double operator[](unsigned int) const;
    407 
    408  /*
    409  Returns:
    410  False if any coordinate is infinte, a nan, or ON_UNSET_VALUE.
    411  */
    412  bool IsValid() const;
    413 
    414  /*
    415  Returns:
    416  True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    417  */
    418  bool IsUnset() const;
    419 
    420  // set 2d point value
    421  void Set(double x,double y);
    422 
    423  double DistanceTo( const ON_2dPoint& ) const;
    424 
    425  int MaximumCoordinateIndex() const;
    426  double MaximumCoordinate() const; // absolute value of maximum coordinate
    427 
    428  int MinimumCoordinateIndex() const;
    429  double MinimumCoordinate() const; // absolute value of minimum coordinate
    430 
    431  ON_DEPRECATED_MSG("Use p = ON_2dPoint::Origin;")
    432  void Zero(); // set all coordinates to zero;
    433 
    434  /*
    435  Returns:
    436  true if all coordinates are not zero and no coordinates are nans.
    437  false otherwise.
    438  */
    439  bool IsZero() const;
    440 
    441  /*
    442  Returns:
    443  true if at lease one coordinate is not zero and no coordinates are nans.
    444  */
    445  bool IsNotZero() const;
    446 
    447  // These transform the point in place. The transformation matrix acts on
    448  // the left of the point; i.e., result = transformation*point
    449  void Transform(
    450  const ON_Xform&
    451  );
    452 
    453  void Rotate( // rotatation in XY plane
    454  double angle, // angle in radians
    455  const ON_2dPoint& center // center of rotation
    456  );
    457 
    458  void Rotate( // rotatation in XY plane
    459  double sin_angle, // sin(angle)
    460  double cos_angle, // cos(angle)
    461  const ON_2dPoint& center // center of rotation
    462  );
    463 
    464  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    465 };
    466 
    467 ON_DECL
    468 ON_2dPoint operator*(int, const ON_2dPoint&);
    469 
    470 ON_DECL
    471 ON_2dPoint operator*(float, const ON_2dPoint&);
    472 
    473 ON_DECL
    474 ON_2dPoint operator*(double, const ON_2dPoint&);
    475 
    476 ////////////////////////////////////////////////////////////////
    477 //
    478 // ON_3dPoint
    479 //
    480 class ON_CLASS ON_3dPoint
    481 {
    482 public:
    483  double x, y, z;
    484 
    485 public:
    486  // x,y,z not initialized
    487  ON_3dPoint() = default;
    488  ~ON_3dPoint() = default;
    489  ON_3dPoint(const ON_3dPoint&) = default;
    490  ON_3dPoint& operator=(const ON_3dPoint&) = default;
    491 
    492 public:
    493  static const ON_3dPoint Origin; // (0.0,0.0,0.0)
    494  static const ON_3dPoint UnsetPoint; // (ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE)
    495  static const ON_3dPoint NanPoint; // (ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN)
    496 
    497  /*
    498  Description:
    499  A well ordered dictionary compare function that is nan aware and can
    500  be used for robust sorting.
    501  */
    502  static int Compare(
    503  const ON_3dPoint& lhs,
    504  const ON_3dPoint& rhs
    505  );
    506 
    507 public:
    508  explicit ON_3dPoint(double x,double y,double z);
    509 #if defined(OPENNURBS_WALL)
    510  // Goal is to eventually have all constructors that discard informtion be explicit.
    511  explicit
    512 #endif
    513  ON_3dPoint(const ON_2dPoint& ); // from 2d point
    514  explicit ON_3dPoint(const ON_4dPoint& h); // from 4d point - h.w must be non-zero
    515  explicit ON_3dPoint(const ON_2dVector& ); // from 2d vector
    516  ON_3dPoint(const ON_3dVector& ); // from 3d vector
    517  explicit ON_3dPoint(const double*); // from double[3] array
    518 
    519  explicit ON_3dPoint(const class ON_2fPoint&); // from 2f point
    520  ON_3dPoint(const class ON_3fPoint&); // from 3f point
    521  explicit ON_3dPoint(const class ON_4fPoint& h ); // from 4f point- h.w must be non-zero
    522  explicit ON_3dPoint(const class ON_2fVector&); // from 2f point
    523  explicit ON_3dPoint(const class ON_3fVector&); // from 3f point
    524  explicit ON_3dPoint(const float*); // from float[3] array
    525 
    526  // (double*) conversion operators
    527  operator double*();
    528  operator const double*() const;
    529 
    530  // use implicit operator=(const ON_3dPoint&)
    531  ON_3dPoint& operator=(const ON_2dPoint&);
    532  ON_3dPoint& operator=(const ON_4dPoint&);
    533  ON_3dPoint& operator=(const ON_2dVector&);
    534  ON_3dPoint& operator=(const ON_3dVector&);
    535  ON_3dPoint& operator=(const double*); // point = double[3] support
    536 
    537  ON_3dPoint& operator=(const class ON_2fPoint&);
    538  ON_3dPoint& operator=(const class ON_3fPoint&);
    539  ON_3dPoint& operator=(const class ON_4fPoint&);
    540  ON_3dPoint& operator=(const class ON_2fVector&);
    541  ON_3dPoint& operator=(const class ON_3fVector&);
    542  ON_3dPoint& operator=(const float*); // point = float[3] support
    543 
    544  ON_3dPoint& operator*=(double);
    545  ON_3dPoint& operator/=(double);
    546  ON_3dPoint& operator+=(const ON_3dVector&);
    547  ON_3dPoint& operator-=(const ON_3dVector&);
    548 
    549  ON_3dPoint operator*(int) const;
    550  ON_3dPoint operator/(int) const;
    551  ON_3dPoint operator*(float) const;
    552  ON_3dPoint operator/(float) const;
    553  ON_3dPoint operator*(double) const;
    554  ON_3dPoint operator/(double) const;
    555 
    556  ON_3dPoint operator+(const ON_3dPoint&) const;
    557  ON_3dPoint operator+(const ON_3dVector&) const;
    558  ON_3dVector operator-(const ON_3dPoint&) const;
    559  ON_3dPoint operator-(const ON_3dVector&) const;
    560  ON_3dPoint operator+(const ON_2dPoint&) const;
    561  ON_3dPoint operator+(const ON_2dVector&) const;
    562  ON_3dVector operator-(const ON_2dPoint&) const;
    563  ON_3dPoint operator-(const ON_2dVector&) const;
    564 
    565  ON_3dPoint operator+(const ON_3fPoint&) const;
    566  ON_3dPoint operator+(const ON_3fVector&) const;
    567  ON_3dVector operator-(const ON_3fPoint&) const;
    568  ON_3dPoint operator-(const ON_3fVector&) const;
    569  ON_3dPoint operator+(const ON_2fPoint&) const;
    570  ON_3dPoint operator+(const ON_2fVector&) const;
    571  ON_3dVector operator-(const ON_2fPoint&) const;
    572  ON_3dPoint operator-(const ON_2fVector&) const;
    573 
    574  double operator*(const ON_3dPoint&) const; // dot product for points acting as vectors
    575  double operator*(const ON_3dVector&) const; // dot product for points acting as vectors
    576 
    577  ON_3dPoint operator*(const ON_Xform&) const;
    578 
    579  bool operator==(const ON_3dPoint&) const;
    580  bool operator!=(const ON_3dPoint&) const;
    581 
    582  // dictionary order comparisons
    583  bool operator<=(const ON_3dPoint&) const;
    584  bool operator>=(const ON_3dPoint&) const;
    585  bool operator<(const ON_3dPoint&) const;
    586  bool operator>(const ON_3dPoint&) const;
    587 
    588  // index operators mimic double[3] behavior
    589  double& operator[](int);
    590  double operator[](int) const;
    591  double& operator[](unsigned int);
    592  double operator[](unsigned int) const;
    593 
    594  /*
    595  Returns:
    596  False if any coordinate is infinte, a nan, or ON_UNSET_VALUE.
    597  */
    598  bool IsValid() const;
    599 
    600  /*
    601  Returns:
    602  True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    603  */
    604  bool IsUnset() const;
    605 
    606  // set 3d point value
    607  void Set(double x,double y,double z);
    608 
    609  double DistanceTo( const ON_3dPoint& ) const;
    610 
    611  int MaximumCoordinateIndex() const;
    612  double MaximumCoordinate() const; // absolute value of maximum coordinate
    613 
    614  int MinimumCoordinateIndex() const;
    615  double MinimumCoordinate() const; // absolute value of minimum coordinate
    616 
    617  double Fuzz( double tolerance = ON_ZERO_TOLERANCE ) const; // tolerance to use when comparing 3d points
    618 
    619 #if defined(OPENNURBS_WALL)
    620  // Goal is to eventually remove all functions that modify points in place.
    621  ON_DEPRECATED_MSG("Use p = ON_3dPoint::Origin;")
    622 #endif
    623  void Zero(); // set all coordinates to zero;
    624 
    625  /*
    626  Returns:
    627  true if all coordinates are not zero and no coordinates are nans.
    628  false otherwise.
    629  */
    630  bool IsZero() const;
    631 
    632  /*
    633  Returns:
    634  true if at lease one coordinate is not zero and no coordinates are nans.
    635  */
    636  bool IsNotZero() const;
    637 
    638  // These transform the point in place. The transformation matrix acts on
    639  // the left of the point; i.e., result = transformation*point
    640  void Transform(
    641  const ON_Xform&
    642  );
    643 
    644  void Rotate(
    645  double angle, // angle in radians
    646  const ON_3dVector& axis, // axis of rotation
    647  const ON_3dPoint& center // center of rotation
    648  );
    649 
    650  void Rotate(
    651  double sin_angle, // sin(angle)
    652  double cos_angle, // cos(angle)
    653  const ON_3dVector& axis, // axis of rotation
    654  const ON_3dPoint& center // center of rotation
    655  );
    656 
    657  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    658 };
    659 
    660 ON_DECL
    661 ON_3dPoint operator*(int, const ON_3dPoint&);
    662 
    663 ON_DECL
    664 ON_3dPoint operator*(float, const ON_3dPoint&);
    665 
    666 ON_DECL
    667 ON_3dPoint operator*(double, const ON_3dPoint&);
    668 
    669 ////////////////////////////////////////////////////////////////
    670 //
    671 // ON_4dPoint (homogeneous coordinates)
    672 //
    673 class ON_CLASS ON_4dPoint
    674 {
    675 public:
    676  double x, y, z, w;
    677 
    678  /*
    679  Returns:
    680  ON_UNSET_VALUE, if x or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    681  and neither x nor w is a nan.
    682  x/w, otherwise
    683  Remarks:
    684  If w is 0.0 or nan, the result will be a nan.
    685  */
    686  double EuclideanX() const;
    687 
    688  /*
    689  Returns:
    690  ON_UNSET_VALUE, if y or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    691  and neither y nor w is a nan.
    692  y/w, otherwise
    693  Remarks:
    694  If w is 0.0 or nan, the result will be a nan.
    695  */
    696  double EuclideanY() const;
    697 
    698  /*
    699  Returns:
    700  ON_UNSET_VALUE, if z or w is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    701  and neither z nor w is a nan.
    702  z/w, otherwise
    703  Remarks:
    704  If w is 0.0 or nan, the result will be a nan.
    705  */
    706  double EuclideanZ() const;
    707 
    708 public:
    709  // x,y,z,w not initialized
    710  ON_4dPoint() = default;
    711  ~ON_4dPoint() = default;
    712  ON_4dPoint(const ON_4dPoint&) = default;
    713  ON_4dPoint& operator=(const ON_4dPoint&) = default;
    714 
    715 public:
    716  static const ON_4dPoint Zero; // (0,0,0,0)
    717  static const ON_4dPoint Nan; // (ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN)
    718 
    719  explicit ON_4dPoint(double x,double y,double z,double w);
    720 
    721  // These constructors are not explicit because no informtion is lost.
    722  ON_4dPoint(const ON_2dPoint& ); // from 2d point (z,y,0,1)
    723  ON_4dPoint(const ON_3dPoint& ); // from 3d point (x,y,z,1)
    724  ON_4dPoint(const ON_2dVector& ); // from 2d vector (x,y,0,0)
    725  ON_4dPoint(const ON_3dVector& ); // from 3d vector (x,y,z,0)
    726 
    727  explicit ON_4dPoint(const double*); // from double[4] array
    728 
    729  // These constructors are not explicit because no informtion is lost.
    730  ON_4dPoint(const ON_2fPoint& ); // from 2f point (z,y,0,1)
    731  ON_4dPoint(const ON_3fPoint& ); // from 3f point (x,y,z,1)
    732  ON_4dPoint(const ON_4fPoint& ); // from 4f point
    733  ON_4dPoint(const ON_2fVector& ); // from 2f vector (z,y,0,0)
    734  ON_4dPoint(const ON_3fVector& ); // from 3f vector (x,y,z,0)
    735 
    736  explicit ON_4dPoint(const float*); // from float[4] array
    737 
    738  /*
    739  Description:
    740  This function is provided because in rare cases it makes sense.
    741  If you are not certian why you want this value, think carefully
    742  or work with vectors and points in Euclidean coordinates.
    743  Returns:
    744  lhs.x*rhs.x + lhs.y*rhs.y + lhs.z*rhs.z + lhs.w*rhs.w;
    745  Remark:
    746  It is intentional that there is no operator* override for ON_4dPoint.
    747  This intentional omission helps people pause and think before calling
    748  ON_4dPoint::InnerProduct().
    749  */
    750  static double InnerProduct(
    751  const ON_4dPoint& lhs,
    752  const ON_4dPoint& rhs
    753  );
    754 
    755  // (double*) conversion operators
    756  operator double*();
    757  operator const double*() const;
    758 
    759  // use implicit operator=(const ON_4dPoint&)
    760  ON_4dPoint& operator=(const ON_2dPoint&);
    761  ON_4dPoint& operator=(const ON_3dPoint&);
    762  ON_4dPoint& operator=(const ON_2dVector&);
    763  ON_4dPoint& operator=(const ON_3dVector&);
    764  ON_4dPoint& operator=(const double*); // point = double[4] support
    765 
    766  ON_4dPoint& operator=(const class ON_2fPoint&);
    767  ON_4dPoint& operator=(const class ON_3fPoint&);
    768  ON_4dPoint& operator=(const class ON_4fPoint&);
    769  ON_4dPoint& operator=(const class ON_2fVector&);
    770  ON_4dPoint& operator=(const class ON_3fVector&);
    771  ON_4dPoint& operator=(const float*); // point = float[4] support
    772 
    773  ON_4dPoint& operator*=(double);
    774  ON_4dPoint& operator/=(double);
    775  ON_4dPoint& operator+=(const ON_4dPoint&); // sum w = sqrt(|w1*w2|)
    776  ON_4dPoint& operator-=(const ON_4dPoint&); // difference w = sqrt(|w1*w2|)
    777 
    778  ON_4dPoint operator*(double) const;
    779  ON_4dPoint operator/(double) const;
    780  ON_4dPoint operator+(const ON_4dPoint&) const; // sum w = sqrt(|w1*w2|)
    781  ON_4dPoint operator-(const ON_4dPoint&) const; // difference w = sqrt(|w1*w2|)
    782 
    783  ON_4dPoint operator*(const ON_Xform&) const;
    784 
    785  /*
    786  Description:
    787  A well ordered projective compare function that is nan aware and can
    788  be used for robust sorting.
    789  Remarks:
    790  double c = non-nan value.
    791  ON_4dPoint h0 = ...;
    792  ON_4dPoint h1(c*h0.x,c*h0.x,c*h0.x,c*h0.x);
    793  0 == ON_4dPoint::ProjectiveCompare(h0,ha);
    794  */
    795  static int ProjectiveCompare(
    796  const ON_4dPoint& lhs,
    797  const ON_4dPoint& rhs
    798  );
    799 
    800  /*
    801  Description:
    802  A well ordered dictionary compare function that is nan aware and can
    803  be used for robust sorting.
    804  */
    805  static int DictionaryCompare(
    806  const ON_4dPoint& lhs,
    807  const ON_4dPoint& rhs
    808  );
    809 
    810  /*
    811  Returns:
    812  True if (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z && lhs.w == rhs.w).
    813  */
    814  bool operator==(const ON_4dPoint& rhs) const;
    815 
    816  /*
    817  Returns:
    818  True if lhs.* != rhs.* for some coordinate and no values are nans.
    819  */
    820  bool operator!=(const ON_4dPoint& rhs) const;
    821 
    822 public:
    823  // index operators mimic double[4] behavior
    824  double& operator[](int);
    825  double operator[](int) const;
    826  double& operator[](unsigned int);
    827  double operator[](unsigned int) const;
    828 
    829  /*
    830  Returns:
    831  False if any coordinate is infinte, a nan, or ON_UNSET_VALUE.
    832  */
    833  bool IsValid() const;
    834 
    835  /*
    836  Returns:
    837  True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    838  */
    839  bool IsUnset() const;
    840 
    841  // set 4d point value
    842  void Set(double x,double y,double z,double w);
    843 
    844  int MaximumCoordinateIndex() const;
    845  double MaximumCoordinate() const; // absolute value of maximum coordinate
    846 
    847  int MinimumCoordinateIndex() const;
    848  double MinimumCoordinate() const; // absolute value of minimum coordinate
    849 
    850  bool Normalize(); // set so x^2 + y^2 + z^2 + w^2 = 1
    851 
    852  // These transform the point in place. The transformation matrix acts on
    853  // the left of the point; i.e., result = transformation*point
    854  void Transform(
    855  const ON_Xform&
    856  );
    857 
    858  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    859 };
    860 
    861 ON_DECL
    862 ON_4dPoint operator*(double, const ON_4dPoint&);
    863 
    864 ////////////////////////////////////////////////////////////////
    865 //
    866 // ON_2dVector
    867 //
    868 class ON_CLASS ON_2dVector
    869 {
    870 public:
    871  double x, y;
    872 
    873 public:
    874  // x,y not initialized
    875  ON_2dVector() = default;
    876  ~ON_2dVector() = default;
    877  ON_2dVector(const ON_2dVector&) = default;
    878  ON_2dVector& operator=(const ON_2dVector&) = default;
    879 
    880 public:
    881  static const ON_2dVector ZeroVector; // (0.0,0.0)
    882  static const ON_2dVector XAxis; // (1.0,0.0)
    883  static const ON_2dVector YAxis; // (0.0,1.0)
    884  static const ON_2dVector UnsetVector; // (ON_UNSET_VALUE,ON_UNSET_VALUE)
    885  static const ON_2dVector NanVector; // (ON_DBL_QNAN,ON_DBL_QNAN)
    886 
    887  /*
    888  Description:
    889  A well ordered dictionary compare function that is nan aware and can
    890  be used for robust sorting.
    891  */
    892  static int Compare(
    893  const ON_2dVector& lhs,
    894  const ON_2dVector& rhs
    895  );
    896 
    897  // Description:
    898  // A index driven function to get unit axis vectors.
    899  // Parameters:
    900  // index - [in] 0 returns (1,0), 1 returns (0,1)
    901  // Returns:
    902  // Unit 2d vector with vector[i] = (i==index)?1:0;
    903  static const ON_2dVector& UnitVector(
    904  int // index
    905  );
    906 
    907  explicit ON_2dVector(double x,double y);
    908 
    909  explicit ON_2dVector(const ON_3dVector& ); // from 3d vector
    910  ON_2dVector(const ON_2dPoint& ); // from 2d point
    911  explicit ON_2dVector(const ON_3dPoint& ); // from 3d point
    912  explicit ON_2dVector(const double*); // from double[2] array
    913 
    914  ON_2dVector(const ON_2fVector& ); // from 2f vector
    915  explicit ON_2dVector(const ON_3fVector& ); // from 3f vector
    916  explicit ON_2dVector(const ON_2fPoint& ); // from 2f point
    917  explicit ON_2dVector(const ON_3fPoint& ); // from 3f point
    918  explicit ON_2dVector(const float*); // from double[2] array
    919 
    920  // (double*) conversion operators
    921  operator double*();
    922  operator const double*() const;
    923 
    924  // use implicit operator=(const ON_2dVector&)
    925  ON_2dVector& operator=(const ON_3dVector&);
    926  ON_2dVector& operator=(const ON_2dPoint&);
    927  ON_2dVector& operator=(const ON_3dPoint&);
    928  ON_2dVector& operator=(const double*); // vector = double[2] support
    929 
    930  ON_2dVector& operator=(const ON_2fVector&);
    931  ON_2dVector& operator=(const ON_3fVector&);
    932  ON_2dVector& operator=(const ON_2fPoint&);
    933  ON_2dVector& operator=(const ON_3fPoint&);
    934  ON_2dVector& operator=(const float*); // vector = float[2] support
    935 
    936  ON_2dVector operator-() const;
    937 
    938  ON_2dVector& operator*=(double);
    939  ON_2dVector& operator/=(double);
    940  ON_2dVector& operator+=(const ON_2dVector&);
    941  ON_2dVector& operator-=(const ON_2dVector&);
    942  // DO NOT ADD ANY MORE overrides of += or -=
    943 
    944  double operator*(const ON_2dVector&) const; // inner (dot) product
    945  double operator*(const ON_2dPoint&) const; // inner (dot) product (point acting as vector)
    946  double operator*(const ON_2fVector&) const; // inner (dot) product
    947 
    948  ON_2dVector operator*(int) const;
    949  ON_2dVector operator/(int) const;
    950  ON_2dVector operator*(float) const;
    951  ON_2dVector operator/(float) const;
    952  ON_2dVector operator*(double) const;
    953  ON_2dVector operator/(double) const;
    954 
    955  ON_2dVector operator+(const ON_2dVector&) const;
    956  ON_2dPoint operator+(const ON_2dPoint&) const;
    957  ON_2dVector operator-(const ON_2dVector&) const;
    958  ON_2dPoint operator-(const ON_2dPoint&) const;
    959  ON_3dVector operator+(const ON_3dVector&) const;
    960  ON_3dPoint operator+(const ON_3dPoint&) const;
    961  ON_3dVector operator-(const ON_3dVector&) const;
    962  ON_3dPoint operator-(const ON_3dPoint&) const;
    963 
    964  ON_2dVector operator+(const ON_2fVector&) const;
    965  ON_2dPoint operator+(const ON_2fPoint&) const;
    966  ON_2dVector operator-(const ON_2fVector&) const;
    967  ON_2dPoint operator-(const ON_2fPoint&) const;
    968  ON_3dVector operator+(const ON_3fVector&) const;
    969  ON_3dPoint operator+(const ON_3fPoint&) const;
    970  ON_3dVector operator-(const ON_3fVector&) const;
    971  ON_3dPoint operator-(const ON_3fPoint&) const;
    972 
    973  ON_2dVector operator*(const ON_Xform&) const;
    974 
    975  bool operator==(const ON_2dVector&) const;
    976  bool operator!=(const ON_2dVector&) const;
    977 
    978  // dictionary order comparisons
    979  bool operator<=(const ON_2dVector&) const;
    980  bool operator>=(const ON_2dVector&) const;
    981  bool operator<(const ON_2dVector&) const;
    982  bool operator>(const ON_2dVector&) const;
    983 
    984  // index operators mimic double[2] behavior
    985  double& operator[](int);
    986  double operator[](int) const;
    987  double& operator[](unsigned int);
    988  double operator[](unsigned int) const;
    989 
    990  /*
    991  Returns:
    992  False if any coordinate is infinte, a nan, or ON_UNSET_VALUE.
    993  */
    994  bool IsValid() const;
    995 
    996  /*
    997  Returns:
    998  True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    999  */
    1000  bool IsUnset() const;
    1001 
    1002  // set 2d vector value
    1003  void Set(double x,double y);
    1004 
    1005  int MaximumCoordinateIndex() const;
    1006  double MaximumCoordinate() const; // absolute value of maximum coordinate
    1007 
    1008  int MinimumCoordinateIndex() const;
    1009  double MinimumCoordinate() const; // absolute value of minimum coordinate
    1010 
    1011  double LengthSquared() const;
    1012  double Length() const;
    1013 
    1014  // Signed area of the parallelagram. The volume element.
    1015  // returns x*B.y - y*B.x
    1016  double WedgeProduct(const ON_2dVector& B) const;
    1017 
    1018  bool Decompose( // Computes a, b such that this vector = a*X + b*Y
    1019  // Returns false if unable to solve for a,b. This happens
    1020  // when X,Y is not really a basis.
    1021  //
    1022  // If X,Y is known to be an orthonormal frame,
    1023  // then a = V*X, b = V*Y will compute
    1024  // the same result more quickly.
    1025  const ON_2dVector&, // X
    1026  const ON_2dVector&, // Y
    1027  double*, // a
    1028  double* // b
    1029  ) const;
    1030 
    1031  int IsParallelTo(
    1032  // returns 1: this and other vectors are parallel
    1033  // -1: this and other vectors are anti-parallel
    1034  // 0: this and other vectors are not parallel
    1035  // or at least one of the vectors is zero
    1036  const ON_2dVector& other, // other vector
    1037  double angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    1038  ) const;
    1039 
    1040  bool IsPerpendicularTo(
    1041  // returns true: this and other vectors are perpendicular
    1042  // false: this and other vectors are not perpendicular
    1043  // or at least one of the vectors is zero
    1044  const ON_2dVector& other, // other vector
    1045  double angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    1046  ) const;
    1047 
    1048  ON_DEPRECATED_MSG("Use v = ON_2dVector::ZeroVector;")
    1049  void Zero(); // set all coordinates to zero;
    1050 
    1051  ON_DEPRECATED_MSG("Use v = -v;")
    1052  void Reverse(); // negate all coordinates
    1053 
    1054  bool Unitize(); // returns false if vector has zero length
    1055 
    1056  /*
    1057  Returns:
    1058  If this is a valid non-zero vector, a unit vector parallel to this is returned.
    1059  Otherwise the zero vector is returned.
    1060  */
    1061  ON_2dVector UnitVector() const;
    1062 
    1063 
    1064  // Description:
    1065  // Test a vector to see if it is very short
    1066  //
    1067  // Parameters:
    1068  // tiny_tol - [in] (default = ON_ZERO_TOLERANCE) a nonzero
    1069  // value used as the coordinate zero tolerance.
    1070  //
    1071  // Returns:
    1072  // ( fabs(x) <= tiny_tol && fabs(y) <= tiny_tol )
    1073  //
    1074  bool IsTiny(
    1075  double tiny_tol = ON_ZERO_TOLERANCE // tiny_tol
    1076  ) const;
    1077 
    1078  // Returns:
    1079  // true if vector is the zero vector.
    1080  bool IsZero() const;
    1081 
    1082  /*
    1083  Returns:
    1084  true if at lease one coordinate is not zero and no coordinates are nans.
    1085  */
    1086  bool IsNotZero() const;
    1087 
    1088  // Returns:
    1089  // true if vector is valid and has length 1.
    1090  bool IsUnitVector() const;
    1091 
    1092  // set this vector to be perpendicular to another vector
    1093  bool PerpendicularTo( // Result is not unitized.
    1094  // returns false if input vector is zero
    1095  const ON_2dVector&
    1096  );
    1097 
    1098  // set this vector to be perpendicular to a line defined by 2 points
    1099  bool PerpendicularTo(
    1100  const ON_2dPoint&,
    1101  const ON_2dPoint&
    1102  );
    1103 
    1104  // These transform the vector in place. The transformation matrix acts on
    1105  // the left of the vector; i.e., result = transformation*vector
    1106  void Transform(
    1107  const ON_Xform& // can use ON_Xform here
    1108  );
    1109 
    1110  void Rotate(
    1111  double angle // angle in radians
    1112  );
    1113 
    1114  void Rotate(
    1115  double sin_angle, // sin(angle)
    1116  double cos_angle // cos(angle)
    1117  );
    1118 
    1119  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    1120 };
    1121 
    1122 ON_DECL
    1123 ON_2dVector operator*(int, const ON_2dVector&);
    1124 
    1125 ON_DECL
    1126 ON_2dVector operator*(float, const ON_2dVector&);
    1127 
    1128 ON_DECL
    1129 ON_2dVector operator*(double, const ON_2dVector&);
    1130 
    1131 ///////////////////////////////////////////////////////////////
    1132 //
    1133 // ON_2dVector utilities
    1134 //
    1135 
    1136 ON_DECL
    1137 double
    1138 ON_DotProduct(
    1139  const ON_2dVector&,
    1140  const ON_2dVector&
    1141  );
    1142 
    1143 ON_DECL
    1144 ON_3dVector
    1145 ON_CrossProduct(
    1146  const ON_2dVector&,
    1147  const ON_2dVector&
    1148  );
    1149 
    1150 ON_DECL
    1151 double
    1152 ON_WedgeProduct( // signed area of the parallelagram. Volume element.
    1153  const ON_2dVector& A, // returns A.x * B.y - A.y * B.x
    1154  const ON_2dVector& B
    1155  );
    1156 
    1157 ON_DECL
    1158 bool
    1159 ON_IsOrthogonalFrame( // true if X, Y are nonzero and mutually perpendicular
    1160  const ON_2dVector&, // X
    1161  const ON_2dVector& // Y
    1162  );
    1163 
    1164 ON_DECL
    1165 bool
    1166 ON_IsOrthonormalFrame( // true if X, Y are orthogonal and unit length
    1167  const ON_2dVector&, // X
    1168  const ON_2dVector& // Y
    1169  );
    1170 
    1171 ON_DECL
    1172 bool
    1173 ON_IsRightHandFrame( // true if X, Y are orthonormal and right handed
    1174  const ON_2dVector&, // X
    1175  const ON_2dVector& // Y
    1176  );
    1177 
    1178 ////////////////////////////////////////////////////////////////
    1179 //
    1180 // ON_3dVector
    1181 //
    1182 class ON_CLASS ON_3dVector
    1183 {
    1184 public:
    1185  double x, y, z;
    1186 
    1187 public:
    1188  // x,y,z not initialized
    1189  ON_3dVector() = default;
    1190  ~ON_3dVector() = default;
    1191  ON_3dVector(const ON_3dVector&) = default;
    1192  ON_3dVector& operator=(const ON_3dVector&) = default;
    1193 
    1194 public:
    1195  static const ON_3dVector ZeroVector; // (0.0,0.0,0.0)
    1196  static const ON_3dVector XAxis; // (1.0,0.0,0.0)
    1197  static const ON_3dVector YAxis; // (0.0,1.0,0.0)
    1198  static const ON_3dVector ZAxis; // (0.0,0.0,1.0)
    1199  static const ON_3dVector UnsetVector; // (ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE)
    1200  static const ON_3dVector NanVector; // (ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN)
    1201 
    1202  /*
    1203  Description:
    1204  A well ordered dictionary compare function that is nan aware and can
    1205  be used for robust sorting.
    1206  */
    1207  static int Compare(
    1208  const ON_3dVector& lhs,
    1209  const ON_3dVector& rhs
    1210  );
    1211 
    1212  // Description:
    1213  // A index driven function to get unit axis vectors.
    1214  // Parameters:
    1215  // index - [in] 0 returns (1,0,0), 1 returns (0,1,0),
    1216  // 2 returns (0,0,1)
    1217  // Returns:
    1218  // Unit 3d vector with vector[i] = (i==index)?1:0;
    1219  static const ON_3dVector& UnitVector(
    1220  int // index
    1221  );
    1222 
    1223  explicit ON_3dVector(double x,double y,double z);
    1224 #if defined(OPENNURBS_WALL)
    1225  // Goal is to eventually have all constructors that change dimension be explicit.
    1226  explicit
    1227 #endif
    1228  ON_3dVector(const ON_2dVector& ); // from 2d vector
    1229  explicit ON_3dVector(const ON_2dPoint& ); // from 2d point
    1230  ON_3dVector(const ON_3dPoint& ); // from 3d point
    1231  explicit ON_3dVector(const double*); // from double[3] array
    1232 
    1233  explicit ON_3dVector(const ON_2fVector& ); // from 2f vector
    1234  ON_3dVector(const ON_3fVector& ); // from 3f vector
    1235  explicit ON_3dVector(const ON_2fPoint& ); // from 2f point
    1236  explicit ON_3dVector(const ON_3fPoint& ); // from 3f point
    1237  explicit ON_3dVector(const float*); // from float[3] array
    1238 
    1239  // (double*) conversion operators
    1240  operator double*();
    1241  operator const double*() const;
    1242 
    1243  // use implicit operator=(const ON_3dVector&)
    1244  ON_3dVector& operator=(const ON_2dVector&);
    1245  ON_3dVector& operator=(const ON_2dPoint&);
    1246  ON_3dVector& operator=(const ON_3dPoint&);
    1247  ON_3dVector& operator=(const double*); // vector = double[3] support
    1248 
    1249  ON_3dVector& operator=(const ON_2fVector&);
    1250  ON_3dVector& operator=(const ON_3fVector&);
    1251  ON_3dVector& operator=(const ON_2fPoint&);
    1252  ON_3dVector& operator=(const ON_3fPoint&);
    1253  ON_3dVector& operator=(const float*); // vector = float[3] support
    1254 
    1255  ON_3dVector operator-() const;
    1256 
    1257  ON_3dVector& operator*=(double);
    1258  ON_3dVector& operator/=(double);
    1259  ON_3dVector& operator+=(const ON_3dVector&);
    1260  ON_3dVector& operator-=(const ON_3dVector&);
    1261  // DO NOT ADD ANY MORE overrides of += or -=
    1262 
    1263  double operator*(const ON_3dVector&) const; // inner (dot) product
    1264  double operator*(const ON_3dPoint&) const; // inner (dot) product
    1265  double operator*(const ON_3fVector&) const; // inner (dot) product
    1266 
    1267  ON_3dVector operator*(int) const;
    1268  ON_3dVector operator/(int) const;
    1269  ON_3dVector operator*(float) const;
    1270  ON_3dVector operator/(float) const;
    1271  ON_3dVector operator*(double) const;
    1272  ON_3dVector operator/(double) const;
    1273 
    1274  ON_3dVector operator+(const ON_3dVector&) const;
    1275  ON_3dPoint operator+(const ON_3dPoint&) const;
    1276  ON_3dVector operator-(const ON_3dVector&) const;
    1277  ON_3dPoint operator-(const ON_3dPoint&) const;
    1278  ON_3dVector operator+(const ON_2dVector&) const;
    1279  ON_3dPoint operator+(const ON_2dPoint&) const;
    1280  ON_3dVector operator-(const ON_2dVector&) const;
    1281  ON_3dPoint operator-(const ON_2dPoint&) const;
    1282 
    1283  ON_3dVector operator+(const ON_3fVector&) const;
    1284  ON_3dPoint operator+(const ON_3fPoint&) const;
    1285  ON_3dVector operator-(const ON_3fVector&) const;
    1286  ON_3dPoint operator-(const ON_3fPoint&) const;
    1287  ON_3dVector operator+(const ON_2fVector&) const;
    1288  ON_3dPoint operator+(const ON_2fPoint&) const;
    1289  ON_3dVector operator-(const ON_2fVector&) const;
    1290  ON_3dPoint operator-(const ON_2fPoint&) const;
    1291 
    1292  ON_3dVector operator*(const ON_Xform&) const;
    1293 
    1294  bool operator==(const ON_3dVector&) const;
    1295  bool operator!=(const ON_3dVector&) const;
    1296 
    1297  // dictionary order comparisons
    1298  bool operator<=(const ON_3dVector&) const;
    1299  bool operator>=(const ON_3dVector&) const;
    1300  bool operator<(const ON_3dVector&) const;
    1301  bool operator>(const ON_3dVector&) const;
    1302 
    1303  // index operators mimic double[3] behavior
    1304  double& operator[](int);
    1305  double operator[](int) const;
    1306  double& operator[](unsigned int);
    1307  double operator[](unsigned int) const;
    1308 
    1309  /*
    1310  Returns:
    1311  False if any coordinate is infinte, a nan, or ON_UNSET_VALUE.
    1312  */
    1313  bool IsValid() const;
    1314 
    1315  /*
    1316  Returns:
    1317  True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    1318  */
    1319  bool IsUnset() const;
    1320 
    1321  // set 3d vector value
    1322  void Set(double x,double y,double z);
    1323 
    1324  int MaximumCoordinateIndex() const;
    1325  double MaximumCoordinate() const; // absolute value of maximum coordinate
    1326 
    1327  int MinimumCoordinateIndex() const;
    1328  double MinimumCoordinate() const; // absolute value of minimum coordinate
    1329 
    1330  double LengthSquared() const;
    1331  double Length() const;
    1332 
    1333  bool Decompose( // Computes a, b, c such that this vector = a*X + b*Y + c*Z
    1334  // Returns false if unable to solve for a,b,c. This happens
    1335  // when X,Y,Z is not really a basis.
    1336  //
    1337  // If X,Y,Z is known to be an orthonormal frame,
    1338  // then a = V*X, b = V*Y, c = V*Z will compute
    1339  // the same result more quickly.
    1340  const ON_3dVector&, // X
    1341  const ON_3dVector&, // Y
    1342  const ON_3dVector&, // Z
    1343  double*, // a
    1344  double*, // b
    1345  double* // c
    1346  ) const;
    1347 
    1348  int IsParallelTo(
    1349  // returns 1: this and other vectors are parallel
    1350  // -1: this and other vectors are anti-parallel
    1351  // 0: this and other vectors are not parallel
    1352  // or at least one of the vectors is zero
    1353  const ON_3dVector& other, // other vector
    1354  double angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    1355  ) const;
    1356 
    1357  bool IsPerpendicularTo(
    1358  // returns true: this and other vectors are perpendicular
    1359  // false: this and other vectors are not perpendicular
    1360  // or at least one of the vectors is zero
    1361  const ON_3dVector& other, // other vector
    1362  double angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    1363  ) const;
    1364 
    1365  double Fuzz( double tolerance = ON_ZERO_TOLERANCE ) const; // tolerance to use when comparing 3d vectors
    1366 
    1367 #if defined(OPENNURBS_WALL)
    1368  // Goal is to eventually remove all functions that modify vectors in place.
    1369  ON_DEPRECATED_MSG("Use v = ON_3dVector::ZeroVector;")
    1370 #endif
    1371  void Zero(); // set all coordinates to zero;
    1372 
    1373 #if defined(OPENNURBS_WALL)
    1374  // Goal is to eventually remove all functions that modify vectors in place.
    1375  ON_DEPRECATED_MSG("Use v = -v;")
    1376 #endif
    1377  void Reverse(); // negate all coordinates
    1378 
    1379  bool Unitize(); // returns false if vector has zero length
    1380  double LengthAndUnitize(); // unitizes and returns initial length
    1381 
    1382  /*
    1383  Returns:
    1384  If this is a valid non-zero vector, a unit vector parallel to this is returned.
    1385  Otherwise the zero vector is returned.
    1386  */
    1387  ON_3dVector UnitVector() const;
    1388 
    1389  // Description:
    1390  // Test a vector to see if it is very short
    1391  //
    1392  // Parameters:
    1393  // tiny_tol - [in] (default = ON_ZERO_TOLERANCE) a nonzero
    1394  // value used as the coordinate zero tolerance.
    1395  //
    1396  // Returns:
    1397  // ( fabs(x) <= tiny_tol && fabs(y) <= tiny_tol && fabs(z) <= tiny_tol )
    1398  //
    1399  bool IsTiny(
    1400  double tiny_tol = ON_ZERO_TOLERANCE // tiny_tol
    1401  ) const;
    1402 
    1403  // Returns:
    1404  // true if vector is the zero vector.
    1405  bool IsZero() const;
    1406 
    1407  /*
    1408  Returns:
    1409  true if at lease one coordinate is not zero and no coordinates are nans.
    1410  */
    1411  bool IsNotZero() const;
    1412 
    1413 
    1414  // Returns:
    1415  // true if vector is valid and has length 1.
    1416  bool IsUnitVector() const;
    1417 
    1418  // set this vector to be perpendicular to another vector
    1419  bool PerpendicularTo( // Result is not unitized.
    1420  // returns false if input vector is zero
    1421  const ON_3dVector&
    1422  );
    1423 
    1424  // set this vector to be perpendicular to a plane defined by 3 points
    1425  bool PerpendicularTo(
    1426  // about 3 times slower than
    1427  // ON_3dVector N = ON_CrossProduct(P1-P0,P2-P0);
    1428  // N.Unitize();
    1429  // returns false if points are coincident or collinear
    1430  const ON_3dPoint&, const ON_3dPoint&, const ON_3dPoint&
    1431  );
    1432 
    1433  // These transform the vector in place. The transformation matrix acts on
    1434  // the left of the vector; i.e., result = transformation*vector
    1435  void Transform(
    1436  const ON_Xform& // can use ON_Xform here
    1437  );
    1438 
    1439  void Rotate(
    1440  double angle, // angle in radians
    1441  const ON_3dVector& axis // axis of rotation
    1442  );
    1443 
    1444  void Rotate(
    1445  double sin_angle, // sin(angle)
    1446  double cos_angle, // cos(angle)
    1447  const ON_3dVector& axis // axis of rotation
    1448  );
    1449 
    1450  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const;
    1451 };
    1452 
    1453 class ON_CLASS ON_3dRay
    1454 {
    1455 public:
    1456  ON_3dPoint m_P;
    1457  ON_3dVector m_V;
    1458 };
    1459 
    1460 /*
    1461 Description:
    1462  Typically the vector portion is a unit vector and
    1463  m_d = -(x*P.x + y*P.y + z*P.z) for a point P on the plane.
    1464 */
    1465 class ON_CLASS ON_PlaneEquation
    1466 {
    1467 public:
    1468  // C++ defaults for construction, destruction, copys, and operator=
    1469  // work fine.
    1470 
    1471  static const ON_PlaneEquation UnsetPlaneEquation; // (ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE)
    1472  static const ON_PlaneEquation ZeroPlaneEquation; // (0.0,0.0,0.0,0.0)
    1473 
    1474  ON_PlaneEquation();
    1475 
    1477  double xx, double yy, double zz, double dd
    1478  );
    1479 
    1480  static void Set(
    1481  ON_PlaneEquation& plane_equation,
    1482  double x, double y, double z, double d
    1483  );
    1484 
    1485  double MaximumCoefficient() const;
    1486 
    1487  /*
    1488  Returns:
    1489  The plane equation whose coefficient values are
    1490  the negative of the coefficent values in this,
    1491  provided the coeffient value is valid. Any invalid
    1492  coefficent values are copied.
    1493  */
    1494  ON_PlaneEquation NegatedPlaneEquation() const;
    1495 
    1496 
    1497  /*
    1498  Returns:
    1499  The plane equation whose first three coefficient values
    1500  are a unit vector.
    1501  */
    1502  ON_PlaneEquation UnitizedPlaneEquation() const;
    1503 
    1504 
    1505 
    1506  /*
    1507  Description:
    1508  returns true if x, y, z, d are valid, finite doubles.
    1509  Remarks:
    1510  this function will return true if x, y and z are all zero.
    1511  See Also:
    1512  ON_PlaneEquation::IsSet().
    1513  */
    1514  bool IsValid() const;
    1515 
    1516  /*
    1517  Description:
    1518  returns true if x, y, z, d are valid, finite doubles and
    1519  at least one of x, y or z is not zero.
    1520  */
    1521  bool IsSet() const;
    1522 
    1523  /*
    1524  Description:
    1525  Sets (x,y,z) to a unitized N and then sets
    1526  d = -(x*P.x + y*P.y + z*P.z).
    1527  Parameters:
    1528  P - [in] point on the plane
    1529  N - [in] vector perpendicular to the plane
    1530  Returns:
    1531  true if input is valid.
    1532  */
    1533  bool Create( ON_3dPoint P, ON_3dVector N );
    1534 
    1535  // index operators mimic double[4] behavior
    1536  // Return null refs or ON_UNSET_VALUE for out-of-range indices
    1537  double& operator[](int);
    1538  double& operator[](unsigned int);
    1539  double operator[](int) const;
    1540  double operator[](unsigned int) const;
    1541 
    1542  /*
    1543  Returns:
    1544  Direction (x,y,z)
    1545  */
    1546  ON_3dVector Direction() const;
    1547 
    1548  double DirectionLength() const;
    1549 
    1550  /*
    1551  Returns:
    1552  Unitized direction or zero vector if not set.
    1553  */
    1554  ON_3dVector UnitNormal() const;
    1555 
    1556  /*
    1557  Returns 1: this and other vectors are parallel
    1558  -1: this and other vectors are anti-parallel
    1559  0: this and other vectors are not parallel
    1560  or at least one of the vectors is zero
    1561  */
    1562  int IsParallelTo(
    1563  const ON_PlaneEquation& other, // other plane equation
    1564  double angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE // optional angle tolerance (radians)
    1565  ) const;
    1566 
    1567  /*
    1568  Description:
    1569  Evaluate the plane at a point.
    1570  Parameters:
    1571  P - [in]
    1572  Returns:
    1573  x*P.x + y*P.y + z*P.z + d;
    1574  */
    1575  double ValueAt(ON_3dPoint P) const;
    1576  double ValueAt(ON_4dPoint P) const;
    1577  double ValueAt(ON_3dVector P) const;
    1578  double ValueAt(double x, double y, double z) const;
    1579 
    1580  /*
    1581  Returns:
    1582  ON_Interval::EmptyInterval if input is not valid.
    1583  */
    1584  ON_Interval ValueRange(
    1585  size_t point_list_count,
    1586  const ON_3dPoint* point_list
    1587  ) const;
    1588 
    1589  /*
    1590  Returns:
    1591  ON_Interval::EmptyInterval if input is not valid.
    1592  */
    1593  ON_Interval ValueRange(
    1594  const ON_SimpleArray< ON_3dPoint >& point_list
    1595  ) const;
    1596 
    1597  /*
    1598  Returns:
    1599  ON_Interval::EmptyInterval if input is not valid.
    1600  */
    1601  ON_Interval ValueRange(
    1602  size_t point_list_count,
    1603  const ON_3fPoint* point_list
    1604  ) const;
    1605 
    1606  /*
    1607  Returns:
    1608  ON_Interval::EmptyInterval if input is not valid.
    1609  */
    1610  ON_Interval ValueRange(
    1611  const ON_SimpleArray< ON_3fPoint >& point_list
    1612  ) const;
    1613 
    1614  /*
    1615  Returns:
    1616  ON_Interval::EmptyInterval if input is not valid.
    1617  */
    1618  ON_Interval ValueRange(
    1619  const class ON_3dPointListRef& point_list
    1620  ) const;
    1621 
    1622  /*
    1623  Returns:
    1624  ON_Interval::EmptyInterval if input is not valid.
    1625  */
    1626  ON_Interval ValueRange(
    1627  size_t point_index_count,
    1628  const unsigned int* point_index_list,
    1629  const class ON_3dPointListRef& point_list
    1630  ) const;
    1631 
    1632  ON_Interval ValueRange(
    1633  size_t point_index_count,
    1634  size_t point_index_stride,
    1635  const unsigned int* point_index_list,
    1636  const class ON_3dPointListRef& point_list
    1637  ) const;
    1638 
    1639  /*
    1640  Description:
    1641  Evaluate the plane at a list of point values.
    1642  Parameters:
    1643  Pcount - [in]
    1644  number of points
    1645  P - [in]
    1646  points
    1647  value - [in]
    1648  If not null, value[] must be an array of length at least Pcount.
    1649  The values will be stored in this array. If null, the an array
    1650  will be allocated with onmalloc() and returned.
    1651  value_range - [out]
    1652  If not null, the range of values will be returned here.
    1653  Returns:
    1654  An array of Pcount values. If the input parameter value was null,
    1655  then the array is allocated on the heap using onmalloc() and the
    1656  caller is responsible for calling onfree() when finished. If the
    1657  input is not valid, null is returned.
    1658  */
    1659  double* ValueAt(
    1660  int Pcount,
    1661  const ON_3fPoint* P,
    1662  double* value,
    1663  double value_range[2]
    1664  ) const;
    1665 
    1666  double* ValueAt(
    1667  int Pcount,
    1668  const ON_3dPoint* P,
    1669  double* value,
    1670  double value_range[2]
    1671  ) const;
    1672 
    1673  /*
    1674  Description:
    1675  This function calculates and evalutes points that
    1676  would be exactly on the plane if double precision
    1677  aritmetic were mathematically perfect and returns
    1678  the largest value of the evaluations.
    1679  */
    1680  double ZeroTolerance() const;
    1681 
    1682  /*
    1683  Description:
    1684  Transform the plane equation so that, if e0 is the initial
    1685  equation, e1 is transformed equation and P is a point,
    1686  then e0.ValueAt(P) = e1.ValueAt(xform*P).
    1687  Parameters:
    1688  xform - [in]
    1689  Invertable transformation.
    1690  Returns:
    1691  True if the plane equation was successfully transformed.
    1692  False if xform is not invertable or the equation is not
    1693  valid.
    1694  Remarks:
    1695  This function has to invert xform. If you have apply the
    1696  same transformation to a bunch of planes, then it will be
    1697  more efficient to calculate xform's inverse transpose
    1698  and apply the resultingt transformation to the equation's
    1699  coefficients as if they were 4d point coordinates.
    1700  */
    1701  bool Transform( const ON_Xform& xform );
    1702 
    1703  /*
    1704  Description:
    1705  Get point on plane that is closest to a given point.
    1706  Parameters:
    1707  point - [in]
    1708  Returns:
    1709  A 3d point on the plane that is closest to the input point.
    1710  */
    1711  ON_3dPoint ClosestPointTo( ON_3dPoint point ) const;
    1712 
    1713  /*
    1714  Description:
    1715  Get the minimum value of the plane equation
    1716  on a bounding box.
    1717  Parameters:
    1718  bbox - [in]
    1719  Returns:
    1720  Minimum value of the plane equation on the bounding box.
    1721  */
    1722  double MinimumValueAt(const ON_BoundingBox& bbox) const;
    1723 
    1724  /*
    1725  Description:
    1726  Get the maximum value of the plane equation
    1727  on a bounding box.
    1728  Parameters:
    1729  bbox - [in]
    1730  Returns:
    1731  Maximum value of the plane equation on the bounding box.
    1732  */
    1733  double MaximumValueAt(const ON_BoundingBox& bbox) const;
    1734 
    1735 
    1736  /*
    1737  Description:
    1738  Get the maximum value of the plane equation on a set of 3d points.
    1739  Parameters:
    1740  bRational - [in]
    1741  False if the points are euclidean (x,y,z)
    1742  True if the points are homogenous rational (x,y,z,w)
    1743  (x/w,y/w,z/w) is used to evaluate the value.
    1744  point_count - [in]
    1745  point_stride - [in]
    1746  i-th point's x coordinate = points[i*point_stride]
    1747  points - [in]
    1748  coordinates of points
    1749  stop_value - [in]
    1750  If stop_value is valid and not ON_UNSET_VALUE, then the
    1751  evaulation stops if a value > stop_value is found.
    1752  If stop_value = ON_UNSET_VALUE, then stop_value is ignored.
    1753  Returns:
    1754  Maximum value of the plane equation on the point list.
    1755  If the input is not valid, then ON_UNSET_VALUE is returned.
    1756  */
    1757  double MaximumValueAt(
    1758  bool bRational,
    1759  int point_count,
    1760  int point_stride,
    1761  const double* points,
    1762  double stop_value
    1763  ) const;
    1764 
    1765  /*
    1766  Description:
    1767  Get the minimum value of the plane equation on a set of 3d points.
    1768  Parameters:
    1769  bRational - [in]
    1770  False if the points are euclidean (x,y,z)
    1771  True if the points are homogenous rational (x,y,z,w)
    1772  (x/w,y/w,z/w) is used to evaluate the value.
    1773  point_count - [in]
    1774  point_stride - [in]
    1775  i-th point's x coordinate = points[i*point_stride]
    1776  points - [in]
    1777  coordinates of points
    1778  stop_value - [in]
    1779  If stop_value is valid and not ON_UNSET_VALUE, then the
    1780  evaulation stops if a value < stop_value is found.
    1781  If stop_value = ON_UNSET_VALUE, then stop_value is ignored.
    1782  Returns:
    1783  Maximum value of the plane equation on the point list.
    1784  If the input is not valid, then ON_UNSET_VALUE is returned.
    1785  */
    1786  double MinimumValueAt(
    1787  bool bRational,
    1788  int point_count,
    1789  int point_stride,
    1790  const double* points,
    1791  double stop_value
    1792  ) const;
    1793 
    1794  /*
    1795  Description:
    1796  Get the maximum absolute value of the plane equation
    1797  on a set of 3d points.
    1798  Parameters:
    1799  bRational - [in]
    1800  False if the points are euclidean (x,y,z)
    1801  True if the points are homogenous rational (x,y,z,w)
    1802  (x/w,y/w,z/w) is used to evaluate the value.
    1803  point_count - [in]
    1804  point_stride - [in]
    1805  i-th point's x coordinate = points[i*point_stride]
    1806  points - [in]
    1807  coordinates of points
    1808  stop_value - [in]
    1809  If stop_value >= 0.0, then the evaulation stops if an
    1810  absolute value > stop_value is found. If stop_value < 0.0
    1811  or stop_value is invalid, then stop_value is ignored.
    1812  Returns:
    1813  Maximum value of the plane equation on the point list.
    1814  If the input is not valid, then ON_UNSET_VALUE is returned.
    1815  */
    1816  double MaximumAbsoluteValueAt(
    1817  bool bRational,
    1818  int point_count,
    1819  int point_stride,
    1820  const double* points,
    1821  double stop_value
    1822  ) const;
    1823 
    1824  /*
    1825  Description:
    1826  Test points on a bezier curve to see if they are near the plane.
    1827  Parameters:
    1828  bezcrv - [in]
    1829  s0 - [in]
    1830  s1 - [in] the interval from s0 to s1 is tested (s0 < s1)
    1831  sample_count - [in] number of interior points to test.
    1832  Numbers like 1, 3, 7, 15, ... work best.
    1833  endpoint_tolerance - [in] If >= 0, then the end points are
    1834  tested to see if the distance from the endpoints
    1835  is <= endpoint_tolerance.
    1836  interior_tolerance - [in] (>=0 and >=endpoint_tolerance)
    1837  This tolerance is used to test the interior sample points.
    1838  smin - [put] If not nullptr, *smin = bezier parameter of nearest
    1839  test point.
    1840  smax - [put] If not nullptr, *smax = bezier parameter of farthest
    1841  test point. If false is returned, this is the
    1842  parameter of the test point that failed.
    1843  Returns:
    1844  True if all the tested points passed the tolerance test.
    1845  False if at least one tested point failed the tolerance test.
    1846  (The test terminates when the first failure is encountered.)
    1847  */
    1848  bool IsNearerThan(
    1849  const class ON_BezierCurve& bezcrv,
    1850  double s0,
    1851  double s1,
    1852  int sample_count,
    1853  double endpoint_tolerance,
    1854  double interior_tolerance,
    1855  double* smin,
    1856  double* smax
    1857  ) const;
    1858 
    1859  bool operator==(const ON_PlaneEquation&) const;
    1860  bool operator!=(const ON_PlaneEquation&) const;
    1861 
    1862  double x;
    1863  double y;
    1864  double z;
    1865  double d; // 4th coefficient of the plane equation.
    1866 };
    1867 
    1868 #if defined(ON_DLL_TEMPLATE)
    1869 
    1870 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_PlaneEquation>;
    1871 
    1872 #endif
    1873 
    1874 ON_DECL
    1875 ON_3dVector operator*(int, const ON_3dVector&);
    1876 
    1877 ON_DECL
    1878 ON_3dVector operator*(float, const ON_3dVector&);
    1879 
    1880 ON_DECL
    1881 ON_3dVector operator*(double, const ON_3dVector&);
    1882 
    1883 ///////////////////////////////////////////////////////////////
    1884 //
    1885 // ON_3dVector utilities
    1886 //
    1887 
    1888 ON_DECL
    1889 double
    1890 ON_DotProduct(
    1891  const ON_3dVector&,
    1892  const ON_3dVector&
    1893  );
    1894 
    1895 
    1896 ON_DECL
    1897 ON_3dVector
    1898 ON_CrossProduct(
    1899  const ON_3dVector&,
    1900  const ON_3dVector&
    1901  );
    1902 
    1903 ON_DECL
    1904 ON_3dVector
    1905 ON_CrossProduct( // 3d cross product for old fashioned arrays
    1906  const double*, // array of 3d doubles
    1907  const double* // array of 3d doubles
    1908  );
    1909 
    1910 ON_DECL
    1911 double
    1912 ON_TripleProduct(
    1913  const ON_3dVector&,
    1914  const ON_3dVector&,
    1915  const ON_3dVector&
    1916  );
    1917 
    1918 ON_DECL
    1919 double
    1920 ON_TripleProduct( // 3d triple product for old fashioned arrays
    1921  const double*, // array of 3d doubles
    1922  const double*, // array of 3d doubles
    1923  const double* // array of 3d doubles
    1924  );
    1925 
    1926 ON_DECL
    1927 bool
    1928 ON_IsOrthogonalFrame( // true if X, Y, Z are nonzero and mutually perpendicular
    1929  const ON_3dVector&, // X
    1930  const ON_3dVector&, // Y
    1931  const ON_3dVector& // Z
    1932  );
    1933 
    1934 ON_DECL
    1935 bool
    1936 ON_IsOrthonormalFrame( // true if X, Y, Z are orthogonal and unit length
    1937  const ON_3dVector&, // X
    1938  const ON_3dVector&, // Y
    1939  const ON_3dVector& // Z
    1940  );
    1941 
    1942 ON_DECL
    1943 bool
    1944 ON_IsRightHandFrame( // true if X, Y, Z are orthonormal and right handed
    1945  const ON_3dVector&, // X
    1946  const ON_3dVector&, // Y
    1947  const ON_3dVector& // Z
    1948  );
    1949 
    1950 ///////////////////////////////////////////////////////////////
    1951 //
    1952 // common points and vectors
    1953 //
    1954 // ON_unset_point is obsolete - use ON_3dPoint::UnsetPoint
    1955 #if !defined(OPENNURBS_WALL)
    1956 
    1957 // OBSOLETE - use ON_3dPoint::UnsetPoint
    1958 #define ON_unset_point ON_3dPoint::UnsetPoint
    1959 // OBSOLETE - use ON_3dPoint::UnsetPoint
    1960 #define ON_UNSET_POINT ON_3dPoint::UnsetPoint
    1961 // OBSOLETE - use ON_3dPoint::UnsetVector
    1962 #define ON_UNSET_VECTOR ON_3dVector::UnsetVector
    1963 // OBSOLETE - use ON_3dPoint::Origin
    1964 #define ON_origin ON_3dPoint::Origin
    1965 // OBSOLETE - use ON_3dVector::XAxis
    1966 #define ON_xaxis ON_3dVector::XAxis
    1967 // OBSOLETE - use ON_3dVector::YAxis
    1968 #define ON_yaxis ON_3dVector::YAxis
    1969 // OBSOLETE - use ON_3dVector::ZAxis
    1970 #define ON_zaxis ON_3dVector::ZAxis
    1971 // OBSOLETE - use ON_3fPoint::Origin
    1972 #define ON_forigin ON_3fPoint::Origin
    1973 // OBSOLETE - use ON_3fVector::XAxis
    1974 #define ON_fxaxis ON_3fVector::XAxis
    1975 // OBSOLETE - use ON_3fVector::YAxis
    1976 #define ON_fyaxis ON_3fVector::YAxis
    1977 // OBSOLETE - use ON_3fVector::ZAxis
    1978 #define ON_fzaxis ON_3fVector::ZAxis
    1979 
    1980 #endif
    1981 
    1982 #include "opennurbs_fpoint.h"
    1983 
    1984 ////////////////////////////////////////////////////////////////
    1985 //
    1986 // ON_SurfaceCurvature
    1987 //
    1988 class ON_CLASS ON_SurfaceCurvature
    1989 {
    1990 public:
    1991  double k1, k2; // principal curvatures
    1992 
    1993  double GaussianCurvature() const;
    1994  double MeanCurvature() const;
    1995  double MinimumRadius() const;
    1996  double MaximumRadius() const;
    1997 };
    1998 
    1999 
    2000 #if defined(ON_DLL_TEMPLATE)
    2001 
    2002 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_2dPoint>;
    2003 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_3dPoint>;
    2004 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_4dPoint>;
    2005 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_2dVector>;
    2006 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_3dVector>;
    2007 
    2008 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_2fPoint>;
    2009 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_3fPoint>;
    2010 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_4fPoint>;
    2011 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_2fVector>;
    2012 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_3fVector>;
    2013 
    2014 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Color>;
    2015 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_SurfaceCurvature>;
    2016 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Interval>;
    2017 
    2018 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_2dex>;
    2019 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_3dex>;
    2020 
    2021 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_COMPONENT_INDEX>;
    2022 
    2023 #endif
    2024 
    2025 /////////////////////////////////////////////////////////////////
    2026 //
    2027 
    2028 class ON_CLASS ON_2dPointArray : public ON_SimpleArray<ON_2dPoint>
    2029 {
    2030 public:
    2031  // see ON_SimpleArray class definition comments for constructor documentation
    2032  ON_2dPointArray();
    2033  ON_2dPointArray(int);
    2034  ON_2dPointArray( const ON_2dPointArray& );
    2035  ON_2dPointArray& operator=( const ON_2dPointArray& );
    2036 
    2037  bool GetBBox( // returns true if successful
    2038  double boxmin[2],
    2039  double boxmax[2],
    2040  bool bGrowBox = false // true means grow box
    2041  ) const;
    2042 
    2043  bool Transform( const ON_Xform& );
    2044  bool SwapCoordinates(int,int);
    2045 };
    2046 
    2047 
    2048 /////////////////////////////////////////////////////////////////
    2049 //
    2050 
    2051 class ON_CLASS ON_2fPointArray : public ON_SimpleArray<ON_2fPoint>
    2052 {
    2053 public:
    2054  // see ON_SimpleArray class definition comments for constructor documentation
    2055  ON_2fPointArray();
    2056  ON_2fPointArray(int);
    2058  ON_2fPointArray& operator=( const ON_2fPointArray& );
    2059 
    2060  bool GetBBox( // returns true if successful
    2061  float boxmin[2],
    2062  float boxmax[2],
    2063  bool bGrowBox = false // true means grow box
    2064  ) const;
    2065  bool Transform( const ON_Xform& );
    2066  bool SwapCoordinates(int,int);
    2067 };
    2068 
    2069 
    2070 /////////////////////////////////////////////////////////////////
    2071 //
    2072 
    2073 class ON_CLASS ON_3dPointArray : public ON_SimpleArray<ON_3dPoint>
    2074 {
    2075 public:
    2076  // see ON_SimpleArray class definition comments for constructor documentation
    2077  ON_3dPointArray();
    2078  ON_3dPointArray(int);
    2079  ON_3dPointArray(const ON_SimpleArray<ON_3dPoint>&);
    2080  ON_3dPointArray& operator=( const ON_3dPointArray& );
    2081  ON_3dPointArray(const ON_SimpleArray<ON_3fPoint>&);
    2082  ON_3dPointArray& operator=( const ON_SimpleArray<ON_3fPoint>& );
    2083 
    2084  // Description:
    2085  // Create 3d point list
    2086  // Parameters:
    2087  // point_dimension - [in] dimension of input points (2 or 3)
    2088  // bRational - [in] true if points are in homogenous rational form
    2089  // point_count - [in] number of points
    2090  // point_stride - [in] number of doubles to skip between points
    2091  // points - [in] array of point coordinates
    2092  bool Create(
    2093  int point_dimension,
    2094  int bRational,
    2095  int point_count,
    2096  int point_stride,
    2097  const double* points
    2098  );
    2099 
    2100  // Description:
    2101  // Create 3d point list
    2102  // Parameters:
    2103  // point_dimension - [in] dimension of input points (2 or 3)
    2104  // bRational - [in] true if points are in homogenous rational form
    2105  // point_count - [in] number of points
    2106  // point_stride - [in] number of doubles to skip between points
    2107  // points - [in] array of point coordinates
    2108  bool Create(
    2109  int point_dimension,
    2110  int bRational,
    2111  int point_count,
    2112  int point_stride,
    2113  const float* points
    2114  );
    2115 
    2116  // Description:
    2117  // Get 3d axis aligned bounding box.
    2118  // Returns:
    2119  // 3d bounding box of point list.
    2120  ON_BoundingBox BoundingBox() const;
    2121 
    2122  // Description:
    2123  // Get 3d axis aligned bounding box or the union
    2124  // of the input box with the point list's bounding box.
    2125  // Parameters:
    2126  // bbox - [in/out] 3d axis aligned bounding box
    2127  // bGrowBox - [in] (default=false)
    2128  // If true, then the union of the input bbox and the
    2129  // point list's bounding box is returned in bbox.
    2130  // If false, the point list's bounding box is returned in bbox.
    2131  // Returns:
    2132  // true if successful.
    2133  bool GetBoundingBox(
    2134  ON_BoundingBox& bbox,
    2135  int bGrowBox = false
    2136  ) const;
    2137 
    2138  // Description:
    2139  // Get axis aligned bounding box.
    2140  // Parameters:
    2141  // boxmin - [in/out] array of 3 doubles
    2142  // boxmax - [in/out] array of 3 doubles
    2143  // bGrowBox - [in] (default=false)
    2144  // If true, then the union of the input bounding box and the
    2145  // object's bounding box is returned.
    2146  // If false, the object's bounding box is returned.
    2147  // Returns:
    2148  // true if object has bounding box and calculation was successful
    2149  bool GetBBox(
    2150  double boxmin[3],
    2151  double boxmax[3],
    2152  bool bGrowBox = false
    2153  ) const;
    2154 
    2155  /*
    2156  Description:
    2157  Get tight bounding box of the point list.
    2158  Parameters:
    2159  tight_bbox - [in/out] tight bounding box
    2160  bGrowBox -[in] (default=false)
    2161  If true and the input tight_bbox is valid, then returned
    2162  tight_bbox is the union of the input tight_bbox and the
    2163  tight bounding box of the point list.
    2164  xform -[in] (default=nullptr)
    2165  If not nullptr, the tight bounding box of the transformed
    2166  point list is calculated. The point list is not modified.
    2167  Returns:
    2168  True if the returned tight_bbox is set to a valid
    2169  bounding box.
    2170  */
    2171  bool GetTightBoundingBox(
    2172  ON_BoundingBox& tight_bbox,
    2173  bool bGrowBox = false,
    2174  const ON_Xform* xform = nullptr
    2175  ) const;
    2176 
    2177  // Description:
    2178  // Transform points by applying xform to each point.
    2179  // Parameters:
    2180  // xform - [in] transformation matrix
    2181  // Returns:
    2182  // true if successful.
    2183  bool Transform(
    2184  const ON_Xform& xform
    2185  );
    2186 
    2187  // Description:
    2188  // Swaps point coordinate values with indices i and j.
    2189  // Parameters:
    2190  // i - [in] coordinate index
    2191  // j - [in] coordinate index
    2192  // Returns:
    2193  // true if successful.
    2194  // Example:
    2195  // The call SwapCoordinates(0,2) would swap the x and z
    2196  // coordinates of each point in the array.
    2197  bool SwapCoordinates(
    2198  int i,
    2199  int j
    2200  );
    2201 
    2202  // Description:
    2203  // Rotate points about a center and axis. A positive angle
    2204  // results in a counter-clockwise rotation about the axis
    2205  // of rotation.
    2206  // Parameters:
    2207  // sin_angle - [in] sine of rotation angle
    2208  // cos_angle - [in] cosine of rotation angle
    2209  // axis_of_rotation - [in] axis of rotation
    2210  // center_of_rotation - [in] center (fixed point) of rotation
    2211  // Returns:
    2212  // true if successful.
    2213  bool Rotate(
    2214  double sin_angle,
    2215  double cos_angle,
    2216  const ON_3dVector& axis_of_rotation,
    2217  const ON_3dPoint& center_of_rotation
    2218  );
    2219 
    2220  // Description:
    2221  // Rotate points about a center and axis. A positive angle
    2222  // results in a counter-clockwise rotation about the axis
    2223  // of rotation.
    2224  // Parameters:
    2225  // angle - [in] angle in radians. Polsine of rotation angle
    2226  // cos_angle - [in] cosine of rotation angle
    2227  // axis_of_rotation - [in] axis of rotation
    2228  // center_of_rotation - [in] center (fixed point) of rotation
    2229  // Returns:
    2230  // true if successful.
    2231  bool Rotate(
    2232  double angle_in_radians,
    2233  const ON_3dVector& axis_of_rotation,
    2234  const ON_3dPoint& center_of_rotation
    2235  );
    2236 
    2237  // Description:
    2238  // Translate a polyline
    2239  // Parameters:
    2240  // delta - [in] translation vectorsine of rotation angle
    2241  // Returns:
    2242  // true if successful.
    2243  bool Translate(
    2244  const ON_3dVector& delta
    2245  );
    2246 
    2247  /*
    2248  Description:
    2249  Get the index of the point in the array that is closest
    2250  to P.
    2251  Parameters:
    2252  P - [in]
    2253  closest_point_index - [out]
    2254  maximum_distance - [in] optional distance constraint.
    2255  If maximum_distance > 0, then only points Q with
    2256  |P-Q| <= maximum_distance are returned.
    2257  Returns:
    2258  True if a point is found; in which case *closest_point_index
    2259  is the index of the point. False if no point is found
    2260  or the input is not valid.
    2261  See Also:
    2262  ON_GetClosestPointInPointList
    2263  ON_PointCloud::GetClosestPoint
    2264  */
    2265  bool GetClosestPoint(
    2266  ON_3dPoint P,
    2267  int* closest_point_index,
    2268  double maximum_distance = 0.0
    2269  ) const;
    2270 
    2271 };
    2272 
    2273 
    2274 /////////////////////////////////////////////////////////////////
    2275 //
    2276 
    2277 class ON_CLASS ON_3fPointArray : public ON_SimpleArray<ON_3fPoint>
    2278 {
    2279 public:
    2280  // see ON_SimpleArray class definition comments for constructor documentation
    2281  ON_3fPointArray();
    2282  ON_3fPointArray(int);
    2284  ON_3fPointArray& operator=( const ON_3fPointArray& );
    2285 
    2286  bool GetBBox(
    2287  float boxmin[3],
    2288  float boxmax[3],
    2289  bool bGrowBox = false
    2290  ) const;
    2291 
    2292  bool Transform( const ON_Xform& );
    2293 
    2294  bool SwapCoordinates(int,int);
    2295 };
    2296 
    2297 
    2298 /////////////////////////////////////////////////////////////////
    2299 //
    2300 
    2301 class ON_CLASS ON_4dPointArray : public ON_SimpleArray<ON_4dPoint>
    2302 {
    2303 public:
    2304  // see ON_SimpleArray class definition comments for constructor documentation
    2305  ON_4dPointArray();
    2306  ON_4dPointArray(int);
    2308  ON_4dPointArray& operator=( const ON_4dPointArray& );
    2309 
    2310  bool Transform( const ON_Xform& );
    2311  bool SwapCoordinates(int,int);
    2312 };
    2313 
    2314 
    2315 /////////////////////////////////////////////////////////////////
    2316 //
    2317 
    2318 class ON_CLASS ON_4fPointArray : public ON_SimpleArray<ON_4fPoint>
    2319 {
    2320 public:
    2321  // see ON_SimpleArray class definition comments for constructor documentation
    2322  ON_4fPointArray();
    2323  ON_4fPointArray(int);
    2325  ON_4fPointArray& operator=( const ON_4fPointArray& );
    2326 
    2327  bool Transform( const ON_Xform& );
    2328  bool SwapCoordinates(int,int);
    2329 };
    2330 
    2331 
    2332 /////////////////////////////////////////////////////////////////
    2333 //
    2334 
    2335 class ON_CLASS ON_2dVectorArray : public ON_SimpleArray<ON_2dVector>
    2336 {
    2337 public:
    2338  // see ON_SimpleArray class definition comments for constructor documentation
    2339  ON_2dVectorArray();
    2340  ON_2dVectorArray(int);
    2342  ON_2dVectorArray& operator=( const ON_2dVectorArray& );
    2343 
    2344  bool GetBBox(
    2345  double boxmin[2],
    2346  double boxmax[2],
    2347  bool bGrowBox = false
    2348  ) const;
    2349 
    2350  bool Transform( const ON_Xform& );
    2351  bool SwapCoordinates(int,int);
    2352 };
    2353 
    2354 
    2355 /////////////////////////////////////////////////////////////////
    2356 //
    2357 
    2358 class ON_CLASS ON_2fVectorArray : public ON_SimpleArray<ON_2fVector>
    2359 {
    2360 public:
    2361  // see ON_SimpleArray class definition comments for constructor documentation
    2362  ON_2fVectorArray();
    2363  ON_2fVectorArray(int);
    2365  ON_2fVectorArray& operator=( const ON_2fVectorArray& );
    2366 
    2367  bool GetBBox(
    2368  float boxmin[2],
    2369  float boxmax[2],
    2370  bool = false
    2371  ) const;
    2372 
    2373  bool Transform( const ON_Xform& );
    2374  bool SwapCoordinates(int,int);
    2375 };
    2376 
    2377 
    2378 /////////////////////////////////////////////////////////////////
    2379 //
    2380 
    2381 class ON_CLASS ON_3dVectorArray : public ON_SimpleArray<ON_3dVector>
    2382 {
    2383 public:
    2384  ON_3dVectorArray();
    2385  ON_3dVectorArray(int);
    2387  ON_3dVectorArray& operator=( const ON_3dVectorArray& );
    2388 
    2389  bool GetBBox(
    2390  double boxmin[3],
    2391  double boxmax[3],
    2392  bool bGrowBow = false
    2393  ) const;
    2394 
    2395  bool Transform( const ON_Xform& );
    2396  bool SwapCoordinates(int,int);
    2397 };
    2398 
    2399 /////////////////////////////////////////////////////////////////
    2400 //
    2401 
    2402 class ON_CLASS ON_3fVectorArray : public ON_SimpleArray<ON_3fVector>
    2403 {
    2404 public:
    2405  ON_3fVectorArray();
    2406  ON_3fVectorArray(int);
    2408  ON_3fVectorArray& operator=( const ON_3fVectorArray& );
    2409 
    2410  bool GetBBox(
    2411  float boxmin[3],
    2412  float boxmax[3],
    2413  bool bGrowBox = false
    2414  ) const;
    2415 
    2416  bool Transform( const ON_Xform& );
    2417  bool SwapCoordinates(int,int);
    2418 };
    2419 
    2420 class ON_CLASS ON_3dPointListRef
    2421 {
    2422 public:
    2423 
    2424 
    2426  : m_point_count(0)
    2427  , m_point_stride(0)
    2428  , m_dP(0)
    2429  , m_fP(0)
    2430  {}
    2431 
    2432  /*
    2433  Description:
    2434  Construct a point list that references the mesh vertex list.
    2435  Remarks:
    2436  If the mesh has double precision vertices, then the point
    2437  list will refer to them; otherwise, the point list will
    2438  refer to the single precision vertices.
    2439  */
    2441  const class ON_Mesh* mesh
    2442  );
    2443 
    2444  /*
    2445  Description:
    2446  Construct a point list that references the points
    2447  in a simple array of ON_3dPoint objects.
    2448  */
    2450  const class ON_SimpleArray<ON_3dPoint>& point_array
    2451  );
    2452 
    2453  /*
    2454  Description:
    2455  Construct a point list that references the points
    2456  in a simple array of ON_3fPoint objects.
    2457  */
    2459  const class ON_SimpleArray<ON_3fPoint>& point_array
    2460  );
    2461 
    2463 
    2464  static
    2465  ON_3dPointListRef FromDoubleArray(
    2466  size_t point_count,
    2467  size_t point_stride,
    2468  const double* point_array
    2469  );
    2470 
    2471  static
    2472  ON_3dPointListRef FromFloatArray(
    2473  size_t point_count,
    2474  size_t point_stride,
    2475  const float* point_array
    2476  );
    2477 
    2478  static
    2479  ON_3dPointListRef FromPointArray(
    2480  const class ON_SimpleArray<ON_3dPoint>& point_array
    2481  );
    2482 
    2483  static
    2484  ON_3dPointListRef FromPointArray(
    2485  const class ON_SimpleArray<ON_3fPoint>& point_array
    2486  );
    2487 
    2488  static
    2489  ON_3dPointListRef FromMesh(
    2490  const class ON_Mesh* mesh
    2491  );
    2492 
    2493  /*
    2494  Returns:
    2495  A copy of the refenced points in an ON_SimpleArray<ON_3dPoint>.
    2496  */
    2497  ON_SimpleArray<ON_3dPoint> To3dPointArray() const;
    2498 
    2499  /*
    2500  Returns:
    2501  A copy of the refenced points in an ON_SimpleArray<ON_3fPoint>.
    2502  */
    2503  ON_SimpleArray<ON_3fPoint> To3fPointArray() const;
    2504 
    2505  /*
    2506  Description:
    2507  Set this point list to reference points with double coordinates.
    2508  Parameters:
    2509  point_count - [in]
    2510  number of points
    2511  point_stride - [in] (>= 3)
    2512  number of doubles between points.
    2513  point_array - [in]
    2514  pointer to the first coordinate of the first point.
    2515  Returns:
    2516  Number of points in the list.
    2517  */
    2518  unsigned int SetFromDoubleArray(
    2519  size_t point_count,
    2520  size_t point_stride,
    2521  const double* point_array
    2522  );
    2523 
    2524  /*
    2525  Description:
    2526  Set this point list to reference points with float coordinates.
    2527  Parameters:
    2528  point_count - [in]
    2529  number of points
    2530  point_stride - [in] (>= 3)
    2531  number of floats between points.
    2532  point_array - [in]
    2533  pointer to the first coordinate of the first point.
    2534  Returns:
    2535  Number of points in the list.
    2536  */
    2537  unsigned int SetFromFloatArray(
    2538  size_t point_count,
    2539  size_t point_stride,
    2540  const float* point_array
    2541  );
    2542 
    2543  /*
    2544  Description:
    2545  Set this point list to reference a mesh vertex list.
    2546  Parameters:
    2547  mesh - [in]
    2548  Returns:
    2549  Number of points in the list.
    2550  */
    2551  unsigned int SetFromMesh(
    2552  const class ON_Mesh* mesh
    2553  );
    2554 
    2555  /*
    2556  Returns:
    2557  0: no points
    2558  1: single precison points (float coordinates)
    2559  2: double precison points (double coordinates)
    2560  */
    2561  unsigned int Precision() const;
    2562 
    2563  /*
    2564  Returns:
    2565  true if the points are double precision
    2566  */
    2567  bool DoublePrecision() const;
    2568 
    2569  /*
    2570  Returns:
    2571  true if the points are single precision
    2572  */
    2573  bool SinglePrecision() const;
    2574 
    2575  /*
    2576  Description:
    2577  Copy point location into buffer and return it as an ON_3dPoint.
    2578  Parameters:
    2579  point_index - [in]
    2580  buffer - [out]
    2581  If point_index is a valid index, the point coordinates
    2582  are copied to buffer[]; oherwise the buffer coordinates
    2583  are set to ON_UNSET_VALUE.
    2584  You must insure buffer is not null, has proper alignment
    2585  for storing doubles, and is large enough to store three
    2586  doubles.
    2587  Returns:
    2588  A reference to an ON_3dPoint which is a cast of buffer.
    2589  Remarks:
    2590  This is the fastest and most efficient way to get a the
    2591  location of a point into memory you are managing.
    2592  */
    2593  inline const class ON_3dPoint& GetPoint(
    2594  unsigned int point_index,
    2595  double buffer[3]
    2596  ) const
    2597  {
    2598  if ( point_index < m_point_count )
    2599  {
    2600  if ( m_dP )
    2601  {
    2602  const double* p = m_dP + (point_index*m_point_stride);
    2603  buffer[0] = *p++;
    2604  buffer[1] = *p++;
    2605  buffer[2] = *p;
    2606  }
    2607  else
    2608  {
    2609  const float* p = m_fP + (point_index*m_point_stride);
    2610  buffer[0] = *p++;
    2611  buffer[1] = *p++;
    2612  buffer[2] = *p;
    2613  }
    2614  }
    2615  else
    2616  {
    2617  buffer[0] = buffer[1] = buffer[2] = ON_UNSET_VALUE;
    2618  }
    2619  return *((const ON_3dPoint*)buffer);
    2620  }
    2621 
    2622  /*
    2623  Parameters:
    2624  point_index - [in]
    2625  Returns:
    2626  If point_index is a valid index, the point location is returned.
    2627  Otherwise ON_3dPoint::UnsetPoint is returned.
    2628  */
    2629  inline ON_3dPoint Point(
    2630  unsigned int point_index
    2631  ) const
    2632  {
    2633  double buffer[3];
    2634  if ( point_index < m_point_count )
    2635  {
    2636  if ( m_dP )
    2637  {
    2638  const double* p = m_dP + (point_index*m_point_stride);
    2639  buffer[0] = *p++;
    2640  buffer[1] = *p++;
    2641  buffer[2] = *p;
    2642  }
    2643  else
    2644  {
    2645  const float* p = m_fP + (point_index*m_point_stride);
    2646  buffer[0] = *p++;
    2647  buffer[1] = *p++;
    2648  buffer[2] = *p;
    2649  }
    2650  }
    2651  else
    2652  {
    2653  buffer[0] = buffer[1] = buffer[2] = ON_UNSET_VALUE;
    2654  }
    2655  return *((const ON_3dPoint*)buffer);
    2656  }
    2657 
    2658  inline ON_3dPoint operator[](int point_index) const
    2659  {
    2660  double buffer[3];
    2661  if ( point_index >= 0 && ((unsigned int)point_index) < m_point_count )
    2662  {
    2663  if ( m_dP )
    2664  {
    2665  const double* p = m_dP + (point_index*m_point_stride);
    2666  buffer[0] = *p++;
    2667  buffer[1] = *p++;
    2668  buffer[2] = *p;
    2669  }
    2670  else
    2671  {
    2672  const float* p = m_fP + (point_index*m_point_stride);
    2673  buffer[0] = *p++;
    2674  buffer[1] = *p++;
    2675  buffer[2] = *p;
    2676  }
    2677  }
    2678  else
    2679  {
    2680  buffer[0] = buffer[1] = buffer[2] = ON_UNSET_VALUE;
    2681  }
    2682  return *((const ON_3dPoint*)buffer);
    2683  }
    2684 
    2685  inline ON_3dPoint operator[](unsigned int point_index) const
    2686  {
    2687  double buffer[3];
    2688  if ( point_index < m_point_count )
    2689  {
    2690  if ( m_dP )
    2691  {
    2692  const double* p = m_dP + (point_index*m_point_stride);
    2693  buffer[0] = *p++;
    2694  buffer[1] = *p++;
    2695  buffer[2] = *p;
    2696  }
    2697  else
    2698  {
    2699  const float* p = m_fP + (point_index*m_point_stride);
    2700  buffer[0] = *p++;
    2701  buffer[1] = *p++;
    2702  buffer[2] = *p;
    2703  }
    2704  }
    2705  else
    2706  {
    2707  buffer[0] = buffer[1] = buffer[2] = ON_UNSET_VALUE;
    2708  }
    2709  return *((const ON_3dPoint*)buffer);
    2710  }
    2711 
    2712  inline ON_3dPoint operator[](ON__INT64 point_index) const
    2713  {
    2714  double buffer[3];
    2715  if ( point_index >= 0 && ((ON__UINT64)point_index) < m_point_count )
    2716  {
    2717  if ( m_dP )
    2718  {
    2719  const double* p = m_dP + (point_index*m_point_stride);
    2720  buffer[0] = *p++;
    2721  buffer[1] = *p++;
    2722  buffer[2] = *p;
    2723  }
    2724  else
    2725  {
    2726  const float* p = m_fP + (point_index*m_point_stride);
    2727  buffer[0] = *p++;
    2728  buffer[1] = *p++;
    2729  buffer[2] = *p;
    2730  }
    2731  }
    2732  else
    2733  {
    2734  buffer[0] = buffer[1] = buffer[2] = ON_UNSET_VALUE;
    2735  }
    2736  return *((const ON_3dPoint*)buffer);
    2737  }
    2738 
    2739  inline ON_3dPoint operator[](ON__UINT64 point_index) const
    2740  {
    2741  double buffer[3];
    2742  if ( point_index < m_point_count )
    2743  {
    2744  if ( m_dP )
    2745  {
    2746  const double* p = m_dP + (point_index*m_point_stride);
    2747  buffer[0] = *p++;
    2748  buffer[1] = *p++;
    2749  buffer[2] = *p;
    2750  }
    2751  else
    2752  {
    2753  const float* p = m_fP + (point_index*m_point_stride);
    2754  buffer[0] = *p++;
    2755  buffer[1] = *p++;
    2756  buffer[2] = *p;
    2757  }
    2758  }
    2759  else
    2760  {
    2761  buffer[0] = buffer[1] = buffer[2] = ON_UNSET_VALUE;
    2762  }
    2763  return *((const ON_3dPoint*)buffer);
    2764  }
    2765 
    2766  inline unsigned int PointCount() const
    2767  {
    2768  return m_point_count;
    2769  }
    2770 
    2771  inline unsigned int PointStride() const
    2772  {
    2773  return m_point_stride;
    2774  }
    2775 
    2776  inline const double* PointDoubleArray() const
    2777  {
    2778  return m_dP;
    2779  }
    2780 
    2781  inline const float* PointFloatArray() const
    2782  {
    2783  return m_fP;
    2784  }
    2785 
    2786  /*
    2787  Returns:
    2788  Number of points copied to face_points[] array.
    2789  */
    2790  unsigned int GetMeshFacePoints(
    2791  const class ON_MeshFace* mesh_face,
    2792  ON_3dPoint face_points[4]
    2793  ) const;
    2794 
    2795  /*
    2796  Returns:
    2797  Number of points copied to ngon_points[] array.
    2798  */
    2799  unsigned int GetMeshNgonPoints(
    2800  const class ON_MeshNgon* mesh_ngon,
    2801  size_t ngon_points_capacity,
    2802  class ON_3dPoint* ngon_points
    2803  ) const;
    2804 
    2805  /*
    2806  Returns:
    2807  Number of points copied to ngon_points[] array.
    2808  */
    2809  unsigned int GetMeshNgonPoints(
    2810  const class ON_MeshNgon* mesh_ngon,
    2811  ON_SimpleArray<ON_3dPoint>& ngon_points
    2812  ) const;
    2813 
    2814  /*
    2815  Returns:
    2816  Number of points copied to quad_points[] array.
    2817  */
    2818  unsigned int GetQuadPoints(
    2819  const int quad_point_indices[4],
    2820  class ON_3dPoint quad_points[4]
    2821  ) const;
    2822 
    2823  /*
    2824  Returns:
    2825  Number of points copied to quad_points[] array.
    2826  */
    2827  unsigned int GetQuadPoints(
    2828  const unsigned int quad_point_indices[4],
    2829  class ON_3dPoint quad_points[4]
    2830  ) const;
    2831 
    2832  /*
    2833  Returns:
    2834  Number of points copied to triangle_points[] array.
    2835  */
    2836  unsigned int GetTrianglePoints(
    2837  const int triangle_point_indices[3],
    2838  class ON_3dPoint triangle_points[3]
    2839  ) const;
    2840 
    2841  /*
    2842  Returns:
    2843  Number of points copied to triangle_points[] array.
    2844  */
    2845  unsigned int GetTrianglePoints(
    2846  const unsigned int triangle_point_indices[3],
    2847  class ON_3dPoint triangle_points[3]
    2848  ) const;
    2849 
    2850  /*
    2851  Returns:
    2852  Number of points copied to points[] array.
    2853  */
    2854  unsigned int GetPoints(
    2855  int point_index_count,
    2856  const int* point_index_list,
    2857  class ON_3dPoint* points
    2858  ) const;
    2859 
    2860  /*
    2861  Returns:
    2862  Number of points copied to points[] array.
    2863  */
    2864  unsigned int GetPoints(
    2865  unsigned int point_index_count,
    2866  const unsigned int* point_index_list,
    2867  class ON_3dPoint* points
    2868  ) const;
    2869 
    2870  /*
    2871  Returns:
    2872  Number of points copied to points[] array.
    2873  */
    2874  unsigned int GetPoints(
    2875  const ON_SimpleArray<int>& point_index_list,
    2876  ON_SimpleArray<ON_3dPoint>& points
    2877  ) const;
    2878 
    2879  /*
    2880  Returns:
    2881  Number of points copied to points[] array.
    2882  */
    2883  unsigned int GetPoints(
    2884  int point_index_count,
    2885  const int* point_index_list,
    2886  ON_SimpleArray<ON_3dPoint>& points
    2887  ) const;
    2888 
    2889  /*
    2890  Returns:
    2891  Number of points copied to points[] array.
    2892  */
    2893  unsigned int GetPoints(
    2894  unsigned int point_index_count,
    2895  const unsigned int* point_index_list,
    2896  ON_SimpleArray<ON_3dPoint>& points
    2897  ) const;
    2898 
    2899 private:
    2900  unsigned int m_point_count;
    2901  unsigned int m_point_stride;
    2902  const double* m_dP;
    2903  const float* m_fP;
    2904 };
    2905 
    2906 
    2907 
    2908 
    2909 
    2910 
    2911 
    2912 
    2913 /*
    2914 Class ON_2dSize
    2915 */
    2916 class ON_CLASS ON_2dSize
    2917 {
    2918 public:
    2919  // Default construction intentionally leaves x and y uninitialized.
    2920  // Use something like
    2921  // ON_2dSize pt(1.0,2.0);
    2922  // or
    2923  // ON_2dSize pt = ON_2dSize::Zero;
    2924  // when you need an initialized ON_2dSize.
    2925  ON_2dSize() = default;
    2926 
    2927  ~ON_2dSize() = default;
    2928  ON_2dSize(const ON_2dSize& ) = default;
    2929  ON_2dSize& operator=(const ON_2dSize& ) = default;
    2930 
    2931  ON_2dSize(
    2932  double cx,
    2933  double cy
    2934  );
    2935 
    2936  /*
    2937  Dictionary compare.
    2938  Returns:
    2939  -1: lhs < rhs
    2940  0: lsh == rsh
    2941  +1: lhs > rhs
    2942  */
    2943  static int Compare(
    2944  const ON_2dSize& lhs,
    2945  const ON_2dSize& rhs
    2946  );
    2947 
    2948  /*
    2949  Dictionary compare.
    2950  Returns:
    2951  -1: lhs < rhs
    2952  0: lsh == rsh
    2953  +1: lhs > rhs
    2954  */
    2955  static int ComparePointer(
    2956  const ON_2dSize* lhs,
    2957  const ON_2dSize* rhs
    2958  );
    2959 
    2960 public:
    2961  static const ON_2dSize Zero; // (0.0,0.0)
    2962  static const ON_2dSize Unset; // (ON_UNSET_DOUBLE,ON_UNSET_DOUBLE)
    2963 
    2964 public:
    2965  /*
    2966  Returns:
    2967  true if both cx and cy are 0.0
    2968  */
    2969  bool IsZero() const;
    2970 
    2971  /*
    2972  Returns:
    2973  true if neither cx nor cy are ON_UNSET_DOUBLE.
    2974  */
    2975  bool IsSet() const;
    2976 
    2977 public:
    2978  double cx;
    2979  double cy;
    2980 };
    2981 
    2982 ON_DECL
    2983 bool operator==(
    2984  const ON_2dSize& lhs,
    2985  const ON_2dSize& rhs
    2986  );
    2987 
    2988 ON_DECL
    2989 bool operator!=(
    2990  const ON_2dSize& lhs,
    2991  const ON_2dSize& rhs
    2992  );
    2993 
    2994 #if defined(ON_DLL_TEMPLATE)
    2995 
    2996 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_2dSize>;
    2997 
    2998 #endif
    2999 
    3000 /*
    3001 Class ON_4iRect
    3002  For those situations where a Windows SDK RECT or MFC CRect
    3003  value needs to be used in code that does not link with MFC.
    3004  If you want a traditional bounding box, use ON_2dBoundingBox.
    3005 */
    3006 class ON_CLASS ON_4dRect
    3007 {
    3008 public:
    3009  // Default construction intentionally leaves x and y uninitialized.
    3010  // Use something like
    3011  // ON_4dRect pt(1.0,2.0,3.0,4.0);
    3012  // or
    3013  // ON_4dRect pt = ON_4dRect::Zero;
    3014  // when you need an initialized ON_4dRect.
    3015  ON_4dRect() = default;
    3016 
    3017  ~ON_4dRect() = default;
    3018  ON_4dRect(const ON_4dRect& ) = default;
    3019  ON_4dRect& operator=(const ON_4dRect& ) = default;
    3020 
    3021  ON_4dRect(
    3022  double left,
    3023  double top,
    3024  double right,
    3025  double bottom
    3026  );
    3027 
    3028  ON_4dRect(const ON_2dPoint topLeft, const ON_2dPoint& bottomRight);
    3029  ON_4dRect(const ON_2dPoint& point, const ON_2dSize& size);
    3030 
    3031 public:
    3032  static const ON_4dRect Zero; // (0.0,0.0,0.0,0.0)
    3033  static const ON_4dRect Unset; // (ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX,ON_UNSET_INT_INDEX)
    3034 
    3035 public:
    3036  /*
    3037  Returns:
    3038  true if all of left, top, right, and bottom are set to 0.
    3039  */
    3040  bool IsZero() const;
    3041 
    3042  void SetZero();
    3043 
    3044  /*
    3045  Returns:
    3046  true if none of left, top, right, or bottom is set to ON_UNSET_INT_INDEX
    3047  */
    3048  bool IsSet() const;
    3049 
    3050  double Width(void) const;
    3051  double Height(void) const;
    3052 
    3053  const ON_2dSize Size(void) const;
    3054 
    3055  const ON_2dPoint CenterPoint(void) const;
    3056  const ON_2dPoint TopLeft(void) const;
    3057  const ON_2dPoint BottomRight(void) const;
    3058 
    3059  bool IntersectRect(const ON_4dRect* r1, const ON_4dRect* r2);
    3060  bool IntersectRect(const ON_4dRect& r1, const ON_4dRect& r2);
    3061 
    3062  bool IsRectEmpty(void) const;
    3063  bool IsRectNull(void) const;
    3064  void SetRectEmpty(void) { *this = Zero; }
    3065  void SetRect(double l, double t, double r, double b);
    3066 
    3067  bool PtInRect(const ON_2dPoint& pt) const;
    3068 
    3069  void OffsetRect(double, double);
    3070  void OffsetRect(const ON_2dVector&);
    3071  void InflateRect(double, double);
    3072  void InflateRect(double, double, double, double);
    3073  void DeflateRect(double, double);
    3074  bool SubtractRect(const ON_4dRect* rect1, const ON_4dRect* rect2);
    3075 
    3076  void NormalizeRect();
    3077 
    3078 public:
    3079  double left;
    3080  double top;
    3081  double right;
    3082  double bottom;
    3083 };
    3084 
    3085 #if defined(ON_DLL_TEMPLATE)
    3086 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_4dRect>;
    3087 #endif
    3088 
    3089 
    3090 ON_DECL
    3091 bool operator==(const ON_4dRect&, const ON_4dRect&);
    3092 
    3093 ON_DECL
    3094 bool operator!=(const ON_4dRect&, const ON_4dRect&);
    3095 
    3096 
    3097 
    3098 
    3099 
    3100 
    3101 
    3102 
    3103 
    3104 #endif
    3105 
    const class ON_3dPoint & GetPoint(unsigned int point_index, double buffer[3]) const
    Definition: opennurbs_point.h:2593
    Definition: opennurbs_point.h:2277
    double k2
    principal curvatures
    Definition: opennurbs_point.h:1991
    static const ON_4dRect Zero
    (0.0,0.0,0.0,0.0)
    Definition: opennurbs_point.h:3032
    @@ -168,9 +166,9 @@ $(function() {
    diff --git a/6/d9/d12/class_o_n___component_status.html b/6/d9/d12/class_o_n___component_status.html index 90fcde55..e5f3187d 100644 --- a/6/d9/d12/class_o_n___component_status.html +++ b/6/d9/d12/class_o_n___component_status.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ComponentStatus Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    -

    Parameters: states_filter - [in] If no states are specified, then false is returned. comparand - [in] If a state is set in states_filter, the corresponding state in "this" and comparand will be tested.
    -Returns: True if every tested state in "this" and comparand are identical. Remarks: For the purposes of this test, ON_ComponentState::Selected and ON_ComponentState::SelectedPersistent are considered equal.

    +

    Parameters: states_filter - [in] If no states are specified, then false is returned. comparand - [in] If a state is set in states_filter, the corresponding state in "this" and comparand will be tested. Returns: True if every tested state in "this" and comparand are identical. Remarks: For the purposes of this test, ON_ComponentState::Selected and ON_ComponentState::SelectedPersistent are considered equal.

    @@ -639,8 +636,7 @@ Returns: True if every tested state in "this" and comparand are identical. Remar
    -

    Selection
    -Returns: ON_ComponentState::not_selected, ON_ComponentState::Selected or ON_ComponentState::Selected_pesistent.

    +

    Selection Returns: ON_ComponentState::not_selected, ON_ComponentState::Selected or ON_ComponentState::Selected_pesistent.

    @@ -659,8 +655,7 @@ Returns: ON_ComponentState::not_selected, ON_ComponentState::Selected or ON_Comp
    -

    Damaged
    -Returns: 1 if status changed. 0 if status did not change.

    +

    Damaged Returns: 1 if status changed. 0 if status did not change.

    @@ -679,8 +674,7 @@ Returns: 1 if status changed. 0 if status did not change.

    -

    Deleted
    -Returns: 1 if status changed. 0 if status did not change.

    +

    Deleted Returns: 1 if status changed. 0 if status did not change.

    @@ -699,8 +693,7 @@ Returns: 1 if status changed. 0 if status did not change.

    -

    Hidden
    -Returns: 1 if status changed. 0 if status did not change.

    +

    Hidden Returns: 1 if status changed. 0 if status did not change.

    @@ -719,8 +712,7 @@ Returns: 1 if status changed. 0 if status did not change.

    -

    Highlighted
    -Returns: 1 if status changed. 0 if status did not change.

    +

    Highlighted Returns: 1 if status changed. 0 if status did not change.

    @@ -739,8 +731,7 @@ Returns: 1 if status changed. 0 if status did not change.

    -

    Locked
    -Returns: 1 if status changed. 0 if status did not change.

    +

    Locked Returns: 1 if status changed. 0 if status did not change.

    @@ -1134,9 +1125,9 @@ Returns: 1 if status changed. 0 if status did not change.

    diff --git a/6/d9/d13/class_o_n__3d_point_array.html b/6/d9/d13/class_o_n__3d_point_array.html index d1777a74..5cec7eda 100644 --- a/6/d9/d13/class_o_n__3d_point_array.html +++ b/6/d9/d13/class_o_n__3d_point_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dPointArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Get 3d axis aligned bounding box or the union of the input box with the point list's bounding box. Parameters: bbox - [in/out] 3d axis aligned bounding box bGrowBox - [in] (default=false) If true, then the union of the input bbox and the point list's bounding box is returned in bbox.
    - If false, the point list's bounding box is returned in bbox. Returns: true if successful.

    +

    Description: Get 3d axis aligned bounding box or the union of the input box with the point list's bounding box. Parameters: bbox - [in/out] 3d axis aligned bounding box bGrowBox - [in] (default=false) If true, then the union of the input bbox and the point list's bounding box is returned in bbox. If false, the point list's bounding box is returned in bbox. Returns: true if successful.

    @@ -616,8 +613,7 @@ Additional Inherited Members
    -

    Description: Get tight bounding box of the point list. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false)
    - If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the tight bounding box of the point list. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed point list is calculated. The point list is not modified. Returns: True if the returned tight_bbox is set to a valid bounding box.

    +

    Description: Get tight bounding box of the point list. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false) If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the tight bounding box of the point list. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed point list is calculated. The point list is not modified. Returns: True if the returned tight_bbox is set to a valid bounding box.

    @@ -803,9 +799,9 @@ Additional Inherited Members diff --git a/6/d9/d15/examples_8h_source.html b/6/d9/d15/examples_8h_source.html index 8ac4f435..c9d07856 100644 --- a/6/d9/d15/examples_8h_source.html +++ b/6/d9/d15/examples_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/examples.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/examples.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 #error OBSOLETE FILE
    diff --git a/6/d9/d27/opennurbs__crc_8h_source.html b/6/d9/d27/opennurbs__crc_8h_source.html index 4dcda03a..972286af 100644 --- a/6/d9/d27/opennurbs__crc_8h_source.html +++ b/6/d9/d27/opennurbs__crc_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_crc.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_crc.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_CRC_INC_)
    18 #define OPENNURBS_CRC_INC_
    19 
    20 ON_BEGIN_EXTERNC
    21 
    22 /*
    23 Description:
    24  Continues 16 bit CRC calulation to include the buffer.
    25 
    26 Parameters:
    27  current_remainder - [in]
    28  sizeof_buffer - [in] number of bytes in buffer
    29  buffer - [in]
    30 
    31 Example:
    32  16 bit CRC calculations are typically done something like this:
    33 
    34  const ON__UINT16 crc_seed = 0; // or 1, or your favorite starting value
    35 
    36  // Compute CRC on "good" data
    37  unsigned ON__UINT16 first_crc = crc_seed;
    38  first_crc = ON_CRC16( first_crc, size1, buffer1 );
    39  ...
    40  first_crc = ON_CRC16( first_crc, sizeN, bufferN );
    41  unsigned char two_zero_bytes[2] = (0,0);
    42  first_crc = ON_CRC16( first_crc, 2, two_zero_bytes );
    43 
    44  // make sure 16 bit CRC calculation is valid
    45  ON__UINT16 check_crc_calculation = ON_CRC16( first_crc, 2, &first_crc );
    46  if ( check_crc_calculation != 0 )
    47  {
    48  printf("ON_CRC16() calculated a bogus 16 bit CRC\n");
    49  }
    50 
    51  // Do something that may potentially change the values in
    52  // the buffers (like storing them on a faulty disk).
    53 
    54  // Compute CRC on "suspect" data
    55  ON__UINT16 second_crc = crc_seed;
    56  second_crc = ON_CRC16( second_crc, size1, buffer1 );
    57  ...
    58  second_crc = ON_CRC16( second_crc, sizeN, bufferN );
    59  if ( 0 != ON_CRC16( second_crc, 2, &first_crc ) )
    60  {
    61  printf( "The value of at least one byte has changed.\n" );
    62  }
    63 */
    64 ON_DECL
    65 ON__UINT16 ON_CRC16(
    66  ON__UINT16 current_remainder,
    67  size_t sizeof_buffer,
    68  const void* buffer
    69  );
    70 
    71 /*
    72 Description:
    73  Continues 32 bit CRC calulation to include the buffer
    74 
    75  ON_CRC32() is a slightly altered version of zlib 1.3.3's crc32()
    76  and the zlib "legal stuff" is reproduced below.
    77 
    78  ON_CRC32() and zlib's crc32() compute the same values. ON_CRC32()
    79  was renamed so it wouldn't clash with the other crc32()'s that are
    80  out there and the argument order was switched to match that used by
    81  the legacy ON_CRC16().
    82 
    83 Parameters:
    84  current_remainder - [in]
    85  sizeof_buffer - [in] number of bytes in buffer
    86  buffer - [in]
    87 
    88 Example:
    89  32 bit CRC calculations are typically done something like this:
    90 
    91  const ON__UINT32 crc_seed = 0; // or 1, or your favorite starting value
    92 
    93  //Compute CRC on "good" data
    94  ON__UINT32 first_crc = crc_seed;
    95  first_crc = ON_CRC32( first_crc, size1, buffer1 );
    96  ...
    97  first_crc = ON_CRC32( first_crc, sizeN, bufferN );
    98 
    99  // Do something that may potentially change the values in
    100  // the buffers (like storing them on a faulty disk).
    101 
    102  // Compute CRC on "suspect" data
    103  ON__UINT32 second_crc = crc_seed;
    104  second_crc = ON_CRC32( second_crc, size1, buffer1 );
    105  ...
    106  second_crc = ON_CRC32( second_crc, sizeN, bufferN );
    107  if ( second_crc != first_crc )
    108  {
    109  printf( "The value of at least one byte has changed.\n" );
    110  }
    111 */
    112 ON_DECL
    113 ON__UINT32 ON_CRC32(
    114  ON__UINT32 current_remainder,
    115  size_t sizeof_buffer,
    116  const void* buffer
    117  );
    118 
    119 /*
    120 zlib.h -- interface of the 'zlib' general purpose compression library
    121 version 1.1.3, July 9th, 1998
    122 
    123 Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
    124 
    125 This software is provided 'as-is', without any express or implied
    126 warranty. In no event will the authors be held liable for any damages
    127 arising from the use of this software.
    128 
    129 Permission is granted to anyone to use this software for any purpose,
    130 including commercial applications, and to alter it and redistribute it
    131 freely, subject to the following restrictions:
    132 
    133 1. The origin of this software must not be misrepresented; you must not
    134  claim that you wrote the original software. If you use this software
    135  in a product, an acknowledgment in the product documentation would be
    136  appreciated but is not required.
    137 2. Altered source versions must be plainly marked as such, and must not be
    138  misrepresented as being the original software.
    139 3. This notice may not be removed or altered from any source distribution.
    140 
    141 Jean-loup Gailly Mark Adler
    142 jloup@gzip.org madler@alumni.caltech.edu
    143 
    144 The data format used by the zlib library is described by RFCs (Request for
    145 Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
    146 (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
    147 
    148 */
    149 
    150 ON_END_EXTERNC
    151 
    152 #endif
    diff --git a/6/d9/d2e/class_o_n__2f_point_array-members.html b/6/d9/d2e/class_o_n__2f_point_array-members.html index 26e3b79f..c1861701 100644 --- a/6/d9/d2e/class_o_n__2f_point_array-members.html +++ b/6/d9/d2e/class_o_n__2f_point_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d2f/class_o_n___dim_style_context.html b/6/d9/d2f/class_o_n___dim_style_context.html index d493b7ca..fd31075a 100644 --- a/6/d9/d2f/class_o_n___dim_style_context.html +++ b/6/d9/d2f/class_o_n___dim_style_context.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_DimStyleContext Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d33/class_o_n___quaternion.html b/6/d9/d33/class_o_n___quaternion.html index cdaea3c7..80f70277 100644 --- a/6/d9/d33/class_o_n___quaternion.html +++ b/6/d9/d33/class_o_n___quaternion.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Quaternion Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_Quaternion() [1/3]

    @@ -1367,9 +1363,9 @@ Static Public Attributes
    diff --git a/6/d9/d37/class_o_n___mapping_channel-members.html b/6/d9/d37/class_o_n___mapping_channel-members.html index 7db71c1a..b98d6648 100644 --- a/6/d9/d37/class_o_n___mapping_channel-members.html +++ b/6/d9/d37/class_o_n___mapping_channel-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d3b/class_o_n___rtf_first_char-members.html b/6/d9/d3b/class_o_n___rtf_first_char-members.html index 24a96796..67889828 100644 --- a/6/d9/d3b/class_o_n___rtf_first_char-members.html +++ b/6/d9/d3b/class_o_n___rtf_first_char-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d42/class_o_n__3dm_render_settings-members.html b/6/d9/d42/class_o_n__3dm_render_settings-members.html index 0ddda7aa..38894e00 100644 --- a/6/d9/d42/class_o_n__3dm_render_settings-members.html +++ b/6/d9/d42/class_o_n__3dm_render_settings-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d42/class_o_n___evaluator.html b/6/d9/d42/class_o_n___evaluator.html index 73d62a60..abaed40e 100644 --- a/6/d9/d42/class_o_n___evaluator.html +++ b/6/d9/d42/class_o_n___evaluator.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Evaluator Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d42/class_o_n___user_data_holder-members.html b/6/d9/d42/class_o_n___user_data_holder-members.html index 36361b0e..ba8dfb9b 100644 --- a/6/d9/d42/class_o_n___user_data_holder-members.html +++ b/6/d9/d42/class_o_n___user_data_holder-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d4c/opennurbs__viewport_8h_source.html b/6/d9/d4c/opennurbs__viewport_8h_source.html index 44789526..8a8aaf05 100644 --- a/6/d9/d4c/opennurbs__viewport_8h_source.html +++ b/6/d9/d4c/opennurbs__viewport_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_viewport.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_viewport.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_viewport.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // defines ON_Viewport
    20 //
    21 ////////////////////////////////////////////////////////////////
    22 
    23 #if !defined(OPENNURBS_VIEWPORT_INC_)
    24 #define OPENNURBS_VIEWPORT_INC_
    25 
    26 ///////////////////////////////////////////////////////////////////////////////
    27 // Class ON_Viewport
    28 //
    29 // This object represents a viewing frustum
    30 ///////////////////////////////////////////////////////////////////////////////
    31 class ON_CLASS ON_Viewport : public ON_Geometry
    32 {
    33  ON_OBJECT_DECLARE( ON_Viewport );
    34 public:
    35 
    36  static const double DefaultNearDist; // 0.005
    37  static const double DefaultFarDist; // 1000.0
    38  static const double DefaultMinNearDist; // 0.0001
    39  static const double DefaultMinNearOverFar; // 0.0001
    40 
    41  static const ON_3dPoint DefaultCameraLocation; // (0.0,0.0,100.0)
    42  static const ON_3dVector Default3dCameraDirection; // (-0.43301270189221932338186158537647,0.75,-0.5)
    43 
    44  /*
    45  Description:
    46  A Y-up parallel projection looking at the origin of the XYplane.
    47  up = ON_3dVector::Yaxis,
    48  dir = -ON_3dVector::Zaxis
    49  */
    51 
    52  /*
    53  Description:
    54  A Z-up perspective projection looking down on the origin of the XY plane.
    55  up = ON_3dVector::Zaxis,
    56  dir = ON_3dVector:Default3dCameraDirection
    57  */
    59 
    60  // Construction
    61  // Default constructor creates a copy of ON_Viewport::DefaultTopViewYUp;
    62  ON_Viewport() = default;
    63  ~ON_Viewport() = default;
    64  ON_Viewport( const ON_Viewport& ) = default;
    65  ON_Viewport& operator=( const ON_Viewport& ) = default;
    66 
    67  /*
    68  Returns:
    69  A sha1 hash of all the settings that effect view projection matrices.
    70  view projection, camera location, camera X,Y,Z frame, frustum, port.
    71  If two ON_Viewport classes have identical values ViewProjectionContentHash(),
    72  then they will have identical view projection matrices and generate identical
    73  images from the same model content.
    74  */
    75  ON_SHA1_Hash ViewProjectionContentHash() const;
    76 
    77  /*
    78  Returns:
    79  candidate_point.IsValid()
    80  && candidate_point.MaximumCoordinate() < ON_NONSENSE_WORLD_COORDINATE_VALUE;
    81  */
    82  static bool IsValidCameraLocation(
    83  ON_3dPoint candidate_point
    84  );
    85 
    86  /*
    87  Returns:
    88  candidate_vector.IsValid()
    89  && candidate_vector.MaximumCoordinate() < ON_NONSENSE_WORLD_COORDINATE_VALUE
    90  && candidate_vector.MaximumCoordinate() > ON_ZERO_TOLERANCE
    91  ;
    92  */
    93  static bool IsValidCameraUpOrDirection(
    94  ON_3dVector candidate_vector
    95  );
    96 
    97  /*
    98  Returns:
    99  True if camera up, direction, X, Y, and Z are valid.
    100  */
    101  bool IsValidCameraFrame() const;
    102 
    103  /*
    104  Returns:
    105  True if camera location is valid and camera up, direction, X, Y, and Z are valid.
    106  */
    107  bool IsValidCamera() const;
    108 
    109  /*
    110  Returns:
    111  True if camera frustum is valid.
    112  */
    113  bool IsValidFrustum() const;
    114 
    115  // ON_Object overrides //////////////////////////////////////////////////////
    116  //
    117  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    118 
    119  // Description:
    120  // Dumps debugging text description to a text log.
    121  //
    122  // Parameters:
    123  // dump_target - [in] text log
    124  //
    125  // Remarks:
    126  // This overrides the virtual ON_Object::Dump() function.
    127  void Dump(
    128  ON_TextLog& // dump_target
    129  ) const override;
    130 
    131  // Description:
    132  // Writes ON_Viewport defintion from a binary archive.
    133  //
    134  // Parameters:
    135  // binary_archive - [in] open binary archive
    136  //
    137  // Returns:
    138  // true if successful.
    139  //
    140  // Remarks:
    141  // This overrides the virtual ON_Object::Write() function.
    142  bool Write(
    143  ON_BinaryArchive& // binary_archive
    144  ) const override;
    145 
    146 
    147  // Description:
    148  // Reads ON_Viewport defintion from a binary archive.
    149  //
    150  // Parameters:
    151  // binary_archive - [in] open binary archive
    152  //
    153  // Returns:
    154  // true if successful.
    155  //
    156  // Remarks:
    157  // This overrides the virtual ON_Object::Read() function.
    158  bool Read(
    159  ON_BinaryArchive& // binary_archive
    160  ) override;
    161 
    162 
    163  // ON_Geometry overrides //////////////////////////////////////////////////////
    164  //
    165 
    166  // Description:
    167  // The dimension of a camera view frustum is 3.
    168  //
    169  // Returns:
    170  // 3
    171  //
    172  // Remarks:
    173  // This is virtual ON_Geometry function.
    174  int Dimension() const override;
    175 
    176  // virtual ON_Geometry GetBBox override
    177  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    178 
    179  // Description:
    180  // Transforms the view camera location, direction, and up.
    181  //
    182  // Parameters:
    183  // xform - [in] transformation to apply to camera.
    184  //
    185  // Returns:
    186  // @untitled table
    187  // true Valid camera was transformed.
    188  // false Invalid camera, frustum, or transformation.
    189  //
    190  // Remarks:
    191  // This overrides the virtual ON_Geometry::Transform() function.
    192  bool Transform(
    193  const ON_Xform& // xform
    194  ) override;
    195 
    196  // Interface /////////////////////////////////////////////////////////////////
    197  //
    198 
    199  /*
    200  */
    201  ON_DEPRECATED_MSG("Use = ON_Viewport::DefaultTopViewYUp")
    202  void Initialize();
    203 
    204  ON::view_projection Projection() const;
    205 
    206  /*
    207  Description:
    208  Unconditionally set the projection.
    209  Parameters:
    210  projection - [in]
    211  See Also:
    212  ON_Viewport::SetParallelProjection
    213  ON_Viewport::SetPerpectiveProjection
    214  ON_Viewport::SetTwoPointPerspectiveProjection
    215  */
    216  bool SetProjection( ON::view_projection projection );
    217 
    218  /*
    219  Description:
    220  Use this function to change projections of valid viewports
    221  from persective to parallel. It will make common additional
    222  adjustments to the frustum so the resulting views are similar.
    223  The camera location and direction will not be changed.
    224  Parameters:
    225  bSymmetricFrustum - [in]
    226  True if you want the resulting frustum to be symmetric.
    227  Remarks:
    228  If the current projection is parallel and bSymmetricFrustum,
    229  FrustumIsLeftRightSymmetric() and FrustumIsTopBottomSymmetric()
    230  are all equal, then no changes are made and true is returned.
    231  */
    232  bool ChangeToParallelProjection( bool bSymmetricFrustum );
    233 
    234  /*
    235  Description:
    236  Use this function to change projections of valid viewports
    237  from parallel to perspective. It will make common additional
    238  adjustments to the frustum and camera location so the resulting
    239  views are similar. The camera direction and target point are
    240  not be changed.
    241  Parameters:
    242  target_distance - [in]
    243  If ON_UNSET_VALUE this parameter is ignored. Otherwise
    244  it must be > 0 and indicates which plane in the current
    245  view frustum should be perserved.
    246  bSymmetricFrustum - [in]
    247  True if you want the resulting frustum to be symmetric.
    248  lens_length - [in] (pass 50.0 when in doubt)
    249  35 mm lens length to use when changing from parallel
    250  to perspective projections. If the current projection
    251  is perspective or lens_length is <= 0.0,
    252  then this parameter is ignored.
    253  Remarks:
    254  If the current projection is perspective and bSymmetricFrustum,
    255  FrustumIsLeftRightSymmetric() and FrustumIsTopBottomSymmetric()
    256  are all equal, then no changes are made and true is returned.
    257  */
    258  bool ChangeToPerspectiveProjection(
    259  double target_distance,
    260  bool bSymmetricFrustum,
    261  double lens_length
    262  );
    263 
    264  /*
    265  Description:
    266  Use this function to change projections of valid viewports
    267  to a two point perspective. It will make common additional
    268  adjustments to the frustum and camera location and direction
    269  so the resulting views are similar.
    270  Parameters:
    271  target_distance - [in]
    272  If ON_UNSET_VALUE this parameter is ignored. Otherwise
    273  it must be > 0 and indicates which plane in the current
    274  view frustum should be perserved.
    275  up - [in]
    276  This direction will be the locked up direction. Pass
    277  ON_3dVector::ZeroVector if you want to use the world axis
    278  direction that is closest to the current up direction.
    279  Pass CameraY() if you want to preserve the current up direction.
    280  lens_length - [in] (pass 50.0 when in doubt)
    281  35 mm lens length to use when changing from parallel
    282  to perspective projections. If the current projection
    283  is perspective or lens_length is <= 0.0,
    284  then this parameter is ignored.
    285  Remarks:
    286  If the current projection is perspective and
    287  FrustumIsLeftRightSymmetric() is true and
    288  FrustumIsTopBottomSymmetric() is false, then no changes are
    289  made and true is returned.
    290  */
    291  bool ChangeToTwoPointPerspectiveProjection(
    292  double target_distance,
    293  ON_3dVector up,
    294  double lens_length
    295  );
    296 
    297  /*
    298  Returns:
    299  True if the projection is ON::perspective_view.
    300  */
    301  bool IsPerspectiveProjection() const;
    302 
    303  /*
    304  Returns
    305  IsPerspectiveProjection()
    306  && CameraUpIsLocked()
    307  && FrustumIsLeftRightSymmetric
    308  && !FrustumIsTopBottomSymmetric
    309  */
    310  bool IsTwoPointPerspectiveProjection() const;
    311 
    312  /*
    313  Returns:
    314  True if the projection is ON::parallel_view.
    315  */
    316  bool IsParallelProjection() const;
    317 
    318  // These return true if the current direction and up are not zero and not
    319  // parallel so the camera position is well defined.
    320  bool SetCameraLocation( const ON_3dPoint& );
    321  bool SetCameraDirection( const ON_3dVector& );
    322  bool SetCameraUp( const ON_3dVector& );
    323 
    324  ON_3dPoint CameraLocation() const;
    325  ON_3dVector CameraDirection() const;
    326  ON_3dVector CameraUp() const;
    327 
    328  /*
    329  Description:
    330  Copy camera location, up, direction and frame from source_viewport.
    331  Parameters:
    332  source_viewport - [in]
    333  camera location to copy
    334  bBreakLocks - [in]
    335  If true, any locked frustum settings will be unlocked.
    336  */
    337  bool SetCamera(
    338  const ON_Viewport& source_viewport,
    339  bool bBreakLocks
    340  );
    341 
    342  bool CameraLocationIsLocked() const;
    343  bool CameraDirectionIsLocked() const;
    344  bool CameraUpIsLocked() const;
    345  bool FrustumIsLeftRightSymmetric() const;
    346  bool FrustumIsTopBottomSymmetric() const;
    347 
    348  void SetCameraLocationLock( bool bLockCameraLocation );
    349  void SetCameraDirectionLock( bool bLockCameraDirection ) ;
    350  void SetCameraUpLock( bool bLockCameraUp );
    351  void SetFrustumLeftRightSymmetry( bool bForceLeftRightSymmetry );
    352  void SetFrustumTopBottomSymmetry( bool bForceTopBottomSymmetry );
    353  void UnlockCamera(); // sets all camera locks to false
    354  void UnlockFrustumSymmetry(); // sets all frustum symmetry locks to false
    355 
    356  // returns true if current camera orientation is valid
    357  bool GetCameraFrame(
    358  double*, // CameraLocation[3]
    359  double*, // CameraX[3]
    360  double*, // CameraY[3]
    361  double* // CameraZ[3]
    362  ) const;
    363 
    364  // these do not check for a valid camera orientation
    365  ON_3dVector CameraX() const; // unit to right vector
    366  ON_3dVector CameraY() const; // unit up vector
    367  ON_3dVector CameraZ() const; // unit vector in -CameraDirection
    368 
    369 
    370  bool IsCameraFrameWorldPlan(
    371  // Returns true if the camera direction = some world axis.
    372  // The indices report which axes are used. For a "twisted"
    373  // plan view it is possible to have zero x and y indices.
    374  // This function returns true if and only if the "z" index
    375  // is non-zero.
    376  //
    377  // Indices are +/-1 = world +/-x, +/-2 = world +/-y, +/-3 = world +/-z,
    378  int*, // if true and plan is axis aligned, view x index, else 0
    379  int*, // if true and plan is axis aligned, view y index, else 0
    380  int* // if true, view z index, else 0
    381  );
    382 
    383  bool GetCameraExtents(
    384  // returns bounding box in camera coordinates - this is useful information
    385  // for setting view frustrums to include the point list
    386  int, // count = number of 3d points
    387  int, // stride = number of doubles to skip between points (>=3)
    388  const double*, // 3d points in world coordinates
    389  ON_BoundingBox& cambbox, // bounding box in camera coordinates
    390  int bGrowBox = false // set to true if you want to enlarge an existing camera coordinate box
    391  ) const;
    392 
    393  bool GetCameraExtents(
    394  // returns bounding box in camera coordinates - this is useful information
    395  // for setting view frustrums to include the point list
    396  const ON_BoundingBox&, // world coordinate bounding box
    397  ON_BoundingBox& cambbox, // bounding box in camera coordinates
    398  int bGrowBox = false // set to true if you want to enlarge an existing camera coordinate box
    399  ) const;
    400 
    401  bool GetCameraExtents(
    402  // returns bounding box in camera coordinates - this is useful information
    403  // for setting view frustrums to include the point list
    404  ON_3dPoint&, // world coordinate bounding sphere center
    405  double, // world coordinate bounding sphere radius
    406  ON_BoundingBox& cambox, // bounding box in camera coordinates
    407  int bGrowBox = false // set to true if you want to enlarge an existing camera coordinate box
    408  ) const;
    409 
    410  /*
    411  Description:
    412  Set the view frustum. If FrustumSymmetryIsLocked() is true
    413  and left != -right or bottom != -top, then they will be
    414  adjusted so the resulting frustum is symmetric.
    415  */
    416  bool SetFrustum(
    417  double left, //
    418  double right, // ( left < right )
    419  double bottom, //
    420  double top, // ( bottom < top )
    421  double near_dist, //
    422  double far_dist // ( 0 < near_dist < far_dist ) // ignored by Rhino version 1.0
    423  );
    424  bool GetFrustum(
    425  double* left, //
    426  double* right, // (left < right)
    427  double* bottom, //
    428  double* top, // (bottom < top)
    429  double* near_dist = nullptr, //
    430  double* far_dist = nullptr // (0 < near_dist < far_dist)
    431  ) const;
    432 
    433 
    434  /*
    435  Description:
    436  Copy frustum information from source_viewport.
    437  Parameters:
    438  source_viewport - [in]
    439  bBreakLocks - [in]
    440  If true, any locked frustum settings will be unlocked.
    441  */
    442  bool SetFrustum(
    443  const ON_Viewport& source_viewport,
    444  bool bBreakLocks
    445  );
    446 
    447 
    448  // SetFrustumAspect() changes the larger of the frustum's widht/height
    449  // so that the resulting value of width/height matches the requested
    450  // aspect. The camera angle is not changed. If you change the shape
    451  // of the view port with a call SetScreenPort(), then you generally
    452  // want to call SetFrustumAspect() with the value returned by
    453  // GetScreenPortAspect().
    454  bool SetFrustumAspect( double );
    455 
    456  // Returns frustum's width/height
    457  bool GetFrustumAspect( double& ) const;
    458 
    459  // Returns world coordinates of frustum's center
    460  bool GetFrustumCenter( double* ) const;
    461 
    462  // The near clipping plane stored in the Rhino 1.0 file is frequently very
    463  // small and useless for high quality z-buffer based rendering. The far
    464  // clipping value is not stored in the file. Use these functions to set
    465  // the frustum's near and far clipping planes to appropriate values.
    466  double FrustumLeft() const;
    467  double FrustumRight() const;
    468  double FrustumBottom() const;
    469  double FrustumTop() const;
    470  double FrustumNear() const;
    471  double FrustumFar() const;
    472 
    473  /*
    474  Returns:
    475  frustum right - frustum left
    476  */
    477  double FrustumWidth() const; // right - left
    478 
    479  /*
    480  Returns:
    481  frustum right - frustum left
    482  */
    483  double FrustumHeight() const; // top - bottom
    484 
    485  /*
    486  Returns:
    487  Minimum of fabs(FrustumWidth()) and fabs(FrustumHeight())
    488  */
    489  double FrustumMinimumDiameter() const;
    490 
    491  /*
    492  Returns:
    493  Maximum of fabs(FrustumWidth()) and fabs(FrustumHeight())
    494  */
    495  double FrustumMaximumDiameter() const;
    496 
    497 
    498  bool SetFrustumNearFar(
    499  const double* bboxmin, // 3d bounding box min
    500  const double* bboxmax // 3d bounding box max
    501  );
    502  bool SetFrustumNearFar(
    503  const double* center, // 3d bounding sphere center
    504  double radius // 3d bounding sphere radius
    505  );
    506  bool SetFrustumNearFar(
    507  double near_dist, // ( > 0 )
    508  double far_dist //
    509  );
    510 
    511  /*
    512  Description:
    513  If needed, adjust the current frustum so it has the
    514  specified symmetries and adjust the camera location
    515  so the target plane remains visible.
    516  Parameters:
    517  bLeftRightSymmetric - [in]
    518  If true, the frustum will be adjusted so left = -right.
    519  bTopBottomSymmetric - [in]
    520  If true, the frustum will be adjusted so top = -bottom.
    521  target_distance - [in]
    522  If projection is not perspective or target_distance
    523  is ON_UNSET_VALUE, this this parameter is ignored.
    524  If the projection is perspective and target_distance
    525  is not ON_UNSET_VALUE, then it must be > 0.0 and
    526  it is used to determine which plane in the old
    527  frustum will appear unchanged in the new frustum.
    528  bool
    529  Returns true if the returned viewport has a frustum
    530  with the specified symmetries.
    531  */
    532  bool ChangeToSymmetricFrustum(
    533  bool bLeftRightSymmetric,
    534  bool bTopBottomSymmetric,
    535  double target_distance
    536  );
    537 
    538  /*
    539  Description:
    540  Get near and far clipping distances of a point
    541  Parameters:
    542  point - [in]
    543  near_dist - [out]
    544  near distance of the point (can be < 0)
    545  far_dist - [out]
    546  far distance of the point (can be equal to near_dist)
    547  bGrowNearFar - [in]
    548  If true and input values of near_dist and far_dist
    549  are not ON_UNSET_VALUE, the near_dist and far_dist
    550  are enlarged to include bbox.
    551  Returns:
    552  True if the point is ing the view frustum and
    553  near_dist/far_dist were set.
    554  False if the bounding box does not intesect the
    555  view frustum.
    556  */
    557  bool GetPointDepth(
    558  ON_3dPoint point,
    559  double* near_dist,
    560  double* far_dist,
    561  bool bGrowNearFar=false
    562  ) const;
    563 
    564  /*
    565  Description:
    566  Get the view plane depth of a point
    567  Parameters:
    568  point - [in]
    569  view_plane_depth - [out]
    570  positive values are in front of the camera and negative
    571  values are behind the camera.
    572  If 0 <= point_depth < FrustumNear(), the point's view
    573  plane is between the camera and the frustum's near plane.
    574  If point_depth > FrustumFar(), the point's view
    575  plane is farther from the camera and the frustum's far plane.
    576  Returns:
    577  True if the point is ing the view frustum and
    578  near_dist/far_dist were set.
    579  False if the bounding box does not intesect the
    580  view frustum.
    581  */
    582  bool GetPointDepth(
    583  ON_3dPoint point,
    584  double* view_plane_depth
    585  ) const;
    586 
    587  /*
    588  Description:
    589  Get near and far clipping distances of a bounding box.
    590  Parameters:
    591  bbox - [in]
    592  bounding box
    593  near_dist - [out]
    594  near distance of the box
    595  This value can be zero or negative when the camera
    596  location is inside bbox.
    597  far_dist - [out]
    598  far distance of the box
    599  This value can be equal to near_dist, zero or negative
    600  when the camera location is in front of the bounding box.
    601  bGrowNearFar - [in]
    602  If true and input values of near_dist and far_dist
    603  are not ON_UNSET_VALUE, the near_dist and far_dist
    604  are enlarged to include bbox.
    605  Returns:
    606  True if the bounding box intersects the view frustum and
    607  near_dist/far_dist were set.
    608  False if the bounding box does not intesect the view frustum.
    609  Remarks:
    610  This function ignores the current value of the viewport's
    611  near and far settings. If the viewport is a perspective
    612  projection, the it intersects the semi infinite frustum
    613  volume with the bounding box and returns the near and far
    614  distances of the intersection. If the viewport is a parallel
    615  projection, it instersects the infinte view region with the
    616  bounding box and returns the near and far distances of the
    617  projection.
    618  */
    619  bool GetBoundingBoxDepth(
    620  ON_BoundingBox bbox,
    621  double* near_dist,
    622  double* far_dist,
    623  bool bGrowNearFar=false
    624  ) const;
    625 
    626  /*
    627  Description:
    628  Get near and far clipping distances of a bounding box.
    629  Parameters:
    630  bbox - [in]
    631  bounding box
    632  bbox_xform - [in]
    633  If not nullptr, this transformation to applied to the corners of bbox.
    634  It should have positive determinant for the results to be meaningful.
    635  Typically bbox_xform is used to pass an instance reference transformation.
    636  near_dist - [out]
    637  near distance of the box
    638  This value can be zero or negative when the camera
    639  location is inside bbox.
    640  far_dist - [out]
    641  far distance of the box
    642  This value can be equal to near_dist, zero or negative
    643  when the camera location is in front of the bounding box.
    644  bGrowNearFar - [in]
    645  If true and input values of near_dist and far_dist
    646  are not ON_UNSET_VALUE, the near_dist and far_dist
    647  are enlarged to include bbox.
    648  Returns:
    649  0: The bounding box does not intersectthe view frustum.
    650  1: A proper subset of the bounding box is inside the view frustum
    651  and near_dist/far_dist were set.
    652  2: The entire bounding box is inside the view frustum
    653  and near_dist/far_dist were set.
    654  Remarks:
    655  This function ignores the current value of the viewport's
    656  near and far settings. If the viewport is a perspective
    657  projection, the it intersects the semi infinite frustum
    658  volume with the bounding box and returns the near and far
    659  distances of the intersection. If the viewport is a parallel
    660  projection, it instersects the infinte view region with the
    661  bounding box and returns the near and far distances of the
    662  projection.
    663  */
    664  int GetBoundingBoxDepth(
    665  ON_BoundingBox bbox,
    666  const ON_Xform* bbox_xform,
    667  double* near_dist,
    668  double* far_dist,
    669  bool bGrowNearFar
    670  ) const;
    671 
    672  /*
    673  Description:
    674  Get the normalized extents of the smallest rectangle that
    675  contains the intersection of bbox and the view's frustum.
    676  Parameters:
    677  bbox - [in]
    678  bounding box
    679  x_extents - [out]
    680  y_extents - [out]
    681  0 <= x_extents[0] <= x_extents[1] <= 1.0
    682  0 <= y_extents[0] <= y_extents[1] <= 1.0
    683  If true is returned, then intersection of the bbox
    684  and the view's frustum is not empty and the bounding
    685  rectangle of the projection of the intersection set
    686  is returned in x_range and y_range. The returned values
    687  are normalized image extents. For example, if
    688  x_extents[0] = 0.0, x_extents[1] = 0.25, y_extents[0] = 0.75
    689  and y_extents[1] = 1.0, then the portion of bbox in the
    690  view's frustum would project to the upper left corner
    691  of the image.
    692  Returns:
    693  True if the bounding box intersects the view frustum and
    694  x_range and y_range were set.
    695  False if the bounding box does not intersect the view
    696  frustum.
    697  Remarks:
    698  This function takes the viewport's near and far settings
    699  into account. Set them to something appropriate before
    700  calling this function.
    701  */
    702  bool GetBoundingBoxProjectionExtents(
    703  ON_BoundingBox bbox,
    704  ON_Interval& x_extents,
    705  ON_Interval& y_extents
    706  ) const;
    707 
    708  /*
    709  Description:
    710  Get near and far clipping distances of a bounding sphere.
    711  Parameters:
    712  sphere - [in]
    713  bounding sphere
    714  near_dist - [out]
    715  near distance of the sphere (can be < 0)
    716  far_dist - [out]
    717  far distance of the sphere (can be equal to near_dist)
    718  bGrowNearFar - [in]
    719  If true and input values of near_dist and far_dist
    720  are not ON_UNSET_VALUE, the near_dist and far_dist
    721  are enlarged to include bbox.
    722  Returns:
    723  True if the sphere intersects the view frustum and
    724  near_dist/far_dist were set.
    725  False if the sphere does not intesect the view frustum.
    726  */
    727  bool GetSphereDepth(
    728  ON_Sphere sphere,
    729  double* near_dist,
    730  double* far_dist,
    731  bool bGrowNearFar=false
    732  ) const;
    733 
    734  /*
    735  Description:
    736  Set near and far clipping distance subject to constraints.
    737  Parameters:
    738  near_dist - [in] (>0) desired near clipping distance
    739  far_dist - [in] (>near_dist) desired near clipping distance
    740  min_near_dist - [in]
    741  If min_near_dist <= 0.0, it is ignored.
    742  If min_near_dist > 0 and near_dist < min_near_dist,
    743  then the frustum's near_dist will be increased to
    744  min_near_dist.
    745  min_near_over_far - [in]
    746  If min_near_over_far <= 0.0, it is ignored.
    747  If near_dist < far_dist*min_near_over_far, then
    748  near_dist is increased and/or far_dist is decreased
    749  so that near_dist = far_dist*min_near_over_far.
    750  If near_dist < target_dist < far_dist, then near_dist
    751  near_dist is increased and far_dist is decreased so that
    752  projection precision will be good at target_dist.
    753  Otherwise, near_dist is simply set to
    754  far_dist*min_near_over_far.
    755  target_dist - [in]
    756  If target_dist <= 0.0, it is ignored.
    757  If target_dist > 0, it is used as described in the
    758  description of the min_near_over_far parameter.
    759  relative_depth_bias - [in]
    760  If relative_depth_bias <= 0.0, it is ignored.
    761  If relative_depth_bias > 0, it is assumed that
    762  the requested near_dist and far_dist were calculated
    763  assuming no depth bias and the values will be
    764  appropriately adjusted to ensure the frustum's
    765  near and far clipping planes will not clip biased
    766  objects.
    767  */
    768  bool SetFrustumNearFar(
    769  double near_dist,
    770  double far_dist,
    771  double min_near_dist,
    772  double min_near_over_far,
    773  double target_dist
    774  );
    775 
    776  bool SetFrustumNearFar(
    777  double near_dist,
    778  double far_dist,
    779  double min_near_dist,
    780  double min_near_over_far,
    781  double target_dist,
    782  double relative_depth_bias
    783  );
    784 
    785  // Description:
    786  // Get near clipping plane.
    787  //
    788  // near_plane - [out] near clipping plane if camera and frustum
    789  // are valid. The plane's frame is the same as the camera's
    790  // frame. The origin is located at the intersection of the
    791  // camera direction ray and the near clipping plane. The plane's
    792  // normal points out of the frustum towards the camera
    793  // location.
    794  //
    795  // Returns:
    796  // true if camera and frustum are valid.
    797  bool GetNearPlane(
    798  ON_Plane& near_plane
    799  ) const;
    800 
    801  bool GetNearPlaneEquation(
    802  ON_PlaneEquation& near_plane_equation
    803  ) const;
    804 
    805  // Description:
    806  // Get far clipping plane.
    807  //
    808  // far_plane - [out] far clipping plane if camera and frustum
    809  // are valid. The plane's frame is the same as the camera's
    810  // frame. The origin is located at the intersection of the
    811  // camera direction ray and the far clipping plane. The plane's
    812  // normal points into the frustum towards the camera location.
    813  //
    814  // Returns:
    815  // true if camera and frustum are valid.
    816  bool GetFarPlane(
    817  ON_Plane& far_plane
    818  ) const;
    819 
    820  bool GetFarPlaneEquation(
    821  ON_PlaneEquation& far_plane_equation
    822  ) const;
    823 
    824  /*
    825  Description:
    826  Get the plane that is a specified distance from the camera.
    827  This plane is parallel to the frustum's near and far planes.
    828  Parameters:
    829  view_plane_depth - [in]
    830  The distance from the camera location to the view plane.
    831  Positive distances are in front of the camera and
    832  negative distances are behind the camera.
    833  A value of FrustumNear() will return the frustum's
    834  near plane and a valud of FrustumFar() will return
    835  the frustum's far plane.
    836  view_plane - [out]
    837  View plane
    838  view_plane_equation - [out]
    839  Equation of the view plane.
    840  Returns:
    841  True if the camera and frustum are valid and view_plane
    842  was calculated. False otherwise.
    843  */
    844  bool GetViewPlane(
    845  double view_plane_depth,
    846  ON_Plane& view_plane
    847  ) const;
    848 
    849  bool GetViewPlaneEquation(
    850  double view_plane_depth,
    851  ON_PlaneEquation& view_plane_equation
    852  ) const;
    853 
    854  /*
    855  Description:
    856  Get left world frustum clipping plane.
    857  Parameters:
    858  left_plane - [out]
    859  frustum left side clipping plane. The normal points
    860  into the visible region of the frustum. If the projection
    861  is perspective, the origin is at the camera location,
    862  otherwise the origin isthe point on the plane that is
    863  closest to the camera location.
    864  Returns:
    865  True if camera and frustum are valid and plane was set.
    866  */
    867  bool GetFrustumLeftPlane(
    868  ON_Plane& left_plane
    869  ) const;
    870 
    871  bool GetFrustumLeftPlaneEquation(
    872  ON_PlaneEquation& left_plane_equation
    873  ) const;
    874 
    875  /*
    876  Description:
    877  Get right world frustum clipping plane.
    878  Parameters:
    879  right_plane - [out]
    880  frustum right side clipping plane. The normal points
    881  into the visible region of the frustum. If the projection
    882  is perspective, the origin is at the camera location,
    883  otherwise the origin isthe point on the plane that is
    884  closest to the camera location.
    885  Returns:
    886  True if camera and frustum are valid and plane was set.
    887  */
    888  bool GetFrustumRightPlane(
    889  ON_Plane& right_plane
    890  ) const;
    891 
    892  bool GetFrustumRightPlaneEquation(
    893  ON_PlaneEquation& right_plane_equation
    894  ) const;
    895 
    896  /*
    897  Description:
    898  Get bottom world frustum clipping plane.
    899  Parameters:
    900  bottom_plane - [out]
    901  frustum bottom side clipping plane. The normal points
    902  into the visible region of the frustum. If the projection
    903  is perspective, the origin is at the camera location,
    904  otherwise the origin isthe point on the plane that is
    905  closest to the camera location.
    906  Returns:
    907  True if camera and frustum are valid and plane was set.
    908  */
    909  bool GetFrustumBottomPlane(
    910  ON_Plane& bottom_plane
    911  ) const;
    912 
    913  bool GetFrustumBottomPlaneEquation(
    914  ON_PlaneEquation& bottom_plane_equation
    915  ) const;
    916  /*
    917  Description:
    918  Get top world frustum clipping plane.
    919  Parameters:
    920  top_plane - [out]
    921  frustum top side clipping plane. The normal points
    922  into the visible region of the frustum. If the projection
    923  is perspective, the origin is at the camera location,
    924  otherwise the origin isthe point on the plane that is
    925  closest to the camera location.
    926  Returns:
    927  True if camera and frustum are valid and plane was set.
    928  */
    929  bool GetFrustumTopPlane(
    930  ON_Plane& top_plane
    931  ) const;
    932 
    933  bool GetFrustumTopPlaneEquation(
    934  ON_PlaneEquation& top_plane_equation
    935  ) const;
    936 
    937  // Description:
    938  // Get corners of near clipping plane rectangle.
    939  //
    940  // Parameters:
    941  // left_bottom - [out]
    942  // right_bottom - [out]
    943  // left_top - [out]
    944  // right_top - [out]
    945  //
    946  // Returns:
    947  // true if camera and frustum are valid.
    948  bool GetNearRect(
    949  ON_3dPoint& left_bottom,
    950  ON_3dPoint& right_bottom,
    951  ON_3dPoint& left_top,
    952  ON_3dPoint& right_top
    953  ) const;
    954 
    955  // Description:
    956  // Get corners of far clipping plane rectangle.
    957  //
    958  // Parameters:
    959  // left_bottom - [out]
    960  // right_bottom - [out]
    961  // left_top - [out]
    962  // right_top - [out]
    963  //
    964  // Returns:
    965  // true if camera and frustum are valid.
    966  bool GetFarRect(
    967  ON_3dPoint& left_bottom,
    968  ON_3dPoint& right_bottom,
    969  ON_3dPoint& left_top,
    970  ON_3dPoint& right_top
    971  ) const;
    972 
    973  /*
    974  Description:
    975  Get the world coordinate corners of the rectangle of
    976  a view plane that is a specified distance from the camera.
    977  This rectangle is parallel to the frustum's near and far planes.
    978  Parameters:
    979  view_plane_depth - [in]
    980  The distance from the camera location to the view plane.
    981  Positive distances are in front of the camera and
    982  negative distances are behind the camera.
    983  A value of FrustumNear() will return the frustum's
    984  near rectangle and a valud of FrustumFar() will return
    985  the frustum's far rectangle.
    986  left_bottom - [out]
    987  right_bottom - [out]
    988  left_top - [out]
    989  right_top - [out]
    990  Returns:
    991  True if the camera and frustum are valid and view_plane
    992  was calculated. False otherwise.
    993  */
    994  bool GetViewPlaneRect(
    995  double view_plane_depth,
    996  ON_3dPoint& left_bottom,
    997  ON_3dPoint& right_bottom,
    998  ON_3dPoint& left_top,
    999  ON_3dPoint& right_top
    1000  ) const;
    1001 
    1002 
    1003  /*
    1004  Description:
    1005  Location of viewport in pixels.
    1006  These are provided so you can set the port you are using
    1007  and get the appropriate transformations to and from
    1008  screen space.
    1009  Parameters:
    1010  port_left - [in]
    1011  port_right - [in] (port_left != port_right)
    1012  port_bottom - [in]
    1013  port_top - [in] (port_top != port_bottom)
    1014  port_near - [in]
    1015  port_far - [in]
    1016  Example:
    1017 
    1018  // For a Windows window
    1019  int width = width of window client area in pixels;
    1020  int height = height of window client area in pixels;
    1021  port_left = 0;
    1022  port_right = width;
    1023  port_top = 0;
    1024  port_bottom = height;
    1025  port_near = 0;
    1026  port_far = 1;
    1027  SetScreenPort( port_left, port_right,
    1028  port_bottom, port_top,
    1029  port_near, port_far );
    1030 
    1031  Returns:
    1032  true if input is valid.
    1033  See Also:
    1034  ON_Viewport::GetScreenPort
    1035  */
    1036  bool SetScreenPort(
    1037  int port_left,
    1038  int port_right,
    1039  int port_bottom,
    1040  int port_top,
    1041  int port_near = 0,
    1042  int port_far = 0
    1043  );
    1044 
    1045  bool GetScreenPort(
    1046  int* left,
    1047  int* right, //( port_left != port_right )
    1048  int* port_bottom,
    1049  int* port_top, //( port_bottom != port_top)
    1050  int* port_near=nullptr,
    1051  int* port_far=nullptr
    1052  ) const;
    1053 
    1054  /*
    1055  Returns:
    1056  std::abs(port_right - port_left)
    1057  */
    1058  int ScreenPortWidth() const;
    1059 
    1060  /*
    1061  Returns:
    1062  std::abs(port_bottom - port_top)
    1063  */
    1064  int ScreenPortHeight() const;
    1065 
    1066  ON_2iSize ScreenPortSize() const;
    1067 
    1068  bool GetScreenPortAspect( double& ) const; // port's |width/height|
    1069 
    1070  bool GetCameraAngle(
    1071  double* half_diagonal_angle, // 1/2 of diagonal subtended angle
    1072  double* half_vertical_angle, // 1/2 of vertical subtended angle
    1073  double* half_horizontal_angle // 1/2 of horizontal subtended angle
    1074  ) const;
    1075  bool GetCameraAngle(
    1076  double* half_smallest_angle // 1/2 of smallest subtended view angle
    1077  ) const;
    1078  bool SetCameraAngle(
    1079  double half_smallest_angle // 1/2 of smallest subtended view angle
    1080  // 0 < angle < pi/2
    1081  );
    1082 
    1083  // These functions assume the camera is horizontal and crop the
    1084  // film rather than the image when the aspect of the frustum
    1085  // is not 36/24. (35mm film is 36mm wide and 24mm high.)
    1086  //
    1087  // The SetCamera35mmLensLength() preserves camera location,
    1088  // changes the frustum, but maintains the frsutrum's aspect.
    1089  bool GetCamera35mmLensLength(
    1090  double* lens_length
    1091  ) const;
    1092  bool SetCamera35mmLensLength(
    1093  double lens_length
    1094  );
    1095 
    1096  // Same as GetCamera35mmLensLength() with "lens" misspelled.
    1097  bool GetCamera35mmLenseLength(
    1098  double* lens_length
    1099  ) const;
    1100 
    1101  // Same as SetCamera35mmLensLength() with "lens" misspelled.
    1102  bool SetCamera35mmLenseLength(
    1103  double lens_length
    1104  );
    1105 
    1106  bool GetXform(
    1107  ON::coordinate_system srcCS,
    1108  ON::coordinate_system destCS,
    1109  ON_Xform& matrix // 4x4 transformation matrix (acts on the left)
    1110  ) const;
    1111 
    1112  /*
    1113  Description:
    1114  Get the world coordinate line in the view frustum
    1115  that projects to a point on the screen.
    1116  Parameters:
    1117  screenx - [in]
    1118  screeny - [in] (screenx,screeny) = screen location
    1119  world_line - [out] 3d world coordinate line segment
    1120  starting on the near clipping plane and ending
    1121  on the far clipping plane.
    1122  Returns:
    1123  true if successful.
    1124  false if view projection or frustum is invalid.
    1125  */
    1126  bool GetFrustumLine(
    1127  double screenx,
    1128  double screeny,
    1129  ON_Line& world_line
    1130  ) const;
    1131 
    1132  // display tools
    1133 
    1134  /*
    1135  Description:
    1136  Get the number of horizontal pixels per world unit at the
    1137  location in screen space where world_point would be rendered.
    1138  Parameters:
    1139  world_point - [in] (ignored for parallel projection viewports)
    1140  world location
    1141  frustum_depth - [in] (ignored for parallel projection viewports)
    1142  If the viewport has a perspective projection, then this parameter
    1143  specifies the depth in the view frustum where the scale is calculated.
    1144  If frustum_depth is not > 0.0, then FrustumNear() is used.
    1145  pixels_per_unit - [out]
    1146  number of horizontal screen pixels per world unit at the location
    1147  in screen space where world_point would be rendered.
    1148  If the viewport is not valid, then 0.0 is returned.
    1149  Returns:
    1150  true: success.
    1151  false: The view projection or frustum is invalid.
    1152  */
    1153  bool GetWorldToScreenScale(
    1154  ON_3dPoint world_point,
    1155  double* pixels_per_unit
    1156  ) const;
    1157 
    1158  /*
    1159  Description:
    1160  Get the number of horizontal pixels per world unit at the
    1161  location in screen space where world_point would be rendered.
    1162  Parameters:
    1163  frustum_depth - [in] (ignored for parallel projection viewports)
    1164  If the viewport has a perspective projection, then this parameter
    1165  specifies the depth in the view frustum where the scale is calculated.
    1166  If frustum_depth is not > 0.0, then FrustumNear() is used.
    1167  pixels_per_unit - [out]
    1168  number of horizontal screen pixels per world unit at the location
    1169  in screen space where frustum_depth would be rendered.
    1170  If the viewport is not valid, then 0.0 is returned.
    1171  Returns:
    1172  true: success.
    1173  false: The view projection or frustum is invalid.
    1174  */
    1175  bool GetWorldToScreenScale(
    1176  double frustum_depth,
    1177  double* pixels_per_unit
    1178  ) const;
    1179 
    1180  bool GetCoordinateSprite(
    1181  int, // size in pixels of coordinate sprite axes
    1182  int, int, // screen (x,y) for sprite origin
    1183  int[3], // returns depth order for axes
    1184  double [3][2] // screen coords for axes ends
    1185  ) const;
    1186 
    1187  // Use Extents() as a quick way to set a viewport to so that bounding
    1188  // volume is inside of a viewports frusmtrum.
    1189  // The view angle is used to determine the position of the camera.
    1190  bool Extents(
    1191  double half_view_angle, // 1/2 smallest subtended view angle
    1192  // (0 < angle < pi/2)
    1193  const ON_BoundingBox& world_bbox// 3d world coordinate bounding box
    1194  );
    1195  bool Extents(
    1196  double half_view_angle, // 1/2 smallest subtended view angle
    1197  // (0 < angle < pi/2)
    1198  const ON_3dPoint& center, // 3d world coordinate bounding sphere center
    1199  double radius // 3d sphere radius
    1200  );
    1201 
    1202  ////////////////////////////////////////////////////////////////////////
    1203  // View changing from screen input points. Handy for
    1204  // using a mouse to manipulate a view.
    1205  //
    1206 
    1207  //////////
    1208  // ZoomToScreenRect() may change camera and frustum settings
    1209  bool ZoomToScreenRect(
    1210  int screen_x0,
    1211  int screen_y0, // (x,y) screen coords of a rectangle corner
    1212  int screen_x1,
    1213  int screen_y1 // (x,y) screen coords of opposite rectangle corner
    1214  );
    1215 
    1216  //////////
    1217  // DollyCamera() does not update the frustum's clipping planes.
    1218  // To update the frustum's clipping planes call DollyFrustum(d)
    1219  // with d = dollyVector o cameraFrameZ. To convert screen locations
    1220  // into a dolly vector, use GetDollyCameraVector().
    1221  bool DollyCamera( // Does not update frustum. To update frustum use
    1222  // DollyFrustum(d) with d = dollyVector o cameraFrameZ
    1223  const ON_3dVector& dolly_vector // dolly vector in world coordinates
    1224  );
    1225 
    1226  //////////
    1227  // Gets a world coordinate dolly vector that can be passed to
    1228  // DollyCamera().
    1229  bool GetDollyCameraVector(
    1230  int screen_x0,
    1231  int screen_y0, // (x,y) screen coords of start point
    1232  int screen_x1,
    1233  int screen_y1, // (x,y) screen coords of end point
    1234  double proj_plane_dist, // distance of projection plane from camera.
    1235  // When in doubt, use 0.5*(frus_near+frus_far).
    1236  ON_3dVector& dolly_vector // world coordinate dolly vector returned here
    1237  ) const;
    1238 
    1239  //////////
    1240  // Moves frustum's clipping planes
    1241  bool DollyFrustum(
    1242  double dolly_distance // distance to move in camera direction
    1243  );
    1244 
    1245  /*
    1246  Description:
    1247  Apply scaling factors to parallel projection clipping coordinates
    1248  by setting the m_clip_mod transformation.
    1249  Parameters:
    1250  x - [in] x > 0
    1251  y - [in] y > 0
    1252  Example:
    1253  If you want to compress the view projection across the viewing
    1254  plane, then set x = 0.5, y = 1.0, and z = 1.0.
    1255  Returns:
    1256  True if successful.
    1257  False if input is invalid or the view is a perspective view.
    1258  */
    1259  bool SetViewScale( double x, double y );
    1260  void GetViewScale( double* x, double* y ) const;
    1261 
    1262  /*
    1263  Description:
    1264  Gets the m_clip_mod transformation;
    1265  Returns:
    1266  value of the m_clip_mod transformation.
    1267  */
    1268  ON_Xform ClipModXform() const;
    1269 
    1270  /*
    1271  Description:
    1272  Gets the m_clip_mod_inverse transformation;
    1273  Returns:
    1274  value of the m_clip_mod_inverse transformation.
    1275  */
    1276  ON_Xform ClipModInverseXform() const;
    1277 
    1278  /*
    1279  Returns:
    1280  True if clip mod xform is identity.
    1281  */
    1282  bool ClipModXformIsIdentity() const;
    1283 
    1284  /*
    1285  Description:
    1286  Return a point on the central axis of the view frustum.
    1287  This point is a good choice for a general purpose target point.
    1288  Parameters:
    1289  target_distance - [in]
    1290  If target_distance > 0.0, then the distance from the returned
    1291  point to the camera plane will be target_distance. Note that
    1292  if the frustum is not symmetric, the distance from the
    1293  returned point to the camera location will be larger than
    1294  target_distanct.
    1295  If target_distance == ON_UNSET_VALUE and the frustum
    1296  is valid with near > 0.0, then 0.5*(near + far) will be used
    1297  as the target_distance.
    1298  Returns:
    1299  A point on the frustum's central axis. If the viewport or input
    1300  is not valid, then ON_3dPoint::UnsetPoint is returned.
    1301  */
    1302  ON_3dPoint FrustumCenterPoint( double target_distance ) const;
    1303 
    1304  /*
    1305  Returns:
    1306  The current value of the target point. This point does not play
    1307  a role in the view projection calculations. It can be used as a
    1308  fixed point when changing the camera so the visible regions of the
    1309  before and after frustums both contain the region of interest.
    1310  Remarks:
    1311  The default constructor sets this point on ON_3dPoint::UnsetPoint.
    1312  You must explicitly call one SetTargetPoint() functions to set
    1313  the target point.
    1314  */
    1315  ON_3dPoint TargetPoint() const;
    1316 
    1317  /*
    1318  Description:
    1319  Set the target point.
    1320  Parameters:
    1321  target_point - [in]
    1322  When in doubt, the point returned by FrustumCenterPoint(ON_UNSET_VALUE)
    1323  is a good choice.
    1324  Remarks:
    1325  The default constructor sets this point on ON_3dPoint::UnsetPoint.
    1326  You must explicitly call one SetTargetPoint() functions to set
    1327  the target point.
    1328  */
    1329  bool SetTargetPoint( ON_3dPoint target_point );
    1330 
    1331  /*
    1332  Description:
    1333  Get the distance from the target point to the camera plane.
    1334  Note that if the frustum is not symmetric, then this distance
    1335  is shorter than the distance from the target to the camera location.
    1336  Parameters:
    1337  bUseFrustumCenterFallback - [in]
    1338  If bUseFrustumCenterFallback is false and the target point is
    1339  not valid, then ON_UNSET_VALUE is returned.
    1340  If bUseFrustumCenterFallback is true and the frustum is valid
    1341  and current target point is not valid or is behind the camera,
    1342  then 0.5*(near + far) is returned.
    1343  Returns:
    1344  Shortest signed distance from camera plane to target point.
    1345  If the target point is on the visible side of the camera,
    1346  a positive value is returned. ON_UNSET_VALUE is returned
    1347  when the input of view is not valid.
    1348  */
    1349  double TargetDistance( bool bUseFrustumCenterFallback ) const;
    1350 
    1351  /*
    1352  Description:
    1353  Get suggested values for setting the perspective minimum
    1354  near distance and minimum near/far ratio.
    1355  Parameters:
    1356  camera_location - [in]
    1357  depth_buffer_bit_depth - [in]
    1358  typically 32, 24, 16 or 8, but any positive value can be
    1359  passed in.
    1360  min_near_dist - [out]
    1361  Suggest value for passing to SetPerspectiveMinNearDist().
    1362  min_near_over_far - [out]
    1363  Suggest value for passing to SetPerspectiveMinNearOverFar().
    1364  */
    1365  static void GetPerspectiveClippingPlaneConstraints(
    1366  ON_3dPoint camera_location,
    1367  unsigned int depth_buffer_bit_depth,
    1368  double* min_near_dist,
    1369  double* min_near_over_far
    1370  );
    1371 
    1372  /*
    1373  Description:
    1374  Calculate the value to add to homogeneous "z" clipping coordinate
    1375  that corresponds to moving the corresponding euclidean camera
    1376  coordinate by relative_depth_bias*(far - near).
    1377  Parameters:
    1378  relative_depth_bias - [in]
    1379  signed relative bias.
    1380  = 0: no bias,
    1381  > 0: bias towards frustum's near clipping plane
    1382  < 0: bias towards frustum's far clipping plane
    1383  When you have curves and points that are "on" shaded objects,
    1384  values around 1/256 work well to move the wire objects
    1385  in front of or behind shaded objects.
    1386  clip_z [-in]
    1387  clip_w [-in]
    1388  clip_z and clip_w are the homogeneous "w" and "w" coordinates
    1389  of a homogeneous clipping coordinate point.
    1390  Returns:
    1391  The clipping coordinate depth bias to add to the z-clipping
    1392  coordinate that corresponds to adding cam_depth_bias
    1393  to the z camera coordinate.
    1394  Remarks:
    1395  For perspective views, this bias is largest in the vicinity
    1396  of the frustum's near clipping plane and smallest in the
    1397  vicinity of the frustum's far clipping plane.
    1398  For orthographic projectsions, this bias is constant.
    1399  */
    1400  double ClipCoordDepthBias(
    1401  double relative_depth_bias,
    1402  double clip_z,
    1403  double clip_w
    1404  ) const;
    1405 
    1406  /*
    1407  Description:
    1408  Calculate a transformation to apply to clipping coordinates to
    1409  bias their depth.
    1410 
    1411  Parameters:
    1412  relative_depth_bias - [in]
    1413  signed relative bias.
    1414  = 0: no bias,
    1415  > 0: bias towards frustum's near clipping plane
    1416  < 0: bias towards frustum's far clipping plane
    1417  When you have curves and points that are "on" shaded objects,
    1418  values around 1/512 work well to move the wire objects
    1419  in front of or behind shaded objects.
    1420 
    1421  clip_bias - [out]
    1422  clip_bias = cam2clip * delta * clip2cam,
    1423  where delta = 1 0 0 0
    1424  0 1 0 0
    1425  0 0 1 D
    1426  0 0 0 1
    1427  and D = relative_depth_bias*(far-near).
    1428 
    1429  Returns:
    1430  True if the function worked. False if the frustum settings
    1431  are not valild, in which cate the identity matrix is returned.
    1432 
    1433  Remarks:
    1434  The inverse of the transformations returned by
    1435  GetClipCoordDepthBiasXform(+r,...) is the transformation
    1436  returned by GetClipCoordDepthBiasXform(-r,...).
    1437  */
    1438  bool GetClipCoordDepthBiasXform(
    1439  double relative_depth_bias,
    1440  ON_Xform& clip_bias
    1441  ) const;
    1442 
    1443  /*
    1444  Description:
    1445  Set suggested the perspective minimum near distance and
    1446  minimum near/far ratio to the suggested values returned
    1447  by GetPerspectiveClippingPlaneConstraints().
    1448  Parameters:
    1449  depth_buffer_bit_depth - [in]
    1450  typically 32, 24, 16 or 8, but any positive value can be
    1451  passed in.
    1452  */
    1453  void SetPerspectiveClippingPlaneConstraints(
    1454  unsigned int depth_buffer_bit_depth
    1455  );
    1456 
    1457  /*
    1458  Description:
    1459  Expert user function to control the minimum
    1460  ratio of near/far when perspective projections
    1461  are begin used.
    1462  Parameters:
    1463  min_near_over_far - [in]
    1464  Remarks:
    1465  This is a runtime setting and is not saved in 3dm files.
    1466  */
    1467  void SetPerspectiveMinNearOverFar(double min_near_over_far);
    1468 
    1469  /*
    1470  Description:
    1471  Expert user function to get the minimum runtime
    1472  value of near/far when perspective projections
    1473  are begin used.
    1474  Returns:
    1475  The minimum permitted value of near/far when perspective
    1476  projections are begin used.
    1477  Remarks:
    1478  This is a runtime setting and is not saved in 3dm files.
    1479  */
    1480  double PerspectiveMinNearOverFar() const;
    1481 
    1482  /*
    1483  Description:
    1484  Expert user function to control the minimum
    1485  value of near when perspective projections
    1486  are begin used.
    1487  Parameters:
    1488  min_near_dist - [in]
    1489  Remarks:
    1490  This is a runtime setting and is not saved in 3dm files.
    1491  */
    1492  void SetPerspectiveMinNearDist(double min_near_dist);
    1493 
    1494  /*
    1495  Description:
    1496  Expert user function to get the minimum
    1497  value of near when perspective projections
    1498  are begin used.
    1499  Returns:
    1500  The minimum permitted value of near when perspective
    1501  projections are begin used.
    1502  Remarks:
    1503  This is a runtime setting and is not saved in 3dm files.
    1504  */
    1505  double PerspectiveMinNearDist() const;
    1506 
    1507  /*
    1508  Description:
    1509  Sets the viewport's id to the value used to
    1510  uniquely identify this viewport.
    1511  Parameters:
    1512  viewport_id - [in]
    1513  Returns:
    1514  True if the viewport's id was successfully set
    1515  and false otherwise (ie. the viewport uuid has
    1516  already been set).
    1517  Remarks:
    1518  There is no approved way to change the viewport
    1519  id once it is set in order to maintain consistency
    1520  across multiple viewports and those routines that
    1521  manage them.
    1522  */
    1523  bool SetViewportId(const ON_UUID& viewport_id );
    1524 
    1525  ON_UUID ViewportId(void) const;
    1526 
    1527  /*
    1528  Description:
    1529  EXPERT USER function to change the viewport's id.
    1530  If you change the id, you risk damaging display
    1531  and visibility relationships in the model.
    1532  Parameters:
    1533  viewport_id - [in]
    1534  */
    1535  void ChangeViewportId(const ON_UUID& viewport_id);
    1536 
    1537 
    1538  /*
    1539  Description:
    1540  The "view frustum" is the frustum the m_xform transformation
    1541  maps to clipping coordinate box (-1,+1)^3. These functions
    1542  determine if some portion of the convex hull of the test points
    1543  is inside the view frustum.
    1544  Parameters:
    1545  P - [in] point
    1546  box - [in] bounding box
    1547  count - [in] number of points
    1548  p - [in] array of points
    1549  bEnableClippingPlanes - [in]
    1550  If true, then the additional clipping planes are tested.
    1551  If false, then the additional clipping planes are ignored.
    1552  Returns:
    1553  0 = No part of the of the convex hull of the tested points
    1554  is in the view frustum or the view camera and frustum
    1555  have not been set.
    1556  1 = A portion of the convex hull of the otested points may
    1557  be in the view frustum.
    1558  2 = The entire convex hull of the tested points is in the
    1559  view frustum.
    1560 
    1561  Remarks:
    1562  Each call to ON_Viewport::InViewFrustum() requires the calculation
    1563  of the world-to-clipping coordinates transformation. If multiple
    1564  queries are required, fewer computation resources will be used
    1565  if you set ON_ClippingRegion.m_xform to the viewport's world-to-
    1566  clipping coordinate transformation and then call the
    1567  ON_ClippingRegion::InViewFrustum() functions.
    1568  */
    1569  int InViewFrustum(
    1570  ON_3dPoint P
    1571  ) const;
    1572  int InViewFrustum(
    1573  const ON_BoundingBox& bbox
    1574  ) const;
    1575  int InViewFrustum(
    1576  int count,
    1577  const ON_3fPoint* p
    1578  ) const;
    1579  int InViewFrustum(
    1580  int count,
    1581  const ON_3dPoint* p
    1582  ) const;
    1583  int InViewFrustum(
    1584  int count,
    1585  const ON_4dPoint* p
    1586  ) const;
    1587 
    1588  /*
    1589  Description:
    1590  Determine if some portion of the transformed bounding box
    1591  is inside the view frustum.
    1592  Parameters:
    1593  bInfiniteFrustum - [in]
    1594  ignore the near and far clipping planes of the viewport.
    1595  bbox - [in]
    1596  bounding box
    1597  bbox_xform - [in]
    1598  If not nullptr, this transformation is applied to the bounding box.
    1599  Typically bbox_xform is used to pass an instance reference transformation.
    1600  Returns:
    1601  0 = No part of the of the transformed bounding box
    1602  is in the view frustum or the view camera and frustum
    1603  have not been set.
    1604  1 = A portion of of the transformed bounding box is
    1605  in the view frustum
    1606  2 = The entire transformed bounding box is in the
    1607  view frustum.
    1608  */
    1609  int InViewFrustum(
    1610  bool bInfiniteFrustum,
    1611  const ON_BoundingBox& bbox,
    1612  const ON_Xform* bbox_xform
    1613  ) const;
    1614 
    1615 protected:
    1616 
    1617  // These boolean status flags are set to true when
    1618  // the associated fields contain valid values.
    1619  bool m_bValidCamera = true;
    1620  bool m_bValidFrustum = true;
    1621  bool m_bValidPort = false;
    1622  bool m_bValidCameraFrame = true;
    1623 
    1624  // Camera Settings: ///////////////////////////////////////////////
    1625 
    1626  // perspective or parallel projection
    1627  ON::view_projection m_projection = ON::parallel_view;
    1628 
    1629  // Camera location, direction and orientation (in world coordinates).
    1630  // These values are used to set the camera frame vectors CamX, CamY,
    1631  // CamZ. If bValidCamera is true, then the CamX, CamY and CamZ
    1632  // vectors are properly initialized and should be used
    1633  // instead of CamDir[] and CamUp[]. The frame vectors CamX, CamY, CamZ
    1634  // are always a right handed orthonormal frame. The CamDir
    1635  // and CamUp vectors contain the values passed to SetViewCamera().
    1636 
    1637  // If true and the camera is valid, then the corresponding camera
    1638  // parameter will not be changed by view editing functions. This
    1639  // permits user interface to easily preserve important camera
    1640  // features without having to perform excessive calculations.
    1641  bool m_bLockCamUp = false;
    1642  bool m_bLockCamDir = false;
    1643  bool m_bLockCamLoc = false;
    1644  unsigned char m_frustum_symmetry_flags = 0; // 0 != (flags & 1) top/bottom symmetry enforced
    1645  // 0 != (flags & 2) left/right symmetry enforced.
    1646  ON_3dPoint m_CamLoc = ON_Viewport::DefaultCameraLocation; // camera location
    1647  ON_3dVector m_CamDir = -ON_3dVector::ZAxis; // from camera towards view (nonzero and not parallel to m_CamUp)
    1648  ON_3dVector m_CamUp = ON_3dVector::YAxis; // (nonzero and not parallel to m_CamDir)
    1649 
    1650  // The camera frame vectors are properly initialized by SetCamera()
    1651  ON_3dVector m_CamX = ON_3dVector::XAxis;
    1652  ON_3dVector m_CamY = ON_3dVector::YAxis;
    1653  ON_3dVector m_CamZ = ON_3dVector::ZAxis;
    1654 
    1655  // View Frustum Settings: ///////////////////////////////////////
    1656  // left, right are camera X coords on near clipping plane
    1657  // bottom, top are camera Y coords on near clipping plane
    1658  // near = distance from camera to near clipping plane
    1659  // far = distance from camera to far clipping plane
    1660  double m_frus_left = -20.0; // frus_left < frus_right
    1661  double m_frus_right = 20.0;
    1662  double m_frus_bottom = -20.0; // frus_bottom < frus_top
    1663  double m_frus_top = 20.0;
    1664  double m_frus_near = ON_Viewport::DefaultMinNearDist; // 0 < frus_near < frus_far
    1665  double m_frus_far = ON_Viewport::DefaultFarDist;
    1666 
    1667  // Device View Port Box Settings: ( in display device coordinates ) ////
    1668  // The point (left,bottom,-near), in camera coordinates, of the view
    1669  // frustum is mapped to pixel coordinate (port_left,port_bottom,port_near).
    1670  // The point (right,top,-far), in camera coordinates, of the view frustum
    1671  // is mapped to pixel coordinate (port_right,port_top,port_far).
    1672  // In many situations including Microsoft Windows coordinates,
    1673  // port_left = 0,
    1674  // port_right = viewport width-1,
    1675  // port_top = 0,
    1676  // port_bottom = viewport height-1.
    1677  int m_port_left = 0; // port_left != port_right
    1678  int m_port_right = 1000;
    1679  int m_port_bottom = 0; // port_bottom != port_top
    1680  int m_port_top = 1000;
    1681  // (If you want an 8 bit z-buffer with
    1682  // z=255 being "in front of" z=0, then
    1683  // set port_near = 255 and port_far = 0.)
    1684  int m_port_near = 0;
    1685  int m_port_far = 1;
    1686 
    1687 
    1688  // The location of this point has no impact on the
    1689  // view projection. It is simply a suggestion for a
    1690  // fixed point when views are rotated or the isometric
    1691  // depth when perpsective views are dollied. The default
    1692  // is ON_3dPoint::UnsetPoint.
    1693  ON_3dPoint m_target_point = ON_3dPoint::UnsetPoint;
    1694 
    1695 private:
    1696  // When this id matches the viewport id saved in an ON_DisplayMaterialRef
    1697  // list in ON_3dmObjectAttributes, then the the display material is used
    1698  // for that object in this view.
    1699  ON_UUID m_viewport_id = ON_nil_uuid;
    1700 
    1701  bool SetCameraFrame(); // used to set m_CamX, m_CamY, m_CamZ
    1702 
    1703  // This transform is used to tweak the clipping
    1704  // coordinates. The default is the identity.
    1705  // Modify this transformation when you need to do
    1706  // things like z-buffer bias, non-uniform viewplane
    1707  // scaling, and so on.
    1708 
    1709  /*
    1710  Description:
    1711  Sets the m_clip_mod transformation;
    1712  Parameters:
    1713  clip_mod_xform - [in] invertable transformation
    1714  */
    1715  bool SetClipModXform( ON_Xform clip_mod_xform );
    1716  ON_Xform m_clip_mods = ON_Xform::IdentityTransformation;
    1717  ON_Xform m_clip_mods_inverse = ON_Xform::IdentityTransformation;
    1718 
    1719  // Runtime values that depend on the graphics hardware being used.
    1720  // These values are not saved in 3dm files.
    1721  double m__MIN_NEAR_DIST = ON_Viewport::DefaultMinNearDist;
    1722  double m__MIN_NEAR_OVER_FAR = ON_Viewport::DefaultMinNearOverFar;
    1723 
    1724 private:
    1725  mutable ON_SHA1_Hash m_projection_content_sha1 = ON_SHA1_Hash::ZeroDigest;
    1726 };
    1727 
    1728 ON_DECL
    1729 bool
    1730 ON_GetViewportRotationAngles(
    1731  const ON_3dVector&, // X, // X,Y,Z must be a right handed orthonormal basis
    1732  const ON_3dVector&, // Y,
    1733  const ON_3dVector&, // Z,
    1734  double*, // angle1, // returns rotation about world Z
    1735  double*, // angle2, // returns rotation about world X ( 0 <= a2 <= pi )
    1736  double* // angle3 // returns rotation about world Z
    1737  );
    1738 
    1739 ON_DECL
    1740 bool
    1741 ON_ViewportFromRhinoView( // create ON_Viewport from legacy Rhino projection info
    1742  ON::view_projection, // projection,
    1743  const ON_3dPoint&, // rhvp_target, // 3d point
    1744  double, // rhvp_angle1 in radians
    1745  double, // rhvp_angle2 in radians
    1746  double, // rhvp_angle3 in radians
    1747  double, // rhvp_viewsize, // > 0
    1748  double, // rhvp_cameradist, // > 0
    1749  int, // screen_width,
    1750  int, // screen_height,
    1751  ON_Viewport&
    1752  );
    1753 
    1754 /*
    1755 Description:
    1756  Calculate the corners of the polygon that is the
    1757  intersection of a view frustum with and infinte plane.
    1758 Parameters:
    1759  vp - [in] defines view frustum
    1760  plane_equation - [in] defined infinte plane
    1761  points - [out] corners of the polygon.
    1762  If true is returned and points.Count() is zero, then
    1763  the plane missed the frustum. Note that the start/end
    1764  point is not duplicated in the list.
    1765 Returns:
    1766  True if input was valid, false otherwise. Note that
    1767  even when true is returned, the returned points.Count()
    1768  may be zero if the plane and frustum do not intersect.
    1769 */
    1770 ON_DECL
    1771 bool
    1772 ON_IntersectViewFrustumPlane(
    1773  const ON_Viewport& vp,
    1774  const ON_PlaneEquation& plane_equation,
    1775  ON_SimpleArray<ON_3dPoint>& points
    1776  );
    1777 
    1778 #endif
    1779 
    virtual bool Transform(const ON_Xform &xform)
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // defines ON_Viewport
    20 //
    21 ////////////////////////////////////////////////////////////////
    22 
    23 #if !defined(OPENNURBS_VIEWPORT_INC_)
    24 #define OPENNURBS_VIEWPORT_INC_
    25 
    26 ///////////////////////////////////////////////////////////////////////////////
    27 // Class ON_Viewport
    28 //
    29 // This object represents a viewing frustum
    30 ///////////////////////////////////////////////////////////////////////////////
    31 class ON_CLASS ON_Viewport : public ON_Geometry
    32 {
    33  ON_OBJECT_DECLARE( ON_Viewport );
    34 public:
    35 
    36  static const double DefaultNearDist; // 0.005
    37  static const double DefaultFarDist; // 1000.0
    38  static const double DefaultMinNearDist; // 0.0001
    39  static const double DefaultMinNearOverFar; // 0.0001
    40 
    41  static const ON_3dPoint DefaultCameraLocation; // (0.0,0.0,100.0)
    42  static const ON_3dVector Default3dCameraDirection; // (-0.43301270189221932338186158537647,0.75,-0.5)
    43 
    44  /*
    45  Description:
    46  A Y-up parallel projection looking at the origin of the XYplane.
    47  up = ON_3dVector::Yaxis,
    48  dir = -ON_3dVector::Zaxis
    49  */
    51 
    52  /*
    53  Description:
    54  A Z-up perspective projection looking down on the origin of the XY plane.
    55  up = ON_3dVector::Zaxis,
    56  dir = ON_3dVector:Default3dCameraDirection
    57  */
    59 
    60  // Construction
    61  // Default constructor creates a copy of ON_Viewport::DefaultTopViewYUp;
    62  ON_Viewport() = default;
    63  ~ON_Viewport() = default;
    64  ON_Viewport( const ON_Viewport& ) = default;
    65  ON_Viewport& operator=( const ON_Viewport& ) = default;
    66 
    67  /*
    68  Returns:
    69  A sha1 hash of all the settings that effect view projection matrices.
    70  view projection, camera location, camera X,Y,Z frame, frustum, port.
    71  If two ON_Viewport classes have identical values ViewProjectionContentHash(),
    72  then they will have identical view projection matrices and generate identical
    73  images from the same model content.
    74  */
    75  ON_SHA1_Hash ViewProjectionContentHash() const;
    76 
    77  /*
    78  Returns:
    79  candidate_point.IsValid()
    80  && candidate_point.MaximumCoordinate() < ON_NONSENSE_WORLD_COORDINATE_VALUE;
    81  */
    82  static bool IsValidCameraLocation(
    83  ON_3dPoint candidate_point
    84  );
    85 
    86  /*
    87  Returns:
    88  candidate_vector.IsValid()
    89  && candidate_vector.MaximumCoordinate() < ON_NONSENSE_WORLD_COORDINATE_VALUE
    90  && candidate_vector.MaximumCoordinate() > ON_ZERO_TOLERANCE
    91  ;
    92  */
    93  static bool IsValidCameraUpOrDirection(
    94  ON_3dVector candidate_vector
    95  );
    96 
    97  /*
    98  Returns:
    99  True if camera up, direction, X, Y, and Z are valid.
    100  */
    101  bool IsValidCameraFrame() const;
    102 
    103  /*
    104  Returns:
    105  True if camera location is valid and camera up, direction, X, Y, and Z are valid.
    106  */
    107  bool IsValidCamera() const;
    108 
    109  /*
    110  Returns:
    111  True if camera frustum is valid.
    112  */
    113  bool IsValidFrustum() const;
    114 
    115  // ON_Object overrides //////////////////////////////////////////////////////
    116  //
    117  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    118 
    119  // Description:
    120  // Dumps debugging text description to a text log.
    121  //
    122  // Parameters:
    123  // dump_target - [in] text log
    124  //
    125  // Remarks:
    126  // This overrides the virtual ON_Object::Dump() function.
    127  void Dump(
    128  ON_TextLog& // dump_target
    129  ) const override;
    130 
    131  // Description:
    132  // Writes ON_Viewport defintion from a binary archive.
    133  //
    134  // Parameters:
    135  // binary_archive - [in] open binary archive
    136  //
    137  // Returns:
    138  // true if successful.
    139  //
    140  // Remarks:
    141  // This overrides the virtual ON_Object::Write() function.
    142  bool Write(
    143  ON_BinaryArchive& // binary_archive
    144  ) const override;
    145 
    146 
    147  // Description:
    148  // Reads ON_Viewport defintion from a binary archive.
    149  //
    150  // Parameters:
    151  // binary_archive - [in] open binary archive
    152  //
    153  // Returns:
    154  // true if successful.
    155  //
    156  // Remarks:
    157  // This overrides the virtual ON_Object::Read() function.
    158  bool Read(
    159  ON_BinaryArchive& // binary_archive
    160  ) override;
    161 
    162 
    163  // ON_Geometry overrides //////////////////////////////////////////////////////
    164  //
    165 
    166  // Description:
    167  // The dimension of a camera view frustum is 3.
    168  //
    169  // Returns:
    170  // 3
    171  //
    172  // Remarks:
    173  // This is virtual ON_Geometry function.
    174  int Dimension() const override;
    175 
    176  // virtual ON_Geometry GetBBox override
    177  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    178 
    179  // Description:
    180  // Transforms the view camera location, direction, and up.
    181  //
    182  // Parameters:
    183  // xform - [in] transformation to apply to camera.
    184  //
    185  // Returns:
    186  // @untitled table
    187  // true Valid camera was transformed.
    188  // false Invalid camera, frustum, or transformation.
    189  //
    190  // Remarks:
    191  // This overrides the virtual ON_Geometry::Transform() function.
    192  bool Transform(
    193  const ON_Xform& // xform
    194  ) override;
    195 
    196  // Interface /////////////////////////////////////////////////////////////////
    197  //
    198 
    199  /*
    200  */
    201  ON_DEPRECATED_MSG("Use = ON_Viewport::DefaultTopViewYUp")
    202  void Initialize();
    203 
    204  ON::view_projection Projection() const;
    205 
    206  /*
    207  Description:
    208  Unconditionally set the projection.
    209  Parameters:
    210  projection - [in]
    211  See Also:
    212  ON_Viewport::SetParallelProjection
    213  ON_Viewport::SetPerpectiveProjection
    214  ON_Viewport::SetTwoPointPerspectiveProjection
    215  */
    216  bool SetProjection( ON::view_projection projection );
    217 
    218  /*
    219  Description:
    220  Use this function to change projections of valid viewports
    221  from persective to parallel. It will make common additional
    222  adjustments to the frustum so the resulting views are similar.
    223  The camera location and direction will not be changed.
    224  Parameters:
    225  bSymmetricFrustum - [in]
    226  True if you want the resulting frustum to be symmetric.
    227  Remarks:
    228  If the current projection is parallel and bSymmetricFrustum,
    229  FrustumIsLeftRightSymmetric() and FrustumIsTopBottomSymmetric()
    230  are all equal, then no changes are made and true is returned.
    231  */
    232  bool ChangeToParallelProjection( bool bSymmetricFrustum );
    233 
    234  /*
    235  Description:
    236  Use this function to change projections of valid viewports
    237  from parallel to perspective. It will make common additional
    238  adjustments to the frustum and camera location so the resulting
    239  views are similar. The camera direction and target point are
    240  not be changed.
    241  Parameters:
    242  target_distance - [in]
    243  If ON_UNSET_VALUE this parameter is ignored. Otherwise
    244  it must be > 0 and indicates which plane in the current
    245  view frustum should be perserved.
    246  bSymmetricFrustum - [in]
    247  True if you want the resulting frustum to be symmetric.
    248  lens_length - [in] (pass 50.0 when in doubt)
    249  35 mm lens length to use when changing from parallel
    250  to perspective projections. If the current projection
    251  is perspective or lens_length is <= 0.0,
    252  then this parameter is ignored.
    253  Remarks:
    254  If the current projection is perspective and bSymmetricFrustum,
    255  FrustumIsLeftRightSymmetric() and FrustumIsTopBottomSymmetric()
    256  are all equal, then no changes are made and true is returned.
    257  */
    258  bool ChangeToPerspectiveProjection(
    259  double target_distance,
    260  bool bSymmetricFrustum,
    261  double lens_length
    262  );
    263 
    264  /*
    265  Description:
    266  Use this function to change projections of valid viewports
    267  to a two point perspective. It will make common additional
    268  adjustments to the frustum and camera location and direction
    269  so the resulting views are similar.
    270  Parameters:
    271  target_distance - [in]
    272  If ON_UNSET_VALUE this parameter is ignored. Otherwise
    273  it must be > 0 and indicates which plane in the current
    274  view frustum should be perserved.
    275  up - [in]
    276  This direction will be the locked up direction. Pass
    277  ON_3dVector::ZeroVector if you want to use the world axis
    278  direction that is closest to the current up direction.
    279  Pass CameraY() if you want to preserve the current up direction.
    280  lens_length - [in] (pass 50.0 when in doubt)
    281  35 mm lens length to use when changing from parallel
    282  to perspective projections. If the current projection
    283  is perspective or lens_length is <= 0.0,
    284  then this parameter is ignored.
    285  Remarks:
    286  If the current projection is perspective and
    287  FrustumIsLeftRightSymmetric() is true and
    288  FrustumIsTopBottomSymmetric() is false, then no changes are
    289  made and true is returned.
    290  */
    291  bool ChangeToTwoPointPerspectiveProjection(
    292  double target_distance,
    293  ON_3dVector up,
    294  double lens_length
    295  );
    296 
    297  /*
    298  Returns:
    299  True if the projection is ON::perspective_view.
    300  */
    301  bool IsPerspectiveProjection() const;
    302 
    303  /*
    304  Returns
    305  IsPerspectiveProjection()
    306  && CameraUpIsLocked()
    307  && FrustumIsLeftRightSymmetric
    308  && !FrustumIsTopBottomSymmetric
    309  */
    310  bool IsTwoPointPerspectiveProjection() const;
    311 
    312  /*
    313  Returns:
    314  True if the projection is ON::parallel_view.
    315  */
    316  bool IsParallelProjection() const;
    317 
    318  // These return true if the current direction and up are not zero and not
    319  // parallel so the camera position is well defined.
    320  bool SetCameraLocation( const ON_3dPoint& );
    321  bool SetCameraDirection( const ON_3dVector& );
    322  bool SetCameraUp( const ON_3dVector& );
    323 
    324  ON_3dPoint CameraLocation() const;
    325  ON_3dVector CameraDirection() const;
    326  ON_3dVector CameraUp() const;
    327 
    328  /*
    329  Description:
    330  Copy camera location, up, direction and frame from source_viewport.
    331  Parameters:
    332  source_viewport - [in]
    333  camera location to copy
    334  bBreakLocks - [in]
    335  If true, any locked frustum settings will be unlocked.
    336  */
    337  bool SetCamera(
    338  const ON_Viewport& source_viewport,
    339  bool bBreakLocks
    340  );
    341 
    342  bool CameraLocationIsLocked() const;
    343  bool CameraDirectionIsLocked() const;
    344  bool CameraUpIsLocked() const;
    345  bool FrustumIsLeftRightSymmetric() const;
    346  bool FrustumIsTopBottomSymmetric() const;
    347 
    348  void SetCameraLocationLock( bool bLockCameraLocation );
    349  void SetCameraDirectionLock( bool bLockCameraDirection ) ;
    350  void SetCameraUpLock( bool bLockCameraUp );
    351  void SetFrustumLeftRightSymmetry( bool bForceLeftRightSymmetry );
    352  void SetFrustumTopBottomSymmetry( bool bForceTopBottomSymmetry );
    353  void UnlockCamera(); // sets all camera locks to false
    354  void UnlockFrustumSymmetry(); // sets all frustum symmetry locks to false
    355 
    356  // returns true if current camera orientation is valid
    357  bool GetCameraFrame(
    358  double*, // CameraLocation[3]
    359  double*, // CameraX[3]
    360  double*, // CameraY[3]
    361  double* // CameraZ[3]
    362  ) const;
    363 
    364  // these do not check for a valid camera orientation
    365  ON_3dVector CameraX() const; // unit to right vector
    366  ON_3dVector CameraY() const; // unit up vector
    367  ON_3dVector CameraZ() const; // unit vector in -CameraDirection
    368 
    369 
    370  bool IsCameraFrameWorldPlan(
    371  // Returns true if the camera direction = some world axis.
    372  // The indices report which axes are used. For a "twisted"
    373  // plan view it is possible to have zero x and y indices.
    374  // This function returns true if and only if the "z" index
    375  // is non-zero.
    376  //
    377  // Indices are +/-1 = world +/-x, +/-2 = world +/-y, +/-3 = world +/-z,
    378  int*, // if true and plan is axis aligned, view x index, else 0
    379  int*, // if true and plan is axis aligned, view y index, else 0
    380  int* // if true, view z index, else 0
    381  );
    382 
    383  bool GetCameraExtents(
    384  // returns bounding box in camera coordinates - this is useful information
    385  // for setting view frustrums to include the point list
    386  int, // count = number of 3d points
    387  int, // stride = number of doubles to skip between points (>=3)
    388  const double*, // 3d points in world coordinates
    389  ON_BoundingBox& cambbox, // bounding box in camera coordinates
    390  int bGrowBox = false // set to true if you want to enlarge an existing camera coordinate box
    391  ) const;
    392 
    393  bool GetCameraExtents(
    394  // returns bounding box in camera coordinates - this is useful information
    395  // for setting view frustrums to include the point list
    396  const ON_BoundingBox&, // world coordinate bounding box
    397  ON_BoundingBox& cambbox, // bounding box in camera coordinates
    398  int bGrowBox = false // set to true if you want to enlarge an existing camera coordinate box
    399  ) const;
    400 
    401  bool GetCameraExtents(
    402  // returns bounding box in camera coordinates - this is useful information
    403  // for setting view frustrums to include the point list
    404  ON_3dPoint&, // world coordinate bounding sphere center
    405  double, // world coordinate bounding sphere radius
    406  ON_BoundingBox& cambox, // bounding box in camera coordinates
    407  int bGrowBox = false // set to true if you want to enlarge an existing camera coordinate box
    408  ) const;
    409 
    410  /*
    411  Description:
    412  Set the view frustum. If FrustumSymmetryIsLocked() is true
    413  and left != -right or bottom != -top, then they will be
    414  adjusted so the resulting frustum is symmetric.
    415  */
    416  bool SetFrustum(
    417  double left, //
    418  double right, // ( left < right )
    419  double bottom, //
    420  double top, // ( bottom < top )
    421  double near_dist, //
    422  double far_dist // ( 0 < near_dist < far_dist ) // ignored by Rhino version 1.0
    423  );
    424  bool GetFrustum(
    425  double* left, //
    426  double* right, // (left < right)
    427  double* bottom, //
    428  double* top, // (bottom < top)
    429  double* near_dist = nullptr, //
    430  double* far_dist = nullptr // (0 < near_dist < far_dist)
    431  ) const;
    432 
    433 
    434  /*
    435  Description:
    436  Copy frustum information from source_viewport.
    437  Parameters:
    438  source_viewport - [in]
    439  bBreakLocks - [in]
    440  If true, any locked frustum settings will be unlocked.
    441  */
    442  bool SetFrustum(
    443  const ON_Viewport& source_viewport,
    444  bool bBreakLocks
    445  );
    446 
    447 
    448  // SetFrustumAspect() changes the larger of the frustum's widht/height
    449  // so that the resulting value of width/height matches the requested
    450  // aspect. The camera angle is not changed. If you change the shape
    451  // of the view port with a call SetScreenPort(), then you generally
    452  // want to call SetFrustumAspect() with the value returned by
    453  // GetScreenPortAspect().
    454  bool SetFrustumAspect( double );
    455 
    456  // Returns frustum's width/height
    457  bool GetFrustumAspect( double& ) const;
    458 
    459  // Returns world coordinates of frustum's center
    460  bool GetFrustumCenter( double* ) const;
    461 
    462  // The near clipping plane stored in the Rhino 1.0 file is frequently very
    463  // small and useless for high quality z-buffer based rendering. The far
    464  // clipping value is not stored in the file. Use these functions to set
    465  // the frustum's near and far clipping planes to appropriate values.
    466  double FrustumLeft() const;
    467  double FrustumRight() const;
    468  double FrustumBottom() const;
    469  double FrustumTop() const;
    470  double FrustumNear() const;
    471  double FrustumFar() const;
    472 
    473  /*
    474  Returns:
    475  frustum right - frustum left
    476  */
    477  double FrustumWidth() const; // right - left
    478 
    479  /*
    480  Returns:
    481  frustum right - frustum left
    482  */
    483  double FrustumHeight() const; // top - bottom
    484 
    485  /*
    486  Returns:
    487  Minimum of fabs(FrustumWidth()) and fabs(FrustumHeight())
    488  */
    489  double FrustumMinimumDiameter() const;
    490 
    491  /*
    492  Returns:
    493  Maximum of fabs(FrustumWidth()) and fabs(FrustumHeight())
    494  */
    495  double FrustumMaximumDiameter() const;
    496 
    497 
    498  bool SetFrustumNearFar(
    499  const double* bboxmin, // 3d bounding box min
    500  const double* bboxmax // 3d bounding box max
    501  );
    502  bool SetFrustumNearFar(
    503  const double* center, // 3d bounding sphere center
    504  double radius // 3d bounding sphere radius
    505  );
    506  bool SetFrustumNearFar(
    507  double near_dist, // ( > 0 )
    508  double far_dist //
    509  );
    510 
    511  /*
    512  Description:
    513  If needed, adjust the current frustum so it has the
    514  specified symmetries and adjust the camera location
    515  so the target plane remains visible.
    516  Parameters:
    517  bLeftRightSymmetric - [in]
    518  If true, the frustum will be adjusted so left = -right.
    519  bTopBottomSymmetric - [in]
    520  If true, the frustum will be adjusted so top = -bottom.
    521  target_distance - [in]
    522  If projection is not perspective or target_distance
    523  is ON_UNSET_VALUE, this this parameter is ignored.
    524  If the projection is perspective and target_distance
    525  is not ON_UNSET_VALUE, then it must be > 0.0 and
    526  it is used to determine which plane in the old
    527  frustum will appear unchanged in the new frustum.
    528  bool
    529  Returns true if the returned viewport has a frustum
    530  with the specified symmetries.
    531  */
    532  bool ChangeToSymmetricFrustum(
    533  bool bLeftRightSymmetric,
    534  bool bTopBottomSymmetric,
    535  double target_distance
    536  );
    537 
    538  /*
    539  Description:
    540  Get near and far clipping distances of a point
    541  Parameters:
    542  point - [in]
    543  near_dist - [out]
    544  near distance of the point (can be < 0)
    545  far_dist - [out]
    546  far distance of the point (can be equal to near_dist)
    547  bGrowNearFar - [in]
    548  If true and input values of near_dist and far_dist
    549  are not ON_UNSET_VALUE, the near_dist and far_dist
    550  are enlarged to include bbox.
    551  Returns:
    552  True if the point is ing the view frustum and
    553  near_dist/far_dist were set.
    554  False if the bounding box does not intesect the
    555  view frustum.
    556  */
    557  bool GetPointDepth(
    558  ON_3dPoint point,
    559  double* near_dist,
    560  double* far_dist,
    561  bool bGrowNearFar=false
    562  ) const;
    563 
    564  /*
    565  Description:
    566  Get the view plane depth of a point
    567  Parameters:
    568  point - [in]
    569  view_plane_depth - [out]
    570  positive values are in front of the camera and negative
    571  values are behind the camera.
    572  If 0 <= point_depth < FrustumNear(), the point's view
    573  plane is between the camera and the frustum's near plane.
    574  If point_depth > FrustumFar(), the point's view
    575  plane is farther from the camera and the frustum's far plane.
    576  Returns:
    577  True if the point is ing the view frustum and
    578  near_dist/far_dist were set.
    579  False if the bounding box does not intesect the
    580  view frustum.
    581  */
    582  bool GetPointDepth(
    583  ON_3dPoint point,
    584  double* view_plane_depth
    585  ) const;
    586 
    587  /*
    588  Description:
    589  Get near and far clipping distances of a bounding box.
    590  Parameters:
    591  bbox - [in]
    592  bounding box
    593  near_dist - [out]
    594  near distance of the box
    595  This value can be zero or negative when the camera
    596  location is inside bbox.
    597  far_dist - [out]
    598  far distance of the box
    599  This value can be equal to near_dist, zero or negative
    600  when the camera location is in front of the bounding box.
    601  bGrowNearFar - [in]
    602  If true and input values of near_dist and far_dist
    603  are not ON_UNSET_VALUE, the near_dist and far_dist
    604  are enlarged to include bbox.
    605  Returns:
    606  True if the bounding box intersects the view frustum and
    607  near_dist/far_dist were set.
    608  False if the bounding box does not intesect the view frustum.
    609  Remarks:
    610  This function ignores the current value of the viewport's
    611  near and far settings. If the viewport is a perspective
    612  projection, the it intersects the semi infinite frustum
    613  volume with the bounding box and returns the near and far
    614  distances of the intersection. If the viewport is a parallel
    615  projection, it instersects the infinte view region with the
    616  bounding box and returns the near and far distances of the
    617  projection.
    618  */
    619  bool GetBoundingBoxDepth(
    620  ON_BoundingBox bbox,
    621  double* near_dist,
    622  double* far_dist,
    623  bool bGrowNearFar=false
    624  ) const;
    625 
    626  /*
    627  Description:
    628  Get near and far clipping distances of a bounding box.
    629  Parameters:
    630  bbox - [in]
    631  bounding box
    632  bbox_xform - [in]
    633  If not nullptr, this transformation to applied to the corners of bbox.
    634  It should have positive determinant for the results to be meaningful.
    635  Typically bbox_xform is used to pass an instance reference transformation.
    636  near_dist - [out]
    637  near distance of the box
    638  This value can be zero or negative when the camera
    639  location is inside bbox.
    640  far_dist - [out]
    641  far distance of the box
    642  This value can be equal to near_dist, zero or negative
    643  when the camera location is in front of the bounding box.
    644  bGrowNearFar - [in]
    645  If true and input values of near_dist and far_dist
    646  are not ON_UNSET_VALUE, the near_dist and far_dist
    647  are enlarged to include bbox.
    648  Returns:
    649  0: The bounding box does not intersectthe view frustum.
    650  1: A proper subset of the bounding box is inside the view frustum
    651  and near_dist/far_dist were set.
    652  2: The entire bounding box is inside the view frustum
    653  and near_dist/far_dist were set.
    654  Remarks:
    655  This function ignores the current value of the viewport's
    656  near and far settings. If the viewport is a perspective
    657  projection, the it intersects the semi infinite frustum
    658  volume with the bounding box and returns the near and far
    659  distances of the intersection. If the viewport is a parallel
    660  projection, it instersects the infinte view region with the
    661  bounding box and returns the near and far distances of the
    662  projection.
    663  */
    664  int GetBoundingBoxDepth(
    665  ON_BoundingBox bbox,
    666  const ON_Xform* bbox_xform,
    667  double* near_dist,
    668  double* far_dist,
    669  bool bGrowNearFar
    670  ) const;
    671 
    672  /*
    673  Description:
    674  Get the normalized extents of the smallest rectangle that
    675  contains the intersection of bbox and the view's frustum.
    676  Parameters:
    677  bbox - [in]
    678  bounding box
    679  x_extents - [out]
    680  y_extents - [out]
    681  0 <= x_extents[0] <= x_extents[1] <= 1.0
    682  0 <= y_extents[0] <= y_extents[1] <= 1.0
    683  If true is returned, then intersection of the bbox
    684  and the view's frustum is not empty and the bounding
    685  rectangle of the projection of the intersection set
    686  is returned in x_range and y_range. The returned values
    687  are normalized image extents. For example, if
    688  x_extents[0] = 0.0, x_extents[1] = 0.25, y_extents[0] = 0.75
    689  and y_extents[1] = 1.0, then the portion of bbox in the
    690  view's frustum would project to the upper left corner
    691  of the image.
    692  Returns:
    693  True if the bounding box intersects the view frustum and
    694  x_range and y_range were set.
    695  False if the bounding box does not intersect the view
    696  frustum.
    697  Remarks:
    698  This function takes the viewport's near and far settings
    699  into account. Set them to something appropriate before
    700  calling this function.
    701  */
    702  bool GetBoundingBoxProjectionExtents(
    703  ON_BoundingBox bbox,
    704  ON_Interval& x_extents,
    705  ON_Interval& y_extents
    706  ) const;
    707 
    708  /*
    709  Description:
    710  Get near and far clipping distances of a bounding sphere.
    711  Parameters:
    712  sphere - [in]
    713  bounding sphere
    714  near_dist - [out]
    715  near distance of the sphere (can be < 0)
    716  far_dist - [out]
    717  far distance of the sphere (can be equal to near_dist)
    718  bGrowNearFar - [in]
    719  If true and input values of near_dist and far_dist
    720  are not ON_UNSET_VALUE, the near_dist and far_dist
    721  are enlarged to include bbox.
    722  Returns:
    723  True if the sphere intersects the view frustum and
    724  near_dist/far_dist were set.
    725  False if the sphere does not intesect the view frustum.
    726  */
    727  bool GetSphereDepth(
    728  ON_Sphere sphere,
    729  double* near_dist,
    730  double* far_dist,
    731  bool bGrowNearFar=false
    732  ) const;
    733 
    734  /*
    735  Description:
    736  Set near and far clipping distance subject to constraints.
    737  Parameters:
    738  near_dist - [in] (>0) desired near clipping distance
    739  far_dist - [in] (>near_dist) desired near clipping distance
    740  min_near_dist - [in]
    741  If min_near_dist <= 0.0, it is ignored.
    742  If min_near_dist > 0 and near_dist < min_near_dist,
    743  then the frustum's near_dist will be increased to
    744  min_near_dist.
    745  min_near_over_far - [in]
    746  If min_near_over_far <= 0.0, it is ignored.
    747  If near_dist < far_dist*min_near_over_far, then
    748  near_dist is increased and/or far_dist is decreased
    749  so that near_dist = far_dist*min_near_over_far.
    750  If near_dist < target_dist < far_dist, then near_dist
    751  near_dist is increased and far_dist is decreased so that
    752  projection precision will be good at target_dist.
    753  Otherwise, near_dist is simply set to
    754  far_dist*min_near_over_far.
    755  target_dist - [in]
    756  If target_dist <= 0.0, it is ignored.
    757  If target_dist > 0, it is used as described in the
    758  description of the min_near_over_far parameter.
    759  relative_depth_bias - [in]
    760  If relative_depth_bias <= 0.0, it is ignored.
    761  If relative_depth_bias > 0, it is assumed that
    762  the requested near_dist and far_dist were calculated
    763  assuming no depth bias and the values will be
    764  appropriately adjusted to ensure the frustum's
    765  near and far clipping planes will not clip biased
    766  objects.
    767  */
    768  bool SetFrustumNearFar(
    769  double near_dist,
    770  double far_dist,
    771  double min_near_dist,
    772  double min_near_over_far,
    773  double target_dist
    774  );
    775 
    776  bool SetFrustumNearFar(
    777  double near_dist,
    778  double far_dist,
    779  double min_near_dist,
    780  double min_near_over_far,
    781  double target_dist,
    782  double relative_depth_bias
    783  );
    784 
    785  // Description:
    786  // Get near clipping plane.
    787  //
    788  // near_plane - [out] near clipping plane if camera and frustum
    789  // are valid. The plane's frame is the same as the camera's
    790  // frame. The origin is located at the intersection of the
    791  // camera direction ray and the near clipping plane. The plane's
    792  // normal points out of the frustum towards the camera
    793  // location.
    794  //
    795  // Returns:
    796  // true if camera and frustum are valid.
    797  bool GetNearPlane(
    798  ON_Plane& near_plane
    799  ) const;
    800 
    801  bool GetNearPlaneEquation(
    802  ON_PlaneEquation& near_plane_equation
    803  ) const;
    804 
    805  // Description:
    806  // Get far clipping plane.
    807  //
    808  // far_plane - [out] far clipping plane if camera and frustum
    809  // are valid. The plane's frame is the same as the camera's
    810  // frame. The origin is located at the intersection of the
    811  // camera direction ray and the far clipping plane. The plane's
    812  // normal points into the frustum towards the camera location.
    813  //
    814  // Returns:
    815  // true if camera and frustum are valid.
    816  bool GetFarPlane(
    817  ON_Plane& far_plane
    818  ) const;
    819 
    820  bool GetFarPlaneEquation(
    821  ON_PlaneEquation& far_plane_equation
    822  ) const;
    823 
    824  /*
    825  Description:
    826  Get the plane that is a specified distance from the camera.
    827  This plane is parallel to the frustum's near and far planes.
    828  Parameters:
    829  view_plane_depth - [in]
    830  The distance from the camera location to the view plane.
    831  Positive distances are in front of the camera and
    832  negative distances are behind the camera.
    833  A value of FrustumNear() will return the frustum's
    834  near plane and a valud of FrustumFar() will return
    835  the frustum's far plane.
    836  view_plane - [out]
    837  View plane
    838  view_plane_equation - [out]
    839  Equation of the view plane.
    840  Returns:
    841  True if the camera and frustum are valid and view_plane
    842  was calculated. False otherwise.
    843  */
    844  bool GetViewPlane(
    845  double view_plane_depth,
    846  ON_Plane& view_plane
    847  ) const;
    848 
    849  bool GetViewPlaneEquation(
    850  double view_plane_depth,
    851  ON_PlaneEquation& view_plane_equation
    852  ) const;
    853 
    854  /*
    855  Description:
    856  Get left world frustum clipping plane.
    857  Parameters:
    858  left_plane - [out]
    859  frustum left side clipping plane. The normal points
    860  into the visible region of the frustum. If the projection
    861  is perspective, the origin is at the camera location,
    862  otherwise the origin isthe point on the plane that is
    863  closest to the camera location.
    864  Returns:
    865  True if camera and frustum are valid and plane was set.
    866  */
    867  bool GetFrustumLeftPlane(
    868  ON_Plane& left_plane
    869  ) const;
    870 
    871  bool GetFrustumLeftPlaneEquation(
    872  ON_PlaneEquation& left_plane_equation
    873  ) const;
    874 
    875  /*
    876  Description:
    877  Get right world frustum clipping plane.
    878  Parameters:
    879  right_plane - [out]
    880  frustum right side clipping plane. The normal points
    881  into the visible region of the frustum. If the projection
    882  is perspective, the origin is at the camera location,
    883  otherwise the origin isthe point on the plane that is
    884  closest to the camera location.
    885  Returns:
    886  True if camera and frustum are valid and plane was set.
    887  */
    888  bool GetFrustumRightPlane(
    889  ON_Plane& right_plane
    890  ) const;
    891 
    892  bool GetFrustumRightPlaneEquation(
    893  ON_PlaneEquation& right_plane_equation
    894  ) const;
    895 
    896  /*
    897  Description:
    898  Get bottom world frustum clipping plane.
    899  Parameters:
    900  bottom_plane - [out]
    901  frustum bottom side clipping plane. The normal points
    902  into the visible region of the frustum. If the projection
    903  is perspective, the origin is at the camera location,
    904  otherwise the origin isthe point on the plane that is
    905  closest to the camera location.
    906  Returns:
    907  True if camera and frustum are valid and plane was set.
    908  */
    909  bool GetFrustumBottomPlane(
    910  ON_Plane& bottom_plane
    911  ) const;
    912 
    913  bool GetFrustumBottomPlaneEquation(
    914  ON_PlaneEquation& bottom_plane_equation
    915  ) const;
    916  /*
    917  Description:
    918  Get top world frustum clipping plane.
    919  Parameters:
    920  top_plane - [out]
    921  frustum top side clipping plane. The normal points
    922  into the visible region of the frustum. If the projection
    923  is perspective, the origin is at the camera location,
    924  otherwise the origin isthe point on the plane that is
    925  closest to the camera location.
    926  Returns:
    927  True if camera and frustum are valid and plane was set.
    928  */
    929  bool GetFrustumTopPlane(
    930  ON_Plane& top_plane
    931  ) const;
    932 
    933  bool GetFrustumTopPlaneEquation(
    934  ON_PlaneEquation& top_plane_equation
    935  ) const;
    936 
    937  // Description:
    938  // Get corners of near clipping plane rectangle.
    939  //
    940  // Parameters:
    941  // left_bottom - [out]
    942  // right_bottom - [out]
    943  // left_top - [out]
    944  // right_top - [out]
    945  //
    946  // Returns:
    947  // true if camera and frustum are valid.
    948  bool GetNearRect(
    949  ON_3dPoint& left_bottom,
    950  ON_3dPoint& right_bottom,
    951  ON_3dPoint& left_top,
    952  ON_3dPoint& right_top
    953  ) const;
    954 
    955  // Description:
    956  // Get corners of far clipping plane rectangle.
    957  //
    958  // Parameters:
    959  // left_bottom - [out]
    960  // right_bottom - [out]
    961  // left_top - [out]
    962  // right_top - [out]
    963  //
    964  // Returns:
    965  // true if camera and frustum are valid.
    966  bool GetFarRect(
    967  ON_3dPoint& left_bottom,
    968  ON_3dPoint& right_bottom,
    969  ON_3dPoint& left_top,
    970  ON_3dPoint& right_top
    971  ) const;
    972 
    973  /*
    974  Description:
    975  Get the world coordinate corners of the rectangle of
    976  a view plane that is a specified distance from the camera.
    977  This rectangle is parallel to the frustum's near and far planes.
    978  Parameters:
    979  view_plane_depth - [in]
    980  The distance from the camera location to the view plane.
    981  Positive distances are in front of the camera and
    982  negative distances are behind the camera.
    983  A value of FrustumNear() will return the frustum's
    984  near rectangle and a valud of FrustumFar() will return
    985  the frustum's far rectangle.
    986  left_bottom - [out]
    987  right_bottom - [out]
    988  left_top - [out]
    989  right_top - [out]
    990  Returns:
    991  True if the camera and frustum are valid and view_plane
    992  was calculated. False otherwise.
    993  */
    994  bool GetViewPlaneRect(
    995  double view_plane_depth,
    996  ON_3dPoint& left_bottom,
    997  ON_3dPoint& right_bottom,
    998  ON_3dPoint& left_top,
    999  ON_3dPoint& right_top
    1000  ) const;
    1001 
    1002 
    1003  /*
    1004  Description:
    1005  Location of viewport in pixels.
    1006  These are provided so you can set the port you are using
    1007  and get the appropriate transformations to and from
    1008  screen space.
    1009  Parameters:
    1010  port_left - [in]
    1011  port_right - [in] (port_left != port_right)
    1012  port_bottom - [in]
    1013  port_top - [in] (port_top != port_bottom)
    1014  port_near - [in]
    1015  port_far - [in]
    1016  Example:
    1017 
    1018  // For a Windows window
    1019  int width = width of window client area in pixels;
    1020  int height = height of window client area in pixels;
    1021  port_left = 0;
    1022  port_right = width;
    1023  port_top = 0;
    1024  port_bottom = height;
    1025  port_near = 0;
    1026  port_far = 1;
    1027  SetScreenPort( port_left, port_right,
    1028  port_bottom, port_top,
    1029  port_near, port_far );
    1030 
    1031  Returns:
    1032  true if input is valid.
    1033  See Also:
    1034  ON_Viewport::GetScreenPort
    1035  */
    1036  bool SetScreenPort(
    1037  int port_left,
    1038  int port_right,
    1039  int port_bottom,
    1040  int port_top,
    1041  int port_near = 0,
    1042  int port_far = 0
    1043  );
    1044 
    1045  bool GetScreenPort(
    1046  int* left,
    1047  int* right, //( port_left != port_right )
    1048  int* port_bottom,
    1049  int* port_top, //( port_bottom != port_top)
    1050  int* port_near=nullptr,
    1051  int* port_far=nullptr
    1052  ) const;
    1053 
    1054  /*
    1055  Returns:
    1056  std::abs(port_right - port_left)
    1057  */
    1058  int ScreenPortWidth() const;
    1059 
    1060  /*
    1061  Returns:
    1062  std::abs(port_bottom - port_top)
    1063  */
    1064  int ScreenPortHeight() const;
    1065 
    1066  ON_2iSize ScreenPortSize() const;
    1067 
    1068  bool GetScreenPortAspect( double& ) const; // port's |width/height|
    1069 
    1070  bool GetCameraAngle(
    1071  double* half_diagonal_angle, // 1/2 of diagonal subtended angle
    1072  double* half_vertical_angle, // 1/2 of vertical subtended angle
    1073  double* half_horizontal_angle // 1/2 of horizontal subtended angle
    1074  ) const;
    1075  bool GetCameraAngle(
    1076  double* half_smallest_angle // 1/2 of smallest subtended view angle
    1077  ) const;
    1078  bool SetCameraAngle(
    1079  double half_smallest_angle // 1/2 of smallest subtended view angle
    1080  // 0 < angle < pi/2
    1081  );
    1082 
    1083  // These functions assume the camera is horizontal and crop the
    1084  // film rather than the image when the aspect of the frustum
    1085  // is not 36/24. (35mm film is 36mm wide and 24mm high.)
    1086  //
    1087  // The SetCamera35mmLensLength() preserves camera location,
    1088  // changes the frustum, but maintains the frsutrum's aspect.
    1089  bool GetCamera35mmLensLength(
    1090  double* lens_length
    1091  ) const;
    1092  bool SetCamera35mmLensLength(
    1093  double lens_length
    1094  );
    1095 
    1096  // Same as GetCamera35mmLensLength() with "lens" misspelled.
    1097  bool GetCamera35mmLenseLength(
    1098  double* lens_length
    1099  ) const;
    1100 
    1101  // Same as SetCamera35mmLensLength() with "lens" misspelled.
    1102  bool SetCamera35mmLenseLength(
    1103  double lens_length
    1104  );
    1105 
    1106  bool GetXform(
    1107  ON::coordinate_system srcCS,
    1108  ON::coordinate_system destCS,
    1109  ON_Xform& matrix // 4x4 transformation matrix (acts on the left)
    1110  ) const;
    1111 
    1112  /*
    1113  Description:
    1114  Get the world coordinate line in the view frustum
    1115  that projects to a point on the screen.
    1116  Parameters:
    1117  screenx - [in]
    1118  screeny - [in] (screenx,screeny) = screen location
    1119  world_line - [out] 3d world coordinate line segment
    1120  starting on the near clipping plane and ending
    1121  on the far clipping plane.
    1122  Returns:
    1123  true if successful.
    1124  false if view projection or frustum is invalid.
    1125  */
    1126  bool GetFrustumLine(
    1127  double screenx,
    1128  double screeny,
    1129  ON_Line& world_line
    1130  ) const;
    1131 
    1132  // display tools
    1133 
    1134  /*
    1135  Description:
    1136  Get the number of horizontal pixels per world unit at the
    1137  location in screen space where world_point would be rendered.
    1138  Parameters:
    1139  world_point - [in] (ignored for parallel projection viewports)
    1140  world location
    1141  frustum_depth - [in] (ignored for parallel projection viewports)
    1142  If the viewport has a perspective projection, then this parameter
    1143  specifies the depth in the view frustum where the scale is calculated.
    1144  If frustum_depth is not > 0.0, then FrustumNear() is used.
    1145  pixels_per_unit - [out]
    1146  number of horizontal screen pixels per world unit at the location
    1147  in screen space where world_point would be rendered.
    1148  If the viewport is not valid, then 0.0 is returned.
    1149  Returns:
    1150  true: success.
    1151  false: The view projection or frustum is invalid.
    1152  */
    1153  bool GetWorldToScreenScale(
    1154  ON_3dPoint world_point,
    1155  double* pixels_per_unit
    1156  ) const;
    1157 
    1158  /*
    1159  Description:
    1160  Get the number of horizontal pixels per world unit at the
    1161  location in screen space where world_point would be rendered.
    1162  Parameters:
    1163  frustum_depth - [in] (ignored for parallel projection viewports)
    1164  If the viewport has a perspective projection, then this parameter
    1165  specifies the depth in the view frustum where the scale is calculated.
    1166  If frustum_depth is not > 0.0, then FrustumNear() is used.
    1167  pixels_per_unit - [out]
    1168  number of horizontal screen pixels per world unit at the location
    1169  in screen space where frustum_depth would be rendered.
    1170  If the viewport is not valid, then 0.0 is returned.
    1171  Returns:
    1172  true: success.
    1173  false: The view projection or frustum is invalid.
    1174  */
    1175  bool GetWorldToScreenScale(
    1176  double frustum_depth,
    1177  double* pixels_per_unit
    1178  ) const;
    1179 
    1180  bool GetCoordinateSprite(
    1181  int, // size in pixels of coordinate sprite axes
    1182  int, int, // screen (x,y) for sprite origin
    1183  int[3], // returns depth order for axes
    1184  double [3][2] // screen coords for axes ends
    1185  ) const;
    1186 
    1187  // Use Extents() as a quick way to set a viewport to so that bounding
    1188  // volume is inside of a viewports frusmtrum.
    1189  // The view angle is used to determine the position of the camera.
    1190  bool Extents(
    1191  double half_view_angle, // 1/2 smallest subtended view angle
    1192  // (0 < angle < pi/2)
    1193  const ON_BoundingBox& world_bbox// 3d world coordinate bounding box
    1194  );
    1195  bool Extents(
    1196  double half_view_angle, // 1/2 smallest subtended view angle
    1197  // (0 < angle < pi/2)
    1198  const ON_3dPoint& center, // 3d world coordinate bounding sphere center
    1199  double radius // 3d sphere radius
    1200  );
    1201 
    1202  ////////////////////////////////////////////////////////////////////////
    1203  // View changing from screen input points. Handy for
    1204  // using a mouse to manipulate a view.
    1205  //
    1206 
    1207  //////////
    1208  // ZoomToScreenRect() may change camera and frustum settings
    1209  bool ZoomToScreenRect(
    1210  int screen_x0,
    1211  int screen_y0, // (x,y) screen coords of a rectangle corner
    1212  int screen_x1,
    1213  int screen_y1 // (x,y) screen coords of opposite rectangle corner
    1214  );
    1215 
    1216  //////////
    1217  // DollyCamera() does not update the frustum's clipping planes.
    1218  // To update the frustum's clipping planes call DollyFrustum(d)
    1219  // with d = dollyVector o cameraFrameZ. To convert screen locations
    1220  // into a dolly vector, use GetDollyCameraVector().
    1221  bool DollyCamera( // Does not update frustum. To update frustum use
    1222  // DollyFrustum(d) with d = dollyVector o cameraFrameZ
    1223  const ON_3dVector& dolly_vector // dolly vector in world coordinates
    1224  );
    1225 
    1226  //////////
    1227  // Gets a world coordinate dolly vector that can be passed to
    1228  // DollyCamera().
    1229  bool GetDollyCameraVector(
    1230  int screen_x0,
    1231  int screen_y0, // (x,y) screen coords of start point
    1232  int screen_x1,
    1233  int screen_y1, // (x,y) screen coords of end point
    1234  double proj_plane_dist, // distance of projection plane from camera.
    1235  // When in doubt, use 0.5*(frus_near+frus_far).
    1236  ON_3dVector& dolly_vector // world coordinate dolly vector returned here
    1237  ) const;
    1238 
    1239  //////////
    1240  // Moves frustum's clipping planes
    1241  bool DollyFrustum(
    1242  double dolly_distance // distance to move in camera direction
    1243  );
    1244 
    1245  /*
    1246  Description:
    1247  Apply scaling factors to parallel projection clipping coordinates
    1248  by setting the m_clip_mod transformation.
    1249  Parameters:
    1250  x - [in] x > 0
    1251  y - [in] y > 0
    1252  Example:
    1253  If you want to compress the view projection across the viewing
    1254  plane, then set x = 0.5, y = 1.0, and z = 1.0.
    1255  Returns:
    1256  True if successful.
    1257  False if input is invalid or the view is a perspective view.
    1258  */
    1259  bool SetViewScale( double x, double y );
    1260  void GetViewScale( double* x, double* y ) const;
    1261 
    1262  /*
    1263  Description:
    1264  Gets the m_clip_mod transformation;
    1265  Returns:
    1266  value of the m_clip_mod transformation.
    1267  */
    1268  ON_Xform ClipModXform() const;
    1269 
    1270  /*
    1271  Description:
    1272  Gets the m_clip_mod_inverse transformation;
    1273  Returns:
    1274  value of the m_clip_mod_inverse transformation.
    1275  */
    1276  ON_Xform ClipModInverseXform() const;
    1277 
    1278  /*
    1279  Returns:
    1280  True if clip mod xform is identity.
    1281  */
    1282  bool ClipModXformIsIdentity() const;
    1283 
    1284  /*
    1285  Description:
    1286  Return a point on the central axis of the view frustum.
    1287  This point is a good choice for a general purpose target point.
    1288  Parameters:
    1289  target_distance - [in]
    1290  If target_distance > 0.0, then the distance from the returned
    1291  point to the camera plane will be target_distance. Note that
    1292  if the frustum is not symmetric, the distance from the
    1293  returned point to the camera location will be larger than
    1294  target_distanct.
    1295  If target_distance == ON_UNSET_VALUE and the frustum
    1296  is valid with near > 0.0, then 0.5*(near + far) will be used
    1297  as the target_distance.
    1298  Returns:
    1299  A point on the frustum's central axis. If the viewport or input
    1300  is not valid, then ON_3dPoint::UnsetPoint is returned.
    1301  */
    1302  ON_3dPoint FrustumCenterPoint( double target_distance ) const;
    1303 
    1304  /*
    1305  Returns:
    1306  The current value of the target point. This point does not play
    1307  a role in the view projection calculations. It can be used as a
    1308  fixed point when changing the camera so the visible regions of the
    1309  before and after frustums both contain the region of interest.
    1310  Remarks:
    1311  The default constructor sets this point on ON_3dPoint::UnsetPoint.
    1312  You must explicitly call one SetTargetPoint() functions to set
    1313  the target point.
    1314  */
    1315  ON_3dPoint TargetPoint() const;
    1316 
    1317  /*
    1318  Description:
    1319  Set the target point.
    1320  Parameters:
    1321  target_point - [in]
    1322  When in doubt, the point returned by FrustumCenterPoint(ON_UNSET_VALUE)
    1323  is a good choice.
    1324  Remarks:
    1325  The default constructor sets this point on ON_3dPoint::UnsetPoint.
    1326  You must explicitly call one SetTargetPoint() functions to set
    1327  the target point.
    1328  */
    1329  bool SetTargetPoint( ON_3dPoint target_point );
    1330 
    1331  /*
    1332  Description:
    1333  Get the distance from the target point to the camera plane.
    1334  Note that if the frustum is not symmetric, then this distance
    1335  is shorter than the distance from the target to the camera location.
    1336  Parameters:
    1337  bUseFrustumCenterFallback - [in]
    1338  If bUseFrustumCenterFallback is false and the target point is
    1339  not valid, then ON_UNSET_VALUE is returned.
    1340  If bUseFrustumCenterFallback is true and the frustum is valid
    1341  and current target point is not valid or is behind the camera,
    1342  then 0.5*(near + far) is returned.
    1343  Returns:
    1344  Shortest signed distance from camera plane to target point.
    1345  If the target point is on the visible side of the camera,
    1346  a positive value is returned. ON_UNSET_VALUE is returned
    1347  when the input of view is not valid.
    1348  */
    1349  double TargetDistance( bool bUseFrustumCenterFallback ) const;
    1350 
    1351  /*
    1352  Description:
    1353  Get suggested values for setting the perspective minimum
    1354  near distance and minimum near/far ratio.
    1355  Parameters:
    1356  camera_location - [in]
    1357  depth_buffer_bit_depth - [in]
    1358  typically 32, 24, 16 or 8, but any positive value can be
    1359  passed in.
    1360  min_near_dist - [out]
    1361  Suggest value for passing to SetPerspectiveMinNearDist().
    1362  min_near_over_far - [out]
    1363  Suggest value for passing to SetPerspectiveMinNearOverFar().
    1364  */
    1365  static void GetPerspectiveClippingPlaneConstraints(
    1366  ON_3dPoint camera_location,
    1367  unsigned int depth_buffer_bit_depth,
    1368  double* min_near_dist,
    1369  double* min_near_over_far
    1370  );
    1371 
    1372  /*
    1373  Description:
    1374  Calculate the value to add to homogeneous "z" clipping coordinate
    1375  that corresponds to moving the corresponding euclidean camera
    1376  coordinate by relative_depth_bias*(far - near).
    1377  Parameters:
    1378  relative_depth_bias - [in]
    1379  signed relative bias.
    1380  = 0: no bias,
    1381  > 0: bias towards frustum's near clipping plane
    1382  < 0: bias towards frustum's far clipping plane
    1383  When you have curves and points that are "on" shaded objects,
    1384  values around 1/256 work well to move the wire objects
    1385  in front of or behind shaded objects.
    1386  clip_z [-in]
    1387  clip_w [-in]
    1388  clip_z and clip_w are the homogeneous "w" and "w" coordinates
    1389  of a homogeneous clipping coordinate point.
    1390  Returns:
    1391  The clipping coordinate depth bias to add to the z-clipping
    1392  coordinate that corresponds to adding cam_depth_bias
    1393  to the z camera coordinate.
    1394  Remarks:
    1395  For perspective views, this bias is largest in the vicinity
    1396  of the frustum's near clipping plane and smallest in the
    1397  vicinity of the frustum's far clipping plane.
    1398  For orthographic projectsions, this bias is constant.
    1399  */
    1400  double ClipCoordDepthBias(
    1401  double relative_depth_bias,
    1402  double clip_z,
    1403  double clip_w
    1404  ) const;
    1405 
    1406  /*
    1407  Description:
    1408  Calculate a transformation to apply to clipping coordinates to
    1409  bias their depth.
    1410 
    1411  Parameters:
    1412  relative_depth_bias - [in]
    1413  signed relative bias.
    1414  = 0: no bias,
    1415  > 0: bias towards frustum's near clipping plane
    1416  < 0: bias towards frustum's far clipping plane
    1417  When you have curves and points that are "on" shaded objects,
    1418  values around 1/512 work well to move the wire objects
    1419  in front of or behind shaded objects.
    1420 
    1421  clip_bias - [out]
    1422  clip_bias = cam2clip * delta * clip2cam,
    1423  where delta = 1 0 0 0
    1424  0 1 0 0
    1425  0 0 1 D
    1426  0 0 0 1
    1427  and D = relative_depth_bias*(far-near).
    1428 
    1429  Returns:
    1430  True if the function worked. False if the frustum settings
    1431  are not valild, in which cate the identity matrix is returned.
    1432 
    1433  Remarks:
    1434  The inverse of the transformations returned by
    1435  GetClipCoordDepthBiasXform(+r,...) is the transformation
    1436  returned by GetClipCoordDepthBiasXform(-r,...).
    1437  */
    1438  bool GetClipCoordDepthBiasXform(
    1439  double relative_depth_bias,
    1440  ON_Xform& clip_bias
    1441  ) const;
    1442 
    1443  /*
    1444  Description:
    1445  Set suggested the perspective minimum near distance and
    1446  minimum near/far ratio to the suggested values returned
    1447  by GetPerspectiveClippingPlaneConstraints().
    1448  Parameters:
    1449  depth_buffer_bit_depth - [in]
    1450  typically 32, 24, 16 or 8, but any positive value can be
    1451  passed in.
    1452  */
    1453  void SetPerspectiveClippingPlaneConstraints(
    1454  unsigned int depth_buffer_bit_depth
    1455  );
    1456 
    1457  /*
    1458  Description:
    1459  Expert user function to control the minimum
    1460  ratio of near/far when perspective projections
    1461  are begin used.
    1462  Parameters:
    1463  min_near_over_far - [in]
    1464  Remarks:
    1465  This is a runtime setting and is not saved in 3dm files.
    1466  */
    1467  void SetPerspectiveMinNearOverFar(double min_near_over_far);
    1468 
    1469  /*
    1470  Description:
    1471  Expert user function to get the minimum runtime
    1472  value of near/far when perspective projections
    1473  are begin used.
    1474  Returns:
    1475  The minimum permitted value of near/far when perspective
    1476  projections are begin used.
    1477  Remarks:
    1478  This is a runtime setting and is not saved in 3dm files.
    1479  */
    1480  double PerspectiveMinNearOverFar() const;
    1481 
    1482  /*
    1483  Description:
    1484  Expert user function to control the minimum
    1485  value of near when perspective projections
    1486  are begin used.
    1487  Parameters:
    1488  min_near_dist - [in]
    1489  Remarks:
    1490  This is a runtime setting and is not saved in 3dm files.
    1491  */
    1492  void SetPerspectiveMinNearDist(double min_near_dist);
    1493 
    1494  /*
    1495  Description:
    1496  Expert user function to get the minimum
    1497  value of near when perspective projections
    1498  are begin used.
    1499  Returns:
    1500  The minimum permitted value of near when perspective
    1501  projections are begin used.
    1502  Remarks:
    1503  This is a runtime setting and is not saved in 3dm files.
    1504  */
    1505  double PerspectiveMinNearDist() const;
    1506 
    1507  /*
    1508  Description:
    1509  Sets the viewport's id to the value used to
    1510  uniquely identify this viewport.
    1511  Parameters:
    1512  viewport_id - [in]
    1513  Returns:
    1514  True if the viewport's id was successfully set
    1515  and false otherwise (ie. the viewport uuid has
    1516  already been set).
    1517  Remarks:
    1518  There is no approved way to change the viewport
    1519  id once it is set in order to maintain consistency
    1520  across multiple viewports and those routines that
    1521  manage them.
    1522  */
    1523  bool SetViewportId(const ON_UUID& viewport_id );
    1524 
    1525  ON_UUID ViewportId(void) const;
    1526 
    1527  /*
    1528  Description:
    1529  EXPERT USER function to change the viewport's id.
    1530  If you change the id, you risk damaging display
    1531  and visibility relationships in the model.
    1532  Parameters:
    1533  viewport_id - [in]
    1534  */
    1535  void ChangeViewportId(const ON_UUID& viewport_id);
    1536 
    1537 
    1538  /*
    1539  Description:
    1540  The "view frustum" is the frustum the m_xform transformation
    1541  maps to clipping coordinate box (-1,+1)^3. These functions
    1542  determine if some portion of the convex hull of the test points
    1543  is inside the view frustum.
    1544  Parameters:
    1545  P - [in] point
    1546  box - [in] bounding box
    1547  count - [in] number of points
    1548  p - [in] array of points
    1549  bEnableClippingPlanes - [in]
    1550  If true, then the additional clipping planes are tested.
    1551  If false, then the additional clipping planes are ignored.
    1552  Returns:
    1553  0 = No part of the of the convex hull of the tested points
    1554  is in the view frustum or the view camera and frustum
    1555  have not been set.
    1556  1 = A portion of the convex hull of the otested points may
    1557  be in the view frustum.
    1558  2 = The entire convex hull of the tested points is in the
    1559  view frustum.
    1560 
    1561  Remarks:
    1562  Each call to ON_Viewport::InViewFrustum() requires the calculation
    1563  of the world-to-clipping coordinates transformation. If multiple
    1564  queries are required, fewer computation resources will be used
    1565  if you set ON_ClippingRegion.m_xform to the viewport's world-to-
    1566  clipping coordinate transformation and then call the
    1567  ON_ClippingRegion::InViewFrustum() functions.
    1568  */
    1569  int InViewFrustum(
    1570  ON_3dPoint P
    1571  ) const;
    1572  int InViewFrustum(
    1573  const ON_BoundingBox& bbox
    1574  ) const;
    1575  int InViewFrustum(
    1576  int count,
    1577  const ON_3fPoint* p
    1578  ) const;
    1579  int InViewFrustum(
    1580  int count,
    1581  const ON_3dPoint* p
    1582  ) const;
    1583  int InViewFrustum(
    1584  int count,
    1585  const ON_4dPoint* p
    1586  ) const;
    1587 
    1588  /*
    1589  Description:
    1590  Determine if some portion of the transformed bounding box
    1591  is inside the view frustum.
    1592  Parameters:
    1593  bInfiniteFrustum - [in]
    1594  ignore the near and far clipping planes of the viewport.
    1595  bbox - [in]
    1596  bounding box
    1597  bbox_xform - [in]
    1598  If not nullptr, this transformation is applied to the bounding box.
    1599  Typically bbox_xform is used to pass an instance reference transformation.
    1600  Returns:
    1601  0 = No part of the of the transformed bounding box
    1602  is in the view frustum or the view camera and frustum
    1603  have not been set.
    1604  1 = A portion of of the transformed bounding box is
    1605  in the view frustum
    1606  2 = The entire transformed bounding box is in the
    1607  view frustum.
    1608  */
    1609  int InViewFrustum(
    1610  bool bInfiniteFrustum,
    1611  const ON_BoundingBox& bbox,
    1612  const ON_Xform* bbox_xform
    1613  ) const;
    1614 
    1615 protected:
    1616 
    1617  // These boolean status flags are set to true when
    1618  // the associated fields contain valid values.
    1619  bool m_bValidCamera = true;
    1620  bool m_bValidFrustum = true;
    1621  bool m_bValidPort = false;
    1622  bool m_bValidCameraFrame = true;
    1623 
    1624  // Camera Settings: ///////////////////////////////////////////////
    1625 
    1626  // perspective or parallel projection
    1627  ON::view_projection m_projection = ON::parallel_view;
    1628 
    1629  // Camera location, direction and orientation (in world coordinates).
    1630  // These values are used to set the camera frame vectors CamX, CamY,
    1631  // CamZ. If bValidCamera is true, then the CamX, CamY and CamZ
    1632  // vectors are properly initialized and should be used
    1633  // instead of CamDir[] and CamUp[]. The frame vectors CamX, CamY, CamZ
    1634  // are always a right handed orthonormal frame. The CamDir
    1635  // and CamUp vectors contain the values passed to SetViewCamera().
    1636 
    1637  // If true and the camera is valid, then the corresponding camera
    1638  // parameter will not be changed by view editing functions. This
    1639  // permits user interface to easily preserve important camera
    1640  // features without having to perform excessive calculations.
    1641  bool m_bLockCamUp = false;
    1642  bool m_bLockCamDir = false;
    1643  bool m_bLockCamLoc = false;
    1644  unsigned char m_frustum_symmetry_flags = 0; // 0 != (flags & 1) top/bottom symmetry enforced
    1645  // 0 != (flags & 2) left/right symmetry enforced.
    1646  ON_3dPoint m_CamLoc = ON_Viewport::DefaultCameraLocation; // camera location
    1647  ON_3dVector m_CamDir = -ON_3dVector::ZAxis; // from camera towards view (nonzero and not parallel to m_CamUp)
    1648  ON_3dVector m_CamUp = ON_3dVector::YAxis; // (nonzero and not parallel to m_CamDir)
    1649 
    1650  // The camera frame vectors are properly initialized by SetCamera()
    1651  ON_3dVector m_CamX = ON_3dVector::XAxis;
    1652  ON_3dVector m_CamY = ON_3dVector::YAxis;
    1653  ON_3dVector m_CamZ = ON_3dVector::ZAxis;
    1654 
    1655  // View Frustum Settings: ///////////////////////////////////////
    1656  // left, right are camera X coords on near clipping plane
    1657  // bottom, top are camera Y coords on near clipping plane
    1658  // near = distance from camera to near clipping plane
    1659  // far = distance from camera to far clipping plane
    1660  double m_frus_left = -20.0; // frus_left < frus_right
    1661  double m_frus_right = 20.0;
    1662  double m_frus_bottom = -20.0; // frus_bottom < frus_top
    1663  double m_frus_top = 20.0;
    1664  double m_frus_near = ON_Viewport::DefaultMinNearDist; // 0 < frus_near < frus_far
    1665  double m_frus_far = ON_Viewport::DefaultFarDist;
    1666 
    1667  // Device View Port Box Settings: ( in display device coordinates ) ////
    1668  // The point (left,bottom,-near), in camera coordinates, of the view
    1669  // frustum is mapped to pixel coordinate (port_left,port_bottom,port_near).
    1670  // The point (right,top,-far), in camera coordinates, of the view frustum
    1671  // is mapped to pixel coordinate (port_right,port_top,port_far).
    1672  // In many situations including Microsoft Windows coordinates,
    1673  // port_left = 0,
    1674  // port_right = viewport width-1,
    1675  // port_top = 0,
    1676  // port_bottom = viewport height-1.
    1677  int m_port_left = 0; // port_left != port_right
    1678  int m_port_right = 1000;
    1679  int m_port_bottom = 0; // port_bottom != port_top
    1680  int m_port_top = 1000;
    1681  // (If you want an 8 bit z-buffer with
    1682  // z=255 being "in front of" z=0, then
    1683  // set port_near = 255 and port_far = 0.)
    1684  int m_port_near = 0;
    1685  int m_port_far = 1;
    1686 
    1687 
    1688  // The location of this point has no impact on the
    1689  // view projection. It is simply a suggestion for a
    1690  // fixed point when views are rotated or the isometric
    1691  // depth when perpsective views are dollied. The default
    1692  // is ON_3dPoint::UnsetPoint.
    1693  ON_3dPoint m_target_point = ON_3dPoint::UnsetPoint;
    1694 
    1695 private:
    1696  // When this id matches the viewport id saved in an ON_DisplayMaterialRef
    1697  // list in ON_3dmObjectAttributes, then the the display material is used
    1698  // for that object in this view.
    1699  ON_UUID m_viewport_id = ON_nil_uuid;
    1700 
    1701  bool SetCameraFrame(); // used to set m_CamX, m_CamY, m_CamZ
    1702 
    1703  // This transform is used to tweak the clipping
    1704  // coordinates. The default is the identity.
    1705  // Modify this transformation when you need to do
    1706  // things like z-buffer bias, non-uniform viewplane
    1707  // scaling, and so on.
    1708 
    1709  /*
    1710  Description:
    1711  Sets the m_clip_mod transformation;
    1712  Parameters:
    1713  clip_mod_xform - [in] invertable transformation
    1714  */
    1715  bool SetClipModXform( ON_Xform clip_mod_xform );
    1716  ON_Xform m_clip_mods = ON_Xform::IdentityTransformation;
    1717  ON_Xform m_clip_mods_inverse = ON_Xform::IdentityTransformation;
    1718 
    1719  // Runtime values that depend on the graphics hardware being used.
    1720  // These values are not saved in 3dm files.
    1721  double m__MIN_NEAR_DIST = ON_Viewport::DefaultMinNearDist;
    1722  double m__MIN_NEAR_OVER_FAR = ON_Viewport::DefaultMinNearOverFar;
    1723 
    1724 private:
    1725  mutable ON_SHA1_Hash m_projection_content_sha1 = ON_SHA1_Hash::ZeroDigest;
    1726 };
    1727 
    1728 ON_DECL
    1729 bool
    1730 ON_GetViewportRotationAngles(
    1731  const ON_3dVector&, // X, // X,Y,Z must be a right handed orthonormal basis
    1732  const ON_3dVector&, // Y,
    1733  const ON_3dVector&, // Z,
    1734  double*, // angle1, // returns rotation about world Z
    1735  double*, // angle2, // returns rotation about world X ( 0 <= a2 <= pi )
    1736  double* // angle3 // returns rotation about world Z
    1737  );
    1738 
    1739 ON_DECL
    1740 bool
    1741 ON_ViewportFromRhinoView( // create ON_Viewport from legacy Rhino projection info
    1742  ON::view_projection, // projection,
    1743  const ON_3dPoint&, // rhvp_target, // 3d point
    1744  double, // rhvp_angle1 in radians
    1745  double, // rhvp_angle2 in radians
    1746  double, // rhvp_angle3 in radians
    1747  double, // rhvp_viewsize, // > 0
    1748  double, // rhvp_cameradist, // > 0
    1749  int, // screen_width,
    1750  int, // screen_height,
    1751  ON_Viewport&
    1752  );
    1753 
    1754 /*
    1755 Description:
    1756  Calculate the corners of the polygon that is the
    1757  intersection of a view frustum with and infinte plane.
    1758 Parameters:
    1759  vp - [in] defines view frustum
    1760  plane_equation - [in] defined infinte plane
    1761  points - [out] corners of the polygon.
    1762  If true is returned and points.Count() is zero, then
    1763  the plane missed the frustum. Note that the start/end
    1764  point is not duplicated in the list.
    1765 Returns:
    1766  True if input was valid, false otherwise. Note that
    1767  even when true is returned, the returned points.Count()
    1768  may be zero if the plane and frustum do not intersect.
    1769 */
    1770 ON_DECL
    1771 bool
    1772 ON_IntersectViewFrustumPlane(
    1773  const ON_Viewport& vp,
    1774  const ON_PlaneEquation& plane_equation,
    1775  ON_SimpleArray<ON_3dPoint>& points
    1776  );
    1777 
    1778 #endif
    1779 
    virtual bool Transform(const ON_Xform &xform)
    ON_UUID is a 16 byte universally unique identifier.
    Definition: opennurbs_uuid.h:32
    virtual int Dimension() const
    Definition: opennurbs_ipoint.h:246
    @@ -107,9 +105,9 @@ $(function() {
    diff --git a/6/d9/d4e/opennurbs__polyedgecurve_8h_source.html b/6/d9/d4e/opennurbs__polyedgecurve_8h_source.html index a7a82bed..5cb807c4 100644 --- a/6/d9/d4e/opennurbs__polyedgecurve_8h_source.html +++ b/6/d9/d4e/opennurbs__polyedgecurve_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_polyedgecurve.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_polyedgecurve.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d9/d50/class_o_n___user_data_item_filter.html b/6/d9/d50/class_o_n___user_data_item_filter.html index 5da5fdf4..9f4e38be 100644 --- a/6/d9/d50/class_o_n___user_data_item_filter.html +++ b/6/d9/d50/class_o_n___user_data_item_filter.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UserDataItemFilter Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d55/class_o_n__3f_point-members.html b/6/d9/d55/class_o_n__3f_point-members.html index c40c7590..e7387cc9 100644 --- a/6/d9/d55/class_o_n__3f_point-members.html +++ b/6/d9/d55/class_o_n__3f_point-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d56/class_o_n___internal___font_glyph_pool-members.html b/6/d9/d56/class_o_n___internal___font_glyph_pool-members.html index 79ec6316..f0610013 100644 --- a/6/d9/d56/class_o_n___internal___font_glyph_pool-members.html +++ b/6/d9/d56/class_o_n___internal___font_glyph_pool-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d5a/class_o_n___mesh_face_list-members.html b/6/d9/d5a/class_o_n___mesh_face_list-members.html index f4b6f7af..1651b4ac 100644 --- a/6/d9/d5a/class_o_n___mesh_face_list-members.html +++ b/6/d9/d5a/class_o_n___mesh_face_list-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d5b/opennurbs__model__component_8h_source.html b/6/d9/d5b/opennurbs__model__component_8h_source.html index cf16ec23..a222914f 100644 --- a/6/d9/d5b/opennurbs__model__component_8h_source.html +++ b/6/d9/d5b/opennurbs__model__component_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_model_component.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_model_component.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_model_component.h
    -
    1 /*
    2 //
    3 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    5 // McNeel & Associates.
    6 //
    7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    10 //
    11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    12 //
    13 ////////////////////////////////////////////////////////////////
    14 */
    15 
    16 #if !defined(ON_MODEL_COMPONENT_INC_)
    17 #define ON_MODEL_COMPONENT_INC_
    18 
    19 /*
    20 Description:
    21  The ON_ModelComponent class is a base class for all components in a
    22  model and manages the index, id and other information common to all
    23  components in a model.
    24 */
    25 class ON_CLASS ON_ModelComponent : public ON_Object
    26 {
    27  ON_OBJECT_DECLARE(ON_ModelComponent);
    28 
    29 public:
    30  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    31 
    32  void Dump(
    33  ON_TextLog&
    34  ) const override;
    35 
    36  unsigned int SizeOf() const override;
    37 
    38 
    39  ON__UINT32 DataCRC(
    40  ON__UINT32 current_remainder
    41  ) const override;
    42 
    43  ON_UUID ModelObjectId() const override;
    44 
    45 public:
    46 
    47 #pragma region RH_C_SHARED_ENUM [ON_ModelComponent::Type] [Rhino.DocObjects.ModelComponentType] [public:byte]
    48  ///<summary>
    49  ///The ON_ModelComponent::Type enum has a value for each explicit component type
    50  ///and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator
    51  ///instance to iterate over the ON_ModelComponent::Type values.
    52  ///</summary>
    53  enum class Type : unsigned char
    54  {
    55  ///<summary>No value set.</summary>
    56  Unset = 0,
    57  ///<summary>Embedded image (bitmap) components.</summary>
    58  Image = 1,
    59  ///<summary>Texture mapping.</summary>
    60  TextureMapping = 2,
    61  ///<summary>Render material.</summary>
    62  RenderMaterial = 3,
    63  ///<summary>Line pattern (linetype).</summary>
    64  LinePattern = 4,
    65  ///<summary>Layer.</summary>
    66  Layer = 5,
    67  ///<summary>Group.</summary>
    68  Group = 6,
    69  ///<summary>Text style.</summary>
    70  TextStyle = 7,
    71  ///<summary>AnnotationDimension style.</summary>
    72  DimStyle = 8,
    73  ///<summary>Render light.</summary>
    74  RenderLight = 9,
    75  ///<summary>Hatch pattern.</summary>
    76  HatchPattern = 10,
    77  ///<summary>Instance definition.</summary>
    78  InstanceDefinition = 11,
    79  ///<summary>Model objects (points, curves, surfaces, ..., annotation, page details, ...), including objects referenced by instance definitions.</summary>
    80  ModelGeometry = 12,
    81  ///<summary>History record.</summary>
    82  HistoryRecord = 13,
    83  ///<summary>Multiple component types.
    84  /// Used when a component type filter must include all explicit component types.
    85  ///</summary>
    86  Mixed = 0xFE
    87  };
    88 #pragma endregion
    89 
    90  static ON_ModelComponent::Type ComponentTypeFromUnsigned(
    91  unsigned int component_type_as_unsigned
    92  );
    93 
    94  static const ON_wString ComponentTypeToString(
    96  );
    97 
    98  /*
    99  Parameters:
    100  component_type - [in]
    101  Returns:
    102  True if component_type is a valid enum value,
    103  and not equal to ON_ModelComponent::Type::Unset.
    104  */
    105  static bool ComponentTypeIsValid(
    106  ON_ModelComponent::Type component_type
    107  );
    108 
    109  /*
    110  Parameters:
    111  component_type - [in]
    112  Returns:
    113  True if component_type is a valid enum value,
    114  and not equal to ON_ModelComponent::Type::Unset,
    115  and not equal to ON_ModelComponent::Type::Mixed.
    116  */
    117  static bool ComponentTypeIsValidAndNotMixed(
    118  ON_ModelComponent::Type component_type
    119  );
    120 
    121  /*
    122  Parameters:
    123  component_type - [in]
    124  Returns:
    125  True if component's of the specified type require uniquen names.
    126  Remarks:
    127  In general, component names ignore case and parent when testing for
    128  equality.
    129  However, there are exceptions. Use
    130  ON_ModelComponent::UniqueNameIncludesParent() and
    131  ON_ModelComponent::UniqueNameIgnoresCase()
    132  to test for exceptions.
    133  */
    134  static bool UniqueNameRequired(
    135  ON_ModelComponent::Type component_type
    136  );
    137 
    138  /*
    139  Parameters:
    140  component_type - [in]
    141  Returns:
    142  True if objects with the same name and different parents are considered
    143  to have a unique name. This typically means the user interface for the
    144  object names is some type of tree.
    145  Remarks:
    146  Currently, layers are the only object type where this property is true.
    147  */
    148  static bool UniqueNameIncludesParent(
    149  ON_ModelComponent::Type component_type
    150  );
    151 
    152  /*
    153  Parameters:
    154  component_type - [in]
    155  Returns:
    156  True if component names ignore case when testing for equality.
    157  Remarks:
    158  Currently all other component types except for groups ignore
    159  case when testing for equality.
    160  */
    161  static bool UniqueNameIgnoresCase(
    162  ON_ModelComponent::Type component_type
    163  );
    164 
    165  static bool IndexRequired(
    166  ON_ModelComponent::Type component_type
    167  );
    168 
    169  /*
    170  Returns:
    171  True if a componenent name can begin with the first code point.
    172  Remarks:
    173  Component names cannot begin with a (, ), [, ], {, }, or space.
    174  These brackets can be the second or later code points.
    175  A space can be an interior code point.
    176  */
    177  static bool IsValidComponentNameFirstCodePoint(
    178  ON__UINT32 unicode_code_point
    179  );
    180 
    181  /*
    182  Parameters:
    183  length - [in]
    184  number of wchar_t elements in candidate_component_name[] or -1
    185  if it is a null terminated string.
    186  candidate_component_name - [in]
    187  The first code point is decoded from this string
    188  and passed to ON_ModelComponent::IsValidComponentNameFirstCodePoint().
    189  Returns:
    190  True if a componenent name can begin with the first code point.
    191  Remarks:
    192  Component names cannot begin with a (, ), [, ], {, }, or space.
    193  These brackets can be the second or later code points.
    194  A space can be an interior code point.
    195  */
    196  static bool IsValidComponentNameFirstCodePoint(
    197  int length,
    198  const wchar_t* candidate_component_name
    199  );
    200 
    201  static bool IsValidComponentName(
    202  const wchar_t* candidate_component_name
    203  );
    204 
    205  static bool IsValidComponentName(
    206  const ON_wString& candidate_component_name
    207  );
    208 
    209  static bool IsValidComponentName(
    210  size_t length,
    211  const wchar_t* candidate_component_name
    212  );
    213 
    214  /*
    215  Parameters:
    216  model_component - [in]
    217  model_manfest - [in]
    218  current model contents
    219  valid_name - [in]
    220  Valid name for this component in a model with the specified manifest.
    221  Returns:
    222  true: model_component.Name() is valid
    223  false: model_component.Name() is not valid
    224  */
    225  static bool IsValidComponentName(
    226  const class ON_ComponentManifest& model_manfest,
    227  const ON_ModelComponent& model_component,
    228  bool bPermitReferencePrefix,
    229  ON_wString& valid_name
    230  );
    231 
    232 public:
    233  static const ON_ModelComponent Unset;
    234 
    235  ON_ModelComponent() ON_NOEXCEPT;
    236 
    237  ~ON_ModelComponent() = default;
    238 
    239  // Locked status of source attributes is not copied to permit copy and modify operations.
    240  // Runtime serial number and content version number are not copied.
    242  const ON_ModelComponent& source
    243  );
    244 
    245  /*
    246  Description:
    247  Sets and locks the component type attribute.
    248  Parameters:
    249  component_type - [in]
    250  */
    252  ON_ModelComponent::Type component_type
    253  ) ON_NOEXCEPT;
    254 
    255  // Locked status of source attributes is not copied to permit copy and modify operations.
    257  ON_ModelComponent::Type component_type,
    258  const ON_ModelComponent& source
    259  ) ON_NOEXCEPT;
    260 
    261  /*
    262  Remarks:
    263  operator= will not change locked destination attributes.
    264  Locked status of source attributes is not copied to permit copy and modify operations.
    265  */
    266  ON_ModelComponent& operator=(const ON_ModelComponent& source);
    267 
    268  /*
    269  The ON_ModelComponent::Attributes enum is used to set bits that identify
    270  model component attributes.
    271  */
    272  enum Attributes : unsigned int
    273  {
    274  NoAttributes = 0U,
    275 
    276  ComponentSerialNumberAttribute = 0x0001U,
    277  TypeAttribute = 0x0002U,
    278  ModelSerialNumberAttribute = 0x0004U,
    279  IdAttribute = 0x0008U,
    280  IndexAttribute = 0x0010U,
    281  NameAttribute = 0x0020U,
    282  ParentIdAttribute = 0x0040U,
    283  DeletedNameAttribute = 0x0080U,
    284  ComponentStatusAttribute = 0x0100U,
    285 
    286  // Default model attributes saved in binary archives.
    287  // Id, ParentId, Name, Index
    288  // Do not include SystemComponentAttribute in BinaryArchiveAttributes
    289  BinaryArchiveAttributes = 0x78U,
    290 
    291  // Do not include SystemComponentAttribute in AllAttributes
    292  AllAttributes = 0x1FFU,
    293 
    294  SystemComponentAttribute = 0x8000U
    295  };
    296 
    297  unsigned int CopyFrom(
    298  const ON_ModelComponent& src,
    299  unsigned int attributes_filter
    300  );
    301 
    302  bool WriteModelComponentAttributes(
    303  class ON_BinaryArchive& archive,
    304  unsigned int attributes_filter
    305  ) const;
    306 
    307  bool ReadModelComponentAttributes(
    308  class ON_BinaryArchive& archive
    309  );
    310 
    311  ///////////////////////////////////////////////////////////////////////////////
    312  //
    313  // Model Serial Number interface
    314  //
    315  // The ModelSerialNumber() identifies the model that manages the component.
    316  // If the component is from some type of reference model, then one or both of
    317  // the reference model serial number and InstanceDefinitionModelSerialNumber()
    318  // identify the source model.
    319  //
    320 
    321  /*
    322  Description:
    323  Specify the model that is managing this component.
    324  Parameters:
    325  model_serial_number - [in]
    326  In Rhino, this is the document runtime serial number.
    327  Returns:
    328  true if the model_serial_number value was changed to component_model_serial_number or is already equal to component_model_serial_number.
    329  false if the model_serial_number value is locked and component_model_serial_number != locked value.
    330  */
    331  bool SetModelSerialNumber(
    332  unsigned int model_serial_number
    333  );
    334 
    335  /*
    336  Description:
    337  Specify the model that is managing this component.
    338  Parameters:
    339  model_serial_number - [in]
    340  In Rhino, this is the document runtime serial number.
    341  reference_model_serial_number - [in]
    342  In Rhino, this is the worksession reference model serial number.
    343  instance_definition_model_serial_number - [in]
    344  In Rhino, this is the linked instance definition model serial number.
    345  Returns:
    346  true if the model_serial_number value was changed to component_model_serial_number or is already equal to component_model_serial_number.
    347  false if the model_serial_number value is locked and component_model_serial_number != locked value.
    348  */
    349  bool SetModelSerialNumber(
    350  unsigned int model_serial_number,
    351  unsigned int reference_model_serial_number,
    352  unsigned int instance_definition_model_serial_number
    353  );
    354 
    355  /*
    356  Returns:
    357  A value identifing the model that manages this component.
    358  Remarks:
    359  If the component is being managed by a model, this value identifies the model.
    360  In Rhino, this value is the document runtime serial number.
    361  Typically this value is set and locked by the code that adds
    362  a component to a model.
    363  This value is copied by the copy constructor and operator=.
    364  This value is not saved in .3dm archives.
    365  */
    366  unsigned int ModelSerialNumber() const;
    367 
    368  /*
    369  Returns:
    370  When a compoent is in a model for reference, this value identifies the
    371  reference model.
    372  Remarks:
    373  Reference components are not saved in .3dm archives.
    374  Typically this value is set and locked by the code that adds
    375  a component to a model.
    376  This value is copied by the copy constructor and operator=.
    377  This value is not saved in .3dm archives.
    378 
    379  In Rhino, this value is a worksession model runtime serial number and
    380  these values are used.
    381  0: not from a worksession reference model
    382  1: from an unidentified reference model
    383  2-1000: reserved for future use
    384  >1000: worksession reference model serial number
    385  */
    386  unsigned int ReferenceModelSerialNumber() const;
    387 
    388  /*
    389  Returns:
    390  When a component is in a model as part of the information required
    391  for a linked instance definition, this value identifies the the linked
    392  instance definition reference model.
    393  Remarks:
    394  Reference components are not saved in .3dm archives.
    395  Typically this value is set and locked by the code that adds
    396  a component to a model.
    397  This value is copied by the copy constructor and operator=.
    398  This value is not saved in .3dm archives.
    399 
    400  In Rhino, this value is a linked instance definition runtime serial number
    401  and these values are used..
    402  0: Active model component.
    403  1-1000: reserved for future use
    404  >1000: linked instance defintion serial number
    405  */
    406  unsigned int InstanceDefinitionModelSerialNumber() const;
    407 
    408  /*
    409  Description:
    410  Sets the model serial number, reference model serial number and instance
    411  definition model serial number values to 0 and flags these values
    412  as unset.
    413  */
    414  bool ClearModelSerialNumber();
    415 
    416  /*
    417  Description:
    418  Calling LockModelSerialNumber() will prohibit future changes to the
    419  ModelSerialNumber(), ReferenceModelSerialNumber(), and
    420  InstanceDefinitionModelSerialNumber() attributes.
    421  */
    422  void LockModelSerialNumber();
    423 
    424  /*
    425  Returns:
    426  True if the ModelSerialNumber(), ReferenceModelSerialNumber(), and
    427  InstanceDefinitionModelSerialNumber() attributes are locked.
    428  */
    429  bool ModelSerialNumberIsLocked() const;
    430 
    431  /*
    432  Returns:
    433  True if the ModelSerialNumber(), ReferenceModelSerialNumber(), and
    434  InstanceDefinitionModelSerialNumber() attributes are set.
    435  */
    436  bool ModelSerialNumberIsSet() const;
    437 
    438  /*
    439  Returns
    440  True if ReferenceModelSerialNumber() or InstanceDefinitionModelSerialNumber() are not zero.
    441  */
    442  bool IsReferenceComponent() const;
    443 
    444  ///////////////////////////////////////////////////////////////////////////////
    445  //
    446  // Type interface
    447  //
    448 
    449  /*
    450  Returns:
    451  Value of the Type attribute.
    452  Remarks:
    453  If the component is in a model, then the component_type is unique for all components
    454  of identical type in the model and is locked.
    455  */
    456  ON_ModelComponent::Type ComponentType() const;
    457 
    458  /*
    459  Parameters:
    460  component_component_type - [in]
    461  Returns:
    462  true if the component_type value was changed to component_component_type or is already equal to component_component_type.
    463  false if the component_type value is locked and component_component_type != locked value.
    464  */
    465  bool SetComponentType(
    466  ON_ModelComponent::Type component_component_type
    467  );
    468 
    469  /*
    470  Description:
    471  Set the model serial number value to the ON_ModelComponent::Unset.Type()
    472  and change the state so TypeIsSet() returns false.
    473  */
    474  bool ClearComponentType();
    475 
    476  /*
    477  Description:
    478  Calling LockType() will prhibit future changes to the Type attribute.
    479  */
    480  void LockComponentType();
    481 
    482  /*
    483  Returns:
    484  True if the Type attribute is locked.
    485  */
    486  bool ComponentTypeIsLocked() const;
    487 
    488  /*
    489  Returns:
    490  True if the Type attribute is set.
    491  */
    492  bool ComponentTypeIsSet() const;
    493 
    494  ///////////////////////////////////////////////////////////////////////////////
    495  //
    496  // Id interface
    497  //
    498  // The component id is intended to be unique in the context of a model.
    499  //
    500 
    501  /*
    502  Returns:
    503  Value of the Id attribute.
    504  Remarks:
    505  If the component is in a model, then the id is unique for all components in
    506  the model and is locked.
    507  */
    508  const ON_UUID& Id() const;
    509 
    510  bool IdIsNil() const;
    511  bool IdIsNotNil() const;
    512 
    513  /*
    514  Parameters:
    515  component_id - [in]
    516  Returns:
    517  true if the id value was changed to component_id or is already equal to component_id.
    518  false if the id value is locked and component_id != locked value.
    519  */
    520  bool SetId(
    521  const ON_UUID& component_id
    522  );
    523 
    524  /*
    525  Description:
    526  Sets the id to a new value created by ON_CreateUuid().
    527  Returns:
    528  ON_nil_uuid: Id is locked.
    529  Otherwise the value of the new id.
    530  */
    531  const ON_UUID& SetId();
    532 
    533  /*
    534  Description:
    535  If the it is nil, call SetId().
    536  */
    537  const ON_UUID& IfIdIsNilSetId();
    538 
    539  /*
    540  Description:
    541  Sets the id to a new value created by ON_CreateUuid() and locks the
    542  id attribute so it cannot be changed.
    543  Returns:
    544  ON_nil_uuid: Id is locked.
    545  Otherwise the value of the new id.
    546  */
    547  const ON_UUID& SetAndLockId();
    548 
    549 
    550  /*
    551  Description:
    552  Set the component id value to the ON_ModelComponent::Unset.ModelComponentId()
    553  and change the state so ModelComponentIdIsSet() returns false.
    554  */
    555  bool ClearId();
    556 
    557  /*
    558  Description:
    559  Calling LockModelComponentId() will prhibit future changes to the ModelComponentId attribute.
    560  */
    561  void LockId();
    562 
    563  /*
    564  Returns:
    565  True if the ModelComponentId attribute is locked.
    566  */
    567  bool IdIsLocked() const;
    568 
    569  /*
    570  Returns:
    571  True if the ModelComponentId attribute is set.
    572  */
    573  bool IdIsSet() const;
    574 
    575 
    576  ///////////////////////////////////////////////////////////////////////////////
    577  //
    578  // Index interface
    579  //
    580  // When a component is managed by a model, the component index is identifies
    581  // the component within the context of that model.
    582  //
    583 
    584  /*
    585  Returns:
    586  Value of the runtime model component index attribute.
    587  Remarks:
    588  If the component is in a model, then the index is unique for all components
    589  of identical type in the model and is locked.
    590  If the index has not been set, ON_UNSET_INT_INDEX is returned.
    591  The Index() value can change when saved in an archive (.3dm file).
    592  Use the Id() when you need to reference model compoenents in an archive.
    593  */
    594  int Index() const;
    595 
    596  /*
    597  Returns:
    598  Value of the model component index attribute.
    599  Parameters:
    600  unset_index_value - [in]
    601  Value to return if the index has not been set.
    602  ON_UNSET_INT_INDEX or indices of default components are often
    603  used for this parameter.
    604  Returns:
    605  IndexIsSet() ? Index() : unset_index_value;
    606  Remarks:
    607  If the component is in a model, then the index is unique for all components
    608  of identical type in the model and is locked.
    609  */
    610  int Index(
    611  int unset_index_value
    612  ) const;
    613 
    614  /*
    615  Parameters:
    616  component_index - [in]
    617  Returns:
    618  true if the index value was changed to component_index or is already equal to component_index.
    619  false if the index value is locked and component_index != locked value.
    620  */
    621  bool SetIndex(
    622  int component_index
    623  );
    624 
    625  /*
    626  Description:
    627  Set the component index value to the ON_ModelComponent::Unset.ModelComponentIndex()
    628  and change the state so ModelComponentIndexIsSet() returns false.
    629  */
    630  bool ClearIndex();
    631 
    632  /*
    633  Description:
    634  Calling LockModelComponentIndex() will prhibit future changes to the ModelComponentIndex attribute.
    635  */
    636  void LockIndex();
    637 
    638  /*
    639  Returns:
    640  True if the ModelComponentIndex attribute is locked.
    641  */
    642  bool IndexIsLocked() const;
    643 
    644  /*
    645  Returns:
    646  True if the ModelComponentIndex attribute is set.
    647  */
    648  bool IndexIsSet() const;
    649 
    650  ///////////////////////////////////////////////////////////////////////////////
    651  //
    652  // Parent object interface
    653  //
    654  //
    655  const ON_UUID& ParentId() const;
    656 
    657  bool ParentIdIsNil() const;
    658  bool ParentIdIsNotNil() const;
    659 
    660  bool SetParentId(
    661  const ON_UUID& parent_id
    662  );
    663  bool ClearParentId();
    664  void LockParentId();
    665  bool ParentIdIsLocked() const;
    666  bool ParentIdIsSet() const;
    667 
    668  ///////////////////////////////////////////////////////////////////////////////
    669  //
    670  // Model component locked, hidden, deleted, selected, highlights, damaged, ... status interface
    671  //
    672  //
    673  ON_ComponentStatus ModelComponentStatus() const;
    674 
    675  bool SetModelComponentStatus(
    676  ON_ComponentStatus component_status
    677  );
    678 
    679  bool ClearModelComponentStatus();
    680 
    681  void LockModelComponentStatus();
    682 
    683  bool ModelComponentStatusIsLocked() const;
    684 
    685  bool ModelComponentStatusIsSet() const;
    686 
    687  /*
    688  Returns:
    689  The component's deleted state.
    690  Remarks:
    691  Deleted components can be undeleted.
    692  */
    693  bool IsDeleted() const;
    694 
    695  /*
    696  Parameters:
    697  bDeleted - [in]
    698  manifest - [in/out]
    699  optional manifest to update
    700  Returns:
    701  True if the component's deleted state was changed from
    702  !bDeleted to bDeleted and all other name and manifest information
    703  was updated as expected.
    704  */
    705  bool SetDeletedModelComponentState(
    706  bool bDeleted,
    707  class ON_ComponentManifest* manifest
    708  );
    709 
    710  /*
    711  Returns:
    712  The component's user interface locked state.
    713  Remarks:
    714  This is a user interface locked state and does not effect
    715  changing the component values.
    716  */
    717  bool IsLocked() const;
    718 
    719  void SetLockedModelComponentState(
    720  bool bLocked
    721  );
    722 
    723  /*
    724  Returns:
    725  The component's user interface hidden state.
    726  Remarks:
    727  This is a user interface hidden state and does not effect
    728  changing the component values.
    729  */
    730  bool IsHidden() const;
    731 
    732  void SetHiddenModelComponentState(
    733  bool bHidden
    734  );
    735 
    736 
    737  ///////////////////////////////////////////////////////////////////////////////
    738  //
    739  // Name interface
    740  //
    741  //
    742 
    743  /*
    744  Returns:
    745  Value of the Name attribute.
    746  Remarks:
    747  If the component is in a model, then the name is unique among all components in
    748  the model. Names are formatted as reference : parent::leaf.
    749  For example in "A.3dm : Z", "A.3dm" is the reference and "Z" is the leaf.
    750  For a layer full path "X::Y::Z", "X::Y" is the parent and "Z" is the leaf.
    751  For most models, only the leaf is present in the name.
    752  The reference portion appears when a model component originates in a reference file
    753  (a linked instance definition with reference component names or a worksession reference).
    754  Components with a tree hierarchy, like layers, can have a parent and leaf.
    755  */
    756  const ON_wString Name() const;
    757 
    758  const ON_wString DeletedName() const;
    759 
    760  /*
    761  Parameters:
    762  component_name - [out]
    763  Returns:
    764  A pointer to the string in component_name.
    765  */
    766  const wchar_t* GetName(
    767  ON_wString& component_name
    768  ) const;
    769 
    770  /*
    771  Description:
    772  Get a platform independent hash of the name suitable for equality testing
    773  and binary searching.
    774  When testing for equality or doing binary searches, using ON_NameHash values
    775  is faster than using the CompareName or ON_wString::CompareAttributeName.
    776  */
    777  const ON_NameHash& NameHash() const;
    778  const ON_NameHash& DeletedNameHash() const;
    779 
    780  /*
    781  Parameters:
    782  new_name - [in]
    783  Returns:
    784  If new_name is empty or a valid component name, then name hash this component would have if SetName(new_name) were called.
    785  If new_name is not valid, then ON_NameHash::UnsetNameHash is returned.
    786  Remarks:
    787  This function trims leading and trailing white space, includes the parent id when
    788  ON_ModelComponent::UniqueNameIncludesParent(ComponentType()) is true,
    789  and uses ON_ModelComponent::IsValidComponentName() to determine if a
    790  non-empty name is valid.
    791  */
    792  const ON_NameHash NewNameHash(
    793  const wchar_t* new_name
    794  ) const;
    795 
    796  /*
    797  Description:
    798  Returns the string " : ". This is the string Rhino uses
    799  to separate the reference file names from and model component names
    800  read from those files.
    801 
    802  Example:
    803  File A.3dm contains a layer "alpha", dimstyle "a1", an embedded block "A_blk",
    804  and a linked block "X" referencing B.3dm with reference component names.
    805  File B.3dm contains a layer "beta", dimstyle "b1", an embedded block "B_blk",
    806  and linked block "Y" referencing C.3dm.
    807  File C.3dm contains a layer gamma, dimstyle "c1", an embedded block "C_blk",
    808  and linked block "Z" referencing D.3dm.
    809  File D.3dm contains a layer "delta", dimstyle "d1", and an embedded block "D_blk".
    810 
    811  Reading file A.3dm will craete the following components:
    812  Layers:
    813  alpha
    814  X>B.3dm
    815  beta (full layer path "X>B.3dm::beta")
    816  Y>C.3dm
    817  gamma (full layer path "Y>C.3dm::gamma")
    818  Z>D.3dm
    819  delta (full layer path "Z>D.3dm::delta")
    820  Blocks:
    821  X
    822  A_blk
    823  Y
    824  B.3dm : B_blk
    825  Z
    826  C.3dm : C_blk
    827  D.3dm : D_blk
    828  Annotation styles
    829  a1
    830  B.3dm : b1
    831  C.3dm : c1
    832  D.3dm : d1
    833 
    834  See Also:
    835  ON_ModelComponent::ReferencePrefixDelimiter = " : "
    836  ON_ModelComponent::ReferencePrefixSeparator = ">"
    837  ON_ModelComponent::NamePathSeparator = "::"
    838  */
    840 
    841  /*
    842  Description:
    843  Returns the string ">". This is the string Rhino uses
    844  to separate the block definition name and linked file name
    845  in grandparent layers.
    846 
    847  Example:
    848  File A.3dm contains a layer "alpha", dimstyle "a1", an embedded block "A_blk",
    849  and a linked block "X" referencing B.3dm with reference component names.
    850  File B.3dm contains a layer "beta", dimstyle "b1", an embedded block "B_blk",
    851  and linked block "Y" referencing C.3dm.
    852  File C.3dm contains a layer gamma, dimstyle "c1", an embedded block "C_blk",
    853  and linked block "Z" referencing D.3dm.
    854  File D.3dm contains a layer "delta", dimstyle "d1", and an embedded block "D_blk".
    855 
    856  Reading file A.3dm will craete the following components:
    857  Layers:
    858  alpha
    859  X>B.3dm
    860  beta (full layer path "X>B.3dm::beta")
    861  Y>C.3dm
    862  gamma (full layer path "Y>C.3dm::gamma")
    863  Z>D.3dm
    864  delta (full layer path "Z>D.3dm::delta")
    865  Blocks:
    866  X
    867  A_blk
    868  Y
    869  B.3dm : B_blk
    870  Z
    871  C.3dm : C_blk
    872  D.3dm : D_blk
    873  Annotation styles
    874  a1
    875  B.3dm : b1
    876  C.3dm : c1
    877  D.3dm : d1
    878 
    879  See Also:
    880  ON_ModelComponent::ReferencePrefixDelimiter = " : "
    881  ON_ModelComponent::ReferencePrefixSeparator = ">"
    882  ON_ModelComponent::NamePathSeparator = "::"
    883  */
    885 
    886 
    887  /*
    888  Description:
    889  Returns the string "::". This is the string Rhino uses in layer
    890  full path names to separate the names of individual layers.
    891 
    892  Example:
    893  If a model has layers
    894  A
    895  B
    896  C
    897  then the full path names are
    898  "A", "A::B", "A::B::C".
    899 
    900  See Also:
    901  ON_ModelComponent::ReferencePrefixDelimiter = " : "
    902  ON_ModelComponent::ReferencePrefixSeparator = ">"
    903  ON_ModelComponent::NamePathSeparator = "::"
    904  */
    906 
    907  ///*
    908  //Description:
    909  //Parameters:
    910  // reference_prefix - [in]
    911  //Returns:
    912  // The worksession component name reference prefix.
    913  //Example:
    914  // "[ A.3dm ]" = ON_ModelComponent::WorksessionReferencePrefix("A.3dm")
    915  //*/
    916  //static const ON_wString WorksessionReferencePrefix(
    917  // const wchar_t* reference_prefix,
    918  // bool bAppendReferencePrefixDelimiter
    919  //);
    920 
    921 
    922  /*
    923  Description:
    924  Test a string to see if its beginning matches the
    925  string returned by ON_ModelComponent::NameReferenceDelimiter.
    926  Parameters:
    927  s - [in];
    928  string to test.
    929  Returns:
    930  null:
    931  The beginning of the string does not match ON_ModelComponent::NameReferenceDelimiter.
    932  non-null:
    933  The beginning of the string matches ON_ModelComponent::NameReferenceDelimiter.
    934  The returned pointer is the first character in s after the last character
    935  of the delimiter. Put another way, if the beginning of s matches
    936  the string ON_ModelComponent::NameReferenceDelimiter, then the returned pointer is
    937  s + ON_ModelComponent::NameReferenceDelimiter.Length().
    938  */
    939  static const wchar_t* IsReferencePrefixDelimiter(
    940  const wchar_t* s
    941  );
    942 
    943  /*
    944  Description:
    945  Test a string to see if its beginning matches the
    946  string returned by ON_ModelComponent::NameReferenceSeparator.
    947  Parameters:
    948  s - [in];
    949  string to test.
    950  Returns:
    951  null:
    952  The beginning of the string does not match ON_ModelComponent::NameReferenceSeparator.
    953  non-null:
    954  The beginning of the string matches ON_ModelComponent::NameReferenceSeparator.
    955  The returned pointer is the first character in s after the last character
    956  of the delimiter. Put another way, if the beginning of s matches
    957  the string ON_ModelComponent::NameReferenceSeparator, then the returned pointer is
    958  s + ON_ModelComponent::NameReferenceSeparator.Length().
    959  */
    960  static const wchar_t* IsReferencePrefixSeparator(
    961  const wchar_t* s
    962  );
    963 
    964  /*
    965  Description:
    966  Test a string to see if its beginning matches the
    967  string returned by ON_ModelComponent::NamePathSeparator.
    968  Parameters:
    969  s - [in];
    970  string to test.
    971  Returns:
    972  null:
    973  The beginning of the string does not match ON_ModelComponent::NamePathSeparator.
    974  non-null:
    975  The beginning of the string matches ON_ModelComponent::NamePathSeparator.
    976  The returned pointer is the first character in s after the last character
    977  of the delimiter. Put another way, if the beginning of s matches
    978  the string ON_ModelComponent::NamePathSeparator, then the returned pointer is
    979  s + ON_ModelComponent::NamePathSeparator.Length().
    980  */
    981  static const wchar_t* IsNamePathSeparator(
    982  const wchar_t* s
    983  );
    984 
    985  /*
    986  Example:
    987  If a full layer name is "A.3dm : X::Y::Z", then
    988  reference_prefix = "A.3dm"
    989  name_parent = "X::Y"
    990  name_leaf = "Z"
    991  */
    992  static void SplitName(
    993  const wchar_t* name,
    994  ON_wString& reference_prefix,
    995  ON_wString& name_parent,
    996  ON_wString& name_leaf
    997  );
    998 
    999  /*
    1000  Parameters:
    1001  name - [in]
    1002  Example:
    1003  If the name is "A.3dm : X", then "A.3dm" is returned.
    1004  */
    1005  static const ON_wString NameReferencePrefix(
    1006  const wchar_t* name
    1007  );
    1008 
    1009  /*
    1010  Parameters:
    1011  name - [in]
    1012  bIncludeReference - [in]
    1013  Example:
    1014  If the name is "A.3dm>B.3dm : X::Y::Z" and bIncludeReference is true,
    1015  then "A.3dm>B.3dm : X::Y" is returned.
    1016  If the name is "A.3dm>B.3dm : X::Y::Z" and bIncludeReference is false,
    1017  then "X::Y" is returned.
    1018  */
    1019  static const ON_wString NameParent(
    1020  const wchar_t* name,
    1021  bool bIncludeReference
    1022  );
    1023 
    1024  /*
    1025  Example:
    1026  If the name is "A.3dm>B.3dm : X::Y::Z",
    1027  then name_leaf = "Z" is returned.
    1028  */
    1029  static const ON_wString NameLeaf(
    1030  const wchar_t* name
    1031  );
    1032 
    1033  /*
    1034  Parameters:
    1035  name - [in]
    1036  Example:
    1037  If the name is "A.3dm : X", then "X" is returned.
    1038  */
    1039  static const ON_wString RemoveReferencePrefix(
    1040  const wchar_t* name
    1041  );
    1042 
    1043  /*
    1044  Description:
    1045  Remove all occurances of ON::NameReferenceDelimiter() from name.
    1046  */
    1047  static const ON_wString RemoveAllReferencePrefixDelimiters(
    1048  const wchar_t* name
    1049  );
    1050 
    1051  /*
    1052  Description:
    1053  Remove any trailing occurance of ON_ModelComponent::NameReferenceDelimiter from name.
    1054  Example:
    1055  "A.3dm" = ON_ModelComponent::RemoveTrailingRemoveReferencePrefixDelimiter("A.3dm : ");
    1056  */
    1057  static const ON_wString RemoveTrailingReferencePrefixDelimiter(
    1058  const wchar_t* name
    1059  );
    1060 
    1061  /*
    1062  Description:
    1063  Remove any trailing occurance of ON_ModelComponent::NameReferenceSeparator from name.
    1064  */
    1065  static const ON_wString RemoveTrailingReferencePrefixSeparator(
    1066  const wchar_t* name
    1067  );
    1068 
    1069  /*
    1070  Description:
    1071  Remove any trailing occurance of ON_ModelComponent::NamePathSeparator from name.
    1072  */
    1073  static const ON_wString RemoveTrailingNamePathSeparator(
    1074  const wchar_t* name
    1075  );
    1076 
    1077 
    1078 
    1079 private:
    1080  const ON_NameHash& Internal_NameHash() const;
    1081 
    1082 public:
    1083  /*
    1084  Description:
    1085  Expert user function that gets a pointer to the name.
    1086  Returns:
    1087  A pointer to the string that contains the name. This pointer
    1088  must be used immediately and then discarded before any code
    1089  can possibly call SetName() or the ON_ModelComponent destructor
    1090  could be called.
    1091  Remarks:
    1092  About the only good use for this function is when a model compoenent is
    1093  peristent and the name is needed for a formatted string. For any
    1094  other use, call the Name() function and store the result in an
    1095  ON_wString. This function is dangerous because the returned pointer
    1096  will be invalid if SetName() is called.
    1097  */
    1098  const wchar_t* NameAsPointer() const;
    1099 
    1100  /*
    1101  Returns:
    1102  true if the name is unset or is set to the empty string.
    1103  */
    1104  bool NameIsEmpty() const;
    1105 
    1106  /*
    1107  Returns:
    1108  true if the name is set and the value is not the empty string.
    1109  */
    1110  bool NameIsNotEmpty() const;
    1111 
    1112  /*
    1113  Parameters:
    1114  component_name - [in]
    1115  Leading and trailing nonzero unicode code points with values <= ON_wString::Space are ignored.
    1116  Returns:
    1117  true
    1118  if the name attribute was changed to component_name or is already equal to component_name.
    1119  false
    1120  False is returned and no changes are made if
    1121  the name attribute is locked and component_name != locked value
    1122  or
    1123  component_name is not empty and ON_ModelComponent::IsValidComponentName(component_name) is false.
    1124  Remarks:
    1125  If component_name is nullptr or the emtpy string, the NameIsSet() state will still be true.
    1126  */
    1127  bool SetName(
    1128  const wchar_t* component_name
    1129  );
    1130 
    1131  /*
    1132  Description:
    1133  Change the name of a component and optionally update a manifest.
    1134  Parameters:
    1135  new_name - [in]
    1136  New name for the component.
    1137  manifest - [in]
    1138  nullptr or a manifest with an item for the component.
    1139  */
    1140  bool ChangeName(
    1141  const wchar_t* new_name,
    1142  class ON_ComponentManifest* manifest
    1143  );
    1144 
    1145  /*
    1146  Description:
    1147  Set the component name value to the ON_ModelComponent::Unset.Name()
    1148  and change the state so NameIsSet() and DeletedNameIsSet() both return false.
    1149  */
    1150  bool ClearName();
    1151 
    1152  /*
    1153  Description:
    1154  Calling LockName() will prohibit future changes to the Name attribute.
    1155  */
    1156  void LockName();
    1157 
    1158  /*
    1159  Returns:
    1160  True if the Name attribute is locked.
    1161  */
    1162  bool NameIsLocked() const;
    1163 
    1164  /*
    1165  Returns:
    1166  True if the name attribute is set.
    1167  Remarks:
    1168  At most one of NameIsSet() and DeletedNameIsSet() is true.
    1169  A name can be set to the empty string.
    1170  */
    1171  bool NameIsSet() const;
    1172 
    1173  /*
    1174  Returns:
    1175  True if the deleted name attribute is set.
    1176  Remarks:
    1177  At most one of NameIsSet() and DeletedNameIsSet() is true.
    1178  */
    1179  bool DeletedNameIsSet() const;
    1180 
    1181  /*
    1182  Description:
    1183  If NameIsSet() is true, then the name is deleted in a waty that can be undone by calling UndeleteName() and
    1184  the DeletedNameIsSet() property is changed to true.
    1185 
    1186  If NameIsSet() is false or NameIsLocked() is true, then nothing is changed.
    1187 
    1188  Note that a name can be set to the empty string and there is a difference between
    1189  a name being set to the empty string and a name being unset.
    1190  If you want to make the name attribute unset, call ClearName().
    1191  */
    1192  bool DeleteName();
    1193 
    1194  bool UndeleteName();
    1195 
    1196  void LockAllSettingsExceptName();
    1197  bool SetLocalizedSystemComponentName(
    1198  const wchar_t* system_component_localized_name
    1199  );
    1200 
    1201  /*
    1202  Parameters:
    1203  other_name -[in]
    1204  Returns:
    1205  ON_wString::CompareAttributeName(this->Name(), other_name)
    1206  Remarks:
    1207  CompareName() is the correct tool to use when looking up objects by name.
    1208  */
    1209  int CompareName(
    1210  const ON_UUID& other_parent_id,
    1211  const wchar_t* other_name
    1212  ) const;
    1213  int CompareName(
    1214  const wchar_t* other_name
    1215  ) const;
    1216 
    1217  /*
    1218  Parameters:
    1219  other_name -[in]
    1220  Returns:
    1221  int rc = ON_wString::CompareAttributeName(this->Name(), other_name);
    1222  return (0 != rc) ? rc : ON_wString::CompareOrdinal(this->Name(), other_name, false);
    1223  Remarks:
    1224  CompareNameExact() is the correct tool to use when detecting changes in
    1225  case are important. Use CompareName() when searching for components by name.
    1226  */
    1227  int CompareNameExact(
    1228  const ON_UUID& other_parent_id,
    1229  const wchar_t* other_name
    1230  ) const;
    1231  int CompareNameExact(
    1232  const wchar_t* other_name
    1233  ) const;
    1234 
    1235 
    1236  /*
    1237  Parameters:
    1238  a -[in]
    1239  b -[in]
    1240  Returns:
    1241  ON_wString::CompareAttributeName(a.Name(), b.Name() )
    1242  Remarks:
    1243  CompareName() is the correct tool to use when looking up objects by name.
    1244  */
    1245  static int CompareName(
    1246  const ON_ModelComponent& a,
    1247  const ON_ModelComponent& b
    1248  );
    1249 
    1250  /*
    1251  Parameters:
    1252  a -[in]
    1253  b -[in]
    1254  Returns:
    1255  int rc = ON_wString::CompareAttributeName(a.Name(), b.Name());
    1256  return (0 != rc) ? rc : ON_wString::CompareOrdinal(a.Name(), b.Name(), false);
    1257  Remarks:
    1258  CompareNameExact() is the correct tool to use when detecting changes in
    1259  case are important. Use CompareName() when searching for components by name.
    1260  */
    1261  static int CompareNameExact(
    1262  const ON_ModelComponent& a,
    1263  const ON_ModelComponent& b
    1264  );
    1265 
    1266  static int CompareId(
    1267  const ON_ModelComponent& a,
    1268  const ON_ModelComponent& b
    1269  );
    1270 
    1271  /*
    1272  Description
    1273  Call ON_ModelComponent::CompareName() and then ON_ModelComponent::CompareId().
    1274  When used for sorting, will be sorted by name and then by id.
    1275  */
    1276  static int CompareNameAndId(
    1277  const ON_ModelComponent& a,
    1278  const ON_ModelComponent& b
    1279  );
    1280 
    1281  /*
    1282  Description
    1283  Call ON_ModelComponent::Id()and then ON_ModelComponent::CompareName().
    1284  When used for sorting, will be sorted by id and then by name.
    1285  */
    1286  static int CompareIdAndName(
    1287  const ON_ModelComponent& a,
    1288  const ON_ModelComponent& b
    1289  );
    1290 
    1291  /*
    1292  Description:
    1293  Set a component's id, name and index to the manifest_item values.
    1294  Parameters:
    1295  manifest_item - [in]
    1296  manifest_name - [in]
    1297  bSetId - [in]
    1298  Set the component id to manifest_item.m_manifest_id.
    1299  bSetParentId - [in]
    1300  Use manifest_item.NameHash().ParentId()
    1301  bSetName - [in]
    1302  Set the component name to manifest_name.
    1303  bSetIndex - [in]
    1304  Set the component index to manifest_item.m_manifest_index.
    1305  */
    1306  bool SetIdentification(
    1307  const class ON_ComponentManifestItem& manifest_item,
    1308  const wchar_t* manifest_name,
    1309  bool bSetId,
    1310  bool bParentId,
    1311  bool bSetName,
    1312  bool bSetIndex
    1313  );
    1314 
    1315 
    1316  ///////////////////////////////////////////////////////////////////////////////
    1317  //
    1318  // General attributes interface
    1319  //
    1320  //
    1321 
    1322  /*
    1323  Description:
    1324  Writes the attributes identified by the component_filter parameter.
    1325  Parameters:
    1326  attributes_filter - [in]
    1327  A bitfield that determines which attributes will be cleared.
    1328  Returns:
    1329  a bitfield indicating which attributes were cleared.
    1330  (Locked attributes cannot be cleared.)
    1331  */
    1332  unsigned int ClearModelComponentAttributes(
    1333  unsigned int attributes_filter
    1334  );
    1335 
    1336  /*
    1337  Returns:
    1338  The runtime serial number.
    1339  This value is unique for every instance of an ON_ModelComponent class.
    1340  This value is never saved in .3dm archives.
    1341  */
    1342  ON__UINT64 RuntimeSerialNumber() const;
    1343 
    1344  /*
    1345  Description:
    1346  Whenever an attribute is changed, the content version number is incremented.
    1347  The ContentVersionNumber() is commonly used by consumers of the model
    1348  component attributes to trigger updates when needed.
    1349  Remarks:
    1350  The ContentVersionNumber value is copied by the copy constructor and operator=.
    1351  The value is not saved in .3dm archives.
    1352  */
    1353  ON__UINT64 ContentVersionNumber() const;
    1354 
    1355  /*
    1356  Returns:
    1357  True if this model component is a system constant.
    1358  Remarks:
    1359  An incomplete list of system constant model compoenents is below:
    1360 
    1361  ON_ModelComponent::Unset
    1362 
    1363  ON_InstanceDefinition::Empty
    1364 
    1365  ON_Linetype::Unset
    1366  ON_Linetype::Continuous
    1367  ON_Linetype::ByLayer
    1368  ON_Linetype::ByParent
    1369 
    1370  ON_Layer::Unset
    1371  ON_Layer::Default
    1372 
    1373  ON_TextStyle::Unset
    1374  ON_TextStyle::Default
    1375  ON_TextStyle::ByLayer
    1376  ON_TextStyle::ByParent
    1377 
    1378  ON_DimStyle::Unset
    1379  ON_DimStyle::Default
    1380  ON_DimStyle::DefaultInchDecimal
    1381  ON_DimStyle::DefaultInchFractional
    1382  ON_DimStyle::DefaultFootInchArchitecture
    1383  ON_DimStyle::DefaultMillimeterSmall
    1384  ON_DimStyle::DefaultMillimeterLarge
    1385  ON_DimStyle::DefaultMillimeterArchitecture
    1386  */
    1387  bool IsSystemComponent() const;
    1388 
    1389  bool EraseIdentification(
    1390  bool bIgnoreLocks
    1391  );
    1392 
    1393  bool SetAsSystemComponent();
    1394  bool SetAsUnsetSystemComponent();
    1395 
    1396 private:
    1397  bool Internal_SetAsSystemComponent(
    1398  bool bUnsetSystemComponent
    1399  );
    1400 
    1401 protected:
    1402  /*
    1403  Classes derived from ON_ModelComponent should have private data members and
    1404  call IncrementContentVersionNumber() when the data member value changes.
    1405  */
    1406  void IncrementContentVersionNumber() const;
    1407 
    1408 private:
    1409  const ON__UINT64 m_runtime_serial_number;
    1410  mutable ON__UINT64 m_content_version_number = 0;
    1411  ON__UINT32 m_model_serial_number = 0;
    1412  ON__UINT32 m_reference_model_serial_number = 0;
    1413  ON__UINT32 m_linked_idef_serial_number = 0;
    1415 
    1416  ON__UINT16 m_locked_status = 0;
    1417  ON__UINT16 m_set_status = 0;
    1418  ON_ComponentStatus m_component_status = ON_ComponentStatus::NoneSet;
    1419  ON__UINT8 m_reserved1 = 0;
    1420  ON__UINT16 m_reserved2 = 0;
    1421 
    1422  // m_component_index is the index of the component in the model identified
    1423  // by m_model_serial_number.
    1424  //
    1425  // Some components use small negative indices (-1,-2,-3,...) to identify
    1426  // default or constant components. An incomplete list includes these:
    1427  // ON_TextStyle::Default, (index = -1)
    1428  // ON_TextStyle::ByLayer, (index = -2)
    1429  // ON_TextStyle::ByParent, (index = -3)
    1430  // ON_Linetype::Continuous, (index = -1)
    1431  // ON_Linetype::ByLayer, (index = -2)
    1432  // ON_Linetype::ByParent, (index = -3)
    1433  //
    1434  // ON_UNSET_INT_INDEX is a large negative number.
    1435  ON__INT32 m_component_index = ON_UNSET_INT_INDEX;
    1436  ON__UINT32 m_reserved3 = 0;
    1437 
    1438  ON_UUID m_component_id = ON_nil_uuid;
    1439  ON_UUID m_component_parent_id = ON_nil_uuid;
    1440  // lazy evaluation is used top initialize m_component_name_hash
    1441  mutable ON_NameHash m_component_name_hash;
    1442 
    1443  ON_wString m_component_name;
    1444 
    1445 public:
    1446  // For internal use. Never call this function.
    1447  static unsigned int Internal_SystemComponentHelper();
    1448 };
    1449 
    1450 
    1452 {
    1453 public:
    1455 public:
    1456  ON_ModelComponentContentMark() = default;
    1457  ~ON_ModelComponentContentMark() = default;
    1459  ON_ModelComponentContentMark& operator=(const ON_ModelComponentContentMark&) = default;
    1460 
    1461  /*
    1462  Description:
    1463  Save the current content state of model_component.
    1464  Parameters:
    1465  model_component - [in]
    1466  */
    1468  const class ON_ModelComponent& model_component
    1469  );
    1470 
    1471  /*
    1472  Description:
    1473  Save the current content state of model_component.
    1474  Parameters:
    1475  model_component - [in]
    1476  */
    1478  const class ON_ModelComponent* model_component
    1479  );
    1480 
    1481  /*
    1482  Description:
    1483  Save the current content state of model_component.
    1484  Parameters:
    1485  model_component - [in]
    1486  */
    1487  void Set(
    1488  const class ON_ModelComponent& model_component
    1489  );
    1490 
    1491  /*
    1492  Description:
    1493  Save the current content state of model_component.
    1494  Parameters:
    1495  model_component - [in]
    1496  */
    1497  void Set(
    1498  const class ON_ModelComponent* model_component
    1499  );
    1500 
    1501  /*
    1502  Parameters:
    1503  model_component - [in]
    1504  Returns:
    1505  true if the content of model_component is identical
    1506  to the content state saved in this ON_ModelComponentContentMark.
    1507  false otherwise.
    1508  */
    1509  bool EqualContent(
    1510  const class ON_ModelComponent& model_component
    1511  ) const;
    1512 
    1513  /*
    1514  Parameters:
    1515  model_component - [in]
    1516  Returns:
    1517  true if the content of model_component is identical
    1518  to the content state saved in this ON_ModelComponentContentMark.
    1519  false otherwise.
    1520  */
    1521  bool EqualContent(
    1522  const class ON_ModelComponent* model_component
    1523  ) const;
    1524 
    1525  /*
    1526  Parameters:
    1527  lhs - [in]
    1528  rhs - [in]
    1529  Returns:
    1530  true if lhs and rhs are identical.
    1531  false otherwise.
    1532  */
    1533  static bool EqualContent(
    1534  const ON_ModelComponentContentMark& lhs,
    1535  const ON_ModelComponentContentMark& rhs
    1536  );
    1537 
    1538  /*
    1539  Returns:
    1540  Saved model component id.
    1541  */
    1542  ON_UUID ComponentId() const;
    1543 
    1544  /*
    1545  Returns:
    1546  Saved model component runtime serial number.
    1547  */
    1548  ON__UINT64 ComponentRuntimeSerialNumber() const;
    1549 
    1550  /*
    1551  Returns:
    1552  Saved model component content version number.
    1553  */
    1554  ON__UINT64 ComponentContentVersionNumber() const;
    1555 
    1556  /*
    1557  Returns:
    1558  Saved model component type.
    1559  */
    1560  ON_ModelComponent::Type ComponentType() const;
    1561 
    1562  /*
    1563  Returns:
    1564  True if a model component content state is saved in this ON_ModelComponentContentMark.
    1565  False otherwise.
    1566  */
    1567  bool IsSet() const;
    1568 
    1569  /*
    1570  Returns:
    1571  True if a model component content state is saved in this ON_ModelComponentContentMark.
    1572  False otherwise.
    1573  */
    1574  bool IsUnset() const;
    1575 
    1576 private:
    1577  ON_UUID m_component_id = ON_nil_uuid;
    1578  ON__UINT64 m_component_serial_number = 0;
    1579  ON__UINT64 m_component_content_version_number = 0;
    1581 
    1582 private:
    1583  unsigned char m_reserved1 = 0;
    1584  unsigned char m_reserved2 = 0;
    1585  unsigned char m_reserved3 = 0;
    1586  unsigned int m_reserved4 = 0;
    1587 };
    1588 
    1589 bool operator==(
    1590  const ON_ModelComponentContentMark& lhs,
    1591  const ON_ModelComponentContentMark& rhs
    1592  );
    1593 
    1594 bool operator!=(
    1595  const ON_ModelComponentContentMark& lhs,
    1596  const ON_ModelComponentContentMark& rhs
    1597  );
    1598 
    1600 {
    1601 public:
    1602  // Default constructor creates ON_ModelComponentTypeIterator::Empty
    1603  ON_ModelComponentTypeIterator() ON_NOEXCEPT;
    1604 
    1605  ~ON_ModelComponentTypeIterator() = default;
    1607  ON_ModelComponentTypeIterator& operator=(const ON_ModelComponentTypeIterator&) = default;
    1608 
    1609  /*
    1610  Paramters:
    1611  type_count - [in] number of types
    1612  types - [in]
    1613  list of types to iterate over
    1614  */
    1616  size_t type_count,
    1617  const ON_ModelComponent::Type* types
    1618  ) ON_NOEXCEPT;
    1619 
    1620  // Contains no types
    1622 
    1623  // Contains all explicit component types (excludes Unset and Mixed).
    1625 
    1626  // Every type in ON_ModelComponentTypeIterator::ExplicitComponents
    1627  // except Image, RenderLight, ModelGeometry, and HistoryRecord
    1628  // The types in ON_ModelComponentTypeIterator::Tables
    1629  // identify the most commonly used "table" component types.
    1631 
    1632  // Number of types in the iterator
    1633  unsigned int TypeCount() const;
    1634 
    1635  /*
    1636  Description:
    1637  Sets the iterator to point to the first available type.
    1638  Returns:
    1639  The first available type.
    1640  */
    1641  ON_ModelComponent::Type FirstType();
    1642 
    1643  /*
    1644  Description:
    1645  Sets the iterator to point to the last available type.
    1646  Returns:
    1647  The last available type.
    1648  */
    1649  ON_ModelComponent::Type LastType();
    1650 
    1651  /*
    1652  Description:
    1653  Increments the iterator and returns the new type.
    1654  Returns:
    1655  The new type.
    1656  ON_ModelComponent::Type::Unset if the iterator is incremented the last type.
    1657  */
    1658  ON_ModelComponent::Type NextType();
    1659 
    1660  /*
    1661  Description:
    1662  Decrements the iterator and returns the new type.
    1663  Returns:
    1664  The new type
    1665  ON_ModelComponent::Type::Unset if the iterator is decrented the first type.
    1666  */
    1667  ON_ModelComponent::Type PreviousType();
    1668 
    1669  /*
    1670  Description:
    1671  Decrements the iterator and returns the new type.
    1672  Returns:
    1673  The current type.
    1674  */
    1675  ON_ModelComponent::Type CurrentType() const;
    1676 
    1677 private:
    1678  ON__INT32 m_type_count = 0;
    1679 
    1680  // -1 iterated before first, m_type_count = iteratated past last
    1681  ON__INT32 m_current_index = ON_UNSET_UINT_INDEX;
    1682 
    1683  ON_ModelComponent::Type m_types[32];
    1684 };
    1685 
    1687 {
    1688 public:
    1690 
    1691  // No = default to insure m_sp is completely managed in the openurbs DLL.
    1692  ON_ModelComponentReference() ON_NOEXCEPT; // No = default to insure m_sp is completely managed in the openurbs DLL.
    1693  ~ON_ModelComponentReference(); // No = default to insure m_sp is completely managed in the openurbs DLL.
    1694  ON_ModelComponentReference(const ON_ModelComponentReference&) ON_NOEXCEPT; // No = default to insure m_sp is completely managed in the openurbs DLL.
    1695  ON_ModelComponentReference& operator=(const ON_ModelComponentReference&); // No = default to insure m_sp is completely managed in the openurbs DLL.
    1696 
    1697 #if defined(ON_HAS_RVALUEREF)
    1700 #endif
    1701 
    1703  std::shared_ptr<ON_ModelComponent>& sp
    1704  ) ON_NOEXCEPT;
    1705 
    1706  ON_ModelComponentReference& operator=(
    1707  std::shared_ptr<ON_ModelComponent>& sp
    1708  );
    1709 
    1710  /*
    1711  Parameters:
    1712  constant_system_component - [in]
    1713  A constant system component that exists for the duration of
    1714  the application.
    1715  Remarks:
    1716  See ON_ModelComponent::CreateConstantSystemComponentReference()
    1717  for more information about constant system components.
    1718 
    1719  */
    1720  static ON_ModelComponentReference CreateConstantSystemComponentReference(
    1721  const class ON_ModelComponent& constant_system_component
    1722  ) ON_NOEXCEPT;
    1723 
    1724  /*
    1725  Parameters:
    1726  model_component - [in]
    1727  bManagedComponentReference - [in]
    1728  true
    1729  model_component will be deleted by the last ON_ModelComponentReference
    1730  and must have been created by call to operator new() with heap allocation.
    1731  false
    1732  model_component must remain in scope until the last ON_ModelComponentReference
    1733  is destroyed.
    1734  Remarks:
    1735  The input pointer will be managed and deleted by the returned
    1736  by ON_ModelComponentReference.
    1737  */
    1738  static ON_ModelComponentReference CreateForExperts(
    1739  class ON_ModelComponent* model_component,
    1740  bool bManagedComponentReference
    1741  ) ON_NOEXCEPT;
    1742 
    1743  /*
    1744  Return:
    1745  A pointer to the managed model component or nullptr.
    1746  */
    1747  const class ON_ModelComponent* ModelComponent() const ON_NOEXCEPT;
    1748 
    1749  ON__UINT64 ModelComponentRuntimeSerialNumber() const ON_NOEXCEPT;
    1750  const ON_UUID ModelComponentId() const ON_NOEXCEPT;
    1751  const ON_NameHash ModelComponentNameHash() const ON_NOEXCEPT;
    1752  int ModelComponentIndex() const ON_NOEXCEPT;
    1753 
    1754  unsigned int ReferenceCount() const ON_NOEXCEPT;
    1755 
    1756  bool IsEmpty() const ON_NOEXCEPT;
    1757 
    1758  void Dump(
    1759  ON_TextLog& text_log
    1760  ) const;
    1761 
    1762 private:
    1763 #pragma ON_PRAGMA_WARNING_PUSH
    1764 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    1765  // C4251: ... needs to have dll-interface to be used by clients of class ...
    1766  // m_sp is private and all code that manages m_sp is explicitly implemented in the DLL.
    1767  std::shared_ptr<ON_ModelComponent> m_sp;
    1768 #pragma ON_PRAGMA_WARNING_POP
    1769 };
    1770 
    1771 #if defined(ON_DLL_TEMPLATE)
    1772 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_ModelComponentReference>;
    1773 #endif
    1774 
    1775 #endif
    static const ON_wString ReferencePrefixSeparator
    Definition: opennurbs_model_component.h:884
    +
    1 /*
    2 //
    3 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    5 // McNeel & Associates.
    6 //
    7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    10 //
    11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    12 //
    13 ////////////////////////////////////////////////////////////////
    14 */
    15 
    16 #if !defined(ON_MODEL_COMPONENT_INC_)
    17 #define ON_MODEL_COMPONENT_INC_
    18 
    19 /*
    20 Description:
    21  The ON_ModelComponent class is a base class for all components in a
    22  model and manages the index, id and other information common to all
    23  components in a model.
    24 */
    25 class ON_CLASS ON_ModelComponent : public ON_Object
    26 {
    27  ON_OBJECT_DECLARE(ON_ModelComponent);
    28 
    29 public:
    30  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    31 
    32  void Dump(
    33  ON_TextLog&
    34  ) const override;
    35 
    36  unsigned int SizeOf() const override;
    37 
    38 
    39  ON__UINT32 DataCRC(
    40  ON__UINT32 current_remainder
    41  ) const override;
    42 
    43  ON_UUID ModelObjectId() const override;
    44 
    45 public:
    46 
    47 #pragma region RH_C_SHARED_ENUM [ON_ModelComponent::Type] [Rhino.DocObjects.ModelComponentType] [public:byte]
    48  ///<summary>
    49  ///The ON_ModelComponent::Type enum has a value for each explicit component type
    50  ///and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator
    51  ///instance to iterate over the ON_ModelComponent::Type values.
    52  ///</summary>
    53  enum class Type : unsigned char
    54  {
    55  ///<summary>No value set.</summary>
    56  Unset = 0,
    57  ///<summary>Embedded image (bitmap) components.</summary>
    58  Image = 1,
    59  ///<summary>Texture mapping.</summary>
    60  TextureMapping = 2,
    61  ///<summary>Render material.</summary>
    62  RenderMaterial = 3,
    63  ///<summary>Line pattern (linetype).</summary>
    64  LinePattern = 4,
    65  ///<summary>Layer.</summary>
    66  Layer = 5,
    67  ///<summary>Group.</summary>
    68  Group = 6,
    69  ///<summary>Text style.</summary>
    70  TextStyle = 7,
    71  ///<summary>AnnotationDimension style.</summary>
    72  DimStyle = 8,
    73  ///<summary>Render light.</summary>
    74  RenderLight = 9,
    75  ///<summary>Hatch pattern.</summary>
    76  HatchPattern = 10,
    77  ///<summary>Instance definition.</summary>
    78  InstanceDefinition = 11,
    79  ///<summary>Model objects (points, curves, surfaces, ..., annotation, page details, ...), including objects referenced by instance definitions.</summary>
    80  ModelGeometry = 12,
    81  ///<summary>History record.</summary>
    82  HistoryRecord = 13,
    83  ///<summary>Multiple component types.
    84  /// Used when a component type filter must include all explicit component types.
    85  ///</summary>
    86  Mixed = 0xFE
    87  };
    88 #pragma endregion
    89 
    90  static ON_ModelComponent::Type ComponentTypeFromUnsigned(
    91  unsigned int component_type_as_unsigned
    92  );
    93 
    94  static const ON_wString ComponentTypeToString(
    96  );
    97 
    98  /*
    99  Parameters:
    100  component_type - [in]
    101  Returns:
    102  True if component_type is a valid enum value,
    103  and not equal to ON_ModelComponent::Type::Unset.
    104  */
    105  static bool ComponentTypeIsValid(
    106  ON_ModelComponent::Type component_type
    107  );
    108 
    109  /*
    110  Parameters:
    111  component_type - [in]
    112  Returns:
    113  True if component_type is a valid enum value,
    114  and not equal to ON_ModelComponent::Type::Unset,
    115  and not equal to ON_ModelComponent::Type::Mixed.
    116  */
    117  static bool ComponentTypeIsValidAndNotMixed(
    118  ON_ModelComponent::Type component_type
    119  );
    120 
    121  /*
    122  Parameters:
    123  component_type - [in]
    124  Returns:
    125  True if component's of the specified type require uniquen names.
    126  Remarks:
    127  In general, component names ignore case and parent when testing for
    128  equality.
    129  However, there are exceptions. Use
    130  ON_ModelComponent::UniqueNameIncludesParent() and
    131  ON_ModelComponent::UniqueNameIgnoresCase()
    132  to test for exceptions.
    133  */
    134  static bool UniqueNameRequired(
    135  ON_ModelComponent::Type component_type
    136  );
    137 
    138  /*
    139  Parameters:
    140  component_type - [in]
    141  Returns:
    142  True if objects with the same name and different parents are considered
    143  to have a unique name. This typically means the user interface for the
    144  object names is some type of tree.
    145  Remarks:
    146  Currently, layers are the only object type where this property is true.
    147  */
    148  static bool UniqueNameIncludesParent(
    149  ON_ModelComponent::Type component_type
    150  );
    151 
    152  /*
    153  Parameters:
    154  component_type - [in]
    155  Returns:
    156  True if component names ignore case when testing for equality.
    157  Remarks:
    158  Currently all other component types except for groups ignore
    159  case when testing for equality.
    160  */
    161  static bool UniqueNameIgnoresCase(
    162  ON_ModelComponent::Type component_type
    163  );
    164 
    165  static bool IndexRequired(
    166  ON_ModelComponent::Type component_type
    167  );
    168 
    169  /*
    170  Returns:
    171  True if a componenent name can begin with the first code point.
    172  Remarks:
    173  Component names cannot begin with a (, ), [, ], {, }, or space.
    174  These brackets can be the second or later code points.
    175  A space can be an interior code point.
    176  */
    177  static bool IsValidComponentNameFirstCodePoint(
    178  ON__UINT32 unicode_code_point
    179  );
    180 
    181  /*
    182  Parameters:
    183  length - [in]
    184  number of wchar_t elements in candidate_component_name[] or -1
    185  if it is a null terminated string.
    186  candidate_component_name - [in]
    187  The first code point is decoded from this string
    188  and passed to ON_ModelComponent::IsValidComponentNameFirstCodePoint().
    189  Returns:
    190  True if a componenent name can begin with the first code point.
    191  Remarks:
    192  Component names cannot begin with a (, ), [, ], {, }, or space.
    193  These brackets can be the second or later code points.
    194  A space can be an interior code point.
    195  */
    196  static bool IsValidComponentNameFirstCodePoint(
    197  int length,
    198  const wchar_t* candidate_component_name
    199  );
    200 
    201  static bool IsValidComponentName(
    202  const wchar_t* candidate_component_name
    203  );
    204 
    205  static bool IsValidComponentName(
    206  const ON_wString& candidate_component_name
    207  );
    208 
    209  static bool IsValidComponentName(
    210  size_t length,
    211  const wchar_t* candidate_component_name
    212  );
    213 
    214  /*
    215  Parameters:
    216  model_component - [in]
    217  model_manfest - [in]
    218  current model contents
    219  valid_name - [in]
    220  Valid name for this component in a model with the specified manifest.
    221  Returns:
    222  true: model_component.Name() is valid
    223  false: model_component.Name() is not valid
    224  */
    225  static bool IsValidComponentName(
    226  const class ON_ComponentManifest& model_manfest,
    227  const ON_ModelComponent& model_component,
    228  bool bPermitReferencePrefix,
    229  ON_wString& valid_name
    230  );
    231 
    232 public:
    233  static const ON_ModelComponent Unset;
    234 
    235  ON_ModelComponent() ON_NOEXCEPT;
    236 
    237  ~ON_ModelComponent() = default;
    238 
    239  // Locked status of source attributes is not copied to permit copy and modify operations.
    240  // Runtime serial number and content version number are not copied.
    242  const ON_ModelComponent& source
    243  );
    244 
    245  /*
    246  Description:
    247  Sets and locks the component type attribute.
    248  Parameters:
    249  component_type - [in]
    250  */
    252  ON_ModelComponent::Type component_type
    253  ) ON_NOEXCEPT;
    254 
    255  // Locked status of source attributes is not copied to permit copy and modify operations.
    257  ON_ModelComponent::Type component_type,
    258  const ON_ModelComponent& source
    259  ) ON_NOEXCEPT;
    260 
    261  /*
    262  Remarks:
    263  operator= will not change locked destination attributes.
    264  Locked status of source attributes is not copied to permit copy and modify operations.
    265  */
    266  ON_ModelComponent& operator=(const ON_ModelComponent& source);
    267 
    268  /*
    269  The ON_ModelComponent::Attributes enum is used to set bits that identify
    270  model component attributes.
    271  */
    272  enum Attributes : unsigned int
    273  {
    274  NoAttributes = 0U,
    275 
    276  ComponentSerialNumberAttribute = 0x0001U,
    277  TypeAttribute = 0x0002U,
    278  ModelSerialNumberAttribute = 0x0004U,
    279  IdAttribute = 0x0008U,
    280  IndexAttribute = 0x0010U,
    281  NameAttribute = 0x0020U,
    282  ParentIdAttribute = 0x0040U,
    283  DeletedNameAttribute = 0x0080U,
    284  ComponentStatusAttribute = 0x0100U,
    285 
    286  // Default model attributes saved in binary archives.
    287  // Id, ParentId, Name, Index
    288  // Do not include SystemComponentAttribute in BinaryArchiveAttributes
    289  BinaryArchiveAttributes = 0x78U,
    290 
    291  // Do not include SystemComponentAttribute in AllAttributes
    292  AllAttributes = 0x1FFU,
    293 
    294  SystemComponentAttribute = 0x8000U
    295  };
    296 
    297  unsigned int CopyFrom(
    298  const ON_ModelComponent& src,
    299  unsigned int attributes_filter
    300  );
    301 
    302  bool WriteModelComponentAttributes(
    303  class ON_BinaryArchive& archive,
    304  unsigned int attributes_filter
    305  ) const;
    306 
    307  bool ReadModelComponentAttributes(
    308  class ON_BinaryArchive& archive
    309  );
    310 
    311  ///////////////////////////////////////////////////////////////////////////////
    312  //
    313  // Model Serial Number interface
    314  //
    315  // The ModelSerialNumber() identifies the model that manages the component.
    316  // If the component is from some type of reference model, then one or both of
    317  // the reference model serial number and InstanceDefinitionModelSerialNumber()
    318  // identify the source model.
    319  //
    320 
    321  /*
    322  Description:
    323  Specify the model that is managing this component.
    324  Parameters:
    325  model_serial_number - [in]
    326  In Rhino, this is the document runtime serial number.
    327  Returns:
    328  true if the model_serial_number value was changed to component_model_serial_number or is already equal to component_model_serial_number.
    329  false if the model_serial_number value is locked and component_model_serial_number != locked value.
    330  */
    331  bool SetModelSerialNumber(
    332  unsigned int model_serial_number
    333  );
    334 
    335  /*
    336  Description:
    337  Specify the model that is managing this component.
    338  Parameters:
    339  model_serial_number - [in]
    340  In Rhino, this is the document runtime serial number.
    341  reference_model_serial_number - [in]
    342  In Rhino, this is the worksession reference model serial number.
    343  instance_definition_model_serial_number - [in]
    344  In Rhino, this is the linked instance definition model serial number.
    345  Returns:
    346  true if the model_serial_number value was changed to component_model_serial_number or is already equal to component_model_serial_number.
    347  false if the model_serial_number value is locked and component_model_serial_number != locked value.
    348  */
    349  bool SetModelSerialNumber(
    350  unsigned int model_serial_number,
    351  unsigned int reference_model_serial_number,
    352  unsigned int instance_definition_model_serial_number
    353  );
    354 
    355  /*
    356  Returns:
    357  A value identifing the model that manages this component.
    358  Remarks:
    359  If the component is being managed by a model, this value identifies the model.
    360  In Rhino, this value is the document runtime serial number.
    361  Typically this value is set and locked by the code that adds
    362  a component to a model.
    363  This value is copied by the copy constructor and operator=.
    364  This value is not saved in .3dm archives.
    365  */
    366  unsigned int ModelSerialNumber() const;
    367 
    368  /*
    369  Returns:
    370  When a compoent is in a model for reference, this value identifies the
    371  reference model.
    372  Remarks:
    373  Reference components are not saved in .3dm archives.
    374  Typically this value is set and locked by the code that adds
    375  a component to a model.
    376  This value is copied by the copy constructor and operator=.
    377  This value is not saved in .3dm archives.
    378 
    379  In Rhino, this value is a worksession model runtime serial number and
    380  these values are used.
    381  0: not from a worksession reference model
    382  1: from an unidentified reference model
    383  2-1000: reserved for future use
    384  >1000: worksession reference model serial number
    385  */
    386  unsigned int ReferenceModelSerialNumber() const;
    387 
    388  /*
    389  Returns:
    390  When a component is in a model as part of the information required
    391  for a linked instance definition, this value identifies the the linked
    392  instance definition reference model.
    393  Remarks:
    394  Reference components are not saved in .3dm archives.
    395  Typically this value is set and locked by the code that adds
    396  a component to a model.
    397  This value is copied by the copy constructor and operator=.
    398  This value is not saved in .3dm archives.
    399 
    400  In Rhino, this value is a linked instance definition runtime serial number
    401  and these values are used..
    402  0: Active model component.
    403  1-1000: reserved for future use
    404  >1000: linked instance defintion serial number
    405  */
    406  unsigned int InstanceDefinitionModelSerialNumber() const;
    407 
    408  /*
    409  Description:
    410  Sets the model serial number, reference model serial number and instance
    411  definition model serial number values to 0 and flags these values
    412  as unset.
    413  */
    414  bool ClearModelSerialNumber();
    415 
    416  /*
    417  Description:
    418  Calling LockModelSerialNumber() will prohibit future changes to the
    419  ModelSerialNumber(), ReferenceModelSerialNumber(), and
    420  InstanceDefinitionModelSerialNumber() attributes.
    421  */
    422  void LockModelSerialNumber();
    423 
    424  /*
    425  Returns:
    426  True if the ModelSerialNumber(), ReferenceModelSerialNumber(), and
    427  InstanceDefinitionModelSerialNumber() attributes are locked.
    428  */
    429  bool ModelSerialNumberIsLocked() const;
    430 
    431  /*
    432  Returns:
    433  True if the ModelSerialNumber(), ReferenceModelSerialNumber(), and
    434  InstanceDefinitionModelSerialNumber() attributes are set.
    435  */
    436  bool ModelSerialNumberIsSet() const;
    437 
    438  /*
    439  Returns
    440  True if ReferenceModelSerialNumber() or InstanceDefinitionModelSerialNumber() are not zero.
    441  */
    442  bool IsReferenceComponent() const;
    443 
    444  ///////////////////////////////////////////////////////////////////////////////
    445  //
    446  // Type interface
    447  //
    448 
    449  /*
    450  Returns:
    451  Value of the Type attribute.
    452  Remarks:
    453  If the component is in a model, then the component_type is unique for all components
    454  of identical type in the model and is locked.
    455  */
    456  ON_ModelComponent::Type ComponentType() const;
    457 
    458  /*
    459  Parameters:
    460  component_component_type - [in]
    461  Returns:
    462  true if the component_type value was changed to component_component_type or is already equal to component_component_type.
    463  false if the component_type value is locked and component_component_type != locked value.
    464  */
    465  bool SetComponentType(
    466  ON_ModelComponent::Type component_component_type
    467  );
    468 
    469  /*
    470  Description:
    471  Set the model serial number value to the ON_ModelComponent::Unset.Type()
    472  and change the state so TypeIsSet() returns false.
    473  */
    474  bool ClearComponentType();
    475 
    476  /*
    477  Description:
    478  Calling LockType() will prhibit future changes to the Type attribute.
    479  */
    480  void LockComponentType();
    481 
    482  /*
    483  Returns:
    484  True if the Type attribute is locked.
    485  */
    486  bool ComponentTypeIsLocked() const;
    487 
    488  /*
    489  Returns:
    490  True if the Type attribute is set.
    491  */
    492  bool ComponentTypeIsSet() const;
    493 
    494  ///////////////////////////////////////////////////////////////////////////////
    495  //
    496  // Id interface
    497  //
    498  // The component id is intended to be unique in the context of a model.
    499  //
    500 
    501  /*
    502  Returns:
    503  Value of the Id attribute.
    504  Remarks:
    505  If the component is in a model, then the id is unique for all components in
    506  the model and is locked.
    507  */
    508  const ON_UUID& Id() const;
    509 
    510  bool IdIsNil() const;
    511  bool IdIsNotNil() const;
    512 
    513  /*
    514  Parameters:
    515  component_id - [in]
    516  Returns:
    517  true if the id value was changed to component_id or is already equal to component_id.
    518  false if the id value is locked and component_id != locked value.
    519  */
    520  bool SetId(
    521  const ON_UUID& component_id
    522  );
    523 
    524  /*
    525  Description:
    526  Sets the id to a new value created by ON_CreateUuid().
    527  Returns:
    528  ON_nil_uuid: Id is locked.
    529  Otherwise the value of the new id.
    530  */
    531  const ON_UUID& SetId();
    532 
    533  /*
    534  Description:
    535  If the it is nil, call SetId().
    536  */
    537  const ON_UUID& IfIdIsNilSetId();
    538 
    539  /*
    540  Description:
    541  Sets the id to a new value created by ON_CreateUuid() and locks the
    542  id attribute so it cannot be changed.
    543  Returns:
    544  ON_nil_uuid: Id is locked.
    545  Otherwise the value of the new id.
    546  */
    547  const ON_UUID& SetAndLockId();
    548 
    549 
    550  /*
    551  Description:
    552  Set the component id value to the ON_ModelComponent::Unset.ModelComponentId()
    553  and change the state so ModelComponentIdIsSet() returns false.
    554  */
    555  bool ClearId();
    556 
    557  /*
    558  Description:
    559  Calling LockModelComponentId() will prhibit future changes to the ModelComponentId attribute.
    560  */
    561  void LockId();
    562 
    563  /*
    564  Returns:
    565  True if the ModelComponentId attribute is locked.
    566  */
    567  bool IdIsLocked() const;
    568 
    569  /*
    570  Returns:
    571  True if the ModelComponentId attribute is set.
    572  */
    573  bool IdIsSet() const;
    574 
    575 
    576  ///////////////////////////////////////////////////////////////////////////////
    577  //
    578  // Index interface
    579  //
    580  // When a component is managed by a model, the component index is identifies
    581  // the component within the context of that model.
    582  //
    583 
    584  /*
    585  Returns:
    586  Value of the runtime model component index attribute.
    587  Remarks:
    588  If the component is in a model, then the index is unique for all components
    589  of identical type in the model and is locked.
    590  If the index has not been set, ON_UNSET_INT_INDEX is returned.
    591  The Index() value can change when saved in an archive (.3dm file).
    592  Use the Id() when you need to reference model compoenents in an archive.
    593  */
    594  int Index() const;
    595 
    596  /*
    597  Returns:
    598  Value of the model component index attribute.
    599  Parameters:
    600  unset_index_value - [in]
    601  Value to return if the index has not been set.
    602  ON_UNSET_INT_INDEX or indices of default components are often
    603  used for this parameter.
    604  Returns:
    605  IndexIsSet() ? Index() : unset_index_value;
    606  Remarks:
    607  If the component is in a model, then the index is unique for all components
    608  of identical type in the model and is locked.
    609  */
    610  int Index(
    611  int unset_index_value
    612  ) const;
    613 
    614  /*
    615  Parameters:
    616  component_index - [in]
    617  Returns:
    618  true if the index value was changed to component_index or is already equal to component_index.
    619  false if the index value is locked and component_index != locked value.
    620  */
    621  bool SetIndex(
    622  int component_index
    623  );
    624 
    625  /*
    626  Description:
    627  Set the component index value to the ON_ModelComponent::Unset.ModelComponentIndex()
    628  and change the state so ModelComponentIndexIsSet() returns false.
    629  */
    630  bool ClearIndex();
    631 
    632  /*
    633  Description:
    634  Calling LockModelComponentIndex() will prhibit future changes to the ModelComponentIndex attribute.
    635  */
    636  void LockIndex();
    637 
    638  /*
    639  Returns:
    640  True if the ModelComponentIndex attribute is locked.
    641  */
    642  bool IndexIsLocked() const;
    643 
    644  /*
    645  Returns:
    646  True if the ModelComponentIndex attribute is set.
    647  */
    648  bool IndexIsSet() const;
    649 
    650  ///////////////////////////////////////////////////////////////////////////////
    651  //
    652  // Parent object interface
    653  //
    654  //
    655  const ON_UUID& ParentId() const;
    656 
    657  bool ParentIdIsNil() const;
    658  bool ParentIdIsNotNil() const;
    659 
    660  bool SetParentId(
    661  const ON_UUID& parent_id
    662  );
    663  bool ClearParentId();
    664  void LockParentId();
    665  bool ParentIdIsLocked() const;
    666  bool ParentIdIsSet() const;
    667 
    668  ///////////////////////////////////////////////////////////////////////////////
    669  //
    670  // Model component locked, hidden, deleted, selected, highlights, damaged, ... status interface
    671  //
    672  //
    673  ON_ComponentStatus ModelComponentStatus() const;
    674 
    675  bool SetModelComponentStatus(
    676  ON_ComponentStatus component_status
    677  );
    678 
    679  bool ClearModelComponentStatus();
    680 
    681  void LockModelComponentStatus();
    682 
    683  bool ModelComponentStatusIsLocked() const;
    684 
    685  bool ModelComponentStatusIsSet() const;
    686 
    687  /*
    688  Returns:
    689  The component's deleted state.
    690  Remarks:
    691  Deleted components can be undeleted.
    692  */
    693  bool IsDeleted() const;
    694 
    695  /*
    696  Parameters:
    697  bDeleted - [in]
    698  manifest - [in/out]
    699  optional manifest to update
    700  Returns:
    701  True if the component's deleted state was changed from
    702  !bDeleted to bDeleted and all other name and manifest information
    703  was updated as expected.
    704  */
    705  bool SetDeletedModelComponentState(
    706  bool bDeleted,
    707  class ON_ComponentManifest* manifest
    708  );
    709 
    710  /*
    711  Returns:
    712  The component's user interface locked state.
    713  Remarks:
    714  This is a user interface locked state and does not effect
    715  changing the component values.
    716  */
    717  bool IsLocked() const;
    718 
    719  void SetLockedModelComponentState(
    720  bool bLocked
    721  );
    722 
    723  /*
    724  Returns:
    725  The component's user interface hidden state.
    726  Remarks:
    727  This is a user interface hidden state and does not effect
    728  changing the component values.
    729  */
    730  bool IsHidden() const;
    731 
    732  void SetHiddenModelComponentState(
    733  bool bHidden
    734  );
    735 
    736 
    737  ///////////////////////////////////////////////////////////////////////////////
    738  //
    739  // Name interface
    740  //
    741  //
    742 
    743  /*
    744  Returns:
    745  Value of the Name attribute.
    746  Remarks:
    747  If the component is in a model, then the name is unique among all components in
    748  the model. Names are formatted as reference : parent::leaf.
    749  For example in "A.3dm : Z", "A.3dm" is the reference and "Z" is the leaf.
    750  For a layer full path "X::Y::Z", "X::Y" is the parent and "Z" is the leaf.
    751  For most models, only the leaf is present in the name.
    752  The reference portion appears when a model component originates in a reference file
    753  (a linked instance definition with reference component names or a worksession reference).
    754  Components with a tree hierarchy, like layers, can have a parent and leaf.
    755  */
    756  const ON_wString Name() const;
    757 
    758  const ON_wString DeletedName() const;
    759 
    760  /*
    761  Parameters:
    762  component_name - [out]
    763  Returns:
    764  A pointer to the string in component_name.
    765  */
    766  const wchar_t* GetName(
    767  ON_wString& component_name
    768  ) const;
    769 
    770  /*
    771  Description:
    772  Get a platform independent hash of the name suitable for equality testing
    773  and binary searching.
    774  When testing for equality or doing binary searches, using ON_NameHash values
    775  is faster than using the CompareName or ON_wString::CompareAttributeName.
    776  */
    777  const ON_NameHash& NameHash() const;
    778  const ON_NameHash& DeletedNameHash() const;
    779 
    780  /*
    781  Parameters:
    782  new_name - [in]
    783  Returns:
    784  If new_name is empty or a valid component name, then name hash this component would have if SetName(new_name) were called.
    785  If new_name is not valid, then ON_NameHash::UnsetNameHash is returned.
    786  Remarks:
    787  This function trims leading and trailing white space, includes the parent id when
    788  ON_ModelComponent::UniqueNameIncludesParent(ComponentType()) is true,
    789  and uses ON_ModelComponent::IsValidComponentName() to determine if a
    790  non-empty name is valid.
    791  */
    792  const ON_NameHash NewNameHash(
    793  const wchar_t* new_name
    794  ) const;
    795 
    796  /*
    797  Description:
    798  Returns the string " : ". This is the string Rhino uses
    799  to separate the reference file names from and model component names
    800  read from those files.
    801 
    802  Example:
    803  File A.3dm contains a layer "alpha", dimstyle "a1", an embedded block "A_blk",
    804  and a linked block "X" referencing B.3dm with reference component names.
    805  File B.3dm contains a layer "beta", dimstyle "b1", an embedded block "B_blk",
    806  and linked block "Y" referencing C.3dm.
    807  File C.3dm contains a layer gamma, dimstyle "c1", an embedded block "C_blk",
    808  and linked block "Z" referencing D.3dm.
    809  File D.3dm contains a layer "delta", dimstyle "d1", and an embedded block "D_blk".
    810 
    811  Reading file A.3dm will craete the following components:
    812  Layers:
    813  alpha
    814  X>B.3dm
    815  beta (full layer path "X>B.3dm::beta")
    816  Y>C.3dm
    817  gamma (full layer path "Y>C.3dm::gamma")
    818  Z>D.3dm
    819  delta (full layer path "Z>D.3dm::delta")
    820  Blocks:
    821  X
    822  A_blk
    823  Y
    824  B.3dm : B_blk
    825  Z
    826  C.3dm : C_blk
    827  D.3dm : D_blk
    828  Annotation styles
    829  a1
    830  B.3dm : b1
    831  C.3dm : c1
    832  D.3dm : d1
    833 
    834  See Also:
    835  ON_ModelComponent::ReferencePrefixDelimiter = " : "
    836  ON_ModelComponent::ReferencePrefixSeparator = ">"
    837  ON_ModelComponent::NamePathSeparator = "::"
    838  */
    840 
    841  /*
    842  Description:
    843  Returns the string ">". This is the string Rhino uses
    844  to separate the block definition name and linked file name
    845  in grandparent layers.
    846 
    847  Example:
    848  File A.3dm contains a layer "alpha", dimstyle "a1", an embedded block "A_blk",
    849  and a linked block "X" referencing B.3dm with reference component names.
    850  File B.3dm contains a layer "beta", dimstyle "b1", an embedded block "B_blk",
    851  and linked block "Y" referencing C.3dm.
    852  File C.3dm contains a layer gamma, dimstyle "c1", an embedded block "C_blk",
    853  and linked block "Z" referencing D.3dm.
    854  File D.3dm contains a layer "delta", dimstyle "d1", and an embedded block "D_blk".
    855 
    856  Reading file A.3dm will craete the following components:
    857  Layers:
    858  alpha
    859  X>B.3dm
    860  beta (full layer path "X>B.3dm::beta")
    861  Y>C.3dm
    862  gamma (full layer path "Y>C.3dm::gamma")
    863  Z>D.3dm
    864  delta (full layer path "Z>D.3dm::delta")
    865  Blocks:
    866  X
    867  A_blk
    868  Y
    869  B.3dm : B_blk
    870  Z
    871  C.3dm : C_blk
    872  D.3dm : D_blk
    873  Annotation styles
    874  a1
    875  B.3dm : b1
    876  C.3dm : c1
    877  D.3dm : d1
    878 
    879  See Also:
    880  ON_ModelComponent::ReferencePrefixDelimiter = " : "
    881  ON_ModelComponent::ReferencePrefixSeparator = ">"
    882  ON_ModelComponent::NamePathSeparator = "::"
    883  */
    885 
    886 
    887  /*
    888  Description:
    889  Returns the string "::". This is the string Rhino uses in layer
    890  full path names to separate the names of individual layers.
    891 
    892  Example:
    893  If a model has layers
    894  A
    895  B
    896  C
    897  then the full path names are
    898  "A", "A::B", "A::B::C".
    899 
    900  See Also:
    901  ON_ModelComponent::ReferencePrefixDelimiter = " : "
    902  ON_ModelComponent::ReferencePrefixSeparator = ">"
    903  ON_ModelComponent::NamePathSeparator = "::"
    904  */
    906 
    907  ///*
    908  //Description:
    909  //Parameters:
    910  // reference_prefix - [in]
    911  //Returns:
    912  // The worksession component name reference prefix.
    913  //Example:
    914  // "[ A.3dm ]" = ON_ModelComponent::WorksessionReferencePrefix("A.3dm")
    915  //*/
    916  //static const ON_wString WorksessionReferencePrefix(
    917  // const wchar_t* reference_prefix,
    918  // bool bAppendReferencePrefixDelimiter
    919  //);
    920 
    921 
    922  /*
    923  Description:
    924  Test a string to see if its beginning matches the
    925  string returned by ON_ModelComponent::NameReferenceDelimiter.
    926  Parameters:
    927  s - [in];
    928  string to test.
    929  Returns:
    930  null:
    931  The beginning of the string does not match ON_ModelComponent::NameReferenceDelimiter.
    932  non-null:
    933  The beginning of the string matches ON_ModelComponent::NameReferenceDelimiter.
    934  The returned pointer is the first character in s after the last character
    935  of the delimiter. Put another way, if the beginning of s matches
    936  the string ON_ModelComponent::NameReferenceDelimiter, then the returned pointer is
    937  s + ON_ModelComponent::NameReferenceDelimiter.Length().
    938  */
    939  static const wchar_t* IsReferencePrefixDelimiter(
    940  const wchar_t* s
    941  );
    942 
    943  /*
    944  Description:
    945  Test a string to see if its beginning matches the
    946  string returned by ON_ModelComponent::NameReferenceSeparator.
    947  Parameters:
    948  s - [in];
    949  string to test.
    950  Returns:
    951  null:
    952  The beginning of the string does not match ON_ModelComponent::NameReferenceSeparator.
    953  non-null:
    954  The beginning of the string matches ON_ModelComponent::NameReferenceSeparator.
    955  The returned pointer is the first character in s after the last character
    956  of the delimiter. Put another way, if the beginning of s matches
    957  the string ON_ModelComponent::NameReferenceSeparator, then the returned pointer is
    958  s + ON_ModelComponent::NameReferenceSeparator.Length().
    959  */
    960  static const wchar_t* IsReferencePrefixSeparator(
    961  const wchar_t* s
    962  );
    963 
    964  /*
    965  Description:
    966  Test a string to see if its beginning matches the
    967  string returned by ON_ModelComponent::NamePathSeparator.
    968  Parameters:
    969  s - [in];
    970  string to test.
    971  Returns:
    972  null:
    973  The beginning of the string does not match ON_ModelComponent::NamePathSeparator.
    974  non-null:
    975  The beginning of the string matches ON_ModelComponent::NamePathSeparator.
    976  The returned pointer is the first character in s after the last character
    977  of the delimiter. Put another way, if the beginning of s matches
    978  the string ON_ModelComponent::NamePathSeparator, then the returned pointer is
    979  s + ON_ModelComponent::NamePathSeparator.Length().
    980  */
    981  static const wchar_t* IsNamePathSeparator(
    982  const wchar_t* s
    983  );
    984 
    985  /*
    986  Example:
    987  If a full layer name is "A.3dm : X::Y::Z", then
    988  reference_prefix = "A.3dm"
    989  name_parent = "X::Y"
    990  name_leaf = "Z"
    991  */
    992  static void SplitName(
    993  const wchar_t* name,
    994  ON_wString& reference_prefix,
    995  ON_wString& name_parent,
    996  ON_wString& name_leaf
    997  );
    998 
    999  /*
    1000  Parameters:
    1001  name - [in]
    1002  Example:
    1003  If the name is "A.3dm : X", then "A.3dm" is returned.
    1004  */
    1005  static const ON_wString NameReferencePrefix(
    1006  const wchar_t* name
    1007  );
    1008 
    1009  /*
    1010  Parameters:
    1011  name - [in]
    1012  bIncludeReference - [in]
    1013  Example:
    1014  If the name is "A.3dm>B.3dm : X::Y::Z" and bIncludeReference is true,
    1015  then "A.3dm>B.3dm : X::Y" is returned.
    1016  If the name is "A.3dm>B.3dm : X::Y::Z" and bIncludeReference is false,
    1017  then "X::Y" is returned.
    1018  */
    1019  static const ON_wString NameParent(
    1020  const wchar_t* name,
    1021  bool bIncludeReference
    1022  );
    1023 
    1024  /*
    1025  Example:
    1026  If the name is "A.3dm>B.3dm : X::Y::Z",
    1027  then name_leaf = "Z" is returned.
    1028  */
    1029  static const ON_wString NameLeaf(
    1030  const wchar_t* name
    1031  );
    1032 
    1033  /*
    1034  Parameters:
    1035  name - [in]
    1036  Example:
    1037  If the name is "A.3dm : X", then "X" is returned.
    1038  */
    1039  static const ON_wString RemoveReferencePrefix(
    1040  const wchar_t* name
    1041  );
    1042 
    1043  /*
    1044  Description:
    1045  Remove all occurances of ON::NameReferenceDelimiter() from name.
    1046  */
    1047  static const ON_wString RemoveAllReferencePrefixDelimiters(
    1048  const wchar_t* name
    1049  );
    1050 
    1051  /*
    1052  Description:
    1053  Remove any trailing occurance of ON_ModelComponent::NameReferenceDelimiter from name.
    1054  Example:
    1055  "A.3dm" = ON_ModelComponent::RemoveTrailingRemoveReferencePrefixDelimiter("A.3dm : ");
    1056  */
    1057  static const ON_wString RemoveTrailingReferencePrefixDelimiter(
    1058  const wchar_t* name
    1059  );
    1060 
    1061  /*
    1062  Description:
    1063  Remove any trailing occurance of ON_ModelComponent::NameReferenceSeparator from name.
    1064  */
    1065  static const ON_wString RemoveTrailingReferencePrefixSeparator(
    1066  const wchar_t* name
    1067  );
    1068 
    1069  /*
    1070  Description:
    1071  Remove any trailing occurance of ON_ModelComponent::NamePathSeparator from name.
    1072  */
    1073  static const ON_wString RemoveTrailingNamePathSeparator(
    1074  const wchar_t* name
    1075  );
    1076 
    1077 
    1078 
    1079 private:
    1080  const ON_NameHash& Internal_NameHash() const;
    1081 
    1082 public:
    1083  /*
    1084  Description:
    1085  Expert user function that gets a pointer to the name.
    1086  Returns:
    1087  A pointer to the string that contains the name. This pointer
    1088  must be used immediately and then discarded before any code
    1089  can possibly call SetName() or the ON_ModelComponent destructor
    1090  could be called.
    1091  Remarks:
    1092  About the only good use for this function is when a model compoenent is
    1093  peristent and the name is needed for a formatted string. For any
    1094  other use, call the Name() function and store the result in an
    1095  ON_wString. This function is dangerous because the returned pointer
    1096  will be invalid if SetName() is called.
    1097  */
    1098  const wchar_t* NameAsPointer() const;
    1099 
    1100  /*
    1101  Returns:
    1102  true if the name is unset or is set to the empty string.
    1103  */
    1104  bool NameIsEmpty() const;
    1105 
    1106  /*
    1107  Returns:
    1108  true if the name is set and the value is not the empty string.
    1109  */
    1110  bool NameIsNotEmpty() const;
    1111 
    1112  /*
    1113  Parameters:
    1114  component_name - [in]
    1115  Leading and trailing nonzero unicode code points with values <= ON_wString::Space are ignored.
    1116  Returns:
    1117  true
    1118  if the name attribute was changed to component_name or is already equal to component_name.
    1119  false
    1120  False is returned and no changes are made if
    1121  the name attribute is locked and component_name != locked value
    1122  or
    1123  component_name is not empty and ON_ModelComponent::IsValidComponentName(component_name) is false.
    1124  Remarks:
    1125  If component_name is nullptr or the emtpy string, the NameIsSet() state will still be true.
    1126  */
    1127  bool SetName(
    1128  const wchar_t* component_name
    1129  );
    1130 
    1131  /*
    1132  Description:
    1133  Change the name of a component and optionally update a manifest.
    1134  Parameters:
    1135  new_name - [in]
    1136  New name for the component.
    1137  manifest - [in]
    1138  nullptr or a manifest with an item for the component.
    1139  */
    1140  bool ChangeName(
    1141  const wchar_t* new_name,
    1142  class ON_ComponentManifest* manifest
    1143  );
    1144 
    1145  /*
    1146  Description:
    1147  Set the component name value to the ON_ModelComponent::Unset.Name()
    1148  and change the state so NameIsSet() and DeletedNameIsSet() both return false.
    1149  */
    1150  bool ClearName();
    1151 
    1152  /*
    1153  Description:
    1154  Calling LockName() will prohibit future changes to the Name attribute.
    1155  */
    1156  void LockName();
    1157 
    1158  /*
    1159  Returns:
    1160  True if the Name attribute is locked.
    1161  */
    1162  bool NameIsLocked() const;
    1163 
    1164  /*
    1165  Returns:
    1166  True if the name attribute is set.
    1167  Remarks:
    1168  At most one of NameIsSet() and DeletedNameIsSet() is true.
    1169  A name can be set to the empty string.
    1170  */
    1171  bool NameIsSet() const;
    1172 
    1173  /*
    1174  Returns:
    1175  True if the deleted name attribute is set.
    1176  Remarks:
    1177  At most one of NameIsSet() and DeletedNameIsSet() is true.
    1178  */
    1179  bool DeletedNameIsSet() const;
    1180 
    1181  /*
    1182  Description:
    1183  If NameIsSet() is true, then the name is deleted in a waty that can be undone by calling UndeleteName() and
    1184  the DeletedNameIsSet() property is changed to true.
    1185 
    1186  If NameIsSet() is false or NameIsLocked() is true, then nothing is changed.
    1187 
    1188  Note that a name can be set to the empty string and there is a difference between
    1189  a name being set to the empty string and a name being unset.
    1190  If you want to make the name attribute unset, call ClearName().
    1191  */
    1192  bool DeleteName();
    1193 
    1194  bool UndeleteName();
    1195 
    1196  void LockAllSettingsExceptName();
    1197  bool SetLocalizedSystemComponentName(
    1198  const wchar_t* system_component_localized_name
    1199  );
    1200 
    1201  /*
    1202  Parameters:
    1203  other_name -[in]
    1204  Returns:
    1205  ON_wString::CompareAttributeName(this->Name(), other_name)
    1206  Remarks:
    1207  CompareName() is the correct tool to use when looking up objects by name.
    1208  */
    1209  int CompareName(
    1210  const ON_UUID& other_parent_id,
    1211  const wchar_t* other_name
    1212  ) const;
    1213  int CompareName(
    1214  const wchar_t* other_name
    1215  ) const;
    1216 
    1217  /*
    1218  Parameters:
    1219  other_name -[in]
    1220  Returns:
    1221  int rc = ON_wString::CompareAttributeName(this->Name(), other_name);
    1222  return (0 != rc) ? rc : ON_wString::CompareOrdinal(this->Name(), other_name, false);
    1223  Remarks:
    1224  CompareNameExact() is the correct tool to use when detecting changes in
    1225  case are important. Use CompareName() when searching for components by name.
    1226  */
    1227  int CompareNameExact(
    1228  const ON_UUID& other_parent_id,
    1229  const wchar_t* other_name
    1230  ) const;
    1231  int CompareNameExact(
    1232  const wchar_t* other_name
    1233  ) const;
    1234 
    1235 
    1236  /*
    1237  Parameters:
    1238  a -[in]
    1239  b -[in]
    1240  Returns:
    1241  ON_wString::CompareAttributeName(a.Name(), b.Name() )
    1242  Remarks:
    1243  CompareName() is the correct tool to use when looking up objects by name.
    1244  */
    1245  static int CompareName(
    1246  const ON_ModelComponent& a,
    1247  const ON_ModelComponent& b
    1248  );
    1249 
    1250  /*
    1251  Parameters:
    1252  a -[in]
    1253  b -[in]
    1254  Returns:
    1255  int rc = ON_wString::CompareAttributeName(a.Name(), b.Name());
    1256  return (0 != rc) ? rc : ON_wString::CompareOrdinal(a.Name(), b.Name(), false);
    1257  Remarks:
    1258  CompareNameExact() is the correct tool to use when detecting changes in
    1259  case are important. Use CompareName() when searching for components by name.
    1260  */
    1261  static int CompareNameExact(
    1262  const ON_ModelComponent& a,
    1263  const ON_ModelComponent& b
    1264  );
    1265 
    1266  static int CompareId(
    1267  const ON_ModelComponent& a,
    1268  const ON_ModelComponent& b
    1269  );
    1270 
    1271  /*
    1272  Description
    1273  Call ON_ModelComponent::CompareName() and then ON_ModelComponent::CompareId().
    1274  When used for sorting, will be sorted by name and then by id.
    1275  */
    1276  static int CompareNameAndId(
    1277  const ON_ModelComponent& a,
    1278  const ON_ModelComponent& b
    1279  );
    1280 
    1281  /*
    1282  Description
    1283  Call ON_ModelComponent::Id()and then ON_ModelComponent::CompareName().
    1284  When used for sorting, will be sorted by id and then by name.
    1285  */
    1286  static int CompareIdAndName(
    1287  const ON_ModelComponent& a,
    1288  const ON_ModelComponent& b
    1289  );
    1290 
    1291  /*
    1292  Description:
    1293  Set a component's id, name and index to the manifest_item values.
    1294  Parameters:
    1295  manifest_item - [in]
    1296  manifest_name - [in]
    1297  bSetId - [in]
    1298  Set the component id to manifest_item.m_manifest_id.
    1299  bSetParentId - [in]
    1300  Use manifest_item.NameHash().ParentId()
    1301  bSetName - [in]
    1302  Set the component name to manifest_name.
    1303  bSetIndex - [in]
    1304  Set the component index to manifest_item.m_manifest_index.
    1305  */
    1306  bool SetIdentification(
    1307  const class ON_ComponentManifestItem& manifest_item,
    1308  const wchar_t* manifest_name,
    1309  bool bSetId,
    1310  bool bParentId,
    1311  bool bSetName,
    1312  bool bSetIndex
    1313  );
    1314 
    1315 
    1316  ///////////////////////////////////////////////////////////////////////////////
    1317  //
    1318  // General attributes interface
    1319  //
    1320  //
    1321 
    1322  /*
    1323  Description:
    1324  Writes the attributes identified by the component_filter parameter.
    1325  Parameters:
    1326  attributes_filter - [in]
    1327  A bitfield that determines which attributes will be cleared.
    1328  Returns:
    1329  a bitfield indicating which attributes were cleared.
    1330  (Locked attributes cannot be cleared.)
    1331  */
    1332  unsigned int ClearModelComponentAttributes(
    1333  unsigned int attributes_filter
    1334  );
    1335 
    1336  /*
    1337  Returns:
    1338  The runtime serial number.
    1339  This value is unique for every instance of an ON_ModelComponent class.
    1340  This value is never saved in .3dm archives.
    1341  */
    1342  ON__UINT64 RuntimeSerialNumber() const;
    1343 
    1344  /*
    1345  Description:
    1346  Whenever an attribute is changed, the content version number is incremented.
    1347  The ContentVersionNumber() is commonly used by consumers of the model
    1348  component attributes to trigger updates when needed.
    1349  Remarks:
    1350  The ContentVersionNumber value is copied by the copy constructor and operator=.
    1351  The value is not saved in .3dm archives.
    1352  */
    1353  ON__UINT64 ContentVersionNumber() const;
    1354 
    1355  /*
    1356  Returns:
    1357  True if this model component is a system constant.
    1358  Remarks:
    1359  An incomplete list of system constant model compoenents is below:
    1360 
    1361  ON_ModelComponent::Unset
    1362 
    1363  ON_InstanceDefinition::Empty
    1364 
    1365  ON_Linetype::Unset
    1366  ON_Linetype::Continuous
    1367  ON_Linetype::ByLayer
    1368  ON_Linetype::ByParent
    1369 
    1370  ON_Layer::Unset
    1371  ON_Layer::Default
    1372 
    1373  ON_TextStyle::Unset
    1374  ON_TextStyle::Default
    1375  ON_TextStyle::ByLayer
    1376  ON_TextStyle::ByParent
    1377 
    1378  ON_DimStyle::Unset
    1379  ON_DimStyle::Default
    1380  ON_DimStyle::DefaultInchDecimal
    1381  ON_DimStyle::DefaultInchFractional
    1382  ON_DimStyle::DefaultFootInchArchitecture
    1383  ON_DimStyle::DefaultMillimeterSmall
    1384  ON_DimStyle::DefaultMillimeterLarge
    1385  ON_DimStyle::DefaultMillimeterArchitecture
    1386  */
    1387  bool IsSystemComponent() const;
    1388 
    1389  bool EraseIdentification(
    1390  bool bIgnoreLocks
    1391  );
    1392 
    1393  bool SetAsSystemComponent();
    1394  bool SetAsUnsetSystemComponent();
    1395 
    1396 private:
    1397  bool Internal_SetAsSystemComponent(
    1398  bool bUnsetSystemComponent
    1399  );
    1400 
    1401 protected:
    1402  /*
    1403  Classes derived from ON_ModelComponent should have private data members and
    1404  call IncrementContentVersionNumber() when the data member value changes.
    1405  */
    1406  void IncrementContentVersionNumber() const;
    1407 
    1408 private:
    1409  const ON__UINT64 m_runtime_serial_number;
    1410  mutable ON__UINT64 m_content_version_number = 0;
    1411  ON__UINT32 m_model_serial_number = 0;
    1412  ON__UINT32 m_reference_model_serial_number = 0;
    1413  ON__UINT32 m_linked_idef_serial_number = 0;
    1415 
    1416  ON__UINT16 m_locked_status = 0;
    1417  ON__UINT16 m_set_status = 0;
    1418  ON_ComponentStatus m_component_status = ON_ComponentStatus::NoneSet;
    1419  ON__UINT8 m_reserved1 = 0;
    1420  ON__UINT16 m_reserved2 = 0;
    1421 
    1422  // m_component_index is the index of the component in the model identified
    1423  // by m_model_serial_number.
    1424  //
    1425  // Some components use small negative indices (-1,-2,-3,...) to identify
    1426  // default or constant components. An incomplete list includes these:
    1427  // ON_TextStyle::Default, (index = -1)
    1428  // ON_TextStyle::ByLayer, (index = -2)
    1429  // ON_TextStyle::ByParent, (index = -3)
    1430  // ON_Linetype::Continuous, (index = -1)
    1431  // ON_Linetype::ByLayer, (index = -2)
    1432  // ON_Linetype::ByParent, (index = -3)
    1433  //
    1434  // ON_UNSET_INT_INDEX is a large negative number.
    1435  ON__INT32 m_component_index = ON_UNSET_INT_INDEX;
    1436  ON__UINT32 m_reserved3 = 0;
    1437 
    1438  ON_UUID m_component_id = ON_nil_uuid;
    1439  ON_UUID m_component_parent_id = ON_nil_uuid;
    1440  // lazy evaluation is used top initialize m_component_name_hash
    1441  mutable ON_NameHash m_component_name_hash;
    1442 
    1443  ON_wString m_component_name;
    1444 
    1445 public:
    1446  // For internal use. Never call this function.
    1447  static unsigned int Internal_SystemComponentHelper();
    1448 };
    1449 
    1450 
    1452 {
    1453 public:
    1455 public:
    1456  ON_ModelComponentContentMark() = default;
    1457  ~ON_ModelComponentContentMark() = default;
    1459  ON_ModelComponentContentMark& operator=(const ON_ModelComponentContentMark&) = default;
    1460 
    1461  /*
    1462  Description:
    1463  Save the current content state of model_component.
    1464  Parameters:
    1465  model_component - [in]
    1466  */
    1468  const class ON_ModelComponent& model_component
    1469  );
    1470 
    1471  /*
    1472  Description:
    1473  Save the current content state of model_component.
    1474  Parameters:
    1475  model_component - [in]
    1476  */
    1478  const class ON_ModelComponent* model_component
    1479  );
    1480 
    1481  /*
    1482  Description:
    1483  Save the current content state of model_component.
    1484  Parameters:
    1485  model_component - [in]
    1486  */
    1487  void Set(
    1488  const class ON_ModelComponent& model_component
    1489  );
    1490 
    1491  /*
    1492  Description:
    1493  Save the current content state of model_component.
    1494  Parameters:
    1495  model_component - [in]
    1496  */
    1497  void Set(
    1498  const class ON_ModelComponent* model_component
    1499  );
    1500 
    1501  /*
    1502  Parameters:
    1503  model_component - [in]
    1504  Returns:
    1505  true if the content of model_component is identical
    1506  to the content state saved in this ON_ModelComponentContentMark.
    1507  false otherwise.
    1508  */
    1509  bool EqualContent(
    1510  const class ON_ModelComponent& model_component
    1511  ) const;
    1512 
    1513  /*
    1514  Parameters:
    1515  model_component - [in]
    1516  Returns:
    1517  true if the content of model_component is identical
    1518  to the content state saved in this ON_ModelComponentContentMark.
    1519  false otherwise.
    1520  */
    1521  bool EqualContent(
    1522  const class ON_ModelComponent* model_component
    1523  ) const;
    1524 
    1525  /*
    1526  Parameters:
    1527  lhs - [in]
    1528  rhs - [in]
    1529  Returns:
    1530  true if lhs and rhs are identical.
    1531  false otherwise.
    1532  */
    1533  static bool EqualContent(
    1534  const ON_ModelComponentContentMark& lhs,
    1535  const ON_ModelComponentContentMark& rhs
    1536  );
    1537 
    1538  /*
    1539  Returns:
    1540  Saved model component id.
    1541  */
    1542  ON_UUID ComponentId() const;
    1543 
    1544  /*
    1545  Returns:
    1546  Saved model component runtime serial number.
    1547  */
    1548  ON__UINT64 ComponentRuntimeSerialNumber() const;
    1549 
    1550  /*
    1551  Returns:
    1552  Saved model component content version number.
    1553  */
    1554  ON__UINT64 ComponentContentVersionNumber() const;
    1555 
    1556  /*
    1557  Returns:
    1558  Saved model component type.
    1559  */
    1560  ON_ModelComponent::Type ComponentType() const;
    1561 
    1562  /*
    1563  Returns:
    1564  True if a model component content state is saved in this ON_ModelComponentContentMark.
    1565  False otherwise.
    1566  */
    1567  bool IsSet() const;
    1568 
    1569  /*
    1570  Returns:
    1571  True if a model component content state is saved in this ON_ModelComponentContentMark.
    1572  False otherwise.
    1573  */
    1574  bool IsUnset() const;
    1575 
    1576 private:
    1577  ON_UUID m_component_id = ON_nil_uuid;
    1578  ON__UINT64 m_component_serial_number = 0;
    1579  ON__UINT64 m_component_content_version_number = 0;
    1581 
    1582 private:
    1583  unsigned char m_reserved1 = 0;
    1584  unsigned char m_reserved2 = 0;
    1585  unsigned char m_reserved3 = 0;
    1586  unsigned int m_reserved4 = 0;
    1587 };
    1588 
    1589 bool operator==(
    1590  const ON_ModelComponentContentMark& lhs,
    1591  const ON_ModelComponentContentMark& rhs
    1592  );
    1593 
    1594 bool operator!=(
    1595  const ON_ModelComponentContentMark& lhs,
    1596  const ON_ModelComponentContentMark& rhs
    1597  );
    1598 
    1600 {
    1601 public:
    1602  // Default constructor creates ON_ModelComponentTypeIterator::Empty
    1603  ON_ModelComponentTypeIterator() ON_NOEXCEPT;
    1604 
    1605  ~ON_ModelComponentTypeIterator() = default;
    1607  ON_ModelComponentTypeIterator& operator=(const ON_ModelComponentTypeIterator&) = default;
    1608 
    1609  /*
    1610  Paramters:
    1611  type_count - [in] number of types
    1612  types - [in]
    1613  list of types to iterate over
    1614  */
    1616  size_t type_count,
    1617  const ON_ModelComponent::Type* types
    1618  ) ON_NOEXCEPT;
    1619 
    1620  // Contains no types
    1622 
    1623  // Contains all explicit component types (excludes Unset and Mixed).
    1625 
    1626  // Every type in ON_ModelComponentTypeIterator::ExplicitComponents
    1627  // except Image, RenderLight, ModelGeometry, and HistoryRecord
    1628  // The types in ON_ModelComponentTypeIterator::Tables
    1629  // identify the most commonly used "table" component types.
    1631 
    1632  // Number of types in the iterator
    1633  unsigned int TypeCount() const;
    1634 
    1635  /*
    1636  Description:
    1637  Sets the iterator to point to the first available type.
    1638  Returns:
    1639  The first available type.
    1640  */
    1641  ON_ModelComponent::Type FirstType();
    1642 
    1643  /*
    1644  Description:
    1645  Sets the iterator to point to the last available type.
    1646  Returns:
    1647  The last available type.
    1648  */
    1649  ON_ModelComponent::Type LastType();
    1650 
    1651  /*
    1652  Description:
    1653  Increments the iterator and returns the new type.
    1654  Returns:
    1655  The new type.
    1656  ON_ModelComponent::Type::Unset if the iterator is incremented the last type.
    1657  */
    1658  ON_ModelComponent::Type NextType();
    1659 
    1660  /*
    1661  Description:
    1662  Decrements the iterator and returns the new type.
    1663  Returns:
    1664  The new type
    1665  ON_ModelComponent::Type::Unset if the iterator is decrented the first type.
    1666  */
    1667  ON_ModelComponent::Type PreviousType();
    1668 
    1669  /*
    1670  Description:
    1671  Decrements the iterator and returns the new type.
    1672  Returns:
    1673  The current type.
    1674  */
    1675  ON_ModelComponent::Type CurrentType() const;
    1676 
    1677 private:
    1678  ON__INT32 m_type_count = 0;
    1679 
    1680  // -1 iterated before first, m_type_count = iteratated past last
    1681  ON__INT32 m_current_index = ON_UNSET_UINT_INDEX;
    1682 
    1683  ON_ModelComponent::Type m_types[32];
    1684 };
    1685 
    1687 {
    1688 public:
    1690 
    1691  // No = default to insure m_sp is completely managed in the openurbs DLL.
    1692  ON_ModelComponentReference() ON_NOEXCEPT; // No = default to insure m_sp is completely managed in the openurbs DLL.
    1693  ~ON_ModelComponentReference(); // No = default to insure m_sp is completely managed in the openurbs DLL.
    1694  ON_ModelComponentReference(const ON_ModelComponentReference&) ON_NOEXCEPT; // No = default to insure m_sp is completely managed in the openurbs DLL.
    1695  ON_ModelComponentReference& operator=(const ON_ModelComponentReference&); // No = default to insure m_sp is completely managed in the openurbs DLL.
    1696 
    1697 #if defined(ON_HAS_RVALUEREF)
    1698  ON_ModelComponentReference( ON_ModelComponentReference&& ) ON_NOEXCEPT;
    1699  ON_ModelComponentReference& operator=( ON_ModelComponentReference&& );
    1700 #endif
    1701 
    1702  ON_ModelComponentReference(
    1703  std::shared_ptr<ON_ModelComponent>& sp
    1704  ) ON_NOEXCEPT;
    1705 
    1706  ON_ModelComponentReference& operator=(
    1707  std::shared_ptr<ON_ModelComponent>& sp
    1708  );
    1709 
    1710  /*
    1711  Parameters:
    1712  constant_system_component - [in]
    1713  A constant system component that exists for the duration of
    1714  the application.
    1715  Remarks:
    1716  See ON_ModelComponent::CreateConstantSystemComponentReference()
    1717  for more information about constant system components.
    1718 
    1719  */
    1720  static ON_ModelComponentReference CreateConstantSystemComponentReference(
    1721  const class ON_ModelComponent& constant_system_component
    1722  ) ON_NOEXCEPT;
    1723 
    1724  /*
    1725  Parameters:
    1726  model_component - [in]
    1727  bManagedComponentReference - [in]
    1728  true
    1729  model_component will be deleted by the last ON_ModelComponentReference
    1730  and must have been created by call to operator new() with heap allocation.
    1731  false
    1732  model_component must remain in scope until the last ON_ModelComponentReference
    1733  is destroyed.
    1734  Remarks:
    1735  The input pointer will be managed and deleted by the returned
    1736  by ON_ModelComponentReference.
    1737  */
    1738  static ON_ModelComponentReference CreateForExperts(
    1739  class ON_ModelComponent* model_component,
    1740  bool bManagedComponentReference
    1741  ) ON_NOEXCEPT;
    1742 
    1743  /*
    1744  Return:
    1745  A pointer to the managed model component or nullptr.
    1746  */
    1747  const class ON_ModelComponent* ModelComponent() const ON_NOEXCEPT;
    1748 
    1749  ON__UINT64 ModelComponentRuntimeSerialNumber() const ON_NOEXCEPT;
    1750  const ON_UUID ModelComponentId() const ON_NOEXCEPT;
    1751  const ON_NameHash ModelComponentNameHash() const ON_NOEXCEPT;
    1752  int ModelComponentIndex() const ON_NOEXCEPT;
    1753 
    1754  unsigned int ReferenceCount() const ON_NOEXCEPT;
    1755 
    1756  bool IsEmpty() const ON_NOEXCEPT;
    1757 
    1758  void Dump(
    1759  ON_TextLog& text_log
    1760  ) const;
    1761 
    1762 private:
    1763 #pragma ON_PRAGMA_WARNING_PUSH
    1764 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    1765  // C4251: ... needs to have dll-interface to be used by clients of class ...
    1766  // m_sp is private and all code that manages m_sp is explicitly implemented in the DLL.
    1767  std::shared_ptr<ON_ModelComponent> m_sp;
    1768 #pragma ON_PRAGMA_WARNING_POP
    1769 };
    1770 
    1771 #if defined(ON_DLL_TEMPLATE)
    1772 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_ModelComponentReference>;
    1773 #endif
    1774 
    1775 #endif
    static const ON_wString ReferencePrefixSeparator
    Definition: opennurbs_model_component.h:884
    Definition: opennurbs_model_component.h:1599
    ON_UUID is a 16 byte universally unique identifier.
    Definition: opennurbs_uuid.h:32
    static const ON_wString ReferencePrefixDelimiter
    Definition: opennurbs_model_component.h:839
    @@ -105,9 +103,9 @@ $(function() {
    diff --git a/6/d9/d5e/opennurbs__arccurve_8h_source.html b/6/d9/d5e/opennurbs__arccurve_8h_source.html index 26cb9c92..a43171c8 100644 --- a/6/d9/d5e/opennurbs__arccurve_8h_source.html +++ b/6/d9/d5e/opennurbs__arccurve_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_arccurve.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_arccurve.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d9/d64/class_o_n___component_manifest_item-members.html b/6/d9/d64/class_o_n___component_manifest_item-members.html index afacc1ce..899fdc9b 100644 --- a/6/d9/d64/class_o_n___component_manifest_item-members.html +++ b/6/d9/d64/class_o_n___component_manifest_item-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d66/class_o_n___brep_edge_array-members.html b/6/d9/d66/class_o_n___brep_edge_array-members.html index 8d2999a3..5ef7cfe3 100644 --- a/6/d9/d66/class_o_n___brep_edge_array-members.html +++ b/6/d9/d66/class_o_n___brep_edge_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d67/class_o_n___hatch_pattern-members.html b/6/d9/d67/class_o_n___hatch_pattern-members.html index c6435793..e1bf421e 100644 --- a/6/d9/d67/class_o_n___hatch_pattern-members.html +++ b/6/d9/d67/class_o_n___hatch_pattern-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d6f/class_o_n___bezier_curve.html b/6/d9/d6f/class_o_n___bezier_curve.html index 57112ad2..eaa70fec 100644 --- a/6/d9/d6f/class_o_n___bezier_curve.html +++ b/6/d9/d6f/class_o_n___bezier_curve.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BezierCurve Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Get tight bounding box of the bezier. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false)
    - If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the tight bounding box of the bezier curve. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed bezier is calculated. The bezier curve is not modified. Returns: True if the returned tight_bbox is set to a valid bounding box.

    +

    Description: Get tight bounding box of the bezier. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false) If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the tight bounding box of the bezier curve. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed bezier is calculated. The bezier curve is not modified. Returns: True if the returned tight_bbox is set to a valid bounding box.

    @@ -1893,8 +1890,7 @@ Public Attributes
    -

    Description: Split() divides the Bezier curve at the specified parameter. The parameter must satisfy 0 < t < 1. You may pass *this as one of the curves to be returned. Parameters: t - [in] (0 < t < 1 ) parameter to split at left_side - [out] right_side - [out]
    -Example: ON_BezierCurve crv = ...; ON_BezierCurve right_side; crv.Split( 0.5, crv, right_side ); would split crv at the 1/2, put the left side in crv, and return the right side in right_side.

    +

    Description: Split() divides the Bezier curve at the specified parameter. The parameter must satisfy 0 < t < 1. You may pass *this as one of the curves to be returned. Parameters: t - [in] (0 < t < 1 ) parameter to split at left_side - [out] right_side - [out] Example: ON_BezierCurve crv = ...; ON_BezierCurve right_side; crv.Split( 0.5, crv, right_side ); would split crv at the 1/2, put the left side in crv, and return the right side in right_side.

    @@ -2111,9 +2107,9 @@ Example: ON_Bezi diff --git a/6/d9/d6f/class_o_n___clipping_region_points.html b/6/d9/d6f/class_o_n___clipping_region_points.html index 2b13ae1c..0f8da141 100644 --- a/6/d9/d6f/class_o_n___clipping_region_points.html +++ b/6/d9/d6f/class_o_n___clipping_region_points.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ClippingRegionPoints Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    These functions and data members are public so they can be used by experts to reference information that is managed by other entities. If you access or modify them, you are responsible for making sure you do it correctly. All the interface functions above assume the values below are correctly set.
    -Reserve buffer capacity.

    +

    These functions and data members are public so they can be used by experts to reference information that is managed by other entities. If you access or modify them, you are responsible for making sure you do it correctly. All the interface functions above assume the values below are correctly set. Reserve buffer capacity.

    @@ -612,9 +609,9 @@ Reserve buffer capacity.

    diff --git a/6/d9/d70/class_o_n___clipping_plane_surface.html b/6/d9/d70/class_o_n___clipping_plane_surface.html index dec6aabe..64c23e0f 100644 --- a/6/d9/d70/class_o_n___clipping_plane_surface.html +++ b/6/d9/d70/class_o_n___clipping_plane_surface.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ClippingPlaneSurface Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    N_iso = 6, iso_count = 7
    - } - pure virtual class for surface objects More...
    + } pure virtual class for surface objects More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -754,9 +752,9 @@ Additional Inherited Members
    diff --git a/6/d9/d77/class_o_n__2d_point_array-members.html b/6/d9/d77/class_o_n__2d_point_array-members.html index 7d304369..37de0676 100644 --- a/6/d9/d77/class_o_n__2d_point_array-members.html +++ b/6/d9/d77/class_o_n__2d_point_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d7b/class_o_n___object.html b/6/d9/d7b/class_o_n___object.html index 87c682e6..05d5091b 100644 --- a/6/d9/d7b/class_o_n___object.html +++ b/6/d9/d7b/class_o_n___object.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Object Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    END: User string support

    -

    User data provides a standard way for extra information to be attached to any class derived from ON_Object. The attached information can persist and be transformed. If you use user data, please carefully read all the comments from here to the end of the file.
    -Description: Attach user data to an object. Parameters: pUserData - [in] user data to attach to object. The ON_UserData pointer passed to AttachUserData() must be created with new.
    -Returns: If true is returned, then ON_Object will delete the user data when appropriate. If false is returned, then data could not be attached and caller must delete.
    -Remarks: AttachUserData() will fail if the user data's m_userdata_uuid field is nil or not unique.

    +

    User data provides a standard way for extra information to be attached to any class derived from ON_Object. The attached information can persist and be transformed. If you use user data, please carefully read all the comments from here to the end of the file. Description: Attach user data to an object. Parameters: pUserData - [in] user data to attach to object. The ON_UserData pointer passed to AttachUserData() must be created with new. Returns: If true is returned, then ON_Object will delete the user data when appropriate. If false is returned, then data could not be attached and caller must delete. Remarks: AttachUserData() will fail if the user data's m_userdata_uuid field is nil or not unique.

    @@ -363,8 +358,7 @@ Remarks:

    Component status interface

    -

    Currently implemnented on ON_SubD and ON_Brep
    -Description: Set all active level component states to ON_ComponentStatus::NoneSet. Returns: Number of components where a state setting chanaged.

    +

    Currently implemnented on ON_SubD and ON_Brep Description: Set all active level component states to ON_ComponentStatus::NoneSet. Returns: Number of components where a state setting chanaged.

    @@ -430,8 +424,7 @@ Description: Set all active level component states to -

    Description: Clear states on an individual component. Parameters: component_index - [in] The states will be cleared on this component. states_to_clear - [in] If a state is set in the states_to_clear parameter, the same state will be cleared on the component.
    -Returns: 0: no state settings changed on the component. 1: some state setting changed on the component.

    +

    Description: Clear states on an individual component. Parameters: component_index - [in] The states will be cleared on this component. states_to_clear - [in] If a state is set in the states_to_clear parameter, the same state will be cleared on the component. Returns: 0: no state settings changed on the component. 1: some state setting changed on the component.

    Reimplemented in ON_Brep.

    @@ -582,8 +575,7 @@ Returns: 0: no state settings changed on the component. 1: some state setting ch
    -

    Expert interface
    -Description: Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. Parameters: bDelete - [in] if true, any cached information is properly deleted. If false, any cached information is simply discarded. This is useful when the cached information may be in alternate memory pools that are managed in nonstandard ways.

    +

    Expert interface Description: Expert user function. If you are using openNURBS in its default configuration to read and write 3dm archives, you never need to call this function. Many objects employ lazy creation of (runtime) caches that save information to help speed geometric calculations. This function will destroy all runtime information. Parameters: bDelete - [in] if true, any cached information is properly deleted. If false, any cached information is simply discarded. This is useful when the cached information may be in alternate memory pools that are managed in nonstandard ways.

    Reimplemented in ON_Mesh, ON_MorphControl, ON_Brep, ON_NurbsCage, ON_BrepFace, ON_BrepLoop, ON_BrepTrim, ON_PolyEdgeSegment, ON_Curve, ON_Extrusion, ON_Surface, ON_CurveProxy, ON_PolyCurve, ON_PolyEdgeCurve, ON_SurfaceProxy, ON_SumSurface, and ON_RevSurface.

    @@ -604,8 +596,7 @@ Description: Expert user function. If you are using openNURBS in its default con
    -

    Description: Remove user data from an object. Parameters: pUserData - [in] user data to attach to object. The ON_UserData pointer passed to DetachUserData() must have been previously attached using AttachUserData().
    -Returns: If true is returned, then the user data was attached to this object and it was detached. If false is returned, then the user data was not attached to this object to begin with. In all cases, you can be assured that the user data is no longer attached to "this". Remarks: Call delete pUserData if you want to destroy the user data.

    +

    Description: Remove user data from an object. Parameters: pUserData - [in] user data to attach to object. The ON_UserData pointer passed to DetachUserData() must have been previously attached using AttachUserData(). Returns: If true is returned, then the user data was attached to this object and it was detached. If false is returned, then the user data was not attached to this object to begin with. In all cases, you can be assured that the user data is no longer attached to "this". Remarks: Call delete pUserData if you want to destroy the user data.

    @@ -715,9 +706,9 @@ Returns: If true is returned, then the user data was attached to this object and

    Parameters: states_filter - [in]

    -

    bAllEqualStates - [in] If a state is set in states_filter, all active level components with the same state set will be included in the components_with_set_states[] array.
    - If bAllEqualStates is true, then ON_ComponentStatus::AllEqualStates() is used to test for inclusion.
    - If bAllEqualStates is false, then ON_ComponentStatus::SomeEqualStates() is used to test for inclusion.

    +

    bAllEqualStates - [in] If a state is set in states_filter, all active level components with the same state set will be included in the components_with_set_states[] array.

    +

    If bAllEqualStates is true, then ON_ComponentStatus::AllEqualStates() is used to test for inclusion.

    +

    If bAllEqualStates is false, then ON_ComponentStatus::SomeEqualStates() is used to test for inclusion.

    components_with_set_states - [out] Returns: Number of returned components.

    Reimplemented in ON_Brep.

    @@ -1070,8 +1061,7 @@ Returns: If true is returned, then the user data was attached to this object and
    -

    Description: PurgeUserData() removes all user data from object.
    -Remarks: Use delete GetUserData(...) to destroy a single piece of user data.

    +

    Description: PurgeUserData() removes all user data from object. Remarks: Use delete GetUserData(...) to destroy a single piece of user data.

    @@ -1138,8 +1128,7 @@ Remarks: Use delete GetUserData(...) to destroy a single piece of user data.

    -

    Description: Set states on an individual component. Parameters: component_index - [in] The states will be set on this component. states_to_set - [in] If a state is set in the states_to_set parameter, the same state will be set on the component.
    -Returns: 0: no state settings changed on the component. 1: some state setting changed on the component.

    +

    Description: Set states on an individual component. Parameters: component_index - [in] The states will be set on this component. states_to_set - [in] If a state is set in the states_to_set parameter, the same state will be set on the component. Returns: 0: no state settings changed on the component. 1: some state setting changed on the component.

    Reimplemented in ON_Brep.

    @@ -1209,8 +1198,7 @@ Returns: 0: no state settings changed on the component. 1: some state setting ch
    -

    BEGIN: User string support
    -Description: Attach a user string to the object. This information will perisist through copy construction, operator=, and file IO. Parameters: key - [in] id used to retrieve this string. string_value - [in] If nullptr, the string with this id will be removed. Returns: True if successful.

    +

    BEGIN: User string support Description: Attach a user string to the object. This information will perisist through copy construction, operator=, and file IO. Parameters: key - [in] id used to retrieve this string. string_value - [in] If nullptr, the string with this id will be removed. Returns: True if successful.

    @@ -1382,8 +1370,8 @@ Description: Attach a user string to the object. This information will perisist
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented in ON_Mesh, ON_Brep, ON_MorphControl, ON_BrepRegion, ON_BrepFaceSide, ON_NurbsCage, ON_BrepFace, ON_Centermark, ON_TextDot, ON_BrepLoop, ON_DimOrdinate, ON_DimRadial, ON_3dmRenderSettings, ON_InstanceRef, ON_Hatch, ON_DocumentUserStringList, ON_ClippingPlaneSurface, ON_BrepTrim, ON_EmbeddedBitmap, ON_WindowsBitmapEx, ON_DimAngular, ON_UserStringList, ON_DimStyle, ON_HatchPattern, ON_RdkMaterialInstanceIdObsoleteUserData, ON_UnknownUserData, ON_BrepEdge, ON_WindowsBitmap, ON_DimLinear, ON_InstanceDefinition, ON_NurbsSurface, ON_TextContent, ON_CurveProxy, ON_NurbsCurve, ON_TextureMapping, ON_TextStyle, ON_Texture, ON_PolyEdgeSegment, ON_Viewport, ON_SumSurface, ON_Material, ON_ArcCurve, ON_RevSurface, ON_PolyCurve, ON_HistoryRecord, ON_Linetype, ON_BrepVertex, ON_CurveOnSurface, ON_SurfaceProxy, ON_Extrusion, ON_PolylineCurve, ON_PointCloud, ON_Leader, ON_LineCurve, ON_Layer, ON_PlaneSurface, ON_3dmObjectAttributes, ON_Bitmap, ON_Text, ON_PointGrid, ON_Point, ON_Light, and ON_DetailView.

    @@ -1392,9 +1380,9 @@ Description: Attach a user string to the object. This information will perisist
    diff --git a/6/d9/d7d/class_o_n___aerial_photo_image.html b/6/d9/d7d/class_o_n___aerial_photo_image.html index b579e174..d952709f 100644 --- a/6/d9/d7d/class_o_n___aerial_photo_image.html +++ b/6/d9/d7d/class_o_n___aerial_photo_image.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_AerialPhotoImage Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d84/class_o_n___dim_style_1_1_dimstyle_field-members.html b/6/d9/d84/class_o_n___dim_style_1_1_dimstyle_field-members.html index 1da21679..4783553f 100644 --- a/6/d9/d84/class_o_n___dim_style_1_1_dimstyle_field-members.html +++ b/6/d9/d84/class_o_n___dim_style_1_1_dimstyle_field-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d94/class_o_n___embedded_bitmap-members.html b/6/d9/d94/class_o_n___embedded_bitmap-members.html index 32028763..86342c7c 100644 --- a/6/d9/d94/class_o_n___embedded_bitmap-members.html +++ b/6/d9/d94/class_o_n___embedded_bitmap-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d96/class_o_n___brep.html b/6/d9/d96/class_o_n___brep.html index 6c698e68..3fabe5b8 100644 --- a/6/d9/d96/class_o_n___brep.html +++ b/6/d9/d96/class_o_n___brep.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Brep Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Create a brep from a surface. The resulting surface has an outer boundary made from four trims. The trims are ordered so that they run along the south, east, north, and then west side of the surface's parameter space. Parameters: pSurface - [in] pointer to a surface. The brep will manage this pointer and delete it in ~ON_Brep. Returns: table true successful When true is returned, the pSurface pointer is added to the brep's m_S[] array and it will be deleted by the brep's destructor. false brep cannot be created from this surface. When false is returned, then the caller is responsible for deleting pSurface unless it was previously added to the brep's m_S[] array.
    -Remarks: The surface class must be created with new so that the delete in ~ON_Brep will not cause a crash.

    +

    Description: Create a brep from a surface. The resulting surface has an outer boundary made from four trims. The trims are ordered so that they run along the south, east, north, and then west side of the surface's parameter space. Parameters: pSurface - [in] pointer to a surface. The brep will manage this pointer and delete it in ~ON_Brep. Returns: table true successful When true is returned, the pSurface pointer is added to the brep's m_S[] array and it will be deleted by the brep's destructor. false brep cannot be created from this surface. When false is returned, then the caller is responsible for deleting pSurface unless it was previously added to the brep's m_S[] array. Remarks: The surface class must be created with new so that the delete in ~ON_Brep will not cause a crash.

    @@ -4396,8 +4393,7 @@ Remarks: The surface class must be created with new so that the delete in ~ON_Br
    -

    Match endpoints of adjacent trims. If a trim needs to be adjusted, copy the 2d curve if necessary, convert to nurb form, yank cvs. Compact() should be called afterwards. Returns false if error in computation, Trims must be from same face and meet at a common vertex. These are expert user functions. When in doubt use MatchTrimEnds() on the entire Brep.
    -Description: Match the end of a trim to the start of the next trim. Parameters: T0 - [in] brep trim T1 - [in] brep trim that comes immediately after T0 in the same loop Returns: true if either trim's 2d curve is changed

    +

    Match endpoints of adjacent trims. If a trim needs to be adjusted, copy the 2d curve if necessary, convert to nurb form, yank cvs. Compact() should be called afterwards. Returns false if error in computation, Trims must be from same face and meet at a common vertex. These are expert user functions. When in doubt use MatchTrimEnds() on the entire Brep. Description: Match the end of a trim to the start of the next trim. Parameters: T0 - [in] brep trim T1 - [in] brep trim that comes immediately after T0 in the same loop Returns: true if either trim's 2d curve is changed

    @@ -5280,8 +5276,7 @@ Description: Match the end of a trim to the start of the next trim. Parameters:
    -

    Description: This is a simple tool for getting running through the edges that begin and end at a vertex. Parameters: current_edge_index - [in] endi - [in] 0 = use the edge start vertex, 1 = use the edge end vertex next_endi - [out] 0 if next edge begins at the vertex, 1 if next edge ends at the vertex Returns: edge index of the next edge or -1 if there is only one edge that begins or ends at the vertex. Remarks: This is a tool that simplifies searching through the ON_BrepVertex.m_ei[] array.
    - The edges are in no particular order. See Also: ON_Brep::NextEdge

    +

    Description: This is a simple tool for getting running through the edges that begin and end at a vertex. Parameters: current_edge_index - [in] endi - [in] 0 = use the edge start vertex, 1 = use the edge end vertex next_endi - [out] 0 if next edge begins at the vertex, 1 if next edge ends at the vertex Returns: edge index of the next edge or -1 if there is only one edge that begins or ends at the vertex. Remarks: This is a tool that simplifies searching through the ON_BrepVertex.m_ei[] array. The edges are in no particular order. See Also: ON_Brep::NextEdge

    @@ -5880,8 +5875,7 @@ Description: Match the end of a trim to the start of the next trim. Parameters:
    -

    Description: Removes nested polycurves from the m_C2[] and m_C3[] arrays. Parameters: bExtractSingleSegments - [in] if true, polycurves with a single segment are replaced with the segment curve. bEdges - [in] if true, the m_C3[] array is processed bTrimCurves - [in] if true, the m_C2[] array is processed.
    -Returns: True if any nesting was removed and false if no nesting was removed.

    +

    Description: Removes nested polycurves from the m_C2[] and m_C3[] arrays. Parameters: bExtractSingleSegments - [in] if true, polycurves with a single segment are replaced with the segment curve. bEdges - [in] if true, the m_C3[] array is processed bTrimCurves - [in] if true, the m_C2[] array is processed. Returns: True if any nesting was removed and false if no nesting was removed.

    @@ -6987,8 +6981,7 @@ Returns: True if any nesting was removed and false if no nesting was removed.
    -

    Description: Sometimes the ON_Surface used by a face extends far beyond the face's outer boundary. ShrinkSurface uses ON_Surface::Trim to remove portions of the surface that extend beyond the face's outer boundary loop. Parameters: face - [in] face to test and whose surface should be shrunk. DisableSide - [in] This is a bit field. A set bit indicates not to shrink the surface on a given side. The default of 0 enables shrinking on all four sides.
    - value meaning 0x0001 Dont shrink on the west side of domain. 0x0002 Dont shrink on the south side of domain. 0x0004 Dont shrink on the east side of domain. 0x0008 Dont shrink on the north side of domain. Returns: table true successful false failure Remarks: If a surface needs to be shrunk it is copied. After shrinking, you may want to call ON_Brep::CullUnusedSurfaces to remove any unused surfaces. See Also: ON_Brep::ShrinkSurfaces ON_Brep::CullUnusedSurfaces

    +

    Description: Sometimes the ON_Surface used by a face extends far beyond the face's outer boundary. ShrinkSurface uses ON_Surface::Trim to remove portions of the surface that extend beyond the face's outer boundary loop. Parameters: face - [in] face to test and whose surface should be shrunk. DisableSide - [in] This is a bit field. A set bit indicates not to shrink the surface on a given side. The default of 0 enables shrinking on all four sides. value meaning 0x0001 Dont shrink on the west side of domain. 0x0002 Dont shrink on the south side of domain. 0x0004 Dont shrink on the east side of domain. 0x0008 Dont shrink on the north side of domain. Returns: table true successful false failure Remarks: If a surface needs to be shrunk it is copied. After shrinking, you may want to call ON_Brep::CullUnusedSurfaces to remove any unused surfaces. See Also: ON_Brep::ShrinkSurfaces ON_Brep::CullUnusedSurfaces

    @@ -8017,9 +8010,9 @@ Returns: True if any nesting was removed and false if no nesting was removed. diff --git a/6/d9/d98/class_o_n___morph_control-members.html b/6/d9/d98/class_o_n___morph_control-members.html index f30be95a..fef11178 100644 --- a/6/d9/d98/class_o_n___morph_control-members.html +++ b/6/d9/d98/class_o_n___morph_control-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/d9d/class_o_n___mapping_tag-members.html b/6/d9/d9d/class_o_n___mapping_tag-members.html index 8b9f2983..6bb9bbcc 100644 --- a/6/d9/d9d/class_o_n___mapping_tag-members.html +++ b/6/d9/d9d/class_o_n___mapping_tag-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/da3/struct_o_n___r_tree_search_result-members.html b/6/d9/da3/struct_o_n___r_tree_search_result-members.html index 083203c3..9b68eda4 100644 --- a/6/d9/da3/struct_o_n___r_tree_search_result-members.html +++ b/6/d9/da3/struct_o_n___r_tree_search_result-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/da7/class_o_n__2d_size-members.html b/6/d9/da7/class_o_n__2d_size-members.html index 872b661d..64dfe1f0 100644 --- a/6/d9/da7/class_o_n__2d_size-members.html +++ b/6/d9/da7/class_o_n__2d_size-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/da8/class_o_n___brep_edge-members.html b/6/d9/da8/class_o_n___brep_edge-members.html index a8486f79..499d7687 100644 --- a/6/d9/da8/class_o_n___brep_edge-members.html +++ b/6/d9/da8/class_o_n___brep_edge-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/da9/class_o_n___terminator.html b/6/d9/da9/class_o_n___terminator.html index 9bc670c5..c66f1828 100644 --- a/6/d9/da9/class_o_n___terminator.html +++ b/6/d9/da9/class_o_n___terminator.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Terminator Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_Terminator()

    @@ -294,8 +290,7 @@ Static Public Member Functions
    -

    Description: A calculation calls ON_Terminator::TerminationRequested(terminator) to determine if it should continue or quit. Parameters: terminator - [in] A pointer to an ON_Terminator or null pointer. Returns: True if the calculation should terminate as soon as possible. False if the calculation should continue. Example:
    - void MyLongCalculation( ..., ON_Terminator* terminator, ...) { for ( i = 0; i < count; i++ ) { if ( ON_Terminator::TerminationRequested(terminator) ) break; ... } }

    +

    Description: A calculation calls ON_Terminator::TerminationRequested(terminator) to determine if it should continue or quit. Parameters: terminator - [in] A pointer to an ON_Terminator or null pointer. Returns: True if the calculation should terminate as soon as possible. False if the calculation should continue. Example: void MyLongCalculation( ..., ON_Terminator* terminator, ...) { for ( i = 0; i < count; i++ ) { if ( ON_Terminator::TerminationRequested(terminator) ) break; ... } }

    @@ -332,8 +327,7 @@ Static Public Member Functions
    -

    Description: An expert user function to determine if a calculation should continue.
    -Parameters: terminator - [in] A pointer to an ON_Terminator or null pointer. callback_delta - [in] Minimum amount of time to delay between calls to the registered callback function in clock() time units. 0 will omit making any call to the registered function. ON_Terminator::TerminationRequested( terminator ) uses a value of callback_delta = CLOCKS_PER_SEC/10 meaning a maximum of 10 callbacks per second. Returns: True if the calculation should terminate as soon as possible. False if the calculation should continue. Remarks: In general, call the ON_Terminator::TerminationRequested( terminator ).

    +

    Description: An expert user function to determine if a calculation should continue. Parameters: terminator - [in] A pointer to an ON_Terminator or null pointer. callback_delta - [in] Minimum amount of time to delay between calls to the registered callback function in clock() time units. 0 will omit making any call to the registered function. ON_Terminator::TerminationRequested( terminator ) uses a value of callback_delta = CLOCKS_PER_SEC/10 meaning a maximum of 10 callbacks per second. Returns: True if the calculation should terminate as soon as possible. False if the calculation should continue. Remarks: In general, call the ON_Terminator::TerminationRequested( terminator ).

    @@ -357,9 +351,9 @@ Parameters: terminator - [in] A pointer to an diff --git a/6/d9/db1/class_o_n__4d_point.html b/6/d9/db1/class_o_n__4d_point.html index 90f7b7ca..7cf383f8 100644 --- a/6/d9/db1/class_o_n__4d_point.html +++ b/6/d9/db1/class_o_n__4d_point.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_4dPoint Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/db1/class_o_n___text_builder_1_1_text_props.html b/6/d9/db1/class_o_n___text_builder_1_1_text_props.html index 601ff589..1fae4835 100644 --- a/6/d9/db1/class_o_n___text_builder_1_1_text_props.html +++ b/6/d9/db1/class_o_n___text_builder_1_1_text_props.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextBuilder::TextProps Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/dba/class_o_n___material-members.html b/6/d9/dba/class_o_n___material-members.html index 7a42f283..cd7d17c3 100644 --- a/6/d9/dba/class_o_n___material-members.html +++ b/6/d9/dba/class_o_n___material-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/dbe/opennurbs__pointgrid_8h_source.html b/6/d9/dbe/opennurbs__pointgrid_8h_source.html index 2eb53ada..58ef823c 100644 --- a/6/d9/dbe/opennurbs__pointgrid_8h_source.html +++ b/6/d9/dbe/opennurbs__pointgrid_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_pointgrid.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_pointgrid.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/dc3/class_o_n___leader.html b/6/d9/dc3/class_o_n___leader.html index c4c5b3dc..b8527d30 100644 --- a/6/d9/dc3/class_o_n___leader.html +++ b/6/d9/dc3/class_o_n___leader.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Leader Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    ON_Leader class.

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_Leader() [1/2]

    @@ -1997,8 +1993,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -2030,9 +2026,9 @@ Additional Inherited Members
    diff --git a/6/d9/dc3/class_o_n___surface_array.html b/6/d9/dc3/class_o_n___surface_array.html index c9d2f1ce..e6d7a275 100644 --- a/6/d9/dc3/class_o_n___surface_array.html +++ b/6/d9/dc3/class_o_n___surface_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SurfaceArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/dcd/class_o_n___uuid_pair_list.html b/6/d9/dcd/class_o_n___uuid_pair_list.html index 0c80beef..be898be0 100644 --- a/6/d9/dcd/class_o_n___uuid_pair_list.html +++ b/6/d9/dcd/class_o_n___uuid_pair_list.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UuidPairList Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/dce/class_o_n___brep_edge_array.html b/6/d9/dce/class_o_n___brep_edge_array.html index 9630fc89..f0c9f8df 100644 --- a/6/d9/dce/class_o_n___brep_edge_array.html +++ b/6/d9/dce/class_o_n___brep_edge_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepEdgeArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/dd4/class_o_n___component_status-members.html b/6/d9/dd4/class_o_n___component_status-members.html index dca60e24..79ef24f1 100644 --- a/6/d9/dd4/class_o_n___component_status-members.html +++ b/6/d9/dd4/class_o_n___component_status-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/dd5/class_o_n___face_name_key-members.html b/6/d9/dd5/class_o_n___face_name_key-members.html index 1b154e10..3dcab5cf 100644 --- a/6/d9/dd5/class_o_n___face_name_key-members.html +++ b/6/d9/dd5/class_o_n___face_name_key-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/dd8/class_o_n___managed_fonts.html b/6/d9/dd8/class_o_n___managed_fonts.html index d3e47e9e..e11b240f 100644 --- a/6/d9/dd8/class_o_n___managed_fonts.html +++ b/6/d9/dd8/class_o_n___managed_fonts.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ManagedFonts Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Public Member Functions

    +const ON_FontGetFromAppleFontName (const wchar_t *apple_font_name, bool bCreateIfNotFound) +  const ON_FontGetFromFontCharacteristics (const ON_Font &font_characteristics, bool bCreateIfNotFound)   const ON_FontGetFromSerialNumber (unsigned int managed_font_runtime_serial_number) @@ -130,6 +130,34 @@ Static Public Attributes
    +
    + + +

    ◆ GetFromAppleFontName()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    const ON_Font* ON_ManagedFonts::GetFromAppleFontName (const wchar_t * apple_font_name,
    bool bCreateIfNotFound 
    )
    +
    +
    @@ -267,9 +295,9 @@ Static Public Attributes diff --git a/6/d9/ddd/opennurbs__dimension_8h_source.html b/6/d9/ddd/opennurbs__dimension_8h_source.html index da3ba9e0..7e1b568b 100644 --- a/6/d9/ddd/opennurbs__dimension_8h_source.html +++ b/6/d9/ddd/opennurbs__dimension_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_dimension.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_dimension.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_dimension.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_DIMENSION_INC_)
    18 #define OPENNURBS_DIMENSION_INC_
    19 
    20 #if defined(ON_DLL_TEMPLATE)
    21 ON_DLL_TEMPLATE template ON_ClassArray< class ON_DimStyle >;
    22 #endif
    23 
    24 class ON_CLASS ON_Dimension : public ON_Annotation
    25 {
    26  ON_OBJECT_DECLARE(ON_Dimension);
    27 
    28 public:
    29 #pragma region RH_C_SHARED_ENUM [ON_Dimension::ForceArrow] [Rhino.Geometry.Dimension.ForceArrow] [nested:int]
    30  /// <summary>
    31  /// Arrowheads forced Inside, or Outside of extension lines, or moved to fit.
    32  /// </summary>
    33  enum class ForceArrow : unsigned int
    34  {
    35  /// <summary> </summary>
    36  Auto = 0,
    37  /// <summary> </summary>
    38  Inside = 1,
    39  /// <summary> </summary>
    40  Outside = 2,
    41  };
    42 #pragma endregion
    43 
    44  static ON_Dimension::ForceArrow ForceArrowFromUnsigned(
    45  unsigned int force_arrow_as_unsigned);
    46 
    47 #pragma region RH_C_SHARED_ENUM [ON_Dimension::ForceText] [Rhino.Geometry.Dimension.ForceText] [nested:int]
    48  /// <summary>
    49  /// Text forced Inside, Right or Left of extension lines, or moved to fit (Auto).
    50  /// </summary>
    51  enum class ForceText : unsigned int
    52  {
    53  /// <summary> </summary>
    54  Auto = 0,
    55  /// <summary> </summary>
    56  Inside = 1,
    57  /// <summary> </summary>
    58  Right = 2,
    59  /// <summary> </summary>
    60  Left = 3,
    61  };
    62 #pragma endregion
    63 
    64  static ON_Dimension::ForceText ForceTextFromUnsigned(
    65  unsigned int force_text_as_unsigned);
    66 
    67 
    68 protected:
    69  ON_Dimension( ON::AnnotationType annotation_type );
    70  ~ON_Dimension();
    71  ON_Dimension(const ON_Dimension& src);
    72  ON_Dimension& operator=(const ON_Dimension& src);
    73 
    74 private:
    75  ON_Dimension() = delete;
    76  void Internal_Destroy();
    77  void Internal_CopyFrom(const ON_Dimension& src);
    78 
    79 public:
    80  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    81 
    82  virtual ON_2dPoint DefaultTextPoint() const;
    83  virtual bool UseDefaultTextPoint() const;
    84  virtual void SetUseDefaultTextPoint(bool usedefault);
    85 
    86  // Text center-midpoint in dimension plane
    87  ON_2dPoint TextPoint() const;
    88  void Set2dTextPoint(const ON_2dPoint& textpoint);
    89 
    90  const wchar_t* UserText() const;
    91  void SetUserText(const wchar_t* text);
    92  const wchar_t* PlainUserText() const;
    93 
    94  // Computes measurement value as a number
    95  virtual double Measurement() const = 0;
    96 
    97  // Add to natural rotation
    98  double TextRotation() const;
    99  void SetTextRotation(double rotation_radians);
    100 
    101  bool ArrowIsFlipped(int i) const;
    102  void FlipArrow(int i, bool flip) const;
    103 
    104  // If the dimension is a paper space object and the geometry being dimensioned is in
    105  // model space, in a detail viewport, DetailMeasured() will have the UUID of the detail
    106  // that the dimension references. Otherwise DetailMeasured() will be ON_nil_uuid.
    107  ON_UUID DetailMeasured() const;
    108  void SetDetailMeasured(ON_UUID uuid);
    109 
    110  // If DetailMeasured() returns ON_nil_uuid, DistanceScale() has no meaning
    111  // If the dimension is in page space and measures model space geometry,
    112  // DistanceScale() is the conversion from the model space distance being measured
    113  // to the paper space distance spanned by the dimension geometry.
    114  // When the zoom factor of the detail view changes, the distance scale will change
    115  double DistanceScale() const;
    116  void SetDistanceScale(double distance_scale) const;
    117 
    118  //virtual bool GetBBox(
    119  // const ON_Viewport* vp,
    120  // double dimscale,
    121  // const ON_DimStyle* dimstyle,
    122  // double* boxmin,
    123  // double* boxmax,
    124  // bool bGrow = 0) const = 0;
    125 
    126  virtual bool GetTextRect(ON_3dPoint text_rect[4]) const;
    127 
    128  // Remakes dimension text geometry object and sets it on the dimension
    129  virtual bool UpdateDimensionText(
    130  ON::LengthUnitSystem units_in,
    131  const ON_DimStyle* dimstyle
    132  ) const;
    133 
    134  // Makes text geometry for a dimension
    135  ON_TextContent* RebuildDimensionText(
    136  ON::LengthUnitSystem units_in,
    137  const ON_DimStyle* dimstyle,
    138  bool expandanglebrackets // replace <> with the formatted distance
    139  ) const;
    140 
    141  virtual bool GetDistanceDisplayText(
    142  ON::LengthUnitSystem units_in,
    143  const ON_DimStyle* dimstyle,
    144  ON_wString& displaytext) const;
    145 
    146  static bool GetCentermarkDisplay(
    147  const ON_Plane& plane,
    148  const ON_2dPoint center,
    149  double marksize,
    150  double radius,
    152  ON_Line lines[6],
    153  bool isline[6],
    154  int maxlines
    155  );
    156 
    157  static bool GetCentermarkSnapPoints(
    158  const ON_Plane& plane,
    159  const ON_2dPoint center,
    160  double marksize,
    161  double radius,
    163  ON_3dPoint points[13],
    164  bool ispoint[13]);
    165 
    166 
    167  ON_Dimension::ForceArrow ForceArrowPosition() const;
    168  void SetForceArrowPosition(ForceArrow force);
    169 
    170  ON_Dimension::ForceText ForceTextPosition() const;
    171  void SetForceTextPosition(ForceText force);
    172 
    173 protected:
    174  ON_wString m_user_text = L"<>"; // If user overridden, or "<>" to use default
    175  double m_text_rotation = 0.0;
    177 
    178  bool m_use_default_text_point = true;
    179  ON_2dPoint m_user_text_point = ON_2dPoint::UnsetPoint; // Text point if default isn't used
    180 
    181  mutable bool m_flip_arrow_1 = false;
    182  mutable bool m_flip_arrow_2 = false;
    183  mutable bool m_text_outside = false;
    184  ForceArrow m_force_arrows = ForceArrow::Auto;
    185  ForceText m_force_textpos = ForceText::Auto;
    186 
    187 
    188  // UUID of detail if dimension is in page space measuring model space geometry
    189  ON_UUID m_detail_measured = ON_nil_uuid;
    190  // Conversion from model space size to paper space size if dimension is in page space measuring model space geometry
    191  mutable double m_distance_scale = 1.0;
    192 
    193  bool Internal_WriteDimension(
    194  ON_BinaryArchive& // serialize definition to binary archive
    195  ) const;
    196 
    197  bool Internal_ReadDimension(
    198  ON_BinaryArchive& // restore definition from binary archive
    199  );
    200 };
    201 
    202 class ON_CLASS ON_DimLinear : public ON_Dimension
    203 {
    204  ON_OBJECT_DECLARE(ON_DimLinear);
    205 
    206 public:
    207  ON_DimLinear();
    208  ~ON_DimLinear() = default;
    209  ON_DimLinear(const ON_DimLinear& src) = default;
    210  ON_DimLinear& operator=(const ON_DimLinear& src) = default;
    211 
    212  static const ON_DimLinear Empty;
    213 
    214  /*
    215  Description:
    216  Create a V6 linear dimension from a V5 linear dimension
    217  The function is used when reading V5 files.
    218  Parameters:
    219  V5_linear_dimension -[in]
    220  annotation_context - [in]
    221  Dimstyle and other information referenced by V5_linear_dimension or nullptr if not available.
    222  destination - [in]
    223  If destination is not nullptr, then the V6 linear dimension is constructed
    224  in destination. If destination is nullptr, then the new V6 linear dimension
    225  is allocated with a call to new ON_DimLinear().
    226  */
    227  static ON_DimLinear* CreateFromV5DimLinear(
    228  const class ON_OBSOLETE_V5_DimLinear& V5_linear_dimension,
    229  const class ON_3dmAnnotationContext* annotation_context,
    230  ON_DimLinear* destination
    231  );
    232 
    233 
    234  /*
    235  Parameters:
    236  annotation_type - [in]
    237  annotation type to test
    238  Returns:
    239  True if input parameter is one of the valid linear dimension types
    240  ON::AnnotationType::Aligned or ON::AnnotationType::Rotated.
    241  */
    242  static bool IsValidLinearDimensionType(
    243  ON::AnnotationType annotation_type
    244  );
    245 
    246  /*
    247  Parameters:
    248  linear_dimension_type - [in]
    249  ON::AnnotationType::Aligned or ON::AnnotationType::Rotated.
    250  Returns:
    251  True if input parameter is valid and type is set.
    252  */
    253  bool SetLinearDimensionType(
    254  ON::AnnotationType linear_dimension_type
    255  );
    256 
    257  bool Write(
    258  ON_BinaryArchive& // serialize definition to binary archive
    259  ) const override;
    260 
    261  bool Read(
    262  ON_BinaryArchive& // restore definition from binary archive
    263  ) override;
    264 
    265  bool Transform(const ON_Xform& xform) override;
    266 
    267  // virtual ON_Geometry GetBBox override
    268  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    269 
    270  bool GetAnnotationBoundingBox(
    271  const ON_Viewport* vp,
    272  const ON_DimStyle* dimstyle,
    273  double dimscale,
    274  double* boxmin,
    275  double* boxmax,
    276  bool bGrow = false
    277  ) const override; // ON_Annotation override
    278 
    279  // Gets transform for dimension text from ON_xy_plane to 3d display location
    280  bool GetTextXform(
    281  const ON_Viewport* vp,
    282  const ON_DimStyle* dimstyle,
    283  double dimscale,
    284  ON_Xform& text_xform_out
    285  ) const override;
    286 
    287  bool Create(
    288  ON::AnnotationType dim_type,
    289  const ON_UUID style_id,
    290  const ON_Plane& plane,
    291  const ON_3dVector& ref_horizontal,
    292  const ON_3dPoint& def_pt1,
    293  const ON_3dPoint& def_pt2,
    294  const ON_3dPoint& dimline_pt,
    295  double rotation_in_plane = 0.0
    296  );
    297 
    298  /*
    299  Description:
    300  Create an aligned linear dimension. The dimension line is
    301  parallel to the segment connecting the extension points.
    302  Parameters:
    303  extension_point0 - [in]
    304  extension_point1 - [in]
    305  locations of one of the points being dimensioned.
    306  The dimension line will be parallel to the segment
    307  connecting these points.
    308  dimension_line_point - [in]
    309  a point on the linear dimension line.
    310  plane_normal - [in]
    311  A vector perpindcular to the line between the extension points
    312  that defines the orientation of the dimension's plane.
    313  dim_style_id - [in]
    314  destination - [in]
    315  If nullptr, the returned ON_DimLinear is allocated by operator new.
    316  Otherwise, the reuturned ON_DimLinear is created in destination.
    317  */
    318  static ON_DimLinear* CreateAligned(
    319  ON_3dPoint extension_point0,
    320  ON_3dPoint extension_point1,
    321  ON_3dPoint dimension_line_point,
    322  ON_3dVector plane_normal,
    323  ON_UUID style_id,
    324  ON_DimLinear* destination
    325  );
    326 
    327  /*
    328  Description:
    329  Create a rotated linear dimension to the document.
    330  The dimension line is explicitly specified.
    331  Parameters:
    332  extension_point0 - [in]
    333  extension_point1 - [in]
    334  locations of one of the points being dimensioned.
    335  The dimension line will be parallel to the segment
    336  connecting these points.
    337  dimension_line - [in]
    338  the dimension line. This is treated as an infinite
    339  line and the points are automatically calculated.
    340  plane_normal - [in]
    341  A vector perpindcular to the line between the extension points
    342  that defines the orientation of the dimension's plane.
    343  The dimension line is projected to this plane.
    344  dim_style_id - [in]
    345  destination - [in]
    346  If nullptr, the returned ON_DimLinear is allocated by operator new.
    347  Otherwise, the reuturned ON_DimLinear is created in destination.
    348  */
    349  static ON_DimLinear* CreateRotated(
    350  ON_3dPoint extension_point0,
    351  ON_3dPoint extension_point1,
    352  ON_Line dimension_line,
    353  ON_3dVector plane_normal,
    354  ON_UUID style_id,
    355  ON_DimLinear* destination
    356  );
    357 
    358  // virtual
    359  double Measurement() const override;
    360  ON_2dPoint DefaultTextPoint() const override;
    361 
    362  // DefPoint1 is m_plane.origin
    363  // Meaasurement is between DefPoint1 and DefPoint2
    364  // parallel to the m_plane x-axis.
    365  ON_2dPoint DefPoint1() const;
    366  ON_2dPoint DefPoint2() const;
    367  ON_2dPoint DimlinePoint() const;
    368 
    369  void Set2dDefPoint1(ON_2dPoint pt);
    370  void Set2dDefPoint2(ON_2dPoint pt);
    371  void Set2dDimlinePoint(ON_2dPoint pt);
    372 
    373  void Set3dDefPoint1(ON_3dPoint pt);
    374  void Set3dDefPoint2(ON_3dPoint pt);
    375  void Set3dDimlinePoint(ON_3dPoint pt);
    376 
    377  ON_2dPoint ArrowPoint1() const; // Calculated
    378  ON_2dPoint ArrowPoint2() const; // Calculated
    379 
    380  bool Get3dPoints(
    381  ON_3dPoint* defpt1,
    382  ON_3dPoint* defpt2,
    383  ON_3dPoint* arrowpt1,
    384  ON_3dPoint* arrowpt2,
    385  ON_3dPoint* dimline,
    386  ON_3dPoint* textpt) const;
    387 
    388  bool GetDisplayLines(
    389  const ON_Viewport* vp,
    390  const ON_DimStyle* style,
    391  double dimscale,
    392  ON_3dPoint text_rect[4],
    393  ON_Line lines[4],
    394  bool isline[4],
    395  int maxlines) const;
    396 
    397  void GetArrowXform(
    398  int which_end,
    399  double scale,
    400  bool arrowflipped,
    401  bool from_the_back,
    402  ON_Xform& arrow_xform_out) const;
    403 
    404 protected:
    407 };
    408 
    409 //---------------------------------------------------------------------
    410 
    411 class ON_CLASS ON_DimAngular : public ON_Dimension
    412 {
    413  ON_OBJECT_DECLARE(ON_DimAngular);
    414 
    415 public:
    416  ON_DimAngular();
    417  ~ON_DimAngular() = default;
    418  ON_DimAngular(const ON_DimAngular& src) = default;
    419  ON_DimAngular& operator=(const ON_DimAngular& src) = default;
    420 
    421  static const ON_DimAngular Empty;
    422 
    423  /*
    424  Parameters:
    425  annotation_type - [in]
    426  annotation type to test
    427  Returns:
    428  True if input parameter is one of the valid linear dimension types
    429  ON::AnnotationType::Angular or ON::AnnotationType::Angular3pt.
    430  */
    431  static bool IsValidAngularDimensionType(
    432  ON::AnnotationType annotation_type
    433  );
    434 
    435  /*
    436  Parameters:
    437  angular_dimension_type - [in]
    438  ON::AnnotationType::Angular or ON::AnnotationType::Angular3pt.
    439  Returns:
    440  True if input parameter is valid and type is set.
    441  */
    442  bool SetAngularDimensionType(
    443  ON::AnnotationType angular_dimension_type
    444  );
    445 
    446  static ON_DimAngular* CreateFromV5DimAngular(
    447  const class ON_OBSOLETE_V5_DimAngular& V5_dim_angle,
    448  const class ON_3dmAnnotationContext* annotation_context,
    449  ON_DimAngular* destination
    450  );
    451 
    452  bool Write(
    453  ON_BinaryArchive& // serialize definition to binary archive
    454  ) const override;
    455 
    456  bool Read(
    457  ON_BinaryArchive& // restore definition from binary archive
    458  ) override;
    459 
    460  bool Transform(const ON_Xform& xform) override;
    461 
    462  // virtual ON_Geometry GetBBox override
    463  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    464 
    465  bool GetAnnotationBoundingBox(
    466  const ON_Viewport* vp,
    467  const ON_DimStyle* dimstyle,
    468  double dimscale,
    469  double* boxmin,
    470  double* boxmax,
    471  bool bGrow = false
    472  ) const override; // ON_Annotation override
    473 
    474  // Gets transform for dimension text from ON_xy_plane to 3d display location
    475  bool GetTextXform(
    476  const ON_Viewport* vp,
    477  const ON_DimStyle* dimstyle,
    478  double dimscale,
    479  ON_Xform& text_xform_out
    480  ) const override;
    481 
    482  /*
    483  Parameters:
    484  dim_style - [in]
    485  Pass nullptr if a dim_style is not available.
    486  arc - [in]
    487  arc being dimensioned
    488  offset - [in]
    489  distance from the arc being dimensioned to the angular dimension arc.
    490  When offset > 0, the dimension is outside the arc's circle.
    491  When offset < 0 and > - arc.Radius(), the dimension is inside the arc's circle.
    492  In all other cases, the angular dimension arc is on the arc.
    493  Returns:
    494  True if successful.
    495  False if input is not valid. In this case ON_DimAngle::Empty settings are returned.
    496  */
    497  bool Create(
    498  const ON_DimStyle* dim_style,
    499  ON_Arc arc,
    500  double offset
    501  );
    502 
    503  /*
    504  Description:
    505  The angle between the lines is dimensioned.
    506 
    507  If the lines intersect in a single point, that point is used as the center
    508  of the angular dimension arc. In this case, there are eight possible angles
    509  to dimension. The point_on_angular_dimension_arc and point_on_line parameters
    510  are used to select the correct angle to dimension. If a point_on_line parameter
    511  is not set, the corresponding line's midpoint is used.
    512 
    513  If the lines are colinear, the point on the line closest to
    514  point_on_angular_dimension_arc is the center of the angular dimension arc.
    515 
    516  Parameters:
    517  dim_style - [in]
    518  Pass nullptr if a dim_style is not available.
    519  line1 - [in]
    520  point_on_line1 - [in]
    521  If point_on_line1 is specified, it inidicates which semi-infinite portion of line1 to dimension.
    522  Otherwise the midpoint of lne1 as a segment is used.
    523  When in doubt, pass ON_3dPoint::UnsetPoint.
    524  line2 - [in]
    525  point_on_line2 - [in]
    526  If point_on_line2 is specified, it inidicates which semi-infinite portion of line2 to dimension.
    527  Otherwise the midpoint of line2 as a segment is used.
    528  When in doubt, pass ON_3dPoint::UnsetPoint.
    529  point_on_angular_dimension_arc - [in]
    530  A point on the interior of the angular dimension arc.
    531  bSetExtensionPoints - [in]
    532  If bSetExtensionPoints is true, and a point_on_line parameter is valid, that point
    533  is used as the extension point. Otherwise the angular dimension arc endpoint is used.
    534  Returns:
    535  True if successful.
    536  False if input is not valid. In this case ON_DimAngle::Empty settings are returned.
    537  */
    538  bool Create(
    539  const ON_DimStyle* dim_style,
    540  ON_Line line1,
    541  ON_3dPoint point_on_line1,
    542  ON_Line line2,
    543  ON_3dPoint point_on_line2,
    544  ON_3dPoint point_on_angular_dimension_arc,
    545  bool bSetExtensionPoints
    546  );
    547 
    548  bool Create(
    549  const ON_UUID style_id,
    550  const ON_Plane& plane,
    551  const ON_3dVector& ref_horizontal,
    552  const ON_3dPoint& center_pt,
    553  const ON_3dPoint& extension_pt1, // point on first extension vector
    554  const ON_3dPoint& extension_pt2, // point on second extension vector
    555  const ON_3dPoint& dimline_pt // point on dimension line
    556  );
    557 
    558  bool Create(
    559  const ON_UUID style_id,
    560  const ON_Plane& plane,
    561  const ON_3dVector& ref_horizontal,
    562  const ON_3dPoint& extension_pt1, // start of first extension line
    563  const ON_3dPoint& extension_pt2, // start of second extension line
    564  const ON_3dPoint& direction_pt1, // point on first extension vector
    565  const ON_3dPoint& direction_pt2, // point on second extension vector
    566  const ON_3dPoint& dimline_pt // point on dimension line
    567  );
    568 
    569  bool AdjustFromPoints(
    570  const ON_Plane& plane,
    571  const ON_3dPoint& center_pt,
    572  const ON_3dPoint& extension_pt1, // point on first extension vector
    573  const ON_3dPoint& extension_pt2, // point on second extension vector
    574  const ON_3dPoint& dimline_pt // point on dimension line
    575  );
    576 
    577  bool AdjustFromPoints(
    578  const ON_Plane& plane,
    579  const ON_3dPoint& extension_pt1, // start of first extension line
    580  const ON_3dPoint& extension_pt2, // start of second extension line
    581  const ON_3dPoint& direction_pt1, // point on first extension vector
    582  const ON_3dPoint& direction_pt2, // point on second extension vector
    583  const ON_3dPoint& dimline_pt // point on dimension line
    584  );
    585 
    586  static bool FindAngleVertex(
    587  ON_Line lines[2],
    588  ON_3dPoint pickpoints[2],
    589  const ON_Plane& plane,
    590  ON_3dPoint& centerpoint_out);
    591 
    592 
    593  bool UpdateDimensionText(const ON_DimStyle* dimstyle) const;
    594 
    595  bool GetAngleDisplayText(const ON_DimStyle* dimstyle, ON_wString& displaytext) const;
    596 
    597  // virtual
    598  double Measurement() const override; // angle in radians
    599  ON_2dPoint DefaultTextPoint() const override;
    600  bool GetAngles(double* start_ang, double* end_ang, double* mid_ang) const;
    601  double Radius() const;
    602 
    603  // CenterPoint is m_plane.origin
    604  // Measurement is angle between m_vec_1 & m_vec_2 in radians
    605  ON_2dPoint CenterPoint() const;
    606  ON_2dPoint DefPoint1() const; // Start of first extension
    607  ON_2dPoint DefPoint2() const; // Start of second extension
    608  ON_2dPoint DimlinePoint() const; // Point on dimension arc
    609  ON_2dPoint UserTextPoint() const; // Text point if user positioned
    610  ON_2dVector ExtDir1() const; // Direction of first extension
    611  ON_2dVector ExtDir2() const; // Direction of second extension
    612  void SetExtDir1(const ON_2dVector& dir1);
    613  void SetExtDir2(const ON_2dVector& dir2);
    614 
    615  void SetUserTextPoint(const ON_3dPoint& point);
    616 
    617  void Set2dCenterPoint(ON_2dPoint pt); // Apex of angle
    618  void Set2dDefPoint1(ON_2dPoint pt); // Point where first extension starts
    619  void Set2dDefPoint2(ON_2dPoint pt); // Point where second extension starts
    620  void Set2dDimlinePoint(ON_2dPoint pt); // Point on dimension arc
    621 
    622  //void Set2dDefPoint1(ON_2dPoint pt); // Point where first extension starts
    623  //void Set2dDefPoint2(ON_2dPoint pt); // Point where second extension starts
    624  //void Set2dDimlinePoint(ON_2dPoint pt); // Point on dimension arc
    625 
    626  //void Set3dCenterPoint(ON_3dPoint pt);
    627  //void Set3dDefPoint1(ON_3dPoint pt);
    628  //void Set3dDefPoint2(ON_3dPoint pt);
    629  //void Set3dDimlinePoint(ON_3dPoint pt);
    630 
    631  ON_2dPoint ArrowPoint1() const; // Calculated - start of arc
    632  ON_2dPoint ArrowPoint2() const; // Calculated - end of arc
    633 
    634  bool Get3dPoints(
    635  ON_3dPoint* center,
    636  ON_3dPoint* defpt1,
    637  ON_3dPoint* defpt2,
    638  ON_3dPoint* arrowpt1,
    639  ON_3dPoint* arrowpt2,
    640  ON_3dPoint* dimline,
    641  ON_3dPoint* textpt) const;
    642 
    643  bool GetDisplayLines(
    644  const ON_Viewport* vp,
    645  const ON_DimStyle* style,
    646  double dimscale,
    647  const ON_3dPoint text_rect[4],
    648  ON_Line lines[2],
    649  bool isline[2],
    650  ON_Arc arcs[2],
    651  bool isarc[2],
    652  int maxlines,
    653  int maxarcs) const;
    654 
    655  void GetArrowXform(
    656  int which_end,
    657  double arrowlength,
    658  bool arrowflipped,
    659  bool from_the_back,
    660  ON_Xform& arrow_xform_out) const;
    661 
    662  bool UpdateDimensionText(
    663  ON::LengthUnitSystem units_in,
    664  const ON_DimStyle* dimstyle) const override;
    665 
    666  bool GetDistanceDisplayText(
    667  ON::LengthUnitSystem units_in,
    668  const ON_DimStyle* dimstyle,
    669  ON_wString& displaytext) const override;
    670 
    671 protected:
    672  // Center point is at plane origin (0,0)
    675  double m_ext_offset_1 = 0.0; // distance along m_vec_1 to start extension line 1
    676  double m_ext_offset_2 = 0.0; // distance along m_vec_2 to start extension line 2
    677  ON_2dPoint m_dimline_pt = ON_2dPoint(1.0, 1.0); // point on interior of dimension arc
    678 };
    679 
    680 //---------------------------------------------------------------------
    681 
    682 class ON_CLASS ON_DimRadial : public ON_Dimension
    683 {
    684  ON_OBJECT_DECLARE(ON_DimRadial);
    685 
    686 public:
    687  ON_DimRadial();
    688  ~ON_DimRadial() = default;
    689  ON_DimRadial(const ON_DimRadial& src) = default;
    690  ON_DimRadial& operator=(const ON_DimRadial& src) = default;
    691 
    692  static const ON_DimRadial Empty;
    693 
    694 
    695  /*
    696  Description:
    697  Create a V6 radial dimension from a V5 radial dimension
    698  The function is used when reading V5 files.
    699  Parameters:
    700  V5_radial_dimension -[in]
    701  annotation_context - [in]
    702  Dimstyle and other information referenced by V5_radial_dimension or nullptr if not available.
    703  destination - [in]
    704  If destination is not nullptr, then the V6 radial dimension is constructed
    705  in destination. If destination is nullptr, then the new V6 radial dimension
    706  is allocated with a call to new ON_DimRadial().
    707  */
    708  static ON_DimRadial* CreateFromV5DimRadial(
    709  const class ON_OBSOLETE_V5_DimRadial& V5_radial_dimension,
    710  const class ON_3dmAnnotationContext* annotation_context,
    711  ON_DimRadial* destination
    712  );
    713 
    714  /*
    715  Parameters:
    716  annotation_type - [in]
    717  annotation type to test
    718  Returns:
    719  True if input parameter is one of the valid radial dimension types
    720  ON::AnnotationType::Radius or ON::AnnotationType::Diameter.
    721  */
    722  static bool IsValidRadialDimensionType(
    723  ON::AnnotationType annotation_type
    724  );
    725 
    726  /*
    727  Parameters:
    728  radial_dimension_type - [in]
    729  ON::AnnotationType::Radius or ON::AnnotationType::Diameter.
    730  Returns:
    731  True if input parameter is valid and type is set.
    732  */
    733  bool SetRadialDimensionType(
    734  ON::AnnotationType radial_dimension_type
    735  );
    736 
    737  bool Write(
    738  ON_BinaryArchive& // serialize definition to binary archive
    739  ) const override;
    740 
    741  bool Read(
    742  ON_BinaryArchive& // restore definition from binary archive
    743  ) override;
    744 
    745  bool Transform(const ON_Xform& xform) override;
    746 
    747  // virtual ON_Geometry GetBBox override
    748  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    749 
    750  bool GetAnnotationBoundingBox(
    751  const ON_Viewport* vp,
    752  const ON_DimStyle* dimstyle,
    753  double dimscale,
    754  double* boxmin,
    755  double* boxmax,
    756  bool bGrow = false
    757  ) const override; // ON_Annotation override
    758 
    759  // Gets transform for dimension text from ON_xy_plane to 3d display location
    760  bool GetTextXform(
    761  const ON_Viewport* vp,
    762  const ON_DimStyle* dimstyle,
    763  double dimscale,
    764  ON_Xform& text_xform_out
    765  ) const override;
    766 
    767  bool Create(
    768  ON::AnnotationType type,
    769  const ON_UUID style_id,
    770  const ON_Plane& plane,
    771  const ON_3dPoint& center_pt,
    772  const ON_3dPoint& radius_pt,
    773  const ON_3dPoint& dimline_pt
    774  );
    775 
    776  bool AdjustFromPoints(
    777  const ON_Plane& plane,
    778  const ON_3dPoint& center_pt,
    779  const ON_3dPoint& radius_pt,
    780  const ON_3dPoint& dimline_pt
    781  );
    782 
    783  double Measurement() const override;
    784 
    785  ON_2dPoint DefaultTextPoint() const override;
    786  ON_2dPoint CenterPoint() const;
    787  ON_2dPoint RadiusPoint() const; // Point on arc being measured
    788  ON_2dPoint DimlinePoint() const; // Endpoint of leader tail, not including landing
    789  ON_2dPoint KneePoint() const; // Point where leader tail bends
    790 
    791  void Set2dCenterPoint(ON_2dPoint pt);
    792  void Set2dRadiusPoint(ON_2dPoint pt);
    793  void Set2dDimlinePoint(ON_2dPoint pt);
    794 
    795  void Set3dCenterPoint(ON_3dPoint pt);
    796  void Set3dRadiusPoint(ON_3dPoint pt);
    797  void Set3dDimlinePoint(ON_3dPoint pt);
    798 
    799  bool Get3dPoints(
    800  ON_3dPoint* center_pt,
    801  ON_3dPoint* radius_pt,
    802  ON_3dPoint* dimline_pt,
    803  ON_3dPoint* knee_pt) const;
    804 
    805  bool GetDisplayLines(
    806  const ON_DimStyle* style,
    807  double dimscale,
    808  ON_3dPoint text_rect[4],
    809  ON_Line lines[9],
    810  bool isline[9],
    811  int maxlines) const;
    812 
    813  void GetArrowXform(
    814  double scale,
    815  ON_Xform& arrow_xform_out) const;
    816 
    817 protected:
    820 };
    821 
    822 
    823 //---------------------------------------------------------------------
    824 // + dimpt
    825 // |
    826 // |
    827 // |
    828 // + kinkpt2
    829 // \
    830 // \ kinkoffset2
    831 // \
    832 // + kinkpt1
    833 // |
    834 // | kinkoffset1
    835 // |
    836 // + ldrpt
    837 // 1
    838 // 2
    839 // 3
    840 
    841 class ON_CLASS ON_DimOrdinate : public ON_Dimension
    842 {
    843  ON_OBJECT_DECLARE(ON_DimOrdinate);
    844 
    845 public:
    846  ON_DimOrdinate();
    847  ~ON_DimOrdinate() = default;
    848  ON_DimOrdinate(const ON_DimOrdinate& src) = default;
    849  ON_DimOrdinate& operator=(const ON_DimOrdinate& src) = default;
    850 
    851  static const ON_DimOrdinate Empty;
    852 
    853 #pragma region RH_C_SHARED_ENUM [ON_DimOrdinate::MeasuredDirection] [Rhino.Geometry.OrdinateDimension.MeasuredDirection] [nested:byte]
    854  /// <summary>
    855  /// Ordinate dimension measures x or y direction
    856  /// </summary>
    857  enum class MeasuredDirection : unsigned char
    858  {
    859  /// <summary> </summary>
    860  Unset = 0,
    861  /// <summary> Measures horizontal distance </summary>
    862  Xaxis = 1,
    863  /// <summary> Measures vertical distance </summary>
    864  Yaxis = 2,
    865  };
    866 #pragma endregion
    867 
    868  static ON_DimOrdinate::MeasuredDirection MeasuredDirectionFromUnsigned(
    869  unsigned int measured_direction_as_unsigned
    870  );
    871 
    872  static ON_DimOrdinate* CreateFromV5DimOrdinate(
    873  const class ON_OBSOLETE_V5_DimOrdinate& V5_dim_ordinate,
    874  const class ON_3dmAnnotationContext* annotation_context,
    875  ON_DimOrdinate* destination
    876  );
    877 
    878  bool Write(
    879  ON_BinaryArchive& archive
    880  ) const override;
    881 
    882  bool Read(
    883  ON_BinaryArchive& archive
    884  ) override;
    885 
    886  bool Transform(const ON_Xform& xform) override;
    887 
    888  // virtual ON_Geometry GetBBox override
    889  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    890 
    891  bool GetAnnotationBoundingBox(
    892  const ON_Viewport* vp,
    893  const ON_DimStyle* dimstyle,
    894  double dimscale,
    895  double* boxmin,
    896  double* boxmax,
    897  bool bGrow = false
    898  ) const override; // ON_Annotation override
    899 
    900  // Gets transform for dimension text from ON_xy_plane to 3d display location
    901  bool GetTextXform(
    902  const ON_Viewport* vp,
    903  const ON_DimStyle* dimstyle,
    904  double dimscale,
    905  ON_Xform& text_xform_out
    906  ) const override;
    907 
    908  bool Create(
    909  const ON_UUID style_id,
    910  const ON_Plane& plane,
    911  MeasuredDirection direction,
    912  const ON_3dPoint& basept,
    913  const ON_3dPoint& defpt,
    914  const ON_3dPoint& ldrpt,
    915  double kinkoffset1,
    916  double kinkoffset2
    917  );
    918 
    919  bool AdjustFromPoints(
    920  const ON_Plane& plane,
    921  MeasuredDirection direction,
    922  const ON_3dPoint& basept,
    923  const ON_3dPoint& defpt,
    924  const ON_3dPoint& ldrpt,
    925  double kinkoffset1,
    926  double kinkoffset2
    927  );
    928 
    929  ON_2dPoint DefPt() const;
    930  ON_2dPoint LeaderPt() const;
    931  ON_2dPoint KinkPt1() const;
    932  ON_2dPoint KinkPt2() const;
    933  double KinkOffset1() const;
    934  double KinkOffset2() const;
    935 
    936  void Set2dDefPt(ON_2dPoint pt);
    937  void Set2dLeaderPt(ON_2dPoint pt);
    938  void SetKinkOffset1(double d);
    939  void SetKinkOffset2(double d);
    940 
    941  void Set3dBasePoint(ON_3dPoint pt);
    942  void Set3dDefPt(ON_3dPoint pt);
    943  void Set3dLeaderPt(ON_3dPoint pt);
    944 
    945  ON_3dPoint Get3dBasePoint() const;
    946  ON_3dPoint Get3dDefPt() const;
    947  ON_3dPoint Get3dLeaderPt() const;
    948  ON_3dPoint Get3dKinkPt1(double default_kink_offset = 1.0) const;
    949  ON_3dPoint Get3dKinkPt2(double default_kink_offset = 1.0) const;
    950 
    951  bool Get3dPoints(
    952  ON_3dPoint* base_pt,
    953  ON_3dPoint* def_pt,
    954  ON_3dPoint* ldr_pt,
    955  ON_3dPoint* kink_pt1,
    956  ON_3dPoint* kink_pt2,
    957  double default_kink_offset = 1.0) const;
    958 
    959  bool GetDisplayLines(
    960  const ON_DimStyle* style,
    961  double dimscale,
    962  ON_3dPoint text_rect[4],
    963  ON_Line lines[3],
    964  bool isline[3],
    965  int maxlines) const;
    966 
    967  bool CalcKinkPoints(
    968  ON_2dPoint defpt,
    969  ON_2dPoint ldrpt,
    970  MeasuredDirection direction,
    971  double default_kink_offset,
    972  ON_2dPoint& kinkpt1_out,
    973  ON_2dPoint& kinkpt2_out) const;
    974 
    975  MeasuredDirection ImpliedDirection(
    976  ON_2dPoint defpt,
    977  ON_2dPoint ldrpt
    978  ) const;
    979 
    980  MeasuredDirection GetMeasuredDirection() const;
    981  void SetMeasuredDirection(MeasuredDirection direction);
    982 
    983  double Measurement() const override;
    984 
    985 protected:
    986  // Plane origin is base for measurements
    987  // Measurements are from plane origin to dimension point
    988  // in either x or y axis direction
    989  MeasuredDirection m_direction = MeasuredDirection::Unset;
    990 
    993 
    994  double m_kink_offset_1 = ON_UNSET_VALUE; // measures from defpt1 toward defpt2 to kink1
    995  double m_kink_offset_2 = ON_UNSET_VALUE; // measures from kink1 toward defpt2 to kink2
    996 };
    997 
    998 
    999 //---------------------------------------------------------------------
    1000 
    1001 class ON_CLASS ON_Centermark : public ON_Dimension
    1002 {
    1003  ON_OBJECT_DECLARE(ON_Centermark);
    1004 
    1005 public:
    1006  ON_Centermark();
    1007  ~ON_Centermark() = default;
    1008  ON_Centermark(const ON_Centermark& src) = default;
    1009  ON_Centermark& operator=(const ON_Centermark& src) = default;
    1010 
    1011  static const ON_Centermark Empty;
    1012 
    1013  bool Write(
    1014  ON_BinaryArchive& // serialize definition to binary archive
    1015  ) const override;
    1016 
    1017  bool Read(
    1018  ON_BinaryArchive& // restore definition from binary archive
    1019  ) override;
    1020 
    1021  bool Transform(const ON_Xform& xform) override;
    1022 
    1023  bool GetTextXform(
    1024  const ON_Viewport*,
    1025  const ON_DimStyle*,
    1026  double,
    1027  ON_Xform&
    1028  ) const override;
    1029 
    1030  // virtual ON_Geometry GetBBox override
    1031  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1032 
    1033  bool GetAnnotationBoundingBox(
    1034  const ON_Viewport* vp,
    1035  const ON_DimStyle* dimstyle,
    1036  double dimscale,
    1037  double* boxmin,
    1038  double* boxmax,
    1039  bool bGrow = false
    1040  ) const override; // ON_Annotation override
    1041 
    1042  bool Create(
    1043  const ON_UUID style_id,
    1044  const ON_Plane& plane,
    1045  const ON_3dPoint& center_pt,
    1046  const double radius
    1047  );
    1048 
    1049  bool AdjustFromPoints(
    1050  const ON_Plane& plane,
    1051  const ON_3dPoint& center_pt
    1052  );
    1053 
    1054  double Measurement() const override;
    1055 
    1056  ON_2dPoint CenterPoint() const;
    1057  void Set2dCenterPoint(ON_2dPoint pt);
    1058  void Set3dCenterPoint(ON_3dPoint pt);
    1059 
    1060  bool GetDisplayLines(
    1061  const ON_DimStyle* style,
    1062  double dimscale,
    1063  ON_Line lines[6],
    1064  bool isline[6],
    1065  int maxlines) const;
    1066 
    1067  double Radius() const; // radius of marked circle
    1068  void SetRadius(double radius);
    1069 
    1070 private:
    1071  double m_radius = 0.0;
    1072 };
    1073 
    1074 
    1075 
    1076 
    1077 #endif
    1078 
    Definition: opennurbs_annotationbase.h:23
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_DIMENSION_INC_)
    18 #define OPENNURBS_DIMENSION_INC_
    19 
    20 #if defined(ON_DLL_TEMPLATE)
    21 ON_DLL_TEMPLATE template ON_ClassArray< class ON_DimStyle >;
    22 #endif
    23 
    24 class ON_CLASS ON_Dimension : public ON_Annotation
    25 {
    26  ON_OBJECT_DECLARE(ON_Dimension);
    27 
    28 public:
    29 #pragma region RH_C_SHARED_ENUM [ON_Dimension::ForceArrow] [Rhino.Geometry.Dimension.ForceArrow] [nested:int]
    30  /// <summary>
    31  /// Arrowheads forced Inside, or Outside of extension lines, or moved to fit.
    32  /// </summary>
    33  enum class ForceArrow : unsigned int
    34  {
    35  /// <summary> </summary>
    36  Auto = 0,
    37  /// <summary> </summary>
    38  Inside = 1,
    39  /// <summary> </summary>
    40  Outside = 2,
    41  };
    42 #pragma endregion
    43 
    44  static ON_Dimension::ForceArrow ForceArrowFromUnsigned(
    45  unsigned int force_arrow_as_unsigned);
    46 
    47 #pragma region RH_C_SHARED_ENUM [ON_Dimension::ForceText] [Rhino.Geometry.Dimension.ForceText] [nested:int]
    48  /// <summary>
    49  /// Text forced Inside, Right or Left of extension lines, or moved to fit (Auto).
    50  /// </summary>
    51  enum class ForceText : unsigned int
    52  {
    53  /// <summary> </summary>
    54  Auto = 0,
    55  /// <summary> </summary>
    56  Inside = 1,
    57  /// <summary> </summary>
    58  Right = 2,
    59  /// <summary> </summary>
    60  Left = 3,
    61  };
    62 #pragma endregion
    63 
    64  static ON_Dimension::ForceText ForceTextFromUnsigned(
    65  unsigned int force_text_as_unsigned);
    66 
    67 
    68 protected:
    69  ON_Dimension( ON::AnnotationType annotation_type );
    70  ~ON_Dimension();
    71  ON_Dimension(const ON_Dimension& src);
    72  ON_Dimension& operator=(const ON_Dimension& src);
    73 
    74 private:
    75  ON_Dimension() = delete;
    76  void Internal_Destroy();
    77  void Internal_CopyFrom(const ON_Dimension& src);
    78 
    79 public:
    80  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    81 
    82  virtual ON_2dPoint DefaultTextPoint() const;
    83  virtual bool UseDefaultTextPoint() const;
    84  virtual void SetUseDefaultTextPoint(bool usedefault);
    85 
    86  // Text center-midpoint in dimension plane
    87  ON_2dPoint TextPoint() const;
    88  void Set2dTextPoint(const ON_2dPoint& textpoint);
    89 
    90  const wchar_t* UserText() const;
    91  void SetUserText(const wchar_t* text);
    92  const wchar_t* PlainUserText() const;
    93 
    94  // Computes measurement value as a number
    95  virtual double Measurement() const = 0;
    96 
    97  // Add to natural rotation
    98  double TextRotation() const;
    99  void SetTextRotation(double rotation_radians);
    100 
    101  bool ArrowIsFlipped(int i) const;
    102  void FlipArrow(int i, bool flip) const;
    103 
    104  // If the dimension is a paper space object and the geometry being dimensioned is in
    105  // model space, in a detail viewport, DetailMeasured() will have the UUID of the detail
    106  // that the dimension references. Otherwise DetailMeasured() will be ON_nil_uuid.
    107  ON_UUID DetailMeasured() const;
    108  void SetDetailMeasured(ON_UUID uuid);
    109 
    110  // If DetailMeasured() returns ON_nil_uuid, DistanceScale() has no meaning
    111  // If the dimension is in page space and measures model space geometry,
    112  // DistanceScale() is the conversion from the model space distance being measured
    113  // to the paper space distance spanned by the dimension geometry.
    114  // When the zoom factor of the detail view changes, the distance scale will change
    115  double DistanceScale() const;
    116  void SetDistanceScale(double distance_scale) const;
    117 
    118  //virtual bool GetBBox(
    119  // const ON_Viewport* vp,
    120  // double dimscale,
    121  // const ON_DimStyle* dimstyle,
    122  // double* boxmin,
    123  // double* boxmax,
    124  // bool bGrow = 0) const = 0;
    125 
    126  virtual bool GetTextRect(ON_3dPoint text_rect[4]) const;
    127 
    128  // Remakes dimension text geometry object and sets it on the dimension
    129  virtual bool UpdateDimensionText(
    130  ON::LengthUnitSystem units_in,
    131  const ON_DimStyle* dimstyle
    132  ) const;
    133 
    134  // Makes text geometry for a dimension
    135  ON_TextContent* RebuildDimensionText(
    136  ON::LengthUnitSystem units_in,
    137  const ON_DimStyle* dimstyle,
    138  bool expandanglebrackets // replace <> with the formatted distance
    139  ) const;
    140 
    141  virtual bool GetDistanceDisplayText(
    142  ON::LengthUnitSystem units_in,
    143  const ON_DimStyle* dimstyle,
    144  ON_wString& displaytext) const;
    145 
    146  static bool GetCentermarkDisplay(
    147  const ON_Plane& plane,
    148  const ON_2dPoint center,
    149  double marksize,
    150  double radius,
    152  ON_Line lines[6],
    153  bool isline[6],
    154  int maxlines
    155  );
    156 
    157  static bool GetCentermarkSnapPoints(
    158  const ON_Plane& plane,
    159  const ON_2dPoint center,
    160  double marksize,
    161  double radius,
    163  ON_3dPoint points[13],
    164  bool ispoint[13]);
    165 
    166 
    167  ON_Dimension::ForceArrow ForceArrowPosition() const;
    168  void SetForceArrowPosition(ForceArrow force);
    169 
    170  ON_Dimension::ForceText ForceTextPosition() const;
    171  void SetForceTextPosition(ForceText force);
    172 
    173 protected:
    174  ON_wString m_user_text = L"<>"; // If user overridden, or "<>" to use default
    175  double m_text_rotation = 0.0;
    177 
    178  bool m_use_default_text_point = true;
    179  ON_2dPoint m_user_text_point = ON_2dPoint::UnsetPoint; // Text point if default isn't used
    180 
    181  mutable bool m_flip_arrow_1 = false;
    182  mutable bool m_flip_arrow_2 = false;
    183  mutable bool m_text_outside = false;
    184  ForceArrow m_force_arrows = ForceArrow::Auto;
    185  ForceText m_force_textpos = ForceText::Auto;
    186 
    187 
    188  // UUID of detail if dimension is in page space measuring model space geometry
    189  ON_UUID m_detail_measured = ON_nil_uuid;
    190  // Conversion from model space size to paper space size if dimension is in page space measuring model space geometry
    191  mutable double m_distance_scale = 1.0;
    192 
    193  bool Internal_WriteDimension(
    194  ON_BinaryArchive& // serialize definition to binary archive
    195  ) const;
    196 
    197  bool Internal_ReadDimension(
    198  ON_BinaryArchive& // restore definition from binary archive
    199  );
    200 };
    201 
    202 class ON_CLASS ON_DimLinear : public ON_Dimension
    203 {
    204  ON_OBJECT_DECLARE(ON_DimLinear);
    205 
    206 public:
    207  ON_DimLinear();
    208  ~ON_DimLinear() = default;
    209  ON_DimLinear(const ON_DimLinear& src) = default;
    210  ON_DimLinear& operator=(const ON_DimLinear& src) = default;
    211 
    212  static const ON_DimLinear Empty;
    213 
    214  /*
    215  Description:
    216  Create a V6 linear dimension from a V5 linear dimension
    217  The function is used when reading V5 files.
    218  Parameters:
    219  V5_linear_dimension -[in]
    220  annotation_context - [in]
    221  Dimstyle and other information referenced by V5_linear_dimension or nullptr if not available.
    222  destination - [in]
    223  If destination is not nullptr, then the V6 linear dimension is constructed
    224  in destination. If destination is nullptr, then the new V6 linear dimension
    225  is allocated with a call to new ON_DimLinear().
    226  */
    227  static ON_DimLinear* CreateFromV5DimLinear(
    228  const class ON_OBSOLETE_V5_DimLinear& V5_linear_dimension,
    229  const class ON_3dmAnnotationContext* annotation_context,
    230  ON_DimLinear* destination
    231  );
    232 
    233 
    234  /*
    235  Parameters:
    236  annotation_type - [in]
    237  annotation type to test
    238  Returns:
    239  True if input parameter is one of the valid linear dimension types
    240  ON::AnnotationType::Aligned or ON::AnnotationType::Rotated.
    241  */
    242  static bool IsValidLinearDimensionType(
    243  ON::AnnotationType annotation_type
    244  );
    245 
    246  /*
    247  Parameters:
    248  linear_dimension_type - [in]
    249  ON::AnnotationType::Aligned or ON::AnnotationType::Rotated.
    250  Returns:
    251  True if input parameter is valid and type is set.
    252  */
    253  bool SetLinearDimensionType(
    254  ON::AnnotationType linear_dimension_type
    255  );
    256 
    257  bool Write(
    258  ON_BinaryArchive& // serialize definition to binary archive
    259  ) const override;
    260 
    261  bool Read(
    262  ON_BinaryArchive& // restore definition from binary archive
    263  ) override;
    264 
    265  bool Transform(const ON_Xform& xform) override;
    266 
    267  // virtual ON_Geometry GetBBox override
    268  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    269 
    270  bool GetAnnotationBoundingBox(
    271  const ON_Viewport* vp,
    272  const ON_DimStyle* dimstyle,
    273  double dimscale,
    274  double* boxmin,
    275  double* boxmax,
    276  bool bGrow = false
    277  ) const override; // ON_Annotation override
    278 
    279  // Gets transform for dimension text from ON_xy_plane to 3d display location
    280  bool GetTextXform(
    281  const ON_Viewport* vp,
    282  const ON_DimStyle* dimstyle,
    283  double dimscale,
    284  ON_Xform& text_xform_out
    285  ) const override;
    286 
    287  bool Create(
    288  ON::AnnotationType dim_type,
    289  const ON_UUID style_id,
    290  const ON_Plane& plane,
    291  const ON_3dVector& ref_horizontal,
    292  const ON_3dPoint& def_pt1,
    293  const ON_3dPoint& def_pt2,
    294  const ON_3dPoint& dimline_pt,
    295  double rotation_in_plane = 0.0
    296  );
    297 
    298  /*
    299  Description:
    300  Create an aligned linear dimension. The dimension line is
    301  parallel to the segment connecting the extension points.
    302  Parameters:
    303  extension_point0 - [in]
    304  extension_point1 - [in]
    305  locations of one of the points being dimensioned.
    306  The dimension line will be parallel to the segment
    307  connecting these points.
    308  dimension_line_point - [in]
    309  a point on the linear dimension line.
    310  plane_normal - [in]
    311  A vector perpindcular to the line between the extension points
    312  that defines the orientation of the dimension's plane.
    313  dim_style_id - [in]
    314  destination - [in]
    315  If nullptr, the returned ON_DimLinear is allocated by operator new.
    316  Otherwise, the reuturned ON_DimLinear is created in destination.
    317  */
    318  static ON_DimLinear* CreateAligned(
    319  ON_3dPoint extension_point0,
    320  ON_3dPoint extension_point1,
    321  ON_3dPoint dimension_line_point,
    322  ON_3dVector plane_normal,
    323  ON_UUID style_id,
    324  ON_DimLinear* destination
    325  );
    326 
    327  /*
    328  Description:
    329  Create a rotated linear dimension to the document.
    330  The dimension line is explicitly specified.
    331  Parameters:
    332  extension_point0 - [in]
    333  extension_point1 - [in]
    334  locations of one of the points being dimensioned.
    335  The dimension line will be parallel to the segment
    336  connecting these points.
    337  dimension_line - [in]
    338  the dimension line. This is treated as an infinite
    339  line and the points are automatically calculated.
    340  plane_normal - [in]
    341  A vector perpindcular to the line between the extension points
    342  that defines the orientation of the dimension's plane.
    343  The dimension line is projected to this plane.
    344  dim_style_id - [in]
    345  destination - [in]
    346  If nullptr, the returned ON_DimLinear is allocated by operator new.
    347  Otherwise, the reuturned ON_DimLinear is created in destination.
    348  */
    349  static ON_DimLinear* CreateRotated(
    350  ON_3dPoint extension_point0,
    351  ON_3dPoint extension_point1,
    352  ON_Line dimension_line,
    353  ON_3dVector plane_normal,
    354  ON_UUID style_id,
    355  ON_DimLinear* destination
    356  );
    357 
    358  // virtual
    359  double Measurement() const override;
    360  ON_2dPoint DefaultTextPoint() const override;
    361 
    362  // DefPoint1 is m_plane.origin
    363  // Meaasurement is between DefPoint1 and DefPoint2
    364  // parallel to the m_plane x-axis.
    365  ON_2dPoint DefPoint1() const;
    366  ON_2dPoint DefPoint2() const;
    367  ON_2dPoint DimlinePoint() const;
    368 
    369  void Set2dDefPoint1(ON_2dPoint pt);
    370  void Set2dDefPoint2(ON_2dPoint pt);
    371  void Set2dDimlinePoint(ON_2dPoint pt);
    372 
    373  void Set3dDefPoint1(ON_3dPoint pt);
    374  void Set3dDefPoint2(ON_3dPoint pt);
    375  void Set3dDimlinePoint(ON_3dPoint pt);
    376 
    377  ON_2dPoint ArrowPoint1() const; // Calculated
    378  ON_2dPoint ArrowPoint2() const; // Calculated
    379 
    380  bool Get3dPoints(
    381  ON_3dPoint* defpt1,
    382  ON_3dPoint* defpt2,
    383  ON_3dPoint* arrowpt1,
    384  ON_3dPoint* arrowpt2,
    385  ON_3dPoint* dimline,
    386  ON_3dPoint* textpt) const;
    387 
    388  bool GetDisplayLines(
    389  const ON_Viewport* vp,
    390  const ON_DimStyle* style,
    391  double dimscale,
    392  ON_3dPoint text_rect[4],
    393  ON_Line lines[4],
    394  bool isline[4],
    395  int maxlines) const;
    396 
    397  void GetArrowXform(
    398  int which_end,
    399  double scale,
    400  bool arrowflipped,
    401  bool from_the_back,
    402  ON_Xform& arrow_xform_out) const;
    403 
    404 protected:
    407 };
    408 
    409 //---------------------------------------------------------------------
    410 
    411 class ON_CLASS ON_DimAngular : public ON_Dimension
    412 {
    413  ON_OBJECT_DECLARE(ON_DimAngular);
    414 
    415 public:
    416  ON_DimAngular();
    417  ~ON_DimAngular() = default;
    418  ON_DimAngular(const ON_DimAngular& src) = default;
    419  ON_DimAngular& operator=(const ON_DimAngular& src) = default;
    420 
    421  static const ON_DimAngular Empty;
    422 
    423  /*
    424  Parameters:
    425  annotation_type - [in]
    426  annotation type to test
    427  Returns:
    428  True if input parameter is one of the valid linear dimension types
    429  ON::AnnotationType::Angular or ON::AnnotationType::Angular3pt.
    430  */
    431  static bool IsValidAngularDimensionType(
    432  ON::AnnotationType annotation_type
    433  );
    434 
    435  /*
    436  Parameters:
    437  angular_dimension_type - [in]
    438  ON::AnnotationType::Angular or ON::AnnotationType::Angular3pt.
    439  Returns:
    440  True if input parameter is valid and type is set.
    441  */
    442  bool SetAngularDimensionType(
    443  ON::AnnotationType angular_dimension_type
    444  );
    445 
    446  static ON_DimAngular* CreateFromV5DimAngular(
    447  const class ON_OBSOLETE_V5_DimAngular& V5_dim_angle,
    448  const class ON_3dmAnnotationContext* annotation_context,
    449  ON_DimAngular* destination
    450  );
    451 
    452  bool Write(
    453  ON_BinaryArchive& // serialize definition to binary archive
    454  ) const override;
    455 
    456  bool Read(
    457  ON_BinaryArchive& // restore definition from binary archive
    458  ) override;
    459 
    460  bool Transform(const ON_Xform& xform) override;
    461 
    462  // virtual ON_Geometry GetBBox override
    463  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    464 
    465  bool GetAnnotationBoundingBox(
    466  const ON_Viewport* vp,
    467  const ON_DimStyle* dimstyle,
    468  double dimscale,
    469  double* boxmin,
    470  double* boxmax,
    471  bool bGrow = false
    472  ) const override; // ON_Annotation override
    473 
    474  // Gets transform for dimension text from ON_xy_plane to 3d display location
    475  bool GetTextXform(
    476  const ON_Viewport* vp,
    477  const ON_DimStyle* dimstyle,
    478  double dimscale,
    479  ON_Xform& text_xform_out
    480  ) const override;
    481 
    482  /*
    483  Parameters:
    484  dim_style - [in]
    485  Pass nullptr if a dim_style is not available.
    486  arc - [in]
    487  arc being dimensioned
    488  offset - [in]
    489  distance from the arc being dimensioned to the angular dimension arc.
    490  When offset > 0, the dimension is outside the arc's circle.
    491  When offset < 0 and > - arc.Radius(), the dimension is inside the arc's circle.
    492  In all other cases, the angular dimension arc is on the arc.
    493  Returns:
    494  True if successful.
    495  False if input is not valid. In this case ON_DimAngle::Empty settings are returned.
    496  */
    497  bool Create(
    498  const ON_DimStyle* dim_style,
    499  ON_Arc arc,
    500  double offset
    501  );
    502 
    503  /*
    504  Description:
    505  The angle between the lines is dimensioned.
    506 
    507  If the lines intersect in a single point, that point is used as the center
    508  of the angular dimension arc. In this case, there are eight possible angles
    509  to dimension. The point_on_angular_dimension_arc and point_on_line parameters
    510  are used to select the correct angle to dimension. If a point_on_line parameter
    511  is not set, the corresponding line's midpoint is used.
    512 
    513  If the lines are colinear, the point on the line closest to
    514  point_on_angular_dimension_arc is the center of the angular dimension arc.
    515 
    516  Parameters:
    517  dim_style - [in]
    518  Pass nullptr if a dim_style is not available.
    519  line1 - [in]
    520  point_on_line1 - [in]
    521  If point_on_line1 is specified, it inidicates which semi-infinite portion of line1 to dimension.
    522  Otherwise the midpoint of lne1 as a segment is used.
    523  When in doubt, pass ON_3dPoint::UnsetPoint.
    524  line2 - [in]
    525  point_on_line2 - [in]
    526  If point_on_line2 is specified, it inidicates which semi-infinite portion of line2 to dimension.
    527  Otherwise the midpoint of line2 as a segment is used.
    528  When in doubt, pass ON_3dPoint::UnsetPoint.
    529  point_on_angular_dimension_arc - [in]
    530  A point on the interior of the angular dimension arc.
    531  bSetExtensionPoints - [in]
    532  If bSetExtensionPoints is true, and a point_on_line parameter is valid, that point
    533  is used as the extension point. Otherwise the angular dimension arc endpoint is used.
    534  Returns:
    535  True if successful.
    536  False if input is not valid. In this case ON_DimAngle::Empty settings are returned.
    537  */
    538  bool Create(
    539  const ON_DimStyle* dim_style,
    540  ON_Line line1,
    541  ON_3dPoint point_on_line1,
    542  ON_Line line2,
    543  ON_3dPoint point_on_line2,
    544  ON_3dPoint point_on_angular_dimension_arc,
    545  bool bSetExtensionPoints
    546  );
    547 
    548  bool Create(
    549  const ON_UUID style_id,
    550  const ON_Plane& plane,
    551  const ON_3dVector& ref_horizontal,
    552  const ON_3dPoint& center_pt,
    553  const ON_3dPoint& extension_pt1, // point on first extension vector
    554  const ON_3dPoint& extension_pt2, // point on second extension vector
    555  const ON_3dPoint& dimline_pt // point on dimension line
    556  );
    557 
    558  bool Create(
    559  const ON_UUID style_id,
    560  const ON_Plane& plane,
    561  const ON_3dVector& ref_horizontal,
    562  const ON_3dPoint& extension_pt1, // start of first extension line
    563  const ON_3dPoint& extension_pt2, // start of second extension line
    564  const ON_3dPoint& direction_pt1, // point on first extension vector
    565  const ON_3dPoint& direction_pt2, // point on second extension vector
    566  const ON_3dPoint& dimline_pt // point on dimension line
    567  );
    568 
    569  bool AdjustFromPoints(
    570  const ON_Plane& plane,
    571  const ON_3dPoint& center_pt,
    572  const ON_3dPoint& extension_pt1, // point on first extension vector
    573  const ON_3dPoint& extension_pt2, // point on second extension vector
    574  const ON_3dPoint& dimline_pt // point on dimension line
    575  );
    576 
    577  bool AdjustFromPoints(
    578  const ON_Plane& plane,
    579  const ON_3dPoint& extension_pt1, // start of first extension line
    580  const ON_3dPoint& extension_pt2, // start of second extension line
    581  const ON_3dPoint& direction_pt1, // point on first extension vector
    582  const ON_3dPoint& direction_pt2, // point on second extension vector
    583  const ON_3dPoint& dimline_pt // point on dimension line
    584  );
    585 
    586  static bool FindAngleVertex(
    587  ON_Line lines[2],
    588  ON_3dPoint pickpoints[2],
    589  const ON_Plane& plane,
    590  ON_3dPoint& centerpoint_out);
    591 
    592 
    593  bool UpdateDimensionText(const ON_DimStyle* dimstyle) const;
    594 
    595  bool GetAngleDisplayText(const ON_DimStyle* dimstyle, ON_wString& displaytext) const;
    596 
    597  // virtual
    598  double Measurement() const override; // angle in radians
    599  ON_2dPoint DefaultTextPoint() const override;
    600  bool GetAngles(double* start_ang, double* end_ang, double* mid_ang) const;
    601  double Radius() const;
    602 
    603  // CenterPoint is m_plane.origin
    604  // Measurement is angle between m_vec_1 & m_vec_2 in radians
    605  ON_2dPoint CenterPoint() const;
    606  ON_2dPoint DefPoint1() const; // Start of first extension
    607  ON_2dPoint DefPoint2() const; // Start of second extension
    608  ON_2dPoint DimlinePoint() const; // Point on dimension arc
    609  ON_2dPoint UserTextPoint() const; // Text point if user positioned
    610  ON_2dVector ExtDir1() const; // Direction of first extension
    611  ON_2dVector ExtDir2() const; // Direction of second extension
    612  void SetExtDir1(const ON_2dVector& dir1);
    613  void SetExtDir2(const ON_2dVector& dir2);
    614 
    615  void SetUserTextPoint(const ON_3dPoint& point);
    616 
    617  void Set2dCenterPoint(ON_2dPoint pt); // Apex of angle
    618  void Set2dDefPoint1(ON_2dPoint pt); // Point where first extension starts
    619  void Set2dDefPoint2(ON_2dPoint pt); // Point where second extension starts
    620  void Set2dDimlinePoint(ON_2dPoint pt); // Point on dimension arc
    621 
    622  //void Set2dDefPoint1(ON_2dPoint pt); // Point where first extension starts
    623  //void Set2dDefPoint2(ON_2dPoint pt); // Point where second extension starts
    624  //void Set2dDimlinePoint(ON_2dPoint pt); // Point on dimension arc
    625 
    626  //void Set3dCenterPoint(ON_3dPoint pt);
    627  //void Set3dDefPoint1(ON_3dPoint pt);
    628  //void Set3dDefPoint2(ON_3dPoint pt);
    629  //void Set3dDimlinePoint(ON_3dPoint pt);
    630 
    631  ON_2dPoint ArrowPoint1() const; // Calculated - start of arc
    632  ON_2dPoint ArrowPoint2() const; // Calculated - end of arc
    633 
    634  bool Get3dPoints(
    635  ON_3dPoint* center,
    636  ON_3dPoint* defpt1,
    637  ON_3dPoint* defpt2,
    638  ON_3dPoint* arrowpt1,
    639  ON_3dPoint* arrowpt2,
    640  ON_3dPoint* dimline,
    641  ON_3dPoint* textpt) const;
    642 
    643  bool GetDisplayLines(
    644  const ON_Viewport* vp,
    645  const ON_DimStyle* style,
    646  double dimscale,
    647  const ON_3dPoint text_rect[4],
    648  ON_Line lines[2],
    649  bool isline[2],
    650  ON_Arc arcs[2],
    651  bool isarc[2],
    652  int maxlines,
    653  int maxarcs) const;
    654 
    655  void GetArrowXform(
    656  int which_end,
    657  double arrowlength,
    658  bool arrowflipped,
    659  bool from_the_back,
    660  ON_Xform& arrow_xform_out) const;
    661 
    662  bool UpdateDimensionText(
    663  ON::LengthUnitSystem units_in,
    664  const ON_DimStyle* dimstyle) const override;
    665 
    666  bool GetDistanceDisplayText(
    667  ON::LengthUnitSystem units_in,
    668  const ON_DimStyle* dimstyle,
    669  ON_wString& displaytext) const override;
    670 
    671 protected:
    672  // Center point is at plane origin (0,0)
    675  double m_ext_offset_1 = 0.0; // distance along m_vec_1 to start extension line 1
    676  double m_ext_offset_2 = 0.0; // distance along m_vec_2 to start extension line 2
    677  ON_2dPoint m_dimline_pt = ON_2dPoint(1.0, 1.0); // point on interior of dimension arc
    678 };
    679 
    680 //---------------------------------------------------------------------
    681 
    682 class ON_CLASS ON_DimRadial : public ON_Dimension
    683 {
    684  ON_OBJECT_DECLARE(ON_DimRadial);
    685 
    686 public:
    687  ON_DimRadial();
    688  ~ON_DimRadial() = default;
    689  ON_DimRadial(const ON_DimRadial& src) = default;
    690  ON_DimRadial& operator=(const ON_DimRadial& src) = default;
    691 
    692  static const ON_DimRadial Empty;
    693 
    694 
    695  /*
    696  Description:
    697  Create a V6 radial dimension from a V5 radial dimension
    698  The function is used when reading V5 files.
    699  Parameters:
    700  V5_radial_dimension -[in]
    701  annotation_context - [in]
    702  Dimstyle and other information referenced by V5_radial_dimension or nullptr if not available.
    703  destination - [in]
    704  If destination is not nullptr, then the V6 radial dimension is constructed
    705  in destination. If destination is nullptr, then the new V6 radial dimension
    706  is allocated with a call to new ON_DimRadial().
    707  */
    708  static ON_DimRadial* CreateFromV5DimRadial(
    709  const class ON_OBSOLETE_V5_DimRadial& V5_radial_dimension,
    710  const class ON_3dmAnnotationContext* annotation_context,
    711  ON_DimRadial* destination
    712  );
    713 
    714  /*
    715  Parameters:
    716  annotation_type - [in]
    717  annotation type to test
    718  Returns:
    719  True if input parameter is one of the valid radial dimension types
    720  ON::AnnotationType::Radius or ON::AnnotationType::Diameter.
    721  */
    722  static bool IsValidRadialDimensionType(
    723  ON::AnnotationType annotation_type
    724  );
    725 
    726  /*
    727  Parameters:
    728  radial_dimension_type - [in]
    729  ON::AnnotationType::Radius or ON::AnnotationType::Diameter.
    730  Returns:
    731  True if input parameter is valid and type is set.
    732  */
    733  bool SetRadialDimensionType(
    734  ON::AnnotationType radial_dimension_type
    735  );
    736 
    737  bool Write(
    738  ON_BinaryArchive& // serialize definition to binary archive
    739  ) const override;
    740 
    741  bool Read(
    742  ON_BinaryArchive& // restore definition from binary archive
    743  ) override;
    744 
    745  bool Transform(const ON_Xform& xform) override;
    746 
    747  // virtual ON_Geometry GetBBox override
    748  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    749 
    750  bool GetAnnotationBoundingBox(
    751  const ON_Viewport* vp,
    752  const ON_DimStyle* dimstyle,
    753  double dimscale,
    754  double* boxmin,
    755  double* boxmax,
    756  bool bGrow = false
    757  ) const override; // ON_Annotation override
    758 
    759  // Gets transform for dimension text from ON_xy_plane to 3d display location
    760  bool GetTextXform(
    761  const ON_Viewport* vp,
    762  const ON_DimStyle* dimstyle,
    763  double dimscale,
    764  ON_Xform& text_xform_out
    765  ) const override;
    766 
    767  bool Create(
    768  ON::AnnotationType type,
    769  const ON_UUID style_id,
    770  const ON_Plane& plane,
    771  const ON_3dPoint& center_pt,
    772  const ON_3dPoint& radius_pt,
    773  const ON_3dPoint& dimline_pt
    774  );
    775 
    776  bool AdjustFromPoints(
    777  const ON_Plane& plane,
    778  const ON_3dPoint& center_pt,
    779  const ON_3dPoint& radius_pt,
    780  const ON_3dPoint& dimline_pt
    781  );
    782 
    783  double Measurement() const override;
    784 
    785  ON_2dPoint DefaultTextPoint() const override;
    786  ON_2dPoint CenterPoint() const;
    787  ON_2dPoint RadiusPoint() const; // Point on arc being measured
    788  ON_2dPoint DimlinePoint() const; // Endpoint of leader tail, not including landing
    789  ON_2dPoint KneePoint() const; // Point where leader tail bends
    790 
    791  void Set2dCenterPoint(ON_2dPoint pt);
    792  void Set2dRadiusPoint(ON_2dPoint pt);
    793  void Set2dDimlinePoint(ON_2dPoint pt);
    794 
    795  void Set3dCenterPoint(ON_3dPoint pt);
    796  void Set3dRadiusPoint(ON_3dPoint pt);
    797  void Set3dDimlinePoint(ON_3dPoint pt);
    798 
    799  bool Get3dPoints(
    800  ON_3dPoint* center_pt,
    801  ON_3dPoint* radius_pt,
    802  ON_3dPoint* dimline_pt,
    803  ON_3dPoint* knee_pt) const;
    804 
    805  bool GetDisplayLines(
    806  const ON_DimStyle* style,
    807  double dimscale,
    808  ON_3dPoint text_rect[4],
    809  ON_Line lines[9],
    810  bool isline[9],
    811  int maxlines) const;
    812 
    813  void GetArrowXform(
    814  double scale,
    815  ON_Xform& arrow_xform_out) const;
    816 
    817 protected:
    820 };
    821 
    822 
    823 //---------------------------------------------------------------------
    824 // + dimpt
    825 // |
    826 // |
    827 // |
    828 // + kinkpt2
    829 // \
    830 // \ kinkoffset2
    831 // \
    832 // + kinkpt1
    833 // |
    834 // | kinkoffset1
    835 // |
    836 // + ldrpt
    837 // 1
    838 // 2
    839 // 3
    840 
    841 class ON_CLASS ON_DimOrdinate : public ON_Dimension
    842 {
    843  ON_OBJECT_DECLARE(ON_DimOrdinate);
    844 
    845 public:
    846  ON_DimOrdinate();
    847  ~ON_DimOrdinate() = default;
    848  ON_DimOrdinate(const ON_DimOrdinate& src) = default;
    849  ON_DimOrdinate& operator=(const ON_DimOrdinate& src) = default;
    850 
    851  static const ON_DimOrdinate Empty;
    852 
    853 #pragma region RH_C_SHARED_ENUM [ON_DimOrdinate::MeasuredDirection] [Rhino.Geometry.OrdinateDimension.MeasuredDirection] [nested:byte]
    854  /// <summary>
    855  /// Ordinate dimension measures x or y direction
    856  /// </summary>
    857  enum class MeasuredDirection : unsigned char
    858  {
    859  /// <summary> </summary>
    860  Unset = 0,
    861  /// <summary> Measures horizontal distance </summary>
    862  Xaxis = 1,
    863  /// <summary> Measures vertical distance </summary>
    864  Yaxis = 2,
    865  };
    866 #pragma endregion
    867 
    868  static ON_DimOrdinate::MeasuredDirection MeasuredDirectionFromUnsigned(
    869  unsigned int measured_direction_as_unsigned
    870  );
    871 
    872  static ON_DimOrdinate* CreateFromV5DimOrdinate(
    873  const class ON_OBSOLETE_V5_DimOrdinate& V5_dim_ordinate,
    874  const class ON_3dmAnnotationContext* annotation_context,
    875  ON_DimOrdinate* destination
    876  );
    877 
    878  bool Write(
    879  ON_BinaryArchive& archive
    880  ) const override;
    881 
    882  bool Read(
    883  ON_BinaryArchive& archive
    884  ) override;
    885 
    886  bool Transform(const ON_Xform& xform) override;
    887 
    888  // virtual ON_Geometry GetBBox override
    889  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    890 
    891  bool GetAnnotationBoundingBox(
    892  const ON_Viewport* vp,
    893  const ON_DimStyle* dimstyle,
    894  double dimscale,
    895  double* boxmin,
    896  double* boxmax,
    897  bool bGrow = false
    898  ) const override; // ON_Annotation override
    899 
    900  // Gets transform for dimension text from ON_xy_plane to 3d display location
    901  bool GetTextXform(
    902  const ON_Viewport* vp,
    903  const ON_DimStyle* dimstyle,
    904  double dimscale,
    905  ON_Xform& text_xform_out
    906  ) const override;
    907 
    908  bool Create(
    909  const ON_UUID style_id,
    910  const ON_Plane& plane,
    911  MeasuredDirection direction,
    912  const ON_3dPoint& basept,
    913  const ON_3dPoint& defpt,
    914  const ON_3dPoint& ldrpt,
    915  double kinkoffset1,
    916  double kinkoffset2
    917  );
    918 
    919  bool AdjustFromPoints(
    920  const ON_Plane& plane,
    921  MeasuredDirection direction,
    922  const ON_3dPoint& basept,
    923  const ON_3dPoint& defpt,
    924  const ON_3dPoint& ldrpt,
    925  double kinkoffset1,
    926  double kinkoffset2
    927  );
    928 
    929  ON_2dPoint DefPt() const;
    930  ON_2dPoint LeaderPt() const;
    931  ON_2dPoint KinkPt1() const;
    932  ON_2dPoint KinkPt2() const;
    933  double KinkOffset1() const;
    934  double KinkOffset2() const;
    935 
    936  void Set2dDefPt(ON_2dPoint pt);
    937  void Set2dLeaderPt(ON_2dPoint pt);
    938  void SetKinkOffset1(double d);
    939  void SetKinkOffset2(double d);
    940 
    941  void Set3dBasePoint(ON_3dPoint pt);
    942  void Set3dDefPt(ON_3dPoint pt);
    943  void Set3dLeaderPt(ON_3dPoint pt);
    944 
    945  ON_3dPoint Get3dBasePoint() const;
    946  ON_3dPoint Get3dDefPt() const;
    947  ON_3dPoint Get3dLeaderPt() const;
    948  ON_3dPoint Get3dKinkPt1(double default_kink_offset = 1.0) const;
    949  ON_3dPoint Get3dKinkPt2(double default_kink_offset = 1.0) const;
    950 
    951  bool Get3dPoints(
    952  ON_3dPoint* base_pt,
    953  ON_3dPoint* def_pt,
    954  ON_3dPoint* ldr_pt,
    955  ON_3dPoint* kink_pt1,
    956  ON_3dPoint* kink_pt2,
    957  double default_kink_offset = 1.0) const;
    958 
    959  bool GetDisplayLines(
    960  const ON_DimStyle* style,
    961  double dimscale,
    962  ON_3dPoint text_rect[4],
    963  ON_Line lines[3],
    964  bool isline[3],
    965  int maxlines) const;
    966 
    967  bool CalcKinkPoints(
    968  ON_2dPoint defpt,
    969  ON_2dPoint ldrpt,
    970  MeasuredDirection direction,
    971  double default_kink_offset,
    972  ON_2dPoint& kinkpt1_out,
    973  ON_2dPoint& kinkpt2_out) const;
    974 
    975  MeasuredDirection ImpliedDirection(
    976  ON_2dPoint defpt,
    977  ON_2dPoint ldrpt
    978  ) const;
    979 
    980  MeasuredDirection GetMeasuredDirection() const;
    981  void SetMeasuredDirection(MeasuredDirection direction);
    982 
    983  double Measurement() const override;
    984 
    985 protected:
    986  // Plane origin is base for measurements
    987  // Measurements are from plane origin to dimension point
    988  // in either x or y axis direction
    989  MeasuredDirection m_direction = MeasuredDirection::Unset;
    990 
    993 
    994  double m_kink_offset_1 = ON_UNSET_VALUE; // measures from defpt1 toward defpt2 to kink1
    995  double m_kink_offset_2 = ON_UNSET_VALUE; // measures from kink1 toward defpt2 to kink2
    996 };
    997 
    998 
    999 //---------------------------------------------------------------------
    1000 
    1001 class ON_CLASS ON_Centermark : public ON_Dimension
    1002 {
    1003  ON_OBJECT_DECLARE(ON_Centermark);
    1004 
    1005 public:
    1006  ON_Centermark();
    1007  ~ON_Centermark() = default;
    1008  ON_Centermark(const ON_Centermark& src) = default;
    1009  ON_Centermark& operator=(const ON_Centermark& src) = default;
    1010 
    1011  static const ON_Centermark Empty;
    1012 
    1013  bool Write(
    1014  ON_BinaryArchive& // serialize definition to binary archive
    1015  ) const override;
    1016 
    1017  bool Read(
    1018  ON_BinaryArchive& // restore definition from binary archive
    1019  ) override;
    1020 
    1021  bool Transform(const ON_Xform& xform) override;
    1022 
    1023  bool GetTextXform(
    1024  const ON_Viewport*,
    1025  const ON_DimStyle*,
    1026  double,
    1027  ON_Xform&
    1028  ) const override;
    1029 
    1030  // virtual ON_Geometry GetBBox override
    1031  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1032 
    1033  bool GetAnnotationBoundingBox(
    1034  const ON_Viewport* vp,
    1035  const ON_DimStyle* dimstyle,
    1036  double dimscale,
    1037  double* boxmin,
    1038  double* boxmax,
    1039  bool bGrow = false
    1040  ) const override; // ON_Annotation override
    1041 
    1042  bool Create(
    1043  const ON_UUID style_id,
    1044  const ON_Plane& plane,
    1045  const ON_3dPoint& center_pt,
    1046  const double radius
    1047  );
    1048 
    1049  bool AdjustFromPoints(
    1050  const ON_Plane& plane,
    1051  const ON_3dPoint& center_pt
    1052  );
    1053 
    1054  double Measurement() const override;
    1055 
    1056  ON_2dPoint CenterPoint() const;
    1057  void Set2dCenterPoint(ON_2dPoint pt);
    1058  void Set3dCenterPoint(ON_3dPoint pt);
    1059 
    1060  bool GetDisplayLines(
    1061  const ON_DimStyle* style,
    1062  double dimscale,
    1063  ON_Line lines[6],
    1064  bool isline[6],
    1065  int maxlines) const;
    1066 
    1067  double Radius() const; // radius of marked circle
    1068  void SetRadius(double radius);
    1069 
    1070 private:
    1071  double m_radius = 0.0;
    1072 };
    1073 
    1074 
    1075 
    1076 
    1077 #endif
    1078 
    Definition: opennurbs_annotationbase.h:23
    static const ON_DimOrdinate Empty
    Definition: opennurbs_dimension.h:851
    ON_UUID is a 16 byte universally unique identifier.
    Definition: opennurbs_uuid.h:32
    Definition: opennurbs_dimension.h:411
    @@ -109,9 +107,9 @@ $(function() {
    diff --git a/6/d9/ddd/opennurbs__instance_8h_source.html b/6/d9/ddd/opennurbs__instance_8h_source.html index 38f347db..483fa07b 100644 --- a/6/d9/ddd/opennurbs__instance_8h_source.html +++ b/6/d9/ddd/opennurbs__instance_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_instance.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_instance.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    opennurbs_instance.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_INSTANCE_INC_)
    18 #define OPENNURBS_INSTANCE_INC_
    19 
    21 {
    22 public:
    27 
    28  bool Read(
    29  ON_BinaryArchive& archive
    30  );
    31 
    32  bool Write(
    33  ON_BinaryArchive& archive
    34  ) const;
    35 
    36  bool IsEmpty() const;
    37  bool IsNotEmpty() const;
    38 
    39  bool HasLayerInformation() const;
    40  bool HasLayerTableInformation() const;
    41  bool HasParentLayerInformation() const;
    42 
    43  /*
    44  Description:
    45  Update runtime layer color visibility, locked, ... settings in the
    46  layer table read from a refence file to the values to use in the
    47  runtime model.
    48  This is typically done right after the reference file layer table is
    49  read and before the layers are added to the runtime model.
    50  Parameters:
    51  source_archive_manifest - [in]
    52  manifest of archive being read (may partially read)
    53  model_manifest - [in]
    54  manifest of runtime model (may partially created)
    55  layer_count - [in]
    56  length of layers[] array;
    57  layers - [in/out]
    58  The input values should be the layer table read from the referenced file.
    59  The output values have color, visibility, locked, ... settings updated
    60  to the state they had the last time the model file (not the referenced file)
    61  was saved.
    62  linked_definition_parent_layer - [in/out]
    63  If linked_definition_parent_layer is not nullptr, its color, visibility, ...
    64  settings are updated to the state they had the last time the model file
    65  (not the referenced file) was saved.
    66  Remarks:
    67  The layer idenitification information (name, index, id) are not changed by
    68  this function.
    69  */
    70  void AfterReferenceLayerTableRead(
    71  const class ON_ComponentManifest& source_archive_manifest,
    72  const class ON_ComponentManifest& model_manifest,
    73  const class ON_ManifestMap& archive_to_model_map,
    74  ON_Layer* linked_definition_parent_layer,
    75  unsigned int layer_count,
    76  ON_Layer** layers
    77  );
    78 
    79  /*
    80  Description:
    81  Update the mapping from from reference file layer id to runtime model layer id.
    82  Typically this is done immediately after the reference file layers are added
    83  to the runtime model.
    84  Parameters:
    85  source_archive_manifest - [in]
    86  manifest of archive being read (may partially read)
    87  model_manifest - [in]
    88  manifest of runtime model (may partially created)
    89  archive_to_model_map - [in]
    90  Manifest map from reference file settings to runtime model settings.
    91  This map typically exists while the archive is being read and is
    92  destroyed after reading is complete. That's why the mapping has
    93  to be saved.
    94  */
    95  void AfterLayerTableAddedToModel(
    96  const class ON_ComponentManifest& source_archive_manifest,
    97  const class ON_ComponentManifest& model_manifest,
    98  const class ON_ManifestMap& archive_to_model_map
    99  );
    100 
    101  /*
    102  Description:
    103  Save the current runtime layer color, visibility, ... states.
    104  Typically this is done immediately before a linked instance definition
    105  or worksession reference information is written. Calling the Write()
    106  function destroys the information created by BeforeWrite() because
    107  it is generally out-of-date if modeling resumes after writing.
    108  Parameters:
    109  model_manifest - [in]
    110  manifest of runtime model
    111  destination_archive_manifest - [in]
    112  manifest of archive being written (may partially written)
    113  model_to_archive_map - [in]
    114  Manifest map from model to destination_archive_manifest.
    115  linked_definition_parent_layer - [in]
    116  nullptr or the parent layer
    117  context - [in]
    118  first parameter passed to ModelLayerFromIdFunc
    119  ModelLayerFromIdFunc - [in]
    120  Function to get model layers from id
    121  */
    122  void BeforeLinkedDefinitionWrite(
    123  const class ON_ComponentManifest& model_manifest,
    124  const class ON_ComponentManifest& destination_archive_manifest,
    125  const class ON_ManifestMap& model_to_archive_map,
    126  const ON_Layer* linked_definition_parent_layer,
    127  void* context,
    128  const ON_Layer*(*ModelLayerFromIdFunc)(void* context, const ON_UUID&)
    129  );
    130 
    131 private:
    132  class ON_ReferencedComponentSettingsImpl* Impl(
    133  bool bCreateIfNull
    134  );
    135 
    136  class ON_ReferencedComponentSettingsImpl* m_impl = nullptr;
    137 };
    138 
    139 /*
    140 Description:
    141  An ON_InstanceDefinition defines the geometry used by
    142  instance references.
    143 See Also:
    144  ON_InstanceRef
    145 */
    147 {
    148  ON_OBJECT_DECLARE(ON_InstanceDefinition);
    149 
    150 public:
    151 
    152  // IDEF_UPDATE_TYPE lists the possible relationships between
    153  // the instance definition geometry and the archive
    154  // (m_source_archive) containing the original defition.
    155  enum class IDEF_UPDATE_TYPE : unsigned int
    156  {
    157  Unset = 0,
    158  Static = 1,
    159  LinkedAndEmbedded = 2,
    160  Linked = 3
    161 
    162 
    163  //static_def = 0,
    164  //embedded_def = 1,
    165  // // As of 7 February, "static_def" and "embedded_def"
    166  // // and shall be treated the same. Using "static_def"
    167  // // is prefered and "embedded_def" is obsolete.
    168  // // The geometry for the instance definition
    169  // // is saved in archives, is fixed and has no
    170  // // connection to a source archive.
    171  // // All source archive information should be
    172  // // empty strings and m_source_archive_checksum
    173  // // shoule be "zero".
    174  //linked_and_embedded_def = 2,
    175  // // The geometry for the instance definition
    176  // // is saved in archives. Complete source
    177  // // archive and checksum information will be
    178  // // present. The document setting
    179  // // ON_3dmIOSettings.m_idef_link_update
    180  // // determines if, when and how the instance
    181  // // definition geometry is updated by reading the
    182  // // source archive.
    183  //linked_def = 3,
    184  // // The geometry for this instance definition
    185  // // is not saved in the archive that contains
    186  // // this instance definition. This instance
    187  // // definition geometry is imported from a
    188  // // "source archive" The "source archive" file
    189  // // name and checksum information are saved
    190  // // in m_source_archive and m_source_archive_checksum.
    191  // // If file named in m_source_archive is not available,
    192  // // then this instance definition is not valid and any
    193  // // references to it are not valid.
    194  };
    195 
    196  // Converts and integer into an IDEF_UPDATE_TYPE enum.
    197  static ON_InstanceDefinition::IDEF_UPDATE_TYPE InstanceDefinitionTypeFromUnsigned(
    198  unsigned int idef_type_as_unsigned
    199  );
    200 
    201  // Bits that identify subsets of the instance defintion
    202  // fields. These bits are used to determine which fields to
    203  // set when an ON_InstanceDefinition class is used to
    204  // modify an existing instance definition.
    205  enum
    206  {
    207  no_idef_settings = 0,
    208  idef_name_setting = 1, // m_name
    209  idef_description_setting = 2, // m_description
    210  idef_url_setting = 4, // all m_url_* fields
    211  idef_units_setting = 8, // m_us and m_unit_scale
    212  idef_source_archive_setting = 0x10, // all m_source_*, layer style, update depth fields
    213  idef_userdata_setting = 0x20,
    214  all_idef_settings = 0xFFFFFFFF
    215  };
    216 
    217 public:
    218  ON_InstanceDefinition() ON_NOEXCEPT;
    221  ON_InstanceDefinition& operator=(const ON_InstanceDefinition&);
    222 
    223 private:
    224  void Internal_Destroy();
    225  void Internal_Copy(const ON_InstanceDefinition& src);
    226 
    227 public:
    228 
    229  static const ON_InstanceDefinition Unset;
    230 
    231  /*
    232  Parameters:
    233  model_component_reference - [in]
    234  none_return_value - [in]
    235  value to return if ON_InstanceDefinition::Cast(model_component_ref.ModelComponent())
    236  is nullptr
    237  Returns:
    238  If ON_InstanceDefinition::Cast(model_component_ref.ModelComponent()) is not nullptr,
    239  that pointer is returned. Otherwise, none_return_value is returned.
    240  */
    241  static const ON_InstanceDefinition* FromModelComponentRef(
    242  const class ON_ModelComponentReference& model_component_reference,
    243  const ON_InstanceDefinition* none_return_value
    244  );
    245 
    246 
    247  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    248 
    249  // virtual ON_Object::Dump override
    250  void Dump(
    251  ON_TextLog& text_log
    252  ) const override;
    253 
    254 public:
    255  bool Write(
    256  ON_BinaryArchive& archive
    257  ) const override;
    258 
    259 private:
    260  bool Internal_WriteV5(
    261  ON_BinaryArchive& archive
    262  ) const;
    263  bool Internal_WriteV6(
    264  ON_BinaryArchive& archive
    265  ) const;
    266 
    267 public:
    268  bool Read(
    269  ON_BinaryArchive& archive
    270  ) override;
    271 
    272 private:
    273  bool Internal_ReadV5(
    274  ON_BinaryArchive& archive
    275  );
    276  bool Internal_ReadV6(
    277  ON_BinaryArchive& archive
    278  );
    279 
    280 public:
    281  ON::object_type ObjectType() const override;
    282 
    283  // virtual ON_Object:: override
    284  unsigned int SizeOf() const override;
    285 
    286  const ON_BoundingBox BoundingBox() const;
    287 
    288  void SetBoundingBox( ON_BoundingBox bbox );
    289 
    290  void ClearBoundingBox();
    291 
    292  const ON_wString Description() const;
    293  void SetDescription( const wchar_t* description );
    294 
    295  const ON_wString URL() const;
    296  void SetURL( const wchar_t* url );
    297 
    298  const ON_wString URL_Tag() const;
    299  void SetURL_Tag( const wchar_t* url_tag );
    300 
    301  /*
    302  Returns:
    303  A list of object ids in the instance geometry table sorted by id.
    304  */
    305  const ON_SimpleArray<ON_UUID>& InstanceGeometryIdList() const;
    306 
    307  /*
    308  Parameters:
    309  instance_geometry_id_list - [in]
    310  A list of object ids in the instance geometry table.
    311  */
    312  void SetInstanceGeometryIdList(
    313  const ON_SimpleArray<ON_UUID>& instance_geometry_id_list
    314  );
    315 
    316  /*
    317  Description:
    318  Remove all ids from the InstanceGeometryIdList().
    319  */
    320  void ClearInstanceGeometryIdList();
    321 
    322  /*
    323  Description:
    324  Remove id from the InstanceGeometryIdList().
    325  */
    326  bool RemoveInstanceGeometryId(
    327  ON_UUID id
    328  );
    329 
    330  /*
    331  Description:
    332  Remove InstanceGeometryIdList()[id_index] from the InstanceGeometryIdList() array.
    333  */
    334  bool RemoveInstanceGeometryId(
    335  int id_index
    336  );
    337 
    338  /*
    339  Description:
    340  Add id to the InstanceGeometryIdList().
    341  Parameters:
    342  id - [in]
    343  non-nil id to add.
    344  Returns:
    345  True if id is not nil and was added to the InstanceGeometryIdList().
    346  */
    347  bool AddInstanceGeometryId(
    348  ON_UUID id
    349  );
    350 
    351  /*
    352  Returns:
    353  True if id is in the InstanceGeometryIdList().
    354  */
    355  bool IsInstanceGeometryId(
    356  ON_UUID id
    357  ) const;
    358 
    359 private:
    360  int Internal_InstanceGeometryIdIndex(
    361  ON_UUID id
    362  ) const;
    363 
    364 public:
    365  /*
    366  Parameters:
    367  instance_definition_type - [in]
    368  ON_InstanceDefinition::IDEF_UPDATE_TYPE::Unset - change the type to Unset
    369  and remove all linked file information.
    370  ON_InstanceDefinition::IDEF_UPDATE_TYPE::Static - change the type to Static
    371  and remove all linked file information.
    372  ON_InstanceDefinition::IDEF_UPDATE_TYPE::LinkedAndEmbedded - change
    373  the type to from Linked to LinkedAndEmbedded. If the current type
    374  is not Linked, then no changes are made.
    375  ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked - change
    376  the type to from LinkedAndEmbedded to Linked. If the current type
    377  is not LinkedAndEmbedded, then no changes are made.
    378  */
    379  bool SetInstanceDefinitionType(
    380  const ON_InstanceDefinition::IDEF_UPDATE_TYPE instance_definition_type
    381  );
    382 
    383  /*
    384  Parameters:
    385  linked_definition_type - [in]
    386  Either ON_InstanceDefinition::IDEF_UPDATE_TYPE::LinkedAndEmbedded
    387  or ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked.
    388  linked_file_reference - [in]
    389  */
    390  bool SetLinkedFileReference(
    391  ON_InstanceDefinition::IDEF_UPDATE_TYPE linked_definition_type,
    392  ON_FileReference linked_file_reference
    393  );
    394 
    395  bool SetLinkedFileReference(
    396  ON_InstanceDefinition::IDEF_UPDATE_TYPE linked_definition_type,
    397  const wchar_t* linked_file_full_path
    398  );
    399 
    400  const ON_FileReference LinkedFileReference() const;
    401 
    402  /*
    403  Destroy all linked file path information and convert the type to Static.
    404  */
    405  void ClearLinkedFileReference();
    406 
    407  void ClearLinkedFileContentHash();
    408 
    409  void ClearLinkedFileRelativePath();
    410 
    411  const ON_wString& LinkedFilePath() const;
    412 
    413  const ON_UnitSystem& UnitSystem() const;
    414 
    415 public:
    416  /*
    417  Description:
    418  Sets m_us and m_unit_scale.
    419  */
    420  void SetUnitSystem( ON::LengthUnitSystem us );
    421  void SetUnitSystem( const ON_UnitSystem& us );
    422 
    423  /*
    424  Returns:
    425  True if this is a linked instance definition with
    426  layer settings information.
    427  */
    428  bool HasLinkedIdefReferenceComponentSettings() const;
    429 
    430  void ClearLinkedIdefReferenceComponentSettings();
    431 
    432  /*
    433  Parameters:
    434  bCreateIfNonePresent - [in]
    435  When bCreateIfNonePresent is true and the idef type is ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked,
    436  then ON_ReferencedComponentSettings will be created if none are present.
    437  Return:
    438  ON_ReferencedComponentSettings pointer or nullptr.
    439  */
    440  const ON_ReferencedComponentSettings* LinkedIdefReferenceComponentSettings() const;
    441 
    442  /*
    443  Parameters:
    444  bCreateIfNonePresent - [in]
    445  When bCreateIfNonePresent is true and the idef type is ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked,
    446  then ON_ReferencedComponentSettings will be created if none are present.
    447  Return:
    448  ON_ReferencedComponentSettings pointer or nullptr.
    449  */
    450  ON_ReferencedComponentSettings* LinkedIdefReferenceComponentSettings(
    451  bool bCreateIfNonePresent
    452  );
    453 
    454 public:
    455 
    456  // OBSOLETE - change IdefUpdateType() to InstanceDefinitionType()
    457  ON_InstanceDefinition::IDEF_UPDATE_TYPE IdefUpdateType() const;
    458 
    459  ON_InstanceDefinition::IDEF_UPDATE_TYPE InstanceDefinitionType() const;
    460 
    461  /*
    462  Returns:
    463  true if InstanceDefinitionType() = ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked or ON_InstanceDefinition::IDEF_UPDATE_TYPE::LinkedAndEmbedded.
    464  */
    465  bool IsLinkedType() const;
    466 
    467  /*
    468  Description:
    469  This property applies when an instance definiton is linked.
    470  Returns:
    471  true:
    472  When reading the file that defines the content of the linked instance definition,
    473  skip any linked instance definitions found in that file.
    474  false:
    475  When reading the file that defines the content of the linked instance definition,
    476  recursively load linked instance definitions found in that file.
    477  */
    478  bool SkipNestedLinkedDefinitions() const;
    479 
    480  void SetSkipNestedLinkedDefinitions(
    481  bool bSkipNestedLinkedDefinitions
    482  );
    483 
    484 private:
    485  // list of object ids in the instance geometry table.
    486  ON_SimpleArray<ON_UUID> m_object_uuid;
    487 
    488 private:
    489  ON_wString m_description;
    490  ON_wString m_url;
    491  ON_wString m_url_tag; // UI link text for m_url
    492 
    493 private:
    494  ON_BoundingBox m_bbox = ON_BoundingBox::EmptyBoundingBox;
    495 
    496 private:
    497  ON_UnitSystem m_us = ON_UnitSystem::None;
    498 
    499 private:
    500  // Note: the embedded_def type is obsolete.
    501  // To avoid having to deal with this obsolete type in
    502  // your code, using ON_InstanceDefintion::IdefUpdateType()
    503  // to get this value. The IdefUpdateType() function
    504  // with convert the obsolte value to the correct
    505  // value.
    507 
    508 private:
    509  bool m_bSkipNestedLinkedDefinitions = false;
    510 
    511 private:
    512  /////////////////////////////////////////////////////////////
    513  //
    514  // linked instance definition internals
    515  //
    516 private:
    517  ON_FileReference m_linked_file_reference;
    518 
    519  // For V5 3dm archive compatibility.
    520  // Set as needed by the Write() function for new idefs and saved if the idef is read from a V5 file.
    521 private:
    522  mutable ON_CheckSum m_linked_file_V5_checksum = ON_CheckSum::UnsetCheckSum;
    523 private:
    524  bool Internal_SetLinkedFileReference(
    525  ON_InstanceDefinition::IDEF_UPDATE_TYPE linked_definition_type,
    526  const ON_FileReference& linked_file_reference,
    527  ON_CheckSum V5_checksum
    528  );
    529 
    530  // See comment for Internal_ReferencedComponentSettings() function.
    531 private:
    532  mutable class ON_ReferencedComponentSettings* m_linked_idef_component_settings = nullptr;
    533 
    534 public:
    535 
    536  /// <summary>
    537  /// ON_InstanceDefinition::LinkedComponentStates specifies how model components
    538  /// (layers, materials, dimension styles, ...) from linked instance defintion files
    539  /// are appear in the active model.
    540  /// </summary>
    541  enum class eLinkedComponentAppearance : unsigned char
    542  {
    543  ///<summary>
    544  /// This is the only valid layer style when the instance definition type is
    545  /// ON_InstanceDefinition::IDEF_UPDATE_TYPE::Static or
    546  /// ON_InstanceDefinition::IDEF_UPDATE_TYPE::LinkedAndEmbedded.
    547  /// This style is not valid when the instance definition type
    548  /// ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked.
    549  ///</summary>
    550  Unset = 0,
    551 
    552  ///<summary>
    553  /// Model components (layers, materials, dimension styles, ...) from
    554  /// linked instance definition files are embedded as ordinary components
    555  /// in the active model.
    556  /// This layer style may be used when the instance definition type is
    557  /// ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked.
    558  ///</summary>
    559  Active = 1,
    560 
    561  ///<summary>
    562  /// Layers from the linked instance definition are reference components in the model.
    563  /// This is the default layer style when the instance definition type is
    564  /// ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked.
    565  /// This layer style may be used when the instance definition type is
    566  /// ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked.
    567  ///</summary>
    568  Reference = 2
    569  };
    570 
    571  static ON_InstanceDefinition::eLinkedComponentAppearance LinkedComponentAppearanceFromUnsigned(
    572  unsigned int linked_component_appearance_as_unsigned
    573  );
    574 
    575  ON_InstanceDefinition::eLinkedComponentAppearance LinkedComponentAppearance() const;
    576 
    577  bool SetLinkedComponentAppearance(
    578  ON_InstanceDefinition::eLinkedComponentAppearance linked_component_appearance
    579  );
    580 
    581 private:
    583 
    584 public:
    585 
    586  /*
    587  Returns:
    588  A SHA-1 hash of these instance defintions properties:
    589 
    590  InstanceGeometryIdList()
    591  BoundingBox()
    592  UnitSystem()
    593  InstanceDefinitionType()
    594  LinkedFileReference()
    595  LinkedComponentAppearance()
    596  */
    597  const ON_SHA1_Hash GeometryContentHash() const;
    598 
    599  /*
    600  Returns:
    601  A SHA-1 hash of these instance defintions properties
    602  Description()
    603  URL()
    604  URL_Tag()
    605  and all the properties that contribute to the GeometryContentHash().
    606  */
    607  const ON_SHA1_Hash ContentHash() const;
    608 
    609 private:
    610  void Internal_AccumulateHash() const;
    611 
    612 private:
    613  // Internal_AccumulateHash() uses lazy evaluation to set m_geometry_content_hash when needed.
    614  mutable ON_SHA1_Hash m_geometry_content_hash = ON_SHA1_Hash::ZeroDigest;
    615 
    616  // Internal_AccumulateHash() uses lazy evaluation to set m_content_hash when needed.
    617  mutable ON_SHA1_Hash m_content_hash = ON_SHA1_Hash::ZeroDigest;
    618 
    619 private:
    620  // Increments content version number and sets hashes to ON_SHA1_Hash::ZeroDigest.
    621  void Internal_ContentChanged();
    622 
    623 private:
    624  unsigned char m_reserved2A = 0;
    625  unsigned char m_reserved2B = 0;
    626  unsigned char m_reserved2C = 0;
    627 
    628 private:
    629  unsigned int m_reserved1 = 0;
    630 
    631 private:
    632  ON__UINT_PTR m_reserved_ptr = 0;
    633 };
    634 
    635 #if defined(ON_DLL_TEMPLATE)
    636 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_InstanceDefinition*>;
    637 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_InstanceDefinition>;
    638 #endif
    639 
    640 /*
    641 Description:
    642  An ON_InstanceRef is a reference to an instance definition
    643  along with transformation to apply to the definition.
    644 See Also:
    645  ON_InstanceRef
    646 */
    647 class ON_CLASS ON_InstanceRef : public ON_Geometry
    648 {
    649  ON_OBJECT_DECLARE(ON_InstanceRef);
    650 
    651 public:
    652  ON_InstanceRef() = default;
    653  ~ON_InstanceRef() = default;
    654  ON_InstanceRef(const ON_InstanceRef&) = default;
    655  ON_InstanceRef& operator=(const ON_InstanceRef&) = default;
    656 
    657 public:
    658  /////////////////////////////////////////////////////////////
    659  //
    660  // virtual ON_Object overrides
    661  //
    662  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    663  bool Write(
    664  ON_BinaryArchive& binary_archive
    665  ) const override;
    666  bool Read(
    667  ON_BinaryArchive& binary_archive
    668  ) override;
    669  ON::object_type ObjectType() const override;
    670 
    671  /////////////////////////////////////////////////////////////
    672  //
    673  // virtual ON_Geometry overrides
    674  //
    675  int Dimension() const override;
    676 
    677  // virtual ON_Geometry GetBBox override
    678  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    679 
    680  bool Transform(
    681  const ON_Xform& xform
    682  ) override;
    683 
    684  // virtual ON_Geometry::IsDeformable() override
    685  bool IsDeformable() const override;
    686 
    687  // virtual ON_Geometry::MakeDeformable() override
    688  bool MakeDeformable() override;
    689 
    690  /////////////////////////////////////////////////////////////
    691  //
    692 
    693  // Unique id of the instance definition (ON_InstanceDefinition)
    694  // in the instance definition table that defines the geometry
    695  // used by this reference.
    696  ON_UUID m_instance_definition_uuid = ON_nil_uuid;
    697 
    698  // Transformation for this reference.
    700 
    701  // Bounding box for this reference.
    703 
    704 #if 0
    705 public:
    706  /*
    707  Remove all reference to the nested linked idef information.
    708  */
    709  void ClearReferenceToNestedLinkedIdef();
    710 
    711  /*
    712  Returns:
    713  true
    714  if input was valid and the reference to the nested linked idef was set.
    715  false
    716  if reference to the nested linked idef was not set.
    717  */
    718  bool SetReferenceToNestedLinkedIdef(
    719  const ON_UUID& parent_idef_uuid,
    720  const ON_FileReference& parent_reference_file,
    721  const ON_FileReference& nested_reference_file
    722  );
    723 
    724  /*
    725  Parameters:
    726  parent_idef_uuid - [in]
    727  The peristent id of the parent idef that contains the (possibly deeply nested)
    728  instance definion this reference refers to.
    729  parent_reference_file - [in]
    730  the file for the parent idef.
    731  nested_reference_file - [in]
    732  if the referenced idef is itself linked, nested_reference_file identifies
    733  the file.
    734 
    735  Returns:
    736  True if this is a reference to a nested linked idef.
    737  */
    738  bool GetReferenceToNestedLinkedIdef(
    739  ON_UUID& parent_idef_uuid,
    740  ON_FileReference& parent_reference_file,
    741  ON_FileReference& nested_reference_file
    742  ) const;
    743 
    744  /*
    745  Returns:
    746  True if this is a reference to a nested linked idef.
    747  */
    748  bool ContainsReferenceToNestedLinkedIdef() const;
    749 
    750 private:
    751  /////////////////////////////////////////////////////////////
    752  //
    753  // Additional information used when this reference is to
    754  // an instance definition that is nested inside an ordinary
    755  // linked instance definition.
    756  //
    757  // For example, if
    758  // idefA = linked instance defintion referencing file A.
    759  // idefX = any type of instance definition found in idefA.
    760  //
    761  // iref = model geometry reference to idefX.
    762  //
    763  // When A is not a 3dm file or the 3dm id of idefX is
    764  // in use in the current model, the id of idefX will change
    765  // every time A is read. This means saving the value of
    766  // iref.m_instance_definition_uuid is not sufficient to identify
    767  // idefX. In this case, the additional information
    768  //
    769  // iref.m_bReferenceToNestedLinkedIdef = true
    770  // iref.m_parent_idef_uuid = idefA.Id()
    771  // iref.m_parent_reference_file = idefA.FileReference().
    772  // iref.m_nested_reference_file = idefX.FileReference().
    773  //
    774  // is used to identify idefX in a peristent way.
    775  //
    776  bool m_bReferenceToNestedLinkedIdef = false;
    777  ON_UUID m_parent_idef_uuid = ON_nil_uuid; // persistent id
    778  ON_FileReference m_parent_reference_file = ON_FileReference::Unset;
    779  ON_FileReference m_nested_reference_file = ON_FileReference::Unset;
    780 #endif
    781 
    782 public:
    783  // Tolerance to use for flagging instance xforms
    784  // as singular.
    785  // A valid ON_InstanceRef.m_xform satisfies:
    786  // true == (m_xform.Inverse()*m_xform).IsIdentity(ON_InstanceRef::SingularTransformationTolerance)
    787  static const double SingularTransformationTolerance;
    788 };
    789 
    790 #endif
    ON_UUID is a 16 byte universally unique identifier.
    Definition: opennurbs_uuid.h:32
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_INSTANCE_INC_)
    18 #define OPENNURBS_INSTANCE_INC_
    19 
    21 {
    22 public:
    27 
    28  bool Read(
    29  ON_BinaryArchive& archive
    30  );
    31 
    32  bool Write(
    33  ON_BinaryArchive& archive
    34  ) const;
    35 
    36  bool IsEmpty() const;
    37  bool IsNotEmpty() const;
    38 
    39  bool HasLayerInformation() const;
    40  bool HasLayerTableInformation() const;
    41  bool HasParentLayerInformation() const;
    42 
    43  /*
    44  Description:
    45  Update runtime layer color visibility, locked, ... settings in the
    46  layer table read from a refence file to the values to use in the
    47  runtime model.
    48  This is typically done right after the reference file layer table is
    49  read and before the layers are added to the runtime model.
    50  Parameters:
    51  source_archive_manifest - [in]
    52  manifest of archive being read (may partially read)
    53  model_manifest - [in]
    54  manifest of runtime model (may partially created)
    55  layer_count - [in]
    56  length of layers[] array;
    57  layers - [in/out]
    58  The input values should be the layer table read from the referenced file.
    59  The output values have color, visibility, locked, ... settings updated
    60  to the state they had the last time the model file (not the referenced file)
    61  was saved.
    62  linked_definition_parent_layer - [in/out]
    63  If linked_definition_parent_layer is not nullptr, its color, visibility, ...
    64  settings are updated to the state they had the last time the model file
    65  (not the referenced file) was saved.
    66  Remarks:
    67  The layer idenitification information (name, index, id) are not changed by
    68  this function.
    69  */
    70  void AfterReferenceLayerTableRead(
    71  const class ON_ComponentManifest& source_archive_manifest,
    72  const class ON_ComponentManifest& model_manifest,
    73  const class ON_ManifestMap& archive_to_model_map,
    74  ON_Layer* linked_definition_parent_layer,
    75  unsigned int layer_count,
    76  ON_Layer** layers
    77  );
    78 
    79  /*
    80  Description:
    81  Update the mapping from from reference file layer id to runtime model layer id.
    82  Typically this is done immediately after the reference file layers are added
    83  to the runtime model.
    84  Parameters:
    85  source_archive_manifest - [in]
    86  manifest of archive being read (may partially read)
    87  model_manifest - [in]
    88  manifest of runtime model (may partially created)
    89  archive_to_model_map - [in]
    90  Manifest map from reference file settings to runtime model settings.
    91  This map typically exists while the archive is being read and is
    92  destroyed after reading is complete. That's why the mapping has
    93  to be saved.
    94  */
    95  void AfterLayerTableAddedToModel(
    96  const class ON_ComponentManifest& source_archive_manifest,
    97  const class ON_ComponentManifest& model_manifest,
    98  const class ON_ManifestMap& archive_to_model_map
    99  );
    100 
    101  /*
    102  Description:
    103  Save the current runtime layer color, visibility, ... states.
    104  Typically this is done immediately before a linked instance definition
    105  or worksession reference information is written. Calling the Write()
    106  function destroys the information created by BeforeWrite() because
    107  it is generally out-of-date if modeling resumes after writing.
    108  Parameters:
    109  model_manifest - [in]
    110  manifest of runtime model
    111  destination_archive_manifest - [in]
    112  manifest of archive being written (may partially written)
    113  model_to_archive_map - [in]
    114  Manifest map from model to destination_archive_manifest.
    115  linked_definition_parent_layer - [in]
    116  nullptr or the parent layer
    117  context - [in]
    118  first parameter passed to ModelLayerFromIdFunc
    119  ModelLayerFromIdFunc - [in]
    120  Function to get model layers from id
    121  */
    122  void BeforeLinkedDefinitionWrite(
    123  const class ON_ComponentManifest& model_manifest,
    124  const class ON_ComponentManifest& destination_archive_manifest,
    125  const class ON_ManifestMap& model_to_archive_map,
    126  const ON_Layer* linked_definition_parent_layer,
    127  void* context,
    128  const ON_Layer*(*ModelLayerFromIdFunc)(void* context, const ON_UUID&)
    129  );
    130 
    131 private:
    132  class ON_ReferencedComponentSettingsImpl* Impl(
    133  bool bCreateIfNull
    134  );
    135 
    136  class ON_ReferencedComponentSettingsImpl* m_impl = nullptr;
    137 };
    138 
    139 /*
    140 Description:
    141  An ON_InstanceDefinition defines the geometry used by
    142  instance references.
    143 See Also:
    144  ON_InstanceRef
    145 */
    147 {
    148  ON_OBJECT_DECLARE(ON_InstanceDefinition);
    149 
    150 public:
    151 
    152  // IDEF_UPDATE_TYPE lists the possible relationships between
    153  // the instance definition geometry and the archive
    154  // (m_source_archive) containing the original defition.
    155  enum class IDEF_UPDATE_TYPE : unsigned int
    156  {
    157  Unset = 0,
    158  Static = 1,
    159  LinkedAndEmbedded = 2,
    160  Linked = 3
    161 
    162 
    163  //static_def = 0,
    164  //embedded_def = 1,
    165  // // As of 7 February, "static_def" and "embedded_def"
    166  // // and shall be treated the same. Using "static_def"
    167  // // is prefered and "embedded_def" is obsolete.
    168  // // The geometry for the instance definition
    169  // // is saved in archives, is fixed and has no
    170  // // connection to a source archive.
    171  // // All source archive information should be
    172  // // empty strings and m_source_archive_checksum
    173  // // shoule be "zero".
    174  //linked_and_embedded_def = 2,
    175  // // The geometry for the instance definition
    176  // // is saved in archives. Complete source
    177  // // archive and checksum information will be
    178  // // present. The document setting
    179  // // ON_3dmIOSettings.m_idef_link_update
    180  // // determines if, when and how the instance
    181  // // definition geometry is updated by reading the
    182  // // source archive.
    183  //linked_def = 3,
    184  // // The geometry for this instance definition
    185  // // is not saved in the archive that contains
    186  // // this instance definition. This instance
    187  // // definition geometry is imported from a
    188  // // "source archive" The "source archive" file
    189  // // name and checksum information are saved
    190  // // in m_source_archive and m_source_archive_checksum.
    191  // // If file named in m_source_archive is not available,
    192  // // then this instance definition is not valid and any
    193  // // references to it are not valid.
    194  };
    195 
    196  // Converts and integer into an IDEF_UPDATE_TYPE enum.
    197  static ON_InstanceDefinition::IDEF_UPDATE_TYPE InstanceDefinitionTypeFromUnsigned(
    198  unsigned int idef_type_as_unsigned
    199  );
    200 
    201  // Bits that identify subsets of the instance defintion
    202  // fields. These bits are used to determine which fields to
    203  // set when an ON_InstanceDefinition class is used to
    204  // modify an existing instance definition.
    205  enum
    206  {
    207  no_idef_settings = 0,
    208  idef_name_setting = 1, // m_name
    209  idef_description_setting = 2, // m_description
    210  idef_url_setting = 4, // all m_url_* fields
    211  idef_units_setting = 8, // m_us and m_unit_scale
    212  idef_source_archive_setting = 0x10, // all m_source_*, layer style, update depth fields
    213  idef_userdata_setting = 0x20,
    214  all_idef_settings = 0xFFFFFFFF
    215  };
    216 
    217 public:
    218  ON_InstanceDefinition() ON_NOEXCEPT;
    221  ON_InstanceDefinition& operator=(const ON_InstanceDefinition&);
    222 
    223 private:
    224  void Internal_Destroy();
    225  void Internal_Copy(const ON_InstanceDefinition& src);
    226 
    227 public:
    228 
    229  static const ON_InstanceDefinition Unset;
    230 
    231  /*
    232  Parameters:
    233  model_component_reference - [in]
    234  none_return_value - [in]
    235  value to return if ON_InstanceDefinition::Cast(model_component_ref.ModelComponent())
    236  is nullptr
    237  Returns:
    238  If ON_InstanceDefinition::Cast(model_component_ref.ModelComponent()) is not nullptr,
    239  that pointer is returned. Otherwise, none_return_value is returned.
    240  */
    241  static const ON_InstanceDefinition* FromModelComponentRef(
    242  const class ON_ModelComponentReference& model_component_reference,
    243  const ON_InstanceDefinition* none_return_value
    244  );
    245 
    246 
    247  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    248 
    249  // virtual ON_Object::Dump override
    250  void Dump(
    251  ON_TextLog& text_log
    252  ) const override;
    253 
    254 public:
    255  bool Write(
    256  ON_BinaryArchive& archive
    257  ) const override;
    258 
    259 private:
    260  bool Internal_WriteV5(
    261  ON_BinaryArchive& archive
    262  ) const;
    263  bool Internal_WriteV6(
    264  ON_BinaryArchive& archive
    265  ) const;
    266 
    267 public:
    268  bool Read(
    269  ON_BinaryArchive& archive
    270  ) override;
    271 
    272 private:
    273  bool Internal_ReadV5(
    274  ON_BinaryArchive& archive
    275  );
    276  bool Internal_ReadV6(
    277  ON_BinaryArchive& archive
    278  );
    279 
    280 public:
    281  ON::object_type ObjectType() const override;
    282 
    283  // virtual ON_Object:: override
    284  unsigned int SizeOf() const override;
    285 
    286  const ON_BoundingBox BoundingBox() const;
    287 
    288  void SetBoundingBox( ON_BoundingBox bbox );
    289 
    290  void ClearBoundingBox();
    291 
    292  const ON_wString Description() const;
    293  void SetDescription( const wchar_t* description );
    294 
    295  const ON_wString URL() const;
    296  void SetURL( const wchar_t* url );
    297 
    298  const ON_wString URL_Tag() const;
    299  void SetURL_Tag( const wchar_t* url_tag );
    300 
    301  /*
    302  Returns:
    303  A list of object ids in the instance geometry table sorted by id.
    304  */
    305  const ON_SimpleArray<ON_UUID>& InstanceGeometryIdList() const;
    306 
    307  /*
    308  Parameters:
    309  instance_geometry_id_list - [in]
    310  A list of object ids in the instance geometry table.
    311  */
    312  void SetInstanceGeometryIdList(
    313  const ON_SimpleArray<ON_UUID>& instance_geometry_id_list
    314  );
    315 
    316  /*
    317  Description:
    318  Remove all ids from the InstanceGeometryIdList().
    319  */
    320  void ClearInstanceGeometryIdList();
    321 
    322  /*
    323  Description:
    324  Remove id from the InstanceGeometryIdList().
    325  */
    326  bool RemoveInstanceGeometryId(
    327  ON_UUID id
    328  );
    329 
    330  /*
    331  Description:
    332  Remove InstanceGeometryIdList()[id_index] from the InstanceGeometryIdList() array.
    333  */
    334  bool RemoveInstanceGeometryId(
    335  int id_index
    336  );
    337 
    338  /*
    339  Description:
    340  Add id to the InstanceGeometryIdList().
    341  Parameters:
    342  id - [in]
    343  non-nil id to add.
    344  Returns:
    345  True if id is not nil and was added to the InstanceGeometryIdList().
    346  */
    347  bool AddInstanceGeometryId(
    348  ON_UUID id
    349  );
    350 
    351  /*
    352  Returns:
    353  True if id is in the InstanceGeometryIdList().
    354  */
    355  bool IsInstanceGeometryId(
    356  ON_UUID id
    357  ) const;
    358 
    359 private:
    360  int Internal_InstanceGeometryIdIndex(
    361  ON_UUID id
    362  ) const;
    363 
    364 public:
    365  /*
    366  Parameters:
    367  instance_definition_type - [in]
    368  ON_InstanceDefinition::IDEF_UPDATE_TYPE::Unset - change the type to Unset
    369  and remove all linked file information.
    370  ON_InstanceDefinition::IDEF_UPDATE_TYPE::Static - change the type to Static
    371  and remove all linked file information.
    372  ON_InstanceDefinition::IDEF_UPDATE_TYPE::LinkedAndEmbedded - change
    373  the type to from Linked to LinkedAndEmbedded. If the current type
    374  is not Linked, then no changes are made.
    375  ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked - change
    376  the type to from LinkedAndEmbedded to Linked. If the current type
    377  is not LinkedAndEmbedded, then no changes are made.
    378  */
    379  bool SetInstanceDefinitionType(
    380  const ON_InstanceDefinition::IDEF_UPDATE_TYPE instance_definition_type
    381  );
    382 
    383  /*
    384  Parameters:
    385  linked_definition_type - [in]
    386  Either ON_InstanceDefinition::IDEF_UPDATE_TYPE::LinkedAndEmbedded
    387  or ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked.
    388  linked_file_reference - [in]
    389  */
    390  bool SetLinkedFileReference(
    391  ON_InstanceDefinition::IDEF_UPDATE_TYPE linked_definition_type,
    392  ON_FileReference linked_file_reference
    393  );
    394 
    395  bool SetLinkedFileReference(
    396  ON_InstanceDefinition::IDEF_UPDATE_TYPE linked_definition_type,
    397  const wchar_t* linked_file_full_path
    398  );
    399 
    400  const ON_FileReference LinkedFileReference() const;
    401 
    402  /*
    403  Destroy all linked file path information and convert the type to Static.
    404  */
    405  void ClearLinkedFileReference();
    406 
    407  void ClearLinkedFileContentHash();
    408 
    409  void ClearLinkedFileRelativePath();
    410 
    411  const ON_wString& LinkedFilePath() const;
    412 
    413  const ON_UnitSystem& UnitSystem() const;
    414 
    415 public:
    416  /*
    417  Description:
    418  Sets m_us and m_unit_scale.
    419  */
    420  void SetUnitSystem( ON::LengthUnitSystem us );
    421  void SetUnitSystem( const ON_UnitSystem& us );
    422 
    423  /*
    424  Returns:
    425  True if this is a linked instance definition with
    426  layer settings information.
    427  */
    428  bool HasLinkedIdefReferenceComponentSettings() const;
    429 
    430  void ClearLinkedIdefReferenceComponentSettings();
    431 
    432  /*
    433  Parameters:
    434  bCreateIfNonePresent - [in]
    435  When bCreateIfNonePresent is true and the idef type is ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked,
    436  then ON_ReferencedComponentSettings will be created if none are present.
    437  Return:
    438  ON_ReferencedComponentSettings pointer or nullptr.
    439  */
    440  const ON_ReferencedComponentSettings* LinkedIdefReferenceComponentSettings() const;
    441 
    442  /*
    443  Parameters:
    444  bCreateIfNonePresent - [in]
    445  When bCreateIfNonePresent is true and the idef type is ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked,
    446  then ON_ReferencedComponentSettings will be created if none are present.
    447  Return:
    448  ON_ReferencedComponentSettings pointer or nullptr.
    449  */
    450  ON_ReferencedComponentSettings* LinkedIdefReferenceComponentSettings(
    451  bool bCreateIfNonePresent
    452  );
    453 
    454 public:
    455 
    456  // OBSOLETE - change IdefUpdateType() to InstanceDefinitionType()
    457  ON_InstanceDefinition::IDEF_UPDATE_TYPE IdefUpdateType() const;
    458 
    459  ON_InstanceDefinition::IDEF_UPDATE_TYPE InstanceDefinitionType() const;
    460 
    461  /*
    462  Returns:
    463  true if InstanceDefinitionType() = ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked or ON_InstanceDefinition::IDEF_UPDATE_TYPE::LinkedAndEmbedded.
    464  */
    465  bool IsLinkedType() const;
    466 
    467  /*
    468  Description:
    469  This property applies when an instance definiton is linked.
    470  Returns:
    471  true:
    472  When reading the file that defines the content of the linked instance definition,
    473  skip any linked instance definitions found in that file.
    474  false:
    475  When reading the file that defines the content of the linked instance definition,
    476  recursively load linked instance definitions found in that file.
    477  */
    478  bool SkipNestedLinkedDefinitions() const;
    479 
    480  void SetSkipNestedLinkedDefinitions(
    481  bool bSkipNestedLinkedDefinitions
    482  );
    483 
    484 private:
    485  // list of object ids in the instance geometry table.
    486  ON_SimpleArray<ON_UUID> m_object_uuid;
    487 
    488 private:
    489  ON_wString m_description;
    490  ON_wString m_url;
    491  ON_wString m_url_tag; // UI link text for m_url
    492 
    493 private:
    494  ON_BoundingBox m_bbox = ON_BoundingBox::EmptyBoundingBox;
    495 
    496 private:
    497  ON_UnitSystem m_us = ON_UnitSystem::None;
    498 
    499 private:
    500  // Note: the embedded_def type is obsolete.
    501  // To avoid having to deal with this obsolete type in
    502  // your code, using ON_InstanceDefintion::IdefUpdateType()
    503  // to get this value. The IdefUpdateType() function
    504  // with convert the obsolte value to the correct
    505  // value.
    506  ON_InstanceDefinition::IDEF_UPDATE_TYPE m_idef_update_type = ON_InstanceDefinition::IDEF_UPDATE_TYPE::Static;
    507 
    508 private:
    509  bool m_bSkipNestedLinkedDefinitions = false;
    510 
    511 private:
    512  /////////////////////////////////////////////////////////////
    513  //
    514  // linked instance definition internals
    515  //
    516 private:
    517  ON_FileReference m_linked_file_reference;
    518 
    519  // For V5 3dm archive compatibility.
    520  // Set as needed by the Write() function for new idefs and saved if the idef is read from a V5 file.
    521 private:
    522  mutable ON_CheckSum m_linked_file_V5_checksum = ON_CheckSum::UnsetCheckSum;
    523 private:
    524  bool Internal_SetLinkedFileReference(
    525  ON_InstanceDefinition::IDEF_UPDATE_TYPE linked_definition_type,
    526  const ON_FileReference& linked_file_reference,
    527  ON_CheckSum V5_checksum
    528  );
    529 
    530  // See comment for Internal_ReferencedComponentSettings() function.
    531 private:
    532  mutable class ON_ReferencedComponentSettings* m_linked_idef_component_settings = nullptr;
    533 
    534 public:
    535 
    536  /// <summary>
    537  /// ON_InstanceDefinition::LinkedComponentStates specifies how model components
    538  /// (layers, materials, dimension styles, ...) from linked instance defintion files
    539  /// are appear in the active model.
    540  /// </summary>
    541  enum class eLinkedComponentAppearance : unsigned char
    542  {
    543  ///<summary>
    544  /// This is the only valid layer style when the instance definition type is
    545  /// ON_InstanceDefinition::IDEF_UPDATE_TYPE::Static or
    546  /// ON_InstanceDefinition::IDEF_UPDATE_TYPE::LinkedAndEmbedded.
    547  /// This style is not valid when the instance definition type
    548  /// ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked.
    549  ///</summary>
    550  Unset = 0,
    551 
    552  ///<summary>
    553  /// Model components (layers, materials, dimension styles, ...) from
    554  /// linked instance definition files are embedded as ordinary components
    555  /// in the active model.
    556  /// This layer style may be used when the instance definition type is
    557  /// ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked.
    558  ///</summary>
    559  Active = 1,
    560 
    561  ///<summary>
    562  /// Layers from the linked instance definition are reference components in the model.
    563  /// This is the default layer style when the instance definition type is
    564  /// ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked.
    565  /// This layer style may be used when the instance definition type is
    566  /// ON_InstanceDefinition::IDEF_UPDATE_TYPE::Linked.
    567  ///</summary>
    568  Reference = 2
    569  };
    570 
    571  static ON_InstanceDefinition::eLinkedComponentAppearance LinkedComponentAppearanceFromUnsigned(
    572  unsigned int linked_component_appearance_as_unsigned
    573  );
    574 
    575  ON_InstanceDefinition::eLinkedComponentAppearance LinkedComponentAppearance() const;
    576 
    577  bool SetLinkedComponentAppearance(
    578  ON_InstanceDefinition::eLinkedComponentAppearance linked_component_appearance
    579  );
    580 
    581 private:
    583 
    584 public:
    585 
    586  /*
    587  Returns:
    588  A SHA-1 hash of these instance defintions properties:
    589 
    590  InstanceGeometryIdList()
    591  BoundingBox()
    592  UnitSystem()
    593  InstanceDefinitionType()
    594  LinkedFileReference()
    595  LinkedComponentAppearance()
    596  */
    597  const ON_SHA1_Hash GeometryContentHash() const;
    598 
    599  /*
    600  Returns:
    601  A SHA-1 hash of these instance defintions properties
    602  Description()
    603  URL()
    604  URL_Tag()
    605  and all the properties that contribute to the GeometryContentHash().
    606  */
    607  const ON_SHA1_Hash ContentHash() const;
    608 
    609 private:
    610  void Internal_AccumulateHash() const;
    611 
    612 private:
    613  // Internal_AccumulateHash() uses lazy evaluation to set m_geometry_content_hash when needed.
    614  mutable ON_SHA1_Hash m_geometry_content_hash = ON_SHA1_Hash::ZeroDigest;
    615 
    616  // Internal_AccumulateHash() uses lazy evaluation to set m_content_hash when needed.
    617  mutable ON_SHA1_Hash m_content_hash = ON_SHA1_Hash::ZeroDigest;
    618 
    619 private:
    620  // Increments content version number and sets hashes to ON_SHA1_Hash::ZeroDigest.
    621  void Internal_ContentChanged();
    622 
    623 private:
    624  unsigned char m_reserved2A = 0;
    625  unsigned char m_reserved2B = 0;
    626  unsigned char m_reserved2C = 0;
    627 
    628 private:
    629  unsigned int m_reserved1 = 0;
    630 
    631 private:
    632  ON__UINT_PTR m_reserved_ptr = 0;
    633 };
    634 
    635 #if defined(ON_DLL_TEMPLATE)
    636 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_InstanceDefinition*>;
    637 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_InstanceDefinition>;
    638 #endif
    639 
    640 /*
    641 Description:
    642  An ON_InstanceRef is a reference to an instance definition
    643  along with transformation to apply to the definition.
    644 See Also:
    645  ON_InstanceRef
    646 */
    647 class ON_CLASS ON_InstanceRef : public ON_Geometry
    648 {
    649  ON_OBJECT_DECLARE(ON_InstanceRef);
    650 
    651 public:
    652  ON_InstanceRef() = default;
    653  ~ON_InstanceRef() = default;
    654  ON_InstanceRef(const ON_InstanceRef&) = default;
    655  ON_InstanceRef& operator=(const ON_InstanceRef&) = default;
    656 
    657 public:
    658  /////////////////////////////////////////////////////////////
    659  //
    660  // virtual ON_Object overrides
    661  //
    662  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    663  bool Write(
    664  ON_BinaryArchive& binary_archive
    665  ) const override;
    666  bool Read(
    667  ON_BinaryArchive& binary_archive
    668  ) override;
    669  ON::object_type ObjectType() const override;
    670 
    671  /////////////////////////////////////////////////////////////
    672  //
    673  // virtual ON_Geometry overrides
    674  //
    675  int Dimension() const override;
    676 
    677  // virtual ON_Geometry GetBBox override
    678  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    679 
    680  bool Transform(
    681  const ON_Xform& xform
    682  ) override;
    683 
    684  // virtual ON_Geometry::IsDeformable() override
    685  bool IsDeformable() const override;
    686 
    687  // virtual ON_Geometry::MakeDeformable() override
    688  bool MakeDeformable() override;
    689 
    690  /////////////////////////////////////////////////////////////
    691  //
    692 
    693  // Unique id of the instance definition (ON_InstanceDefinition)
    694  // in the instance definition table that defines the geometry
    695  // used by this reference.
    696  ON_UUID m_instance_definition_uuid = ON_nil_uuid;
    697 
    698  // Transformation for this reference.
    700 
    701  // Bounding box for this reference.
    703 
    704 #if 0
    705 public:
    706  /*
    707  Remove all reference to the nested linked idef information.
    708  */
    709  void ClearReferenceToNestedLinkedIdef();
    710 
    711  /*
    712  Returns:
    713  true
    714  if input was valid and the reference to the nested linked idef was set.
    715  false
    716  if reference to the nested linked idef was not set.
    717  */
    718  bool SetReferenceToNestedLinkedIdef(
    719  const ON_UUID& parent_idef_uuid,
    720  const ON_FileReference& parent_reference_file,
    721  const ON_FileReference& nested_reference_file
    722  );
    723 
    724  /*
    725  Parameters:
    726  parent_idef_uuid - [in]
    727  The peristent id of the parent idef that contains the (possibly deeply nested)
    728  instance definion this reference refers to.
    729  parent_reference_file - [in]
    730  the file for the parent idef.
    731  nested_reference_file - [in]
    732  if the referenced idef is itself linked, nested_reference_file identifies
    733  the file.
    734 
    735  Returns:
    736  True if this is a reference to a nested linked idef.
    737  */
    738  bool GetReferenceToNestedLinkedIdef(
    739  ON_UUID& parent_idef_uuid,
    740  ON_FileReference& parent_reference_file,
    741  ON_FileReference& nested_reference_file
    742  ) const;
    743 
    744  /*
    745  Returns:
    746  True if this is a reference to a nested linked idef.
    747  */
    748  bool ContainsReferenceToNestedLinkedIdef() const;
    749 
    750 private:
    751  /////////////////////////////////////////////////////////////
    752  //
    753  // Additional information used when this reference is to
    754  // an instance definition that is nested inside an ordinary
    755  // linked instance definition.
    756  //
    757  // For example, if
    758  // idefA = linked instance defintion referencing file A.
    759  // idefX = any type of instance definition found in idefA.
    760  //
    761  // iref = model geometry reference to idefX.
    762  //
    763  // When A is not a 3dm file or the 3dm id of idefX is
    764  // in use in the current model, the id of idefX will change
    765  // every time A is read. This means saving the value of
    766  // iref.m_instance_definition_uuid is not sufficient to identify
    767  // idefX. In this case, the additional information
    768  //
    769  // iref.m_bReferenceToNestedLinkedIdef = true
    770  // iref.m_parent_idef_uuid = idefA.Id()
    771  // iref.m_parent_reference_file = idefA.FileReference().
    772  // iref.m_nested_reference_file = idefX.FileReference().
    773  //
    774  // is used to identify idefX in a peristent way.
    775  //
    776  bool m_bReferenceToNestedLinkedIdef = false;
    777  ON_UUID m_parent_idef_uuid = ON_nil_uuid; // persistent id
    778  ON_FileReference m_parent_reference_file = ON_FileReference::Unset;
    779  ON_FileReference m_nested_reference_file = ON_FileReference::Unset;
    780 #endif
    781 
    782 public:
    783  // Tolerance to use for flagging instance xforms
    784  // as singular.
    785  // A valid ON_InstanceRef.m_xform satisfies:
    786  // true == (m_xform.Inverse()*m_xform).IsIdentity(ON_InstanceRef::SingularTransformationTolerance)
    787  static const double SingularTransformationTolerance;
    788 };
    789 
    790 #endif
    ON_UUID is a 16 byte universally unique identifier.
    Definition: opennurbs_uuid.h:32
    Definition: opennurbs_model_component.h:25
    Definition: opennurbs_archive.h:1520
    @@ -101,9 +99,9 @@ $(function() {
    diff --git a/6/d9/ddf/class_o_n___brep_vertex.html b/6/d9/ddf/class_o_n___brep_vertex.html index d36502ed..c88478dc 100644 --- a/6/d9/ddf/class_o_n___brep_vertex.html +++ b/6/d9/ddf/class_o_n___brep_vertex.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepVertex Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/d9/dec/class_o_n___dimension.html b/6/d9/dec/class_o_n___dimension.html index 1b28df0d..113e1138 100644 --- a/6/d9/dec/class_o_n___dimension.html +++ b/6/d9/dec/class_o_n___dimension.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Dimension Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    enum  ForceArrow : unsigned int { ForceArrow::Auto = 0, ForceArrow::Inside = 1, ForceArrow::Outside = 2 - } - Arrowheads forced Inside, or Outside of extension lines, or moved to fit. More...
    + } Arrowheads forced Inside, or Outside of extension lines, or moved to fit. More...
    +   enum  ForceText : unsigned int { ForceText::Auto = 0, ForceText::Inside = 1, ForceText::Right = 2, ForceText::Left = 3 - } - Text forced Inside, Right or Left of extension lines, or moved to fit (Auto). More...
    + } Text forced Inside, Right or Left of extension lines, or moved to fit (Auto). More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -901,8 +899,7 @@ Additional Inherited Members

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Member Enumeration Documentation

    ◆ ForceArrow

    @@ -2189,9 +2186,9 @@ Additional Inherited Members
    diff --git a/6/d9/dec/class_o_n___instance_definition.html b/6/d9/dec/class_o_n___instance_definition.html index b75f7460..c6268790 100644 --- a/6/d9/dec/class_o_n___instance_definition.html +++ b/6/d9/dec/class_o_n___instance_definition.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_InstanceDefinition Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    enum  eLinkedComponentAppearance : unsigned char { eLinkedComponentAppearance::Unset = 0, eLinkedComponentAppearance::Active = 1, eLinkedComponentAppearance::Reference = 2 - } - ON_InstanceDefinition::LinkedComponentStates specifies how model components (layers, materials, dimension styles, ...) from linked instance defintion files are appear in the active model. More...
    + } ON_InstanceDefinition::LinkedComponentStates specifies how model components (layers, materials, dimension styles, ...) from linked instance defintion files are appear in the active model. More...
    +   enum  IDEF_UPDATE_TYPE : unsigned int { IDEF_UPDATE_TYPE::Unset = 0, IDEF_UPDATE_TYPE::Static = 1, @@ -152,8 +150,8 @@ Public Types Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -1047,8 +1045,8 @@ Additional Inherited Members
    -

    Returns: A SHA-1 hash of these instance defintions properties:
    - InstanceGeometryIdList() BoundingBox() UnitSystem() InstanceDefinitionType() LinkedFileReference() LinkedComponentAppearance()

    +

    Returns: A SHA-1 hash of these instance defintions properties:

    +

    InstanceGeometryIdList() BoundingBox() UnitSystem() InstanceDefinitionType() LinkedFileReference() LinkedComponentAppearance()

    @@ -1809,8 +1807,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -1842,9 +1840,9 @@ Additional Inherited Members
    diff --git a/6/d9/df0/class_o_n___dim_style_context-members.html b/6/d9/df0/class_o_n___dim_style_context-members.html index e0b27682..da08e156 100644 --- a/6/d9/df0/class_o_n___dim_style_context-members.html +++ b/6/d9/df0/class_o_n___dim_style_context-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/df2/opennurbs__curveonsurface_8h_source.html b/6/d9/df2/opennurbs__curveonsurface_8h_source.html index b119a786..b923c1fe 100644 --- a/6/d9/df2/opennurbs__curveonsurface_8h_source.html +++ b/6/d9/df2/opennurbs__curveonsurface_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_curveonsurface.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_curveonsurface.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/df6/class_o_n___manifest_map.html b/6/d9/df6/class_o_n___manifest_map.html index 59855ba8..3dc920a1 100644 --- a/6/d9/df6/class_o_n___manifest_map.html +++ b/6/d9/df6/class_o_n___manifest_map.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ManifestMap Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/df6/class_o_n___number_formatter-members.html b/6/d9/df6/class_o_n___number_formatter-members.html index 049f2bc9..4985b947 100644 --- a/6/d9/df6/class_o_n___number_formatter-members.html +++ b/6/d9/df6/class_o_n___number_formatter-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/d9/df9/opennurbs__rtree_8h_source.html b/6/d9/df9/opennurbs__rtree_8h_source.html index f6876741..d9ba2a89 100644 --- a/6/d9/df9/opennurbs__rtree_8h_source.html +++ b/6/d9/df9/opennurbs__rtree_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_rtree.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_rtree.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_rtree.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_RTREE_INC_)
    18 #define OPENNURBS_RTREE_INC_
    19 
    20 /*
    21 The opennurbs rtree code is a modifed version of the
    22 free and unrestricted R-tree implementation obtianed from
    23 http://www.superliminal.com/sources/sources.htm
    24 
    25 The first lines on the website indicate the code is free and unrestricted:
    26 
    27  Free Source Code
    28  Here are a few useful bits of free source code.
    29  You're completely free to use them for any purpose whatsoever.
    30  All I ask is that if you find one to be particularly valuable,
    31  then consider sending feedback. Please send bugs and suggestions too.
    32  Enjoy
    33 
    34 The readme.txt file included with the R-tree source says
    35 
    36  LICENSE:
    37  Entirely free for all uses. Enjoy!
    38 
    39 The original authors are
    40 
    41 AUTHORS
    42  * 1983 Original algorithm and test code by Antonin Guttman and Michael Stonebraker, UC Berkely
    43  * 1994 ANCI C ported from original test code by Melinda Green - melinda@superliminal.com
    44  * 1995 Sphere volume fix for degeneracy problem submitted by Paul Brook
    45  * 2004 Templated C++ port by Greg Douglas
    46 
    47 The opennurbs version adds some custom memory allocation and replaces
    48 the leaf iterator. The rest of the changes are cosmetic.
    49 
    50 */
    51 
    52 
    53 
    54 // Minimum and maximum number of elements
    55 // in ON_RTreeNode::m_branch[].
    56 // must have ON_RTree_MAX_NODE_COUNT > ON_RTree_MIN_NODE_COUNT
    57 #define ON_RTree_MIN_NODE_COUNT 2
    58 #define ON_RTree_MAX_NODE_COUNT 6
    59 
    60 /*
    61 In a test of a sphere mesh with mesh: 8385 vertices, 8192 polygons
    62 and ON_RTree_MAX_NODE_COUNT = 3, 4, 5, and 6, the memory use was
    63 most efficient with ON_RTree_MAX_NODE_COUNT=6
    64 
    65 Memory Usage MAX_NODE_COUNT = 3
    66  ON_RTree: 1212 KB (1241136) (352 wasted)
    67  ON_RTree: 7036 nodes, 5881 unused branches (321 KB) 0.835844 per node
    68 
    69 Memory Usage MAX_NODE_COUNT = 4
    70  ON_RTree: 1152 KB (1179720) (5568 wasted)
    71  ON_RTree: 5051 nodes, 6962 unused branches (380 KB) 1.37834 per node
    72 
    73 Memory Usage MAX_NODE_COUNT = 5
    74  ON_RTree: 1040 KB (1065504) (11808 wasted)
    75  ON_RTree: 3655 nodes, 6429 unused branches (351 KB) 1.75896 per node
    76 
    77 Memory Usage MAX_NODE_COUNT = 6
    78  ON_RTree: 995 KB (1019592) (3440 wasted)
    79  ON_RTree: 2951 nodes, 6564 unused branches (358 KB) 2.22433 per node
    80 */
    81 
    82 // This struct is used instead of ON_BoundingBox to avoid calling
    83 // constructors.
    85 {
    86  double m_min[3];
    87  double m_max[3];
    88 };
    89 
    91 {
    92  double m_point[3];
    93  double m_radius;
    94 };
    95 
    97 {
    98  double m_point[2][3];
    99  double m_radius;
    100  double m_domain[2];
    101 };
    102 
    104 {
    106 
    107  // If ON_RTreeNode.m_level > 0, then m_child points to a child node.
    108  // If ON_RTreeNode.m_level == 0, then m_id identifies the leaf element.
    109  union
    110  {
    112  ON__INT_PTR m_id;
    113  };
    114 };
    115 
    117 {
    119  ON__INT_PTR m_id;
    120 };
    121 
    122 // The ON_RTreeNode is used at root, branch and leaf nodes.
    123 // When m_level > 0, the node is a branch.
    124 // When m_level = 0, the node is a leaf.
    126 {
    127  inline bool IsInternalNode() const
    128  { return (m_level > 0); } // internal nodes have m_level > 0
    129  inline bool IsLeaf() const
    130  { return (m_level == 0); } // branch nodes have m_level = 0
    131 
    132  // m_level must be a signed int to insure signed compares work correctly
    133  int m_level; // =0 at leaf nodes, > 0 at branch nodes
    134 
    135  // The m_branch[] array contains m_count elements
    136  // 0 <= m_count <= ON_RTree_MAX_NODE_COUNT
    137  // m_count must be a signed int to insure signed compares work correctly
    138  int m_count;
    139  ON_RTreeBranch m_branch[ON_RTree_MAX_NODE_COUNT];
    140 };
    141 
    143 {
    144  int m_capacity; // m_id[] array capacity (search terminates when m_count == m_capacity)
    145  int m_count; // number of elements in m_id[]
    146  ON__INT_PTR* m_id; // m_id[] = array of search results.
    147 };
    148 
    149 class ON_CLASS ON_RTreeMemPool
    150 {
    151 public:
    152  static const ON_RTreeMemPool Empty;
    153 
    154  ON_RTreeMemPool() = default;
    155 
    156  ON_RTreeMemPool( size_t leaf_count );
    157  ~ON_RTreeMemPool();
    158 
    159  ON_RTreeNode* AllocNode();
    160  void FreeNode(ON_RTreeNode* node);
    161 
    162  struct ON_RTreeListNode* AllocListNode();
    163  void FreeListNode(struct ON_RTreeListNode* list_node);
    164 
    165  void DeallocateAll();
    166 
    167  /*
    168  Returns:
    169  Total number of bytes of heap memory allocated.
    170  */
    171  size_t SizeOf() const;
    172 
    173  /*
    174  Returns:
    175  Number of bytes of heap memory not currently in use.
    176  */
    177  size_t SizeOfUnusedBuffer() const;
    178 
    179 private:
    180  void GrowBuffer();
    181 
    182  struct Blk
    183  {
    184  struct Blk* m_next;
    185  };
    186 
    187  // linked list of unused ON_RTreeNode
    188  struct Blk* m_nodes = nullptr;
    189  // linked list of unused ON_RTreeListNode
    190  struct Blk* m_list_nodes = nullptr;
    191 
    192  // buffer for new allocations
    193  unsigned char* m_buffer = nullptr;
    194  size_t m_buffer_capacity = 0;
    195 
    196  struct Blk* m_blk_list = nullptr; // linked list used to free all allocated memory
    197  size_t m_sizeof_blk = 0; // total amount of memory in each block.
    198 
    199  size_t m_sizeof_heap = 0; // total amount of heap memory in this rtree
    200 };
    201 
    202 ////////////////////////////////////////////////////////////////
    203 //
    204 // ON_RTreeIterator
    205 //
    206 // The ON_RTreeIterator class can be used to iterate each leaf
    207 // in an ON_RTree.
    208 //
    209 class ON_CLASS ON_RTreeIterator
    210 {
    211 public:
    212  /*
    213  Description:
    214  Construct an empty iterator. Call Initialize() to attach
    215  the iterator to an R-tree.
    216  Remark:
    217  Any calls to ON_RTree::Insert() or ON_RTree::Remove() that modify
    218  an R-tree being iterated invalidate the iterator. The iterator
    219  must be re-initialized before being used again.
    220 
    221  There is no connection between the order elements are inserted
    222  in an R-tree and the order the elements are iterated by an
    223  iterator.
    224  */
    226  ON_RTreeIterator(const class ON_RTree& a_rtree);
    227 
    228  ~ON_RTreeIterator();
    229 
    230  /*
    231  Description:
    232  Initialize an iterator to iterate every leaf in the rtree.
    233  Parameters:
    234  a_rtree - [in]
    235  R-tree to iterate
    236  Example:
    237  See the comment for ON_RTreeIterator::First().
    238  Returns:
    239  True if a_rtree has at least one element.
    240  Remarks:
    241  Any calls to ON_RTree::Insert() or ON_RTree::Remove() that modify
    242  this node or its children will invalidate this iterator and it
    243  must be re-initialized.
    244 
    245  There is no connection between the order elements are inserted
    246  in an R-tree and the order the elements are iterated by an
    247  iterator.
    248  */
    249  bool Initialize(const class ON_RTree& a_rtree);
    250 
    251  /*
    252  Description:
    253  Initialize an iterator to iterate every leaf on or below a_node.
    254  Parameters:
    255  a_node - [in]
    256  R-tree node to iterate
    257  Example:
    258  See the comment for ON_RTreeIterator::First().
    259  Returns:
    260  True if a_node has at least one element.
    261  Remarks:
    262  Any calls to ON_RTree::Insert() or ON_RTree::Remove() that modify
    263  this node or its children will invalidate this iterator and it
    264  must be re-initialized.
    265 
    266  There is no connection between the order elements are inserted
    267  in an R-tree and the order the elements are iterated by an
    268  iterator.
    269  */
    270  bool Initialize(const struct ON_RTreeNode* a_node);
    271 
    272  /*
    273  Description:
    274  Get the value of the current leaf element. Calling Value()
    275  does not increment or decrement the iterator.
    276  Example:
    277  See the comment for ON_RTreeIterator::First().
    278  Return:
    279  Null pointer if there are no more leaves to iterate
    280  A pointer to the current R-tree leaf. When there are no more leaves,
    281  the returned pointer is null.
    282  */
    283  const ON_RTreeBranch* Value() const;
    284 
    285  /*
    286  Description:
    287  Reset the iterator so the current leaf is the first leaf in
    288  the R-tree. The Initialize() functions automatically do
    289  this, but First() can be called if an iterator needs to be
    290  used more than once or to make code easy to read and understand.
    291  Example:
    292  Iterate every leaf in an R-tree.
    293 
    294  ON_RTree rtree;
    295  ...
    296  ON_RtreeIterator rit(rtree);
    297  const ON_RTreeBranch* rtree_leaf;
    298  for ( rit.First(); 0 != (rtree_leaf = rit.Value()); rit.Next() )
    299  {
    300  // leaf id = rtree_leaf->m_id
    301  // leaf bounding box = rtree->m_rect
    302  }
    303 
    304  Returns:
    305  True if a call to Value() will return a non-null pointer.
    306  See Also:
    307  ON_RTreeIterator::Last();
    308  */
    309  bool First();
    310 
    311  /*
    312  Description:
    313  Increment the iterator to the next leaf in the R-tree.
    314  Example:
    315  See the comment for ON_RTreeIterator::First()
    316  Returns:
    317  True if a call to Value() will return a non-null pointer.
    318  False if there is not a next leaf and all susequent calls to
    319  Value() will return null.
    320  See Also:
    321  ON_RTreeIterator::Prev();
    322  */
    323  bool Next();
    324 
    325 
    326  /*
    327  Description:
    328  Set the iterator so the current leaf is the last leaf in the R-tree.
    329 
    330  Example:
    331  Iterate an R-tree in reverse order.
    332 
    333  ON_RTree rtree;
    334  ...
    335  ON_RTreeIterator rit(rtree);
    336  const ON_RTreeBranch* rtree_leaf;
    337  for ( rit.Last(); 0 != (rtree_leaf = rit.Value()); rit.Prev() )
    338  {
    339  // leaf id = rtree_leaf->m_id
    340  // leaf bounding box = rtree->m_rect
    341  }
    342 
    343  Returns:
    344  True if a call to Value() will return a non-null pointer.
    345  See Also:
    346  ON_RTreeIterator::First();
    347  */
    348  bool Last();
    349 
    350  /*
    351  Description:
    352  Decrement the iterator to the previous leaf in the R-tree.
    353  Example:
    354  See the comment for ON_RTreeIterator::Last()
    355  Returns:
    356  True if a call to Value() will return a non-null pointer.
    357  False if there is not a previous leaf and all susequent calls to
    358  Value() will return null.
    359  See Also:
    360  ON_RTreeIterator::Next();
    361  */
    362  bool Prev();
    363 
    364 private:
    365  enum { MAX_STACK = 32 }; // Max stack size. Allows almost n^32 where n is number of branches in node
    366 
    367  struct StackElement
    368  {
    369  const struct ON_RTreeNode* m_node;
    370  int m_branchIndex; // must be a signed int to insure signed compares work correctly
    371  };
    372 
    373  bool PushChildren(struct StackElement* sp, bool bFirstChild);
    374 
    375  StackElement m_stack[MAX_STACK]; // stack
    376  StackElement* m_sp; // stack pointer (null or points into m_stack[])
    377  const ON_RTreeNode* m_root; // root of tree being iterated
    378 };
    379 
    380 
    381 class ON_CLASS ON_RTree
    382 {
    383 public:
    384  static const ON_RTree Empty;
    385 
    386  ON_RTree( size_t leaf_count = 0 );
    387  ~ON_RTree();
    388 
    389  /*
    390  Description:
    391  Create an R-tree with an element for each face in the mesh.
    392  The element id is set to the index of the face.
    393  Parameters:
    394  mesh - [in]
    395  Returns:
    396  True if successful.
    397  */
    398  bool CreateMeshFaceTree( const class ON_Mesh* mesh );
    399 
    400  /*
    401  Description:
    402  Insert an element into the RTree.
    403  Parameters:
    404  a_min - [in]
    405  a_max - [in]
    406  3d bounding box of the element. The values in a_min[3] and a_max[3]
    407  must satisfy
    408  a_min[0] <= a_max[0],
    409  a_min[1] <= a_max[1], and
    410  a_min[1] <= a_max[1].
    411  a_dataId - [in]
    412  id of the element. This can be either a pointer or an integer id.
    413  Returns:
    414  True if element was successfully inserted.
    415  Remarks:
    416  Calling Insert() or Remove() invalidates any ON_RTreeIterator
    417  used to iterate this rtree.
    418  */
    419  bool Insert(const double a_min[3], const double a_max[3], void* a_element_id);
    420  bool Insert(const double a_min[3], const double a_max[3], int a_element_id);
    421  bool Insert2d(const double a_min[2], const double a_max[2], void* a_element_id);
    422  bool Insert2d(const double a_min[2], const double a_max[2], int a_element_id);
    423 
    424  /*
    425  Description:
    426  Remove an element from the RTree.
    427  Parameters:
    428  a_min - [in]
    429  a_max - [in]
    430  3d bounding box of the element. The values in a_min[3] and a_max[3]
    431  must satisfy
    432  a_min[0] <= a_max[0],
    433  a_min[1] <= a_max[1], and
    434  a_min[2] <= a_max[2].
    435  a_dataId - [in]
    436  id of the element. This can be either a pointer or an integer id.
    437  Returns:
    438  True if element was successfully removed.
    439  Remarks:
    440  Calling Insert() or Remove() invalidates any ON_RTreeIterator
    441  used to iterate this rtree.
    442  */
    443  bool Remove(const double a_min[3], const double a_max[3], void* a_elementId);
    444  bool Remove(const double a_min[3], const double a_max[3], int a_elementId);
    445  bool Remove2d(const double a_min[2], const double a_max[2], void* a_elementId);
    446  bool Remove2d(const double a_min[2], const double a_max[2], int a_elementId);
    447 
    448  /*
    449  Description:
    450  Remove all elements from the R-tree.
    451  */
    452  void RemoveAll();
    453 
    454  /*
    455  Description:
    456  Search the R-tree for all elements whose bounding boxes overlap
    457  a_rect.
    458  Parameters:
    459  a_rect - [in/out]
    460  The version of search that has ON_RTreeBBox* a_rect as the first
    461  argument, allows you to shrink the a_rect as the search progresses.
    462  This is useful for doing things like searching for closest points.
    463  If you want to shrink a_rect, you must use a_context to pass it
    464  to the resultCallback function and shrink it in the resultCallback
    465  function. In the callback, the modified rect must be contained
    466  in the previous rect.
    467  a_sphere - [in/out]
    468  The version of search that has ON_RTreeSphere* a_sphere as the first
    469  argument, allows you to shrink the a_sphere as the search progresses.
    470  This is useful for doing things like searching for closest points.
    471  If you want to shrink a_sphere, you must use a_context to pass it
    472  to the resultCallback function and shrink it in the resultCallback
    473  function. In the callback, the modified sphere must be contained
    474  in the previous sphere.
    475  a_capsule - [in/out]
    476  The version of search that has ON_RTreeSphere* a_capsule as the first
    477  argument, allows you to shrink the a_capsule as the search progresses.
    478  This is useful for doing things like searching for closest points.
    479  If you want to shrink a_capsule, you must use a_context to pass it
    480  to the resultCallback function and shrink it in the resultCallback
    481  function. In the callback, the modified capsule must be contained
    482  in the previous capsule.
    483  a_min - [in]
    484  a_max - [in]
    485  (a_min,a_max) is the bounding box of the search region.
    486  a_results - [out]
    487  The ids of elements that overlaps the search region.
    488  resultCallback - [in]
    489  A function to call when leaf nodes overlap.
    490  a_context - [in]
    491  pointer passed to the resultCallback() function.
    492  Returns:
    493  True if entire tree was searched. It is possible no results were found.
    494  Remarks:
    495  If you are using a Search() that uses a resultCallback() function,
    496  then return true to keep searching and false to terminate the search.
    497  */
    498  bool Search(
    499  ON_RTreeSphere* a_sphere,
    500  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id),
    501  void* a_context
    502  ) const;
    503 
    504  bool Search(
    505  ON_RTreeCapsule* a_capsule,
    506  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id),
    507  void* a_context
    508  ) const;
    509 
    510  bool Search(
    511  ON_RTreeBBox* a_rect,
    512  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id),
    513  void* a_context
    514  ) const;
    515 
    516  /*
    517  Description:
    518  Search the R-tree for all elements whose bounding boxes overlap
    519  the set of points between to parallel planes.
    520  Parameters:
    521  a_plane_eqn - [in]
    522  a_min - [in]
    523  a_max - [in]
    524  The region between the parallel planes is the set point points
    525  where the value of the plane equation is >= a_min and <= a_max.
    526  resultCallback - [in]
    527  A function to call when leaf nodes overlap the region between
    528  the parallel planes.
    529  a_context - [in]
    530  pointer passed to the resultCallback() function.
    531  Returns:
    532  True if entire tree was searched. It is possible no results were found.
    533  Remarks:
    534  If you are using a Search() that uses a resultCallback() function,
    535  then return true to keep searching and false to terminate the search.
    536  */
    537  bool Search(
    538  const double a_plane_eqn[4],
    539  double a_min,
    540  double a_max,
    541  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id),
    542  void* a_context
    543  ) const;
    544 
    545  bool Search(
    546  const class ON_PlaneEquation& a_plane_eqn,
    547  double a_min,
    548  double a_max,
    549  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id),
    550  void* a_context
    551  ) const;
    552 
    553  bool Search(const double a_min[3], const double a_max[3],
    554  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id), void* a_context
    555  ) const;
    556 
    557  bool Search(const double a_min[3], const double a_max[3],
    558  ON_RTreeSearchResult& a_result
    559  ) const;
    560 
    561  bool Search(const double a_min[3], const double a_max[3],
    563  ) const;
    564 
    565  bool Search(const double a_min[3], const double a_max[3],
    566  ON_SimpleArray<void*>& a_result
    567  ) const;
    568 
    569  bool Search(const double a_min[3], const double a_max[3],
    570  ON_SimpleArray<int>& a_result
    571  ) const;
    572 
    573  bool Search2d(const double a_min[2], const double a_max[2],
    574  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id), void* a_context
    575  ) const;
    576 
    577  bool Search2d(const double a_min[2], const double a_max[2],
    578  ON_RTreeSearchResult& a_result
    579  ) const;
    580 
    581  bool Search2d(const double a_min[2], const double a_max[2],
    583  ) const;
    584 
    585  bool Search2d(const double a_min[2], const double a_max[2],
    586  ON_SimpleArray<void*>& a_result
    587  ) const;
    588 
    589  bool Search2d(const double a_min[2], const double a_max[2],
    590  ON_SimpleArray<int>& a_result
    591  ) const;
    592 
    593  /*
    594  Description:
    595  Search two R-trees for all pairs elements whose bounding boxes overlap.
    596  Parameters:
    597  a_rtreeA - [in]
    598  a_rtreeB - [in]
    599  tolerance - [in]
    600  If the distance between a pair of bounding boxes is <= tolerance,
    601  then the pair is added to a_result[].
    602  a_result - [out]
    603  Pairs of ids of elements who bounding boxes overlap.
    604  Returns:
    605  True if entire tree was searched. It is possible no results were found.
    606  Remarks:
    607  If you have a single R-tree and you want to find paris of distinct nodes whose
    608  bounding boxes overlap, then use the non-static
    609  ON_RTree::Search(double tolerance, ... results )
    610  member functions.
    611  */
    612  static bool Search(
    613  const ON_RTree& a_rtreeA,
    614  const ON_RTree& a_rtreeB,
    615  double tolerance,
    616  ON_SimpleArray<ON_2dex>& a_result
    617  );
    618 
    619  /*
    620  Description:
    621  Search two R-trees for all pairs elements whose bounding boxes overlap.
    622  Parameters:
    623  a_rtreeA - [in]
    624  a_rtreeB - [in]
    625  tolerance - [in]
    626  If the distance between a pair of bounding boxes is <= tolerance,
    627  then resultCallback() is called.
    628  resultCallback - [out]
    629  callback function
    630  a_context - [in] argument passed through to resultCallback().
    631  Returns:
    632  True if entire tree was searched. It is possible no results were found.
    633  Remarks:
    634  If you have a single R-tree and you want to find paris of distinct nodes whose
    635  bounding boxes overlap, then use the non-static
    636  ON_RTree::Search(double tolerance, ... results )
    637  member functions.
    638  */
    639  static bool Search(
    640  const ON_RTree& a_rtreeA,
    641  const ON_RTree& a_rtreeB,
    642  double tolerance,
    643  void ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB),
    644  void* a_context
    645  );
    646 
    647  /*
    648  Description:
    649  Search two R-trees for all pairs elements whose bounding boxes overlap.
    650  Parameters:
    651  a_rtreeA - [in]
    652  a_rtreeB - [in]
    653  tolerance - [in]
    654  If the distance between a pair of bounding boxes is <= tolerance,
    655  then resultCallback() is called.
    656  resultCallback - [out]
    657  callback function
    658  Return true for the search to continue and false to terminate the search.
    659  a_context - [in] argument passed through to resultCallback().
    660  Returns:
    661  True if entire tree was searched. It is possible no results were found.
    662  Remarks:
    663  If you have a single R-tree and you want to find paris of distinct nodes whose
    664  bounding boxes overlap, then use the non-static
    665  ON_RTree::Search(double tolerance, ... results )
    666  member functions.
    667  */
    668  static bool Search(
    669  const ON_RTree& a_rtreeA,
    670  const ON_RTree& a_rtreeB,
    671  double tolerance,
    672  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB),
    673  void* a_context
    674  );
    675 
    676 
    677  /*
    678  Description:
    679  Search two R-trees for all pairs elements whose bounding boxes overlap.
    680  The tolerance can be reduced by the callback function during the search.
    681  This version of search is well suited to finding closest points between
    682  two objects.
    683  Parameters:
    684  a_rtreeA - [in]
    685  a_rtreeB - [in]
    686  tolerance - [in]
    687  If the distance between a pair of bounding boxes is <= tolerance,
    688  then resultCallback() is called.
    689  resultCallback - [out]
    690  callback function
    691  Return true for the search to continue and false to terminate the search.
    692  The callback may reduce the value of the tolerance parameter during the search.
    693  Increasing the value of the tolerance or setting it to an invalid value is
    694  not supported and will lead to unpredictable results.
    695  a_context - [in] argument passed through to resultCallback().
    696  Returns:
    697  True if entire tree was searched. It is possible no results were found.
    698  Remarks:
    699  If you have a single R-tree and you want to find paris of distinct nodes whose
    700  bounding boxes overlap, then use the non-static
    701  ON_RTree::Search(double tolerance, ... results )
    702  member functions.
    703  */
    704  static bool Search(
    705  const ON_RTree& a_rtreeA,
    706  const ON_RTree& a_rtreeB,
    707  double tolerance,
    708  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB, double* tolerance),
    709  void* a_context
    710  );
    711 
    712 
    713  /*
    714  Description:
    715  Search a single R-tree for all pairs of distinct elements whose bounding boxes overlap.
    716  Parameters:
    717  tolerance - [in]
    718  If the distance between a pair of bounding boxes is <= tolerance,
    719  then the pair is added to a_result[].
    720  a_result - [out]
    721  Pairs of ids of elements who bounding boxes overlap.
    722  Returns:
    723  True if entire tree was searched. It is possible no results were found.
    724  */
    725  bool Search(
    726  double tolerance,
    727  ON_SimpleArray<ON_2dex>& a_result
    728  ) const;
    729 
    730  /*
    731  Description:
    732  Search a single R-tree for all pairs of distinct elements whose bounding boxes overlap.
    733  Parameters:
    734  tolerance - [in]
    735  If the distance between a pair of bounding boxes is <= tolerance,
    736  then resultCallback() is called.
    737  resultCallback - [out]
    738  callback function
    739  a_context - [in]
    740  argument passed through to resultCallback().
    741  Returns:
    742  True if entire tree was searched. It is possible no results were found.
    743  */
    744  bool Search(
    745  double tolerance,
    746  void ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB),
    747  void* a_context
    748  ) const;
    749 
    750  /*
    751  Description:
    752  Search a single R-tree for all pairs of distinct elements whose bounding boxes overlap.
    753  Parameters:
    754  tolerance - [in]
    755  If the distance between a pair of bounding boxes is <= tolerance,
    756  then resultCallback() is called.
    757  resultCallback - [out]
    758  callback function
    759  a_context - [in]
    760  argument passed through to resultCallback().
    761  Returns:
    762  True if entire tree was searched. It is possible no results were found.
    763  */
    764  bool Search(
    765  double tolerance,
    766  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB),
    767  void* a_context
    768  ) const;
    769 
    770  /*
    771  Description:
    772  Search a single R-tree for all pairs of distinct elements whose bounding boxes overlap.
    773  Parameters:
    774  tolerance - [in]
    775  If the distance between a pair of bounding boxes is <= tolerance,
    776  then resultCallback() is called.
    777  resultCallback - [out]
    778  callback function
    779  Return true for the search to continue and false to terminate the search.
    780  The callback may reduce the value of the tolerance parameter during the search.
    781  Increasing the value of the tolerance or setting it to an invalid value is
    782  not supported and will lead to unpredictable results.
    783  a_context - [in]
    784  argument passed through to resultCallback().
    785  Returns:
    786  True if entire tree was searched. It is possible no results were found.
    787  */
    788  bool Search(
    789  double tolerance,
    790  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB, double* tolerance),
    791  void* a_context
    792  ) const;
    793 
    794  /*
    795  Returns:
    796  Number of elements (leaves).
    797  Remark:
    798  No internal count is maintained, so this function traverses the
    799  tree to count the leaves. If efficiency is important, save the
    800  result.
    801  */
    802  int ElementCount();
    803 
    804  /*
    805  Returns:
    806  Pointer to the root node.
    807  */
    808  const ON_RTreeNode* Root() const;
    809 
    810  /*
    811  Returns:
    812  Bounding box of the entire R-tree;
    813  */
    814  ON_BoundingBox BoundingBox() const;
    815 
    816  /*
    817  Returns:
    818  Number of bytes of heap memory used by this R-tree.
    819  */
    820  size_t SizeOf() const;
    821 
    822 private:
    823  void SplitNode(ON_RTreeNode*, ON_RTreeBranch*, ON_RTreeNode**);
    824  bool AddBranch(ON_RTreeBranch*, ON_RTreeNode*, ON_RTreeNode**);
    825  bool InsertRectRec(ON_RTreeBBox*, ON__INT_PTR, ON_RTreeNode*, ON_RTreeNode**, int);
    826  bool InsertRect(ON_RTreeBBox*, ON__INT_PTR, ON_RTreeNode**, int);
    827  void LoadNodes(ON_RTreeNode*, ON_RTreeNode*, struct ON_RTreePartitionVars*);
    828  bool RemoveRect(ON_RTreeBBox*, ON__INT_PTR, ON_RTreeNode**);
    829  bool RemoveRectRec(ON_RTreeBBox*, ON__INT_PTR, ON_RTreeNode*, struct ON_RTreeListNode**);
    830  void ReInsert(ON_RTreeNode*, struct ON_RTreeListNode**);
    831  void RemoveAllRec(ON_RTreeNode*);
    832  ON_RTreeNode* m_root = nullptr;
    833  size_t m_reserved = 0;
    834  ON_RTreeMemPool m_mem_pool;
    835 };
    836 
    837 #endif
    Definition: opennurbs_rtree.h:90
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_RTREE_INC_)
    18 #define OPENNURBS_RTREE_INC_
    19 
    20 /*
    21 The opennurbs rtree code is a modifed version of the
    22 free and unrestricted R-tree implementation obtianed from
    23 http://www.superliminal.com/sources/sources.htm
    24 
    25 The first lines on the website indicate the code is free and unrestricted:
    26 
    27  Free Source Code
    28  Here are a few useful bits of free source code.
    29  You're completely free to use them for any purpose whatsoever.
    30  All I ask is that if you find one to be particularly valuable,
    31  then consider sending feedback. Please send bugs and suggestions too.
    32  Enjoy
    33 
    34 The readme.txt file included with the R-tree source says
    35 
    36  LICENSE:
    37  Entirely free for all uses. Enjoy!
    38 
    39 The original authors are
    40 
    41 AUTHORS
    42  * 1983 Original algorithm and test code by Antonin Guttman and Michael Stonebraker, UC Berkely
    43  * 1994 ANCI C ported from original test code by Melinda Green - melinda@superliminal.com
    44  * 1995 Sphere volume fix for degeneracy problem submitted by Paul Brook
    45  * 2004 Templated C++ port by Greg Douglas
    46 
    47 The opennurbs version adds some custom memory allocation and replaces
    48 the leaf iterator. The rest of the changes are cosmetic.
    49 
    50 */
    51 
    52 
    53 
    54 // Minimum and maximum number of elements
    55 // in ON_RTreeNode::m_branch[].
    56 // must have ON_RTree_MAX_NODE_COUNT > ON_RTree_MIN_NODE_COUNT
    57 #define ON_RTree_MIN_NODE_COUNT 2
    58 #define ON_RTree_MAX_NODE_COUNT 6
    59 
    60 /*
    61 In a test of a sphere mesh with mesh: 8385 vertices, 8192 polygons
    62 and ON_RTree_MAX_NODE_COUNT = 3, 4, 5, and 6, the memory use was
    63 most efficient with ON_RTree_MAX_NODE_COUNT=6
    64 
    65 Memory Usage MAX_NODE_COUNT = 3
    66  ON_RTree: 1212 KB (1241136) (352 wasted)
    67  ON_RTree: 7036 nodes, 5881 unused branches (321 KB) 0.835844 per node
    68 
    69 Memory Usage MAX_NODE_COUNT = 4
    70  ON_RTree: 1152 KB (1179720) (5568 wasted)
    71  ON_RTree: 5051 nodes, 6962 unused branches (380 KB) 1.37834 per node
    72 
    73 Memory Usage MAX_NODE_COUNT = 5
    74  ON_RTree: 1040 KB (1065504) (11808 wasted)
    75  ON_RTree: 3655 nodes, 6429 unused branches (351 KB) 1.75896 per node
    76 
    77 Memory Usage MAX_NODE_COUNT = 6
    78  ON_RTree: 995 KB (1019592) (3440 wasted)
    79  ON_RTree: 2951 nodes, 6564 unused branches (358 KB) 2.22433 per node
    80 */
    81 
    82 // This struct is used instead of ON_BoundingBox to avoid calling
    83 // constructors.
    85 {
    86  double m_min[3];
    87  double m_max[3];
    88 };
    89 
    91 {
    92  double m_point[3];
    93  double m_radius;
    94 };
    95 
    97 {
    98  double m_point[2][3];
    99  double m_radius;
    100  double m_domain[2];
    101 };
    102 
    104 {
    106 
    107  // If ON_RTreeNode.m_level > 0, then m_child points to a child node.
    108  // If ON_RTreeNode.m_level == 0, then m_id identifies the leaf element.
    109  union
    110  {
    112  ON__INT_PTR m_id;
    113  };
    114 };
    115 
    117 {
    119  ON__INT_PTR m_id;
    120 };
    121 
    122 // The ON_RTreeNode is used at root, branch and leaf nodes.
    123 // When m_level > 0, the node is a branch.
    124 // When m_level = 0, the node is a leaf.
    126 {
    127  inline bool IsInternalNode() const
    128  { return (m_level > 0); } // internal nodes have m_level > 0
    129  inline bool IsLeaf() const
    130  { return (m_level == 0); } // branch nodes have m_level = 0
    131 
    132  // m_level must be a signed int to insure signed compares work correctly
    133  int m_level; // =0 at leaf nodes, > 0 at branch nodes
    134 
    135  // The m_branch[] array contains m_count elements
    136  // 0 <= m_count <= ON_RTree_MAX_NODE_COUNT
    137  // m_count must be a signed int to insure signed compares work correctly
    138  int m_count;
    139  ON_RTreeBranch m_branch[ON_RTree_MAX_NODE_COUNT];
    140 };
    141 
    143 {
    144  int m_capacity; // m_id[] array capacity (search terminates when m_count == m_capacity)
    145  int m_count; // number of elements in m_id[]
    146  ON__INT_PTR* m_id; // m_id[] = array of search results.
    147 };
    148 
    149 class ON_CLASS ON_RTreeMemPool
    150 {
    151 public:
    152  static const ON_RTreeMemPool Empty;
    153 
    154  ON_RTreeMemPool() = default;
    155 
    156  ON_RTreeMemPool( size_t leaf_count );
    157  ~ON_RTreeMemPool();
    158 
    159  ON_RTreeNode* AllocNode();
    160  void FreeNode(ON_RTreeNode* node);
    161 
    162  struct ON_RTreeListNode* AllocListNode();
    163  void FreeListNode(struct ON_RTreeListNode* list_node);
    164 
    165  void DeallocateAll();
    166 
    167  /*
    168  Returns:
    169  Total number of bytes of heap memory allocated.
    170  */
    171  size_t SizeOf() const;
    172 
    173  /*
    174  Returns:
    175  Number of bytes of heap memory not currently in use.
    176  */
    177  size_t SizeOfUnusedBuffer() const;
    178 
    179 private:
    180  void GrowBuffer();
    181 
    182  struct Blk
    183  {
    184  struct Blk* m_next;
    185  };
    186 
    187  // linked list of unused ON_RTreeNode
    188  struct Blk* m_nodes = nullptr;
    189  // linked list of unused ON_RTreeListNode
    190  struct Blk* m_list_nodes = nullptr;
    191 
    192  // buffer for new allocations
    193  unsigned char* m_buffer = nullptr;
    194  size_t m_buffer_capacity = 0;
    195 
    196  struct Blk* m_blk_list = nullptr; // linked list used to free all allocated memory
    197  size_t m_sizeof_blk = 0; // total amount of memory in each block.
    198 
    199  size_t m_sizeof_heap = 0; // total amount of heap memory in this rtree
    200 };
    201 
    202 ////////////////////////////////////////////////////////////////
    203 //
    204 // ON_RTreeIterator
    205 //
    206 // The ON_RTreeIterator class can be used to iterate each leaf
    207 // in an ON_RTree.
    208 //
    209 class ON_CLASS ON_RTreeIterator
    210 {
    211 public:
    212  /*
    213  Description:
    214  Construct an empty iterator. Call Initialize() to attach
    215  the iterator to an R-tree.
    216  Remark:
    217  Any calls to ON_RTree::Insert() or ON_RTree::Remove() that modify
    218  an R-tree being iterated invalidate the iterator. The iterator
    219  must be re-initialized before being used again.
    220 
    221  There is no connection between the order elements are inserted
    222  in an R-tree and the order the elements are iterated by an
    223  iterator.
    224  */
    226  ON_RTreeIterator(const class ON_RTree& a_rtree);
    227 
    228  ~ON_RTreeIterator();
    229 
    230  /*
    231  Description:
    232  Initialize an iterator to iterate every leaf in the rtree.
    233  Parameters:
    234  a_rtree - [in]
    235  R-tree to iterate
    236  Example:
    237  See the comment for ON_RTreeIterator::First().
    238  Returns:
    239  True if a_rtree has at least one element.
    240  Remarks:
    241  Any calls to ON_RTree::Insert() or ON_RTree::Remove() that modify
    242  this node or its children will invalidate this iterator and it
    243  must be re-initialized.
    244 
    245  There is no connection between the order elements are inserted
    246  in an R-tree and the order the elements are iterated by an
    247  iterator.
    248  */
    249  bool Initialize(const class ON_RTree& a_rtree);
    250 
    251  /*
    252  Description:
    253  Initialize an iterator to iterate every leaf on or below a_node.
    254  Parameters:
    255  a_node - [in]
    256  R-tree node to iterate
    257  Example:
    258  See the comment for ON_RTreeIterator::First().
    259  Returns:
    260  True if a_node has at least one element.
    261  Remarks:
    262  Any calls to ON_RTree::Insert() or ON_RTree::Remove() that modify
    263  this node or its children will invalidate this iterator and it
    264  must be re-initialized.
    265 
    266  There is no connection between the order elements are inserted
    267  in an R-tree and the order the elements are iterated by an
    268  iterator.
    269  */
    270  bool Initialize(const struct ON_RTreeNode* a_node);
    271 
    272  /*
    273  Description:
    274  Get the value of the current leaf element. Calling Value()
    275  does not increment or decrement the iterator.
    276  Example:
    277  See the comment for ON_RTreeIterator::First().
    278  Return:
    279  Null pointer if there are no more leaves to iterate
    280  A pointer to the current R-tree leaf. When there are no more leaves,
    281  the returned pointer is null.
    282  */
    283  const ON_RTreeBranch* Value() const;
    284 
    285  /*
    286  Description:
    287  Reset the iterator so the current leaf is the first leaf in
    288  the R-tree. The Initialize() functions automatically do
    289  this, but First() can be called if an iterator needs to be
    290  used more than once or to make code easy to read and understand.
    291  Example:
    292  Iterate every leaf in an R-tree.
    293 
    294  ON_RTree rtree;
    295  ...
    296  ON_RtreeIterator rit(rtree);
    297  const ON_RTreeBranch* rtree_leaf;
    298  for ( rit.First(); 0 != (rtree_leaf = rit.Value()); rit.Next() )
    299  {
    300  // leaf id = rtree_leaf->m_id
    301  // leaf bounding box = rtree->m_rect
    302  }
    303 
    304  Returns:
    305  True if a call to Value() will return a non-null pointer.
    306  See Also:
    307  ON_RTreeIterator::Last();
    308  */
    309  bool First();
    310 
    311  /*
    312  Description:
    313  Increment the iterator to the next leaf in the R-tree.
    314  Example:
    315  See the comment for ON_RTreeIterator::First()
    316  Returns:
    317  True if a call to Value() will return a non-null pointer.
    318  False if there is not a next leaf and all susequent calls to
    319  Value() will return null.
    320  See Also:
    321  ON_RTreeIterator::Prev();
    322  */
    323  bool Next();
    324 
    325 
    326  /*
    327  Description:
    328  Set the iterator so the current leaf is the last leaf in the R-tree.
    329 
    330  Example:
    331  Iterate an R-tree in reverse order.
    332 
    333  ON_RTree rtree;
    334  ...
    335  ON_RTreeIterator rit(rtree);
    336  const ON_RTreeBranch* rtree_leaf;
    337  for ( rit.Last(); 0 != (rtree_leaf = rit.Value()); rit.Prev() )
    338  {
    339  // leaf id = rtree_leaf->m_id
    340  // leaf bounding box = rtree->m_rect
    341  }
    342 
    343  Returns:
    344  True if a call to Value() will return a non-null pointer.
    345  See Also:
    346  ON_RTreeIterator::First();
    347  */
    348  bool Last();
    349 
    350  /*
    351  Description:
    352  Decrement the iterator to the previous leaf in the R-tree.
    353  Example:
    354  See the comment for ON_RTreeIterator::Last()
    355  Returns:
    356  True if a call to Value() will return a non-null pointer.
    357  False if there is not a previous leaf and all susequent calls to
    358  Value() will return null.
    359  See Also:
    360  ON_RTreeIterator::Next();
    361  */
    362  bool Prev();
    363 
    364 private:
    365  enum { MAX_STACK = 32 }; // Max stack size. Allows almost n^32 where n is number of branches in node
    366 
    367  struct StackElement
    368  {
    369  const struct ON_RTreeNode* m_node;
    370  int m_branchIndex; // must be a signed int to insure signed compares work correctly
    371  };
    372 
    373  bool PushChildren(struct StackElement* sp, bool bFirstChild);
    374 
    375  StackElement m_stack[MAX_STACK]; // stack
    376  StackElement* m_sp; // stack pointer (null or points into m_stack[])
    377  const ON_RTreeNode* m_root; // root of tree being iterated
    378 };
    379 
    380 
    381 class ON_CLASS ON_RTree
    382 {
    383 public:
    384  static const ON_RTree Empty;
    385 
    386  ON_RTree( size_t leaf_count = 0 );
    387  ~ON_RTree();
    388 
    389  /*
    390  Description:
    391  Create an R-tree with an element for each face in the mesh.
    392  The element id is set to the index of the face.
    393  Parameters:
    394  mesh - [in]
    395  Returns:
    396  True if successful.
    397  */
    398  bool CreateMeshFaceTree( const class ON_Mesh* mesh );
    399 
    400  /*
    401  Description:
    402  Insert an element into the RTree.
    403  Parameters:
    404  a_min - [in]
    405  a_max - [in]
    406  3d bounding box of the element. The values in a_min[3] and a_max[3]
    407  must satisfy
    408  a_min[0] <= a_max[0],
    409  a_min[1] <= a_max[1], and
    410  a_min[1] <= a_max[1].
    411  a_dataId - [in]
    412  id of the element. This can be either a pointer or an integer id.
    413  Returns:
    414  True if element was successfully inserted.
    415  Remarks:
    416  Calling Insert() or Remove() invalidates any ON_RTreeIterator
    417  used to iterate this rtree.
    418  */
    419  bool Insert(const double a_min[3], const double a_max[3], void* a_element_id);
    420  bool Insert(const double a_min[3], const double a_max[3], int a_element_id);
    421  bool Insert2d(const double a_min[2], const double a_max[2], void* a_element_id);
    422  bool Insert2d(const double a_min[2], const double a_max[2], int a_element_id);
    423 
    424  /*
    425  Description:
    426  Remove an element from the RTree.
    427  Parameters:
    428  a_min - [in]
    429  a_max - [in]
    430  3d bounding box of the element. The values in a_min[3] and a_max[3]
    431  must satisfy
    432  a_min[0] <= a_max[0],
    433  a_min[1] <= a_max[1], and
    434  a_min[2] <= a_max[2].
    435  a_dataId - [in]
    436  id of the element. This can be either a pointer or an integer id.
    437  Returns:
    438  True if element was successfully removed.
    439  Remarks:
    440  Calling Insert() or Remove() invalidates any ON_RTreeIterator
    441  used to iterate this rtree.
    442  */
    443  bool Remove(const double a_min[3], const double a_max[3], void* a_elementId);
    444  bool Remove(const double a_min[3], const double a_max[3], int a_elementId);
    445  bool Remove2d(const double a_min[2], const double a_max[2], void* a_elementId);
    446  bool Remove2d(const double a_min[2], const double a_max[2], int a_elementId);
    447 
    448  /*
    449  Description:
    450  Remove all elements from the R-tree.
    451  */
    452  void RemoveAll();
    453 
    454  /*
    455  Description:
    456  Search the R-tree for all elements whose bounding boxes overlap
    457  a_rect.
    458  Parameters:
    459  a_rect - [in/out]
    460  The version of search that has ON_RTreeBBox* a_rect as the first
    461  argument, allows you to shrink the a_rect as the search progresses.
    462  This is useful for doing things like searching for closest points.
    463  If you want to shrink a_rect, you must use a_context to pass it
    464  to the resultCallback function and shrink it in the resultCallback
    465  function. In the callback, the modified rect must be contained
    466  in the previous rect.
    467  a_sphere - [in/out]
    468  The version of search that has ON_RTreeSphere* a_sphere as the first
    469  argument, allows you to shrink the a_sphere as the search progresses.
    470  This is useful for doing things like searching for closest points.
    471  If you want to shrink a_sphere, you must use a_context to pass it
    472  to the resultCallback function and shrink it in the resultCallback
    473  function. In the callback, the modified sphere must be contained
    474  in the previous sphere.
    475  a_capsule - [in/out]
    476  The version of search that has ON_RTreeSphere* a_capsule as the first
    477  argument, allows you to shrink the a_capsule as the search progresses.
    478  This is useful for doing things like searching for closest points.
    479  If you want to shrink a_capsule, you must use a_context to pass it
    480  to the resultCallback function and shrink it in the resultCallback
    481  function. In the callback, the modified capsule must be contained
    482  in the previous capsule.
    483  a_min - [in]
    484  a_max - [in]
    485  (a_min,a_max) is the bounding box of the search region.
    486  a_results - [out]
    487  The ids of elements that overlaps the search region.
    488  resultCallback - [in]
    489  A function to call when leaf nodes overlap.
    490  a_context - [in]
    491  pointer passed to the resultCallback() function.
    492  Returns:
    493  True if entire tree was searched. It is possible no results were found.
    494  Remarks:
    495  If you are using a Search() that uses a resultCallback() function,
    496  then return true to keep searching and false to terminate the search.
    497  */
    498  bool Search(
    499  ON_RTreeSphere* a_sphere,
    500  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id),
    501  void* a_context
    502  ) const;
    503 
    504  bool Search(
    505  ON_RTreeCapsule* a_capsule,
    506  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id),
    507  void* a_context
    508  ) const;
    509 
    510  bool Search(
    511  ON_RTreeBBox* a_rect,
    512  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id),
    513  void* a_context
    514  ) const;
    515 
    516  /*
    517  Description:
    518  Search the R-tree for all elements whose bounding boxes overlap
    519  the set of points between to parallel planes.
    520  Parameters:
    521  a_plane_eqn - [in]
    522  a_min - [in]
    523  a_max - [in]
    524  The region between the parallel planes is the set point points
    525  where the value of the plane equation is >= a_min and <= a_max.
    526  resultCallback - [in]
    527  A function to call when leaf nodes overlap the region between
    528  the parallel planes.
    529  a_context - [in]
    530  pointer passed to the resultCallback() function.
    531  Returns:
    532  True if entire tree was searched. It is possible no results were found.
    533  Remarks:
    534  If you are using a Search() that uses a resultCallback() function,
    535  then return true to keep searching and false to terminate the search.
    536  */
    537  bool Search(
    538  const double a_plane_eqn[4],
    539  double a_min,
    540  double a_max,
    541  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id),
    542  void* a_context
    543  ) const;
    544 
    545  bool Search(
    546  const class ON_PlaneEquation& a_plane_eqn,
    547  double a_min,
    548  double a_max,
    549  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id),
    550  void* a_context
    551  ) const;
    552 
    553  bool Search(const double a_min[3], const double a_max[3],
    554  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id), void* a_context
    555  ) const;
    556 
    557  bool Search(const double a_min[3], const double a_max[3],
    558  ON_RTreeSearchResult& a_result
    559  ) const;
    560 
    561  bool Search(const double a_min[3], const double a_max[3],
    563  ) const;
    564 
    565  bool Search(const double a_min[3], const double a_max[3],
    566  ON_SimpleArray<void*>& a_result
    567  ) const;
    568 
    569  bool Search(const double a_min[3], const double a_max[3],
    570  ON_SimpleArray<int>& a_result
    571  ) const;
    572 
    573  bool Search2d(const double a_min[2], const double a_max[2],
    574  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_id), void* a_context
    575  ) const;
    576 
    577  bool Search2d(const double a_min[2], const double a_max[2],
    578  ON_RTreeSearchResult& a_result
    579  ) const;
    580 
    581  bool Search2d(const double a_min[2], const double a_max[2],
    583  ) const;
    584 
    585  bool Search2d(const double a_min[2], const double a_max[2],
    586  ON_SimpleArray<void*>& a_result
    587  ) const;
    588 
    589  bool Search2d(const double a_min[2], const double a_max[2],
    590  ON_SimpleArray<int>& a_result
    591  ) const;
    592 
    593  /*
    594  Description:
    595  Search two R-trees for all pairs elements whose bounding boxes overlap.
    596  Parameters:
    597  a_rtreeA - [in]
    598  a_rtreeB - [in]
    599  tolerance - [in]
    600  If the distance between a pair of bounding boxes is <= tolerance,
    601  then the pair is added to a_result[].
    602  a_result - [out]
    603  Pairs of ids of elements who bounding boxes overlap.
    604  Returns:
    605  True if entire tree was searched. It is possible no results were found.
    606  Remarks:
    607  If you have a single R-tree and you want to find paris of distinct nodes whose
    608  bounding boxes overlap, then use the non-static
    609  ON_RTree::Search(double tolerance, ... results )
    610  member functions.
    611  */
    612  static bool Search(
    613  const ON_RTree& a_rtreeA,
    614  const ON_RTree& a_rtreeB,
    615  double tolerance,
    616  ON_SimpleArray<ON_2dex>& a_result
    617  );
    618 
    619  /*
    620  Description:
    621  Search two R-trees for all pairs elements whose bounding boxes overlap.
    622  Parameters:
    623  a_rtreeA - [in]
    624  a_rtreeB - [in]
    625  tolerance - [in]
    626  If the distance between a pair of bounding boxes is <= tolerance,
    627  then resultCallback() is called.
    628  resultCallback - [out]
    629  callback function
    630  a_context - [in] argument passed through to resultCallback().
    631  Returns:
    632  True if entire tree was searched. It is possible no results were found.
    633  Remarks:
    634  If you have a single R-tree and you want to find paris of distinct nodes whose
    635  bounding boxes overlap, then use the non-static
    636  ON_RTree::Search(double tolerance, ... results )
    637  member functions.
    638  */
    639  static bool Search(
    640  const ON_RTree& a_rtreeA,
    641  const ON_RTree& a_rtreeB,
    642  double tolerance,
    643  void ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB),
    644  void* a_context
    645  );
    646 
    647  /*
    648  Description:
    649  Search two R-trees for all pairs elements whose bounding boxes overlap.
    650  Parameters:
    651  a_rtreeA - [in]
    652  a_rtreeB - [in]
    653  tolerance - [in]
    654  If the distance between a pair of bounding boxes is <= tolerance,
    655  then resultCallback() is called.
    656  resultCallback - [out]
    657  callback function
    658  Return true for the search to continue and false to terminate the search.
    659  a_context - [in] argument passed through to resultCallback().
    660  Returns:
    661  True if entire tree was searched. It is possible no results were found.
    662  Remarks:
    663  If you have a single R-tree and you want to find paris of distinct nodes whose
    664  bounding boxes overlap, then use the non-static
    665  ON_RTree::Search(double tolerance, ... results )
    666  member functions.
    667  */
    668  static bool Search(
    669  const ON_RTree& a_rtreeA,
    670  const ON_RTree& a_rtreeB,
    671  double tolerance,
    672  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB),
    673  void* a_context
    674  );
    675 
    676 
    677  /*
    678  Description:
    679  Search two R-trees for all pairs elements whose bounding boxes overlap.
    680  The tolerance can be reduced by the callback function during the search.
    681  This version of search is well suited to finding closest points between
    682  two objects.
    683  Parameters:
    684  a_rtreeA - [in]
    685  a_rtreeB - [in]
    686  tolerance - [in]
    687  If the distance between a pair of bounding boxes is <= tolerance,
    688  then resultCallback() is called.
    689  resultCallback - [out]
    690  callback function
    691  Return true for the search to continue and false to terminate the search.
    692  The callback may reduce the value of the tolerance parameter during the search.
    693  Increasing the value of the tolerance or setting it to an invalid value is
    694  not supported and will lead to unpredictable results.
    695  a_context - [in] argument passed through to resultCallback().
    696  Returns:
    697  True if entire tree was searched. It is possible no results were found.
    698  Remarks:
    699  If you have a single R-tree and you want to find paris of distinct nodes whose
    700  bounding boxes overlap, then use the non-static
    701  ON_RTree::Search(double tolerance, ... results )
    702  member functions.
    703  */
    704  static bool Search(
    705  const ON_RTree& a_rtreeA,
    706  const ON_RTree& a_rtreeB,
    707  double tolerance,
    708  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB, double* tolerance),
    709  void* a_context
    710  );
    711 
    712 
    713  /*
    714  Description:
    715  Search a single R-tree for all pairs of distinct elements whose bounding boxes overlap.
    716  Parameters:
    717  tolerance - [in]
    718  If the distance between a pair of bounding boxes is <= tolerance,
    719  then the pair is added to a_result[].
    720  a_result - [out]
    721  Pairs of ids of elements who bounding boxes overlap.
    722  Returns:
    723  True if entire tree was searched. It is possible no results were found.
    724  */
    725  bool Search(
    726  double tolerance,
    727  ON_SimpleArray<ON_2dex>& a_result
    728  ) const;
    729 
    730  /*
    731  Description:
    732  Search a single R-tree for all pairs of distinct elements whose bounding boxes overlap.
    733  Parameters:
    734  tolerance - [in]
    735  If the distance between a pair of bounding boxes is <= tolerance,
    736  then resultCallback() is called.
    737  resultCallback - [out]
    738  callback function
    739  a_context - [in]
    740  argument passed through to resultCallback().
    741  Returns:
    742  True if entire tree was searched. It is possible no results were found.
    743  */
    744  bool Search(
    745  double tolerance,
    746  void ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB),
    747  void* a_context
    748  ) const;
    749 
    750  /*
    751  Description:
    752  Search a single R-tree for all pairs of distinct elements whose bounding boxes overlap.
    753  Parameters:
    754  tolerance - [in]
    755  If the distance between a pair of bounding boxes is <= tolerance,
    756  then resultCallback() is called.
    757  resultCallback - [out]
    758  callback function
    759  a_context - [in]
    760  argument passed through to resultCallback().
    761  Returns:
    762  True if entire tree was searched. It is possible no results were found.
    763  */
    764  bool Search(
    765  double tolerance,
    766  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB),
    767  void* a_context
    768  ) const;
    769 
    770  /*
    771  Description:
    772  Search a single R-tree for all pairs of distinct elements whose bounding boxes overlap.
    773  Parameters:
    774  tolerance - [in]
    775  If the distance between a pair of bounding boxes is <= tolerance,
    776  then resultCallback() is called.
    777  resultCallback - [out]
    778  callback function
    779  Return true for the search to continue and false to terminate the search.
    780  The callback may reduce the value of the tolerance parameter during the search.
    781  Increasing the value of the tolerance or setting it to an invalid value is
    782  not supported and will lead to unpredictable results.
    783  a_context - [in]
    784  argument passed through to resultCallback().
    785  Returns:
    786  True if entire tree was searched. It is possible no results were found.
    787  */
    788  bool Search(
    789  double tolerance,
    790  bool ON_CALLBACK_CDECL resultCallback(void* a_context, ON__INT_PTR a_idA, ON__INT_PTR a_idB, double* tolerance),
    791  void* a_context
    792  ) const;
    793 
    794  /*
    795  Returns:
    796  Number of elements (leaves).
    797  Remark:
    798  No internal count is maintained, so this function traverses the
    799  tree to count the leaves. If efficiency is important, save the
    800  result.
    801  */
    802  int ElementCount();
    803 
    804  /*
    805  Returns:
    806  Pointer to the root node.
    807  */
    808  const ON_RTreeNode* Root() const;
    809 
    810  /*
    811  Returns:
    812  Bounding box of the entire R-tree;
    813  */
    814  ON_BoundingBox BoundingBox() const;
    815 
    816  /*
    817  Returns:
    818  Number of bytes of heap memory used by this R-tree.
    819  */
    820  size_t SizeOf() const;
    821 
    822 private:
    823  void SplitNode(ON_RTreeNode*, ON_RTreeBranch*, ON_RTreeNode**);
    824  bool AddBranch(ON_RTreeBranch*, ON_RTreeNode*, ON_RTreeNode**);
    825  bool InsertRectRec(ON_RTreeBBox*, ON__INT_PTR, ON_RTreeNode*, ON_RTreeNode**, int);
    826  bool InsertRect(ON_RTreeBBox*, ON__INT_PTR, ON_RTreeNode**, int);
    827  void LoadNodes(ON_RTreeNode*, ON_RTreeNode*, struct ON_RTreePartitionVars*);
    828  bool RemoveRect(ON_RTreeBBox*, ON__INT_PTR, ON_RTreeNode**);
    829  bool RemoveRectRec(ON_RTreeBBox*, ON__INT_PTR, ON_RTreeNode*, struct ON_RTreeListNode**);
    830  void ReInsert(ON_RTreeNode*, struct ON_RTreeListNode**);
    831  void RemoveAllRec(ON_RTreeNode*);
    832  ON_RTreeNode* m_root = nullptr;
    833  size_t m_reserved = 0;
    834  ON_RTreeMemPool m_mem_pool;
    835 };
    836 
    837 #endif
    Definition: opennurbs_rtree.h:90
    Definition: opennurbs_rtree.h:142
    Definition: opennurbs_rtree.h:84
    ON_RTreeBBox m_rect
    Definition: opennurbs_rtree.h:118
    Definition: opennurbs_rtree.h:381
    -
    ON_RTreeBranch m_branch[ON_RTree_MAX_NODE_COUNT]
    Definition: opennurbs_rtree.h:139
    ON__INT_PTR m_id
    Definition: opennurbs_rtree.h:119
    Definition: opennurbs_array.h:36
    bool IsInternalNode() const
    internal nodes have m_level > 0
    Definition: opennurbs_rtree.h:127
    Definition: opennurbs_rtree.h:96
    int m_level
    m_level must be a signed int to insure signed compares work correctly
    Definition: opennurbs_rtree.h:133
    int m_count
    number of elements in m_id[]
    Definition: opennurbs_rtree.h:145
    -
    double m_point[3]
    Definition: opennurbs_rtree.h:92
    -
    double m_point[2][3]
    Definition: opennurbs_rtree.h:98
    Definition: opennurbs_rtree.h:125
    double m_min[3]
    Definition: opennurbs_rtree.h:86
    static const ON_RTreeMemPool Empty
    Definition: opennurbs_rtree.h:152
    @@ -98,7 +93,6 @@ $(function() {
    bool IsLeaf() const
    branch nodes have m_level = 0
    Definition: opennurbs_rtree.h:129
    Definition: opennurbs_rtree.h:103
    struct ON_RTreeNode * m_child
    Definition: opennurbs_rtree.h:111
    -
    double m_domain[2]
    Definition: opennurbs_rtree.h:100
    Definition: opennurbs_rtree.h:209
    double m_max[3]
    Definition: opennurbs_rtree.h:87
    Definition: opennurbs_point.h:1465
    @@ -108,9 +102,9 @@ $(function() {
    diff --git a/6/d9/dfc/class_o_n___font_metrics-members.html b/6/d9/dfc/class_o_n___font_metrics-members.html index dc7ccf4d..da3d360b 100644 --- a/6/d9/dfc/class_o_n___font_metrics-members.html +++ b/6/d9/dfc/class_o_n___font_metrics-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/da/d04/class_o_n___space_morph.html b/6/da/d04/class_o_n___space_morph.html index dab54ce7..d543e9b1 100644 --- a/6/da/d04/class_o_n___space_morph.html +++ b/6/da/d04/class_o_n___space_morph.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SpaceMorph Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Returns: True if the morph should be done in a way that preserves the structure of the geometry.
    - In particular, for NURBS objects, true means that only the control points are moved. Remarks: The value returned by PreserveStructure() does not affect the way meshes and points are morphed. The default is false.

    +

    Returns: True if the morph should be done in a way that preserves the structure of the geometry. In particular, for NURBS objects, true means that only the control points are moved. Remarks: The value returned by PreserveStructure() does not affect the way meshes and points are morphed. The default is false.

    @@ -383,9 +380,9 @@ Public Member Functions diff --git a/6/da/d08/class_o_n__2d_vector.html b/6/da/d08/class_o_n__2d_vector.html index e1f2a051..c5e80a0c 100644 --- a/6/da/d08/class_o_n__2d_vector.html +++ b/6/da/d08/class_o_n__2d_vector.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2dVector Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    ◆ operator<()

    +

    ◆ operator<()

    @@ -1701,7 +1699,7 @@ Static Public Attributes
    -

    ◆ operator<=()

    +

    ◆ operator<=()

    @@ -1933,7 +1931,7 @@ Static Public Attributes
    -

    ◆ operator>()

    +

    ◆ operator>()

    @@ -1951,7 +1949,7 @@ Static Public Attributes
    -

    ◆ operator>=()

    +

    ◆ operator>=()

    @@ -2473,9 +2471,9 @@ Static Public Attributes
    diff --git a/6/da/d08/class_o_n___object_array.html b/6/da/d08/class_o_n___object_array.html index 9900edad..985b45b8 100644 --- a/6/da/d08/class_o_n___object_array.html +++ b/6/da/d08/class_o_n___object_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ObjectArray< T > Class Template Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +

    virtual ON_ClassArray<T> override that calls MemoryRelocate on each element after the heap sort. QuickSort() is generally the better choice.

    -

    The "this->" in this->m_count and this->m_a are needed for gcc 4 to compile.
    - The MemoryRelocate step is required to synch userdata back pointers so the user data destructor will work correctly.

    +

    The "this->" in this->m_count and this->m_a are needed for gcc 4 to compile.

    +

    The MemoryRelocate step is required to synch userdata back pointers so the user data destructor will work correctly.

    Reimplemented from ON_ClassArray< T >.

    @@ -464,8 +462,8 @@ template<class T>

    virtual ON_ClassArray<T> override that calls MemoryRelocate on each element after the quick sort.

    -

    The "this->" in this->m_count and this->m_a are needed for gcc 4 to compile.
    - The MemoryRelocate step is required to synch userdata back pointers so the user data destructor will work correctly.

    +

    The "this->" in this->m_count and this->m_a are needed for gcc 4 to compile.

    +

    The MemoryRelocate step is required to synch userdata back pointers so the user data destructor will work correctly.

    Reimplemented from ON_ClassArray< T >.

    @@ -516,9 +514,9 @@ template<class T>
    diff --git a/6/da/d13/class_o_n___unit_system-members.html b/6/da/d13/class_o_n___unit_system-members.html index 1449dfec..c94d4c18 100644 --- a/6/da/d13/class_o_n___unit_system-members.html +++ b/6/da/d13/class_o_n___unit_system-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d2a/class_o_n___matrix-members.html b/6/da/d2a/class_o_n___matrix-members.html index a9fab83f..8263e4bf 100644 --- a/6/da/d2a/class_o_n___matrix-members.html +++ b/6/da/d2a/class_o_n___matrix-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d34/class_o_n___mesh_component_ref-members.html b/6/da/d34/class_o_n___mesh_component_ref-members.html index fc48a560..e6c7a719 100644 --- a/6/da/d34/class_o_n___mesh_component_ref-members.html +++ b/6/da/d34/class_o_n___mesh_component_ref-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d39/opennurbs__material_8h_source.html b/6/da/d39/opennurbs__material_8h_source.html index b334a47c..ce521c22 100644 --- a/6/da/d39/opennurbs__material_8h_source.html +++ b/6/da/d39/opennurbs__material_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_material.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_material.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_material.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_MATERIAL_INC_)
    18 #define OPENNURBS_MATERIAL_INC_
    19 
    20 
    21 ///////////////////////////////////////////////////////////////////////////////
    22 //
    23 // Class ON_Material
    24 //
    25 class ON_CLASS ON_Material : public ON_ModelComponent
    26 {
    27  ON_OBJECT_DECLARE(ON_Material);
    28 
    29 public:
    30  static const double MaxShine; // maximum value of shine exponent = 255.0
    31 
    32  static const ON_Material Unset; // nil id
    33  static const ON_Material Default; // persistent id
    34 
    35  /*
    36  Parameters:
    37  model_component_reference - [in]
    38  none_return_value - [in]
    39  value to return if ON_Material::Cast(model_component_ref.ModelComponent())
    40  is nullptr
    41  Returns:
    42  If ON_Material::Cast(model_component_ref.ModelComponent()) is not nullptr,
    43  that pointer is returned. Otherwise, none_return_value is returned.
    44  */
    45  static const ON_Material* FromModelComponentRef(
    46  const class ON_ModelComponentReference& model_component_reference,
    47  const ON_Material* none_return_value
    48  );
    49 
    50  // compare everything except Index() value.
    51  static int Compare(
    52  const ON_Material& a,
    53  const ON_Material& b
    54  );
    55 
    56  // compare Id(), Name(), m_rdk_material_instance_id
    57  static int CompareNameAndIds(
    58  const ON_Material& a,
    59  const ON_Material& b
    60  );
    61 
    62  // Compare all settings (color, reflection, texture, plug-in id)
    63  // that effect the appearance.
    64  // Ignore Index(), Id(), Name(), m_rdk_material_instance_id.
    65  static int CompareAppearance(
    66  const ON_Material& a,
    67  const ON_Material& b
    68  );
    69 
    70  static int CompareColorAttributes(
    71  const ON_Material& a,
    72  const ON_Material& b
    73  );
    74 
    75  static int CompareReflectionAttributes(
    76  const ON_Material& a,
    77  const ON_Material& b
    78  );
    79 
    80  static int CompareTextureAttributes(
    81  const ON_Material& a,
    82  const ON_Material& b
    83  );
    84 
    85 
    86 
    87  /*
    88  Parameters:
    89  fresnel_index_of_refraction - [in]
    90  ON_Material::Material::Default.m_fresnel_index_of_refraction
    91  is a good default
    92  N - [in]
    93  3d surface normal
    94  R - [in]
    95  3d reflection direction
    96  Returns:
    97  1.0:
    98  The input values were not valid or the calculation failed due to
    99  a divide by zero or some other numerical arithmetic failure.
    100  fresnel reflection coefficient
    101  1/2 * ((g-c)/(g+c))^2 * (1 + ( (c*(g+c) -1)/(c*(g+c) + 1) )^2)
    102  where
    103  c = N o (N-R); // c = 3d vector dot product of N and (N-R)
    104  and
    105  g = sqrt(fresnel_index_of_refraction*fresnel_index_of_refraction + c*c - 1.0).
    106  */
    107  static double FresnelReflectionCoefficient(
    108  double fresnel_index_of_refraction,
    109  const double N[3],
    110  const double R[3]
    111  );
    112 
    113 public:
    114  ON_Material() ON_NOEXCEPT;
    115  ON_Material(const ON_Material& src);
    116  ~ON_Material() = default;
    117  ON_Material& operator=(const ON_Material& src) = default;
    118 
    119 private:
    120  void Internal_CopyFrom(
    121  const ON_Material& src
    122  );
    123 
    124 public:
    125  /////////////////////////////////////////////////////////////////
    126  // ON_Object overrides
    127  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    128 
    129  void Dump(
    130  ON_TextLog& text_log
    131  ) const override;
    132 
    133  bool Write(
    134  ON_BinaryArchive& archive
    135  ) const override;
    136 
    137  bool Read(
    138  ON_BinaryArchive& archive
    139  ) override;
    140 
    141  ON::object_type ObjectType() const override;
    142 
    143  /////////////////////////////////////////////////////////////////
    144  // Interface
    145 
    146  ON_Color Ambient() const;
    147  ON_Color Diffuse() const;
    148  ON_Color Emission() const;
    149  ON_Color Specular() const;
    150 
    151  void SetAmbient( ON_Color );
    152  void SetDiffuse( ON_Color );
    153  void SetEmission( ON_Color );
    154  void SetSpecular( ON_Color );
    155 
    156  // Shine values are in range 0.0 to ON_Material::MaxShine
    157  double Shine() const;
    158  void SetShine( double ); // 0 to ON_Material::MaxShine
    159 
    160  // Transparency values are in range 0.0 = opaque to 1.0 = transparent
    161  double Transparency() const;
    162  void SetTransparency( double ); // 0.0 = opaque, 1.0 = transparent
    163 
    164  // Transparency values are in range 0.0 = opaque to 1.0 = transparent
    165  double Reflectivity() const;
    166  void SetReflectivity( double ); // 0.0 = opaque, 1.0 = transparent
    167 
    168  // ID of the last plug-in to modify this material
    169  ON_UUID MaterialPlugInId() const;
    170  void SetMaterialPlugInId(
    171  ON_UUID plugin_id
    172  );
    173 
    174 public:
    175  /*
    176  Description:
    177  Get the RDK material id.
    178  Returns:
    179  The RDK material id for this material.
    180  Remarks:
    181  The RDK material id identifies a material definition managed by
    182  the RDK (rendering development kit). Multiple materials in
    183  a Rhino or opennurbs model can reference the same RDK material.
    184  */
    185  ON_UUID RdkMaterialInstanceId() const;
    186 
    187  /*
    188  Description:
    189  Set this material's RDK material id.
    190  Parameters:
    191  rdk_material_id - [in]
    192  RDK material id value.
    193  Remarks:
    194  The RDK material id identifies a material definition managed by
    195  the RDK (rendering development kit). Multiple materials in
    196  a Rhino or opennurbs model can reference the same RDK material.
    197  */
    198  void SetRdkMaterialInstanceId(
    199  ON_UUID rdk_material_instance_id
    200  );
    201 
    202  bool RdkMaterialInstanceIdIsNotNil() const;
    203  bool RdkMaterialInstanceIdIsNil() const;
    204 
    205  /*
    206  Returns:
    207  True if the material can be shared.
    208  Remarks:
    209  If true, when an object using this material is copied,
    210  the copy references the same material.
    211  */
    212  bool Shareable() const;
    213  void SetShareable(
    214  bool bShareable
    215  );
    216 
    217  /*
    218  Returns:
    219  True if lighting is disabled.
    220  Remarks:
    221  True means render this object without
    222  applying any modulation based on lights.
    223  Basically, the diffuse, ambient, specular and
    224  emissive channels get combined additively, clamped,
    225  and then get treated as an emissive channel.
    226  Another way to think about it is when
    227  m_bDisableLighting is true, render the same way
    228  OpenGL does when ::glDisable( GL_LIGHTING ) is called.
    229  */
    230  bool DisableLighting() const;
    231 
    232  void SetDisableLighting(
    233  bool bDisableLighting
    234  );
    235 
    236  //If m_bUseDiffuseTextureAlphaForObjectTransparencyTexture is true, the alpha channel
    237  //of the texture in m_textures with m_type=bitmap_texture is used in addition to any
    238  //textures with m_type=transparency_texture.
    239  bool UseDiffuseTextureAlphaForObjectTransparencyTexture() const;
    240  void SetUseDiffuseTextureAlphaForObjectTransparencyTexture(
    241  bool bUseDiffuseTextureAlphaForObjectTransparencyTexture
    242  );
    243 
    244  //////////////////////////////////////////////////////////////
    245  //
    246  // Reflection and Refraction settings
    247  //
    248 
    249  // The bool m_bFresnelReflections enables fresnel scaling
    250  // of reflection contributions to the diffuse color.
    251  // True:
    252  // The fresnel term is used to scale the reflection contribution
    253  // before addition to the diffuse component.
    254  // False:
    255  // The reflection contribution is simply added to the diffuse component.
    256  bool FresnelReflections() const;
    257  void SetFresnelReflections(
    258  bool bFresnelReflections
    259  );
    260 
    261 
    262 private:
    263  // The value of m_rdk_material_id idetifies an RDK (rendering development kit)
    264  // material. Multiple materials in a Rhino model can refer to the same
    265  // RDK material id. In V5 this value is stored in user data. In V6 it is
    266  // saved in the m_rdk_material_id field.
    267  ON_UUID m_rdk_material_instance_id = ON_nil_uuid;
    268 
    269 public:
    270  ON_Color m_ambient = ON_Color::Black;
    271  ON_Color m_diffuse = ON_Color::Gray126;
    272  ON_Color m_emission = ON_Color::Black;
    273  ON_Color m_specular = ON_Color::White;
    274  ON_Color m_reflection = ON_Color::White;
    275  ON_Color m_transparent = ON_Color::White;
    276 
    277 private:
    278  bool m_bShareable = false;
    279 
    280 private:
    281  bool m_bDisableLighting = false;
    282 
    283 private:
    284  bool m_bUseDiffuseTextureAlphaForObjectTransparencyTexture = false;
    285 
    286 private:
    287  bool m_bFresnelReflections = false;
    288 
    289 private:
    290  unsigned int m_reserved1 = 0;
    291 
    292 public:
    293  double m_reflectivity = 0.0; // 0.0 = none, 1.0 = 100%
    294  double m_shine = 0.0; // 0.0 = none to GetMaxShine()=maximum
    295  double m_transparency = 0.0; // 0.0 = opaque to 1.0 = transparent (1.0-alpha)
    296 
    297  /*
    298  m_reflection_glossiness:
    299  Default is 0.0.
    300  Values from 0.0 to 1.0 make sense.
    301  - 0.0 reflections are perfectly specular.
    302  - t > 0.0 permits reflection ray direction to vary
    303  from the specular direction by up to t*pi/2.
    304  */
    305  double m_reflection_glossiness = 0.0;
    306 
    307  /*
    308  m_refraction_glossiness:
    309  Default is 0.0.
    310  Values from 0.0 to 1.0 make sense.
    311  - 0.0 refractions are perfectly specular.
    312  - t > 0.0 permits refraction ray direction to vary
    313  from the specular direction by up to t*pi/2.
    314  */
    315  double m_refraction_glossiness = 0.0;
    316 
    317  /*
    318  m_index_of_refraction:
    319  Default is 1.0.
    320  Physically, the index of refraction is >= 1.0 and is
    321  the value (speed of light in vacum)/(speed of light in material).
    322  Some rendering algorithms set m_index_of_refraction to zero or
    323  values < 1.0 to generate desirable effects.
    324  */
    325  double m_index_of_refraction = 1.0;
    326 
    327  /*
    328  m_fresnel_index_of_refraction:
    329  Default is 1.56.
    330  This is the value ON:Material::FresnelReflectionCoefficient() passes
    331  as the first parameter to ON_FresnelReflectionCoefficient().
    332  - Glass material types can be simulated with
    333  m_index_of_refraction ~ 1.56
    334  m_fresnel_index_of_refraction ~ 1.56
    335  - Thin glass can be simulated with
    336  m_fresnel_index_of_refraction = 1.56
    337  m_index_of_refraction = 0.0
    338  - Porcelain type materials can be simulated with
    339  m_fresnel_index_of_refraction = 1.56
    340  m_index_of_refraction = 1.0
    341  m_transparency = 0.0
    342  */
    343  double m_fresnel_index_of_refraction = 1.56;
    344 
    345  /*
    346  Parameters:
    347  N - [in]
    348  3d surface normal
    349  R - [in]
    350  3d reflection direction
    351  Returns:
    352  If m_bFresnelReflections is false, then 1.0 is returned.
    353  If m_bFresnelReflections is true, then the value of the fresnel
    354  reflection coefficient is returned. In typical rendering applications,
    355  the reflection term is multiplied by the fresnel reflection coefficient
    356  before it is added to the diffuse color.
    357  If any input is not valid or the calculation fails, then 1.0 is returned.
    358  Remarks:
    359  When m_bFresnelReflections is true, the calculation is performed by
    360  calling ON_FresnelReflectionCoefficient() with m_fresnel_index_of_refraction
    361  as the fresnel index of refraction.
    362  */
    363  double FresnelReflectionCoefficient(
    364  ON_3dVector N,
    365  ON_3dVector R
    366  ) const;
    367 
    368  /*
    369  Description:
    370  Searches for a texure with matching texture_id.
    371  If more than one texture matches, the first match
    372  is returned.
    373  Parameters:
    374  texture_id - [in]
    375  Returns:
    376  >=0 m_textures[] index of matching texture
    377  -1 if no match is found.
    378  */
    379  int FindTexture(
    380  ON_UUID texture_id
    381  ) const;
    382 
    383  /*
    384  Description:
    385  Searches for a texure with matching filename and type.
    386  If more than one texture matches, the first match
    387  is returned.
    388  Parameters:
    389  filename - [in] If nullptr, then any filename matches.
    390  type - [in] If ON_Texture::no_texture_type, then
    391  any texture type matches.
    392  i0 - [in] If i0 is < 0, the search begins at
    393  m_textures[0], if i0 >= m_textures.Count(),
    394  -1 is returnd, otherwise, the search begins
    395  at m_textures[i0+1].
    396  Example:
    397  Iterate through all the the bitmap textures on
    398  a material.
    399 
    400  ON_Material& mat = ...;
    401  int ti = -1;
    402  int bitmap_texture_count = 0;
    403  for(;;)
    404  {
    405  ti = mat.FindTexture(
    406  nullptr,
    407  ON_Texture::TYPE::bitmap_texture,
    408  ti );
    409 
    410  if ( ti < 0 )
    411  {
    412  // no more bitmap textures
    413  break;
    414  }
    415 
    416  // we have a bitmap texture
    417  bitmap_texture_count++;
    418  const ON_Texture& bitmap_texture = mat.m_textures[ti];
    419  ...
    420  }
    421 
    422  Returns:
    423  >=0 m_textures[] index of matching texture
    424  -1 if no match is found.
    425  */
    426  int FindTexture(
    427  const wchar_t* filename,
    428  ON_Texture::TYPE type,
    429  int i0 = -1
    430  ) const;
    431 
    432  /*
    433  Description:
    434  If there is already a texture with the same file name and
    435  type, then that texture is modified, otherwise a new texture
    436  is added. If tx has user data, the user data is copied
    437  to the m_textures[] element.
    438  Parameters:
    439  tx - [in]
    440  Returns:
    441  Index of the added texture in the m_textures[] array.
    442  Remarks:
    443  This is intended to be a quick and simple way to add
    444  textures to the material. If you need to do something
    445  different, then just work on the m_textures[] array.
    446  */
    447  int AddTexture(
    448  const ON_Texture& tx
    449  );
    450 
    451  /*
    452  Description:
    453  If there is a texture with a matching type, that texture's
    454  filename is modified, otherwise a new texture is added.
    455  Parameters:
    456  filename - [in] new filename
    457  type - [in]
    458  Returns:
    459  Index of the added texture in the m_textures[] array.
    460  Remarks:
    461  This is intended to be a quick and simple way to add
    462  textures to the material. If you need to do something
    463  different, then just work on the m_textures[] array.
    464  */
    465  int AddTexture(
    466  const wchar_t* filename,
    467  ON_Texture::TYPE type
    468  );
    469 
    470  /*
    471  Description:
    472  Deletes all texures with matching filenames and types.
    473  Parameters:
    474  filename - [in] If nullptr, then any filename matches.
    475  type - [in] If ON_Texture::no_texture_type, then
    476  any texture type matches.
    477  Returns:
    478  Number of textures deleted.
    479  */
    480  int DeleteTexture(
    481  const wchar_t* filename,
    482  ON_Texture::TYPE type
    483  );
    484 
    486 
    487  /*
    488  Description:
    489  Used to provide per face material support.
    490  The parent object reference a basic material.
    491  When a brep face or mesh facet wants to use
    492  a material besides the base material, it specifies
    493  a channelSupports material channel. The default
    494  material channel is 0 and that indicates the base
    495  material. A channel of n > 0 means that face
    496  used the material with id m_material_channel[n-1].
    497  If (n-1) >= m_material_channel.Count(), then the base
    498  material is used. The value of
    499  m_material_channel[n].m_id is persistent. The
    500  value of m_material_channel[n].m_i is a runtime
    501  index in the CRhinoDoc::m_material_table[]. If
    502  CRhinoDoc::m_material_table[m_i].m_uuid != m_id,
    503  then m_id is assumed to be correct.
    504  */
    505  ON_SimpleArray<ON_UuidIndex> m_material_channel;
    506 
    507 private:
    508  ON_UUID m_plugin_id = ON_nil_uuid;
    509 
    510 private:
    511  bool Internal_ReadV3( ON_BinaryArchive& archive, int minor_version );
    512  bool Internal_WriteV3( ON_BinaryArchive& archive ) const;
    513  bool Internal_ReadV5( ON_BinaryArchive& archive );
    514  bool Internal_WriteV5( ON_BinaryArchive& archive ) const;
    515 };
    516 
    517 ON_DECL
    518 bool operator==(const ON_Material&, const ON_Material&);
    519 
    520 ON_DECL
    521 bool operator!=(const ON_Material&, const ON_Material&);
    522 
    523 #if defined(ON_DLL_TEMPLATE)
    524 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Material*>;
    525 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_Material*>;
    526 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_Material>;
    527 
    528 // NO! // ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Material>;
    529 // It is a serious error to have an ON_ClassArray<ON_Material> and crashes
    530 // will occur when user data back pointers are not updated.
    531 #endif
    532 
    533 #endif
    534 
    static const ON_Material Unset
    nil id
    Definition: opennurbs_material.h:32
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_MATERIAL_INC_)
    18 #define OPENNURBS_MATERIAL_INC_
    19 
    20 
    21 ///////////////////////////////////////////////////////////////////////////////
    22 //
    23 // Class ON_Material
    24 //
    25 class ON_CLASS ON_Material : public ON_ModelComponent
    26 {
    27  ON_OBJECT_DECLARE(ON_Material);
    28 
    29 public:
    30  static const double MaxShine; // maximum value of shine exponent = 255.0
    31 
    32  static const ON_Material Unset; // nil id
    33  static const ON_Material Default; // persistent id
    34 
    35  /*
    36  Parameters:
    37  model_component_reference - [in]
    38  none_return_value - [in]
    39  value to return if ON_Material::Cast(model_component_ref.ModelComponent())
    40  is nullptr
    41  Returns:
    42  If ON_Material::Cast(model_component_ref.ModelComponent()) is not nullptr,
    43  that pointer is returned. Otherwise, none_return_value is returned.
    44  */
    45  static const ON_Material* FromModelComponentRef(
    46  const class ON_ModelComponentReference& model_component_reference,
    47  const ON_Material* none_return_value
    48  );
    49 
    50  // compare everything except Index() value.
    51  static int Compare(
    52  const ON_Material& a,
    53  const ON_Material& b
    54  );
    55 
    56  // compare Id(), Name(), m_rdk_material_instance_id
    57  static int CompareNameAndIds(
    58  const ON_Material& a,
    59  const ON_Material& b
    60  );
    61 
    62  // Compare all settings (color, reflection, texture, plug-in id)
    63  // that effect the appearance.
    64  // Ignore Index(), Id(), Name(), m_rdk_material_instance_id.
    65  static int CompareAppearance(
    66  const ON_Material& a,
    67  const ON_Material& b
    68  );
    69 
    70  static int CompareColorAttributes(
    71  const ON_Material& a,
    72  const ON_Material& b
    73  );
    74 
    75  static int CompareReflectionAttributes(
    76  const ON_Material& a,
    77  const ON_Material& b
    78  );
    79 
    80  static int CompareTextureAttributes(
    81  const ON_Material& a,
    82  const ON_Material& b
    83  );
    84 
    85 
    86 
    87  /*
    88  Parameters:
    89  fresnel_index_of_refraction - [in]
    90  ON_Material::Material::Default.m_fresnel_index_of_refraction
    91  is a good default
    92  N - [in]
    93  3d surface normal
    94  R - [in]
    95  3d reflection direction
    96  Returns:
    97  1.0:
    98  The input values were not valid or the calculation failed due to
    99  a divide by zero or some other numerical arithmetic failure.
    100  fresnel reflection coefficient
    101  1/2 * ((g-c)/(g+c))^2 * (1 + ( (c*(g+c) -1)/(c*(g+c) + 1) )^2)
    102  where
    103  c = N o (N-R); // c = 3d vector dot product of N and (N-R)
    104  and
    105  g = sqrt(fresnel_index_of_refraction*fresnel_index_of_refraction + c*c - 1.0).
    106  */
    107  static double FresnelReflectionCoefficient(
    108  double fresnel_index_of_refraction,
    109  const double N[3],
    110  const double R[3]
    111  );
    112 
    113 public:
    114  ON_Material() ON_NOEXCEPT;
    115  ON_Material(const ON_Material& src);
    116  ~ON_Material() = default;
    117  ON_Material& operator=(const ON_Material& src) = default;
    118 
    119 private:
    120  void Internal_CopyFrom(
    121  const ON_Material& src
    122  );
    123 
    124 public:
    125  /////////////////////////////////////////////////////////////////
    126  // ON_Object overrides
    127  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    128 
    129  void Dump(
    130  ON_TextLog& text_log
    131  ) const override;
    132 
    133  bool Write(
    134  ON_BinaryArchive& archive
    135  ) const override;
    136 
    137  bool Read(
    138  ON_BinaryArchive& archive
    139  ) override;
    140 
    141  ON::object_type ObjectType() const override;
    142 
    143  /////////////////////////////////////////////////////////////////
    144  // Interface
    145 
    146  ON_Color Ambient() const;
    147  ON_Color Diffuse() const;
    148  ON_Color Emission() const;
    149  ON_Color Specular() const;
    150 
    151  void SetAmbient( ON_Color );
    152  void SetDiffuse( ON_Color );
    153  void SetEmission( ON_Color );
    154  void SetSpecular( ON_Color );
    155 
    156  // Shine values are in range 0.0 to ON_Material::MaxShine
    157  double Shine() const;
    158  void SetShine( double ); // 0 to ON_Material::MaxShine
    159 
    160  // Transparency values are in range 0.0 = opaque to 1.0 = transparent
    161  double Transparency() const;
    162  void SetTransparency( double ); // 0.0 = opaque, 1.0 = transparent
    163 
    164  // Transparency values are in range 0.0 = opaque to 1.0 = transparent
    165  double Reflectivity() const;
    166  void SetReflectivity( double ); // 0.0 = opaque, 1.0 = transparent
    167 
    168  // ID of the last plug-in to modify this material
    169  ON_UUID MaterialPlugInId() const;
    170  void SetMaterialPlugInId(
    171  ON_UUID plugin_id
    172  );
    173 
    174 public:
    175  /*
    176  Description:
    177  Get the RDK material id.
    178  Returns:
    179  The RDK material id for this material.
    180  Remarks:
    181  The RDK material id identifies a material definition managed by
    182  the RDK (rendering development kit). Multiple materials in
    183  a Rhino or opennurbs model can reference the same RDK material.
    184  */
    185  ON_UUID RdkMaterialInstanceId() const;
    186 
    187  /*
    188  Description:
    189  Set this material's RDK material id.
    190  Parameters:
    191  rdk_material_id - [in]
    192  RDK material id value.
    193  Remarks:
    194  The RDK material id identifies a material definition managed by
    195  the RDK (rendering development kit). Multiple materials in
    196  a Rhino or opennurbs model can reference the same RDK material.
    197  */
    198  void SetRdkMaterialInstanceId(
    199  ON_UUID rdk_material_instance_id
    200  );
    201 
    202  bool RdkMaterialInstanceIdIsNotNil() const;
    203  bool RdkMaterialInstanceIdIsNil() const;
    204 
    205  /*
    206  Returns:
    207  True if the material can be shared.
    208  Remarks:
    209  If true, when an object using this material is copied,
    210  the copy references the same material.
    211  */
    212  bool Shareable() const;
    213  void SetShareable(
    214  bool bShareable
    215  );
    216 
    217  /*
    218  Returns:
    219  True if lighting is disabled.
    220  Remarks:
    221  True means render this object without
    222  applying any modulation based on lights.
    223  Basically, the diffuse, ambient, specular and
    224  emissive channels get combined additively, clamped,
    225  and then get treated as an emissive channel.
    226  Another way to think about it is when
    227  m_bDisableLighting is true, render the same way
    228  OpenGL does when ::glDisable( GL_LIGHTING ) is called.
    229  */
    230  bool DisableLighting() const;
    231 
    232  void SetDisableLighting(
    233  bool bDisableLighting
    234  );
    235 
    236  //If m_bUseDiffuseTextureAlphaForObjectTransparencyTexture is true, the alpha channel
    237  //of the texture in m_textures with m_type=bitmap_texture is used in addition to any
    238  //textures with m_type=transparency_texture.
    239  bool UseDiffuseTextureAlphaForObjectTransparencyTexture() const;
    240  void SetUseDiffuseTextureAlphaForObjectTransparencyTexture(
    241  bool bUseDiffuseTextureAlphaForObjectTransparencyTexture
    242  );
    243 
    244  //////////////////////////////////////////////////////////////
    245  //
    246  // Reflection and Refraction settings
    247  //
    248 
    249  // The bool m_bFresnelReflections enables fresnel scaling
    250  // of reflection contributions to the diffuse color.
    251  // True:
    252  // The fresnel term is used to scale the reflection contribution
    253  // before addition to the diffuse component.
    254  // False:
    255  // The reflection contribution is simply added to the diffuse component.
    256  bool FresnelReflections() const;
    257  void SetFresnelReflections(
    258  bool bFresnelReflections
    259  );
    260 
    261 
    262 private:
    263  // The value of m_rdk_material_id idetifies an RDK (rendering development kit)
    264  // material. Multiple materials in a Rhino model can refer to the same
    265  // RDK material id. In V5 this value is stored in user data. In V6 it is
    266  // saved in the m_rdk_material_id field.
    267  ON_UUID m_rdk_material_instance_id = ON_nil_uuid;
    268 
    269 public:
    270  ON_Color m_ambient = ON_Color::Black;
    271  ON_Color m_diffuse = ON_Color::Gray126;
    272  ON_Color m_emission = ON_Color::Black;
    273  ON_Color m_specular = ON_Color::White;
    274  ON_Color m_reflection = ON_Color::White;
    275  ON_Color m_transparent = ON_Color::White;
    276 
    277 private:
    278  bool m_bShareable = false;
    279 
    280 private:
    281  bool m_bDisableLighting = false;
    282 
    283 private:
    284  bool m_bUseDiffuseTextureAlphaForObjectTransparencyTexture = false;
    285 
    286 private:
    287  bool m_bFresnelReflections = false;
    288 
    289 private:
    290  unsigned int m_reserved1 = 0;
    291 
    292 public:
    293  double m_reflectivity = 0.0; // 0.0 = none, 1.0 = 100%
    294  double m_shine = 0.0; // 0.0 = none to GetMaxShine()=maximum
    295  double m_transparency = 0.0; // 0.0 = opaque to 1.0 = transparent (1.0-alpha)
    296 
    297  /*
    298  m_reflection_glossiness:
    299  Default is 0.0.
    300  Values from 0.0 to 1.0 make sense.
    301  - 0.0 reflections are perfectly specular.
    302  - t > 0.0 permits reflection ray direction to vary
    303  from the specular direction by up to t*pi/2.
    304  */
    305  double m_reflection_glossiness = 0.0;
    306 
    307  /*
    308  m_refraction_glossiness:
    309  Default is 0.0.
    310  Values from 0.0 to 1.0 make sense.
    311  - 0.0 refractions are perfectly specular.
    312  - t > 0.0 permits refraction ray direction to vary
    313  from the specular direction by up to t*pi/2.
    314  */
    315  double m_refraction_glossiness = 0.0;
    316 
    317  /*
    318  m_index_of_refraction:
    319  Default is 1.0.
    320  Physically, the index of refraction is >= 1.0 and is
    321  the value (speed of light in vacum)/(speed of light in material).
    322  Some rendering algorithms set m_index_of_refraction to zero or
    323  values < 1.0 to generate desirable effects.
    324  */
    325  double m_index_of_refraction = 1.0;
    326 
    327  /*
    328  m_fresnel_index_of_refraction:
    329  Default is 1.56.
    330  This is the value ON:Material::FresnelReflectionCoefficient() passes
    331  as the first parameter to ON_FresnelReflectionCoefficient().
    332  - Glass material types can be simulated with
    333  m_index_of_refraction ~ 1.56
    334  m_fresnel_index_of_refraction ~ 1.56
    335  - Thin glass can be simulated with
    336  m_fresnel_index_of_refraction = 1.56
    337  m_index_of_refraction = 0.0
    338  - Porcelain type materials can be simulated with
    339  m_fresnel_index_of_refraction = 1.56
    340  m_index_of_refraction = 1.0
    341  m_transparency = 0.0
    342  */
    343  double m_fresnel_index_of_refraction = 1.56;
    344 
    345  /*
    346  Parameters:
    347  N - [in]
    348  3d surface normal
    349  R - [in]
    350  3d reflection direction
    351  Returns:
    352  If m_bFresnelReflections is false, then 1.0 is returned.
    353  If m_bFresnelReflections is true, then the value of the fresnel
    354  reflection coefficient is returned. In typical rendering applications,
    355  the reflection term is multiplied by the fresnel reflection coefficient
    356  before it is added to the diffuse color.
    357  If any input is not valid or the calculation fails, then 1.0 is returned.
    358  Remarks:
    359  When m_bFresnelReflections is true, the calculation is performed by
    360  calling ON_FresnelReflectionCoefficient() with m_fresnel_index_of_refraction
    361  as the fresnel index of refraction.
    362  */
    363  double FresnelReflectionCoefficient(
    364  ON_3dVector N,
    365  ON_3dVector R
    366  ) const;
    367 
    368  /*
    369  Description:
    370  Searches for a texure with matching texture_id.
    371  If more than one texture matches, the first match
    372  is returned.
    373  Parameters:
    374  texture_id - [in]
    375  Returns:
    376  >=0 m_textures[] index of matching texture
    377  -1 if no match is found.
    378  */
    379  int FindTexture(
    380  ON_UUID texture_id
    381  ) const;
    382 
    383  /*
    384  Description:
    385  Searches for a texure with matching filename and type.
    386  If more than one texture matches, the first match
    387  is returned.
    388  Parameters:
    389  filename - [in] If nullptr, then any filename matches.
    390  type - [in] If ON_Texture::no_texture_type, then
    391  any texture type matches.
    392  i0 - [in] If i0 is < 0, the search begins at
    393  m_textures[0], if i0 >= m_textures.Count(),
    394  -1 is returnd, otherwise, the search begins
    395  at m_textures[i0+1].
    396  Example:
    397  Iterate through all the the bitmap textures on
    398  a material.
    399 
    400  ON_Material& mat = ...;
    401  int ti = -1;
    402  int bitmap_texture_count = 0;
    403  for(;;)
    404  {
    405  ti = mat.FindTexture(
    406  nullptr,
    407  ON_Texture::TYPE::bitmap_texture,
    408  ti );
    409 
    410  if ( ti < 0 )
    411  {
    412  // no more bitmap textures
    413  break;
    414  }
    415 
    416  // we have a bitmap texture
    417  bitmap_texture_count++;
    418  const ON_Texture& bitmap_texture = mat.m_textures[ti];
    419  ...
    420  }
    421 
    422  Returns:
    423  >=0 m_textures[] index of matching texture
    424  -1 if no match is found.
    425  */
    426  int FindTexture(
    427  const wchar_t* filename,
    428  ON_Texture::TYPE type,
    429  int i0 = -1
    430  ) const;
    431 
    432  /*
    433  Description:
    434  If there is already a texture with the same file name and
    435  type, then that texture is modified, otherwise a new texture
    436  is added. If tx has user data, the user data is copied
    437  to the m_textures[] element.
    438  Parameters:
    439  tx - [in]
    440  Returns:
    441  Index of the added texture in the m_textures[] array.
    442  Remarks:
    443  This is intended to be a quick and simple way to add
    444  textures to the material. If you need to do something
    445  different, then just work on the m_textures[] array.
    446  */
    447  int AddTexture(
    448  const ON_Texture& tx
    449  );
    450 
    451  /*
    452  Description:
    453  If there is a texture with a matching type, that texture's
    454  filename is modified, otherwise a new texture is added.
    455  Parameters:
    456  filename - [in] new filename
    457  type - [in]
    458  Returns:
    459  Index of the added texture in the m_textures[] array.
    460  Remarks:
    461  This is intended to be a quick and simple way to add
    462  textures to the material. If you need to do something
    463  different, then just work on the m_textures[] array.
    464  */
    465  int AddTexture(
    466  const wchar_t* filename,
    467  ON_Texture::TYPE type
    468  );
    469 
    470  /*
    471  Description:
    472  Deletes all texures with matching filenames and types.
    473  Parameters:
    474  filename - [in] If nullptr, then any filename matches.
    475  type - [in] If ON_Texture::no_texture_type, then
    476  any texture type matches.
    477  Returns:
    478  Number of textures deleted.
    479  */
    480  int DeleteTexture(
    481  const wchar_t* filename,
    482  ON_Texture::TYPE type
    483  );
    484 
    486 
    487  /*
    488  Description:
    489  Used to provide per face material support.
    490  The parent object reference a basic material.
    491  When a brep face or mesh facet wants to use
    492  a material besides the base material, it specifies
    493  a channelSupports material channel. The default
    494  material channel is 0 and that indicates the base
    495  material. A channel of n > 0 means that face
    496  used the material with id m_material_channel[n-1].
    497  If (n-1) >= m_material_channel.Count(), then the base
    498  material is used. The value of
    499  m_material_channel[n].m_id is persistent. The
    500  value of m_material_channel[n].m_i is a runtime
    501  index in the CRhinoDoc::m_material_table[]. If
    502  CRhinoDoc::m_material_table[m_i].m_uuid != m_id,
    503  then m_id is assumed to be correct.
    504  */
    505  ON_SimpleArray<ON_UuidIndex> m_material_channel;
    506 
    507 private:
    508  ON_UUID m_plugin_id = ON_nil_uuid;
    509 
    510 private:
    511  bool Internal_ReadV3( ON_BinaryArchive& archive, int minor_version );
    512  bool Internal_WriteV3( ON_BinaryArchive& archive ) const;
    513  bool Internal_ReadV5( ON_BinaryArchive& archive );
    514  bool Internal_WriteV5( ON_BinaryArchive& archive ) const;
    515 };
    516 
    517 ON_DECL
    518 bool operator==(const ON_Material&, const ON_Material&);
    519 
    520 ON_DECL
    521 bool operator!=(const ON_Material&, const ON_Material&);
    522 
    523 #if defined(ON_DLL_TEMPLATE)
    524 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Material*>;
    525 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_Material*>;
    526 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_Material>;
    527 
    528 // NO! // ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Material>;
    529 // It is a serious error to have an ON_ClassArray<ON_Material> and crashes
    530 // will occur when user data back pointers are not updated.
    531 #endif
    532 
    533 #endif
    534 
    static const ON_Material Unset
    nil id
    Definition: opennurbs_material.h:32
    Definition: opennurbs_material.h:25
    ON_UUID is a 16 byte universally unique identifier.
    Definition: opennurbs_uuid.h:32
    static const double MaxShine
    maximum value of shine exponent = 255.0
    Definition: opennurbs_material.h:30
    @@ -86,9 +84,9 @@ $(function() {
    diff --git a/6/da/d39/struct_o_n___unicode_error_parameters-members.html b/6/da/d39/struct_o_n___unicode_error_parameters-members.html index ced5619e..bc4eb4e6 100644 --- a/6/da/d39/struct_o_n___unicode_error_parameters-members.html +++ b/6/da/d39/struct_o_n___unicode_error_parameters-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/da/d4f/class_o_n___function_list.html b/6/da/d4f/class_o_n___function_list.html index 933e5300..0dc5e841 100644 --- a/6/da/d4f/class_o_n___function_list.html +++ b/6/da/d4f/class_o_n___function_list.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_FunctionList Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_FunctionList()

    @@ -183,8 +179,7 @@ Public Member Functions
    -

    Description: Call all the functions in the function list. Parameters: bFirstToLast - [in] true - function are called in the order added false - functions are called in the reverse order added
    -Returns: True if the functions were called or the list is empty. False if the list is in use.

    +

    Description: Call all the functions in the function list. Parameters: bFirstToLast - [in] true - function are called in the order added false - functions are called in the reverse order added Returns: True if the functions were called or the list is empty. False if the list is in use.

    @@ -340,9 +335,9 @@ Returns: True if the functions were called or the list is empty. False if the li diff --git a/6/da/d51/class_o_n___annotation.html b/6/da/d51/class_o_n___annotation.html index 2fa40489..43b1f560 100644 --- a/6/da/d51/class_o_n___annotation.html +++ b/6/da/d51/class_o_n___annotation.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Annotation Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_Annotation() [1/2]

    @@ -1557,8 +1554,7 @@ Additional Inherited Members
    -

    Get the proper dimension style, including overrides, to use for this annotation object. If there is an override in place, that dimstyle will be returned If there is no override, the parent style passed in will be returned If the content of the parent style has changed since the override was made, the override style will be updated with the non-overriden values from
    -the parent before returning. If your annotation object has an override style and you call either of these functions with a dimstyle other than the correct parent style for this annotation, the override style will be removed.

    +

    Get the proper dimension style, including overrides, to use for this annotation object. If there is an override in place, that dimstyle will be returned If there is no override, the parent style passed in will be returned If the content of the parent style has changed since the override was made, the override style will be updated with the non-overriden values from the parent before returning. If your annotation object has an override style and you call either of these functions with a dimstyle other than the correct parent style for this annotation, the override style will be removed.

    @@ -1716,8 +1712,7 @@ the parent before returning. If your annotation object has an override style and
    -

    virtual bool Explode( const ON_DimStyle* dimstyle, ON_SimpleArray<const ON_Geometry*> object_parts) const = 0;
    -Returns: The value of ON_DimStyle.TextPositionPropertiesHash() from the dimension style used to calculate the runtime text position (location, glyphs, and size).

    +

    virtual bool Explode( const ON_DimStyle* dimstyle, ON_SimpleArray<const ON_Geometry*> object_parts) const = 0; Returns: The value of ON_DimStyle.TextPositionPropertiesHash() from the dimension style used to calculate the runtime text position (location, glyphs, and size).

    @@ -6823,9 +6818,9 @@ Returns: The value of diff --git a/6/da/d51/struct_o_n___windows_r_g_b_q_u_a_d-members.html b/6/da/d51/struct_o_n___windows_r_g_b_q_u_a_d-members.html index 7bb0830c..76ea04d2 100644 --- a/6/da/d51/struct_o_n___windows_r_g_b_q_u_a_d-members.html +++ b/6/da/d51/struct_o_n___windows_r_g_b_q_u_a_d-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d53/opennurbs__quaternion_8h_source.html b/6/da/d53/opennurbs__quaternion_8h_source.html index 3c37aef3..21dd4afb 100644 --- a/6/da/d53/opennurbs__quaternion_8h_source.html +++ b/6/da/d53/opennurbs__quaternion_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_quaternion.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_quaternion.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d54/opennurbs__sphere_8h_source.html b/6/da/d54/opennurbs__sphere_8h_source.html index 41c8f367..2fc83061 100644 --- a/6/da/d54/opennurbs__sphere_8h_source.html +++ b/6/da/d54/opennurbs__sphere_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_sphere.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_sphere.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d5b/class_o_n___binary_archive_buffer.html b/6/da/d5b/class_o_n___binary_archive_buffer.html index 1c83b372..0a111408 100644 --- a/6/da/d5b/class_o_n___binary_archive_buffer.html +++ b/6/da/d5b/class_o_n___binary_archive_buffer.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BinaryArchiveBuffer Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d5e/class_o_n__2i_point-members.html b/6/da/d5e/class_o_n__2i_point-members.html index 3a72669c..bf2f6588 100644 --- a/6/da/d5e/class_o_n__2i_point-members.html +++ b/6/da/d5e/class_o_n__2i_point-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d5f/struct_o_n___r_tree_branch-members.html b/6/da/d5f/struct_o_n___r_tree_branch-members.html index 8e889081..4f455902 100644 --- a/6/da/d5f/struct_o_n___r_tree_branch-members.html +++ b/6/da/d5f/struct_o_n___r_tree_branch-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d62/class_o_n__4f_point-members.html b/6/da/d62/class_o_n__4f_point-members.html index 074e1bba..457afe3f 100644 --- a/6/da/d62/class_o_n__4f_point-members.html +++ b/6/da/d62/class_o_n__4f_point-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d62/class_o_n___font_glyph_outline_point.html b/6/da/d62/class_o_n___font_glyph_outline_point.html index 3ee37c34..84295f0e 100644 --- a/6/da/d62/class_o_n___font_glyph_outline_point.html +++ b/6/da/d62/class_o_n___font_glyph_outline_point.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_FontGlyphOutlinePoint Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d69/class_o_n___text_style.html b/6/da/d69/class_o_n___text_style.html index 66c74386..70e9b5be 100644 --- a/6/da/d69/class_o_n___text_style.html +++ b/6/da/d69/class_o_n___text_style.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextStyle Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -1220,9 +1218,9 @@ Additional Inherited Members
    diff --git a/6/da/d6b/class_o_n___text_run_builder.html b/6/da/d6b/class_o_n___text_run_builder.html index bbd5c709..d1528a95 100644 --- a/6/da/d6b/class_o_n___text_run_builder.html +++ b/6/da/d6b/class_o_n___text_run_builder.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextRunBuilder Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d7b/class_o_n___clipping_plane-members.html b/6/da/d7b/class_o_n___clipping_plane-members.html index 69ec2914..73711e1b 100644 --- a/6/da/d7b/class_o_n___clipping_plane-members.html +++ b/6/da/d7b/class_o_n___clipping_plane-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d7b/opennurbs__internal__glyph_8h_source.html b/6/da/d7b/opennurbs__internal__glyph_8h_source.html index 80c24dec..4733eaef 100644 --- a/6/da/d7b/opennurbs__internal__glyph_8h_source.html +++ b/6/da/d7b/opennurbs__internal__glyph_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_internal_glyph.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_internal_glyph.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_internal_glyph.h
    -
    1 /*
    2 //
    3 // Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved.
    4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    5 // McNeel & Associates.
    6 //
    7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    10 //
    11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    12 //
    13 ////////////////////////////////////////////////////////////////
    14 */
    15 #if !defined(OPENNURBS_INTERNAL_GLYPH_INC_)
    16 #define OPENNURBS_INTERNAL_GLYPH_INC_
    17 
    19 {
    20 private:
    21  friend class ON_FontGlyph;
    22  friend class ON_GlyphMap;
    24  ~ON_Internal_FontGlyphPool() = default;
    26  ON_Internal_FontGlyphPool operator=(const ON_Internal_FontGlyphPool&) = delete;
    27  static ON_Internal_FontGlyphPool theGlyphItemPool;
    28 };
    29 
    31 {
    32 public:
    33  // List is the only instance of this class.
    35 
    37  const ON_Font& font_characteristics,
    38  bool bCreateIfNotFound
    39  );
    40 
    42  unsigned int managed_font_runtime_serial_number
    43  );
    44 
    45  unsigned int GetList(
    47  );
    48 
    49  /*
    50  Returns:
    51  0: failure
    52  >0: success font glyph id
    53  */
    54  static ON__UINT_PTR GetGlyphMetrics(
    55  const class ON_Font* font,
    56  ON__UINT32 unicode_code_point,
    57  class ON_TextBox& font_unit_glyph_box
    58  );
    59 
    60  static void GetFontMetrics(
    61  const ON_Font* font,
    62  ON_FontMetrics& font_unit_font_metrics
    63  );
    64 
    65 private:
    66  ON_ManagedFonts() = default;
    67  ~ON_ManagedFonts();
    68 
    69  const ON_Font* Internal_AddManagedFont(
    70  const ON_Font* managed_font
    71  );
    72 
    73 private:
    74  ON_SimpleArray<const ON_Font*> m_managed_fonts;
    75  ON_SimpleArray<const ON_Font*> m_managed_fonts_by_serial_number;
    76  unsigned int m_sorted_count = 0;
    77  unsigned int m_sorted_by_serial_number_count = 0;
    78 };
    79 
    80 class ON_CLASS ON_GlyphMap
    81 {
    82 public:
    83  ON_GlyphMap();
    84  ~ON_GlyphMap() = default;
    85 
    86 public:
    87  const class ON_FontGlyph* FindGlyph(
    88  const ON__UINT32 unicode_code_point
    89  ) const;
    90 
    91  // returns pointer to the persistent glyph item
    92  const ON_FontGlyph* InsertGlyph(
    93  const ON_FontGlyph& glyph
    94  );
    95 
    96  unsigned int GlyphCount() const;
    97 
    98 private:
    99  friend class ON_Font;
    100  friend class ON_FontGlyph;
    101  unsigned int m_glyph_count = 0;
    102  unsigned int m_reserved = 0;
    104 };
    105 
    106 #endif
    const ON_Font * GetFromFontCharacteristics(const ON_Font &font_characteristics, bool bCreateIfNotFound)
    -
    Definition: opennurbs_font.h:2097
    +
    1 /*
    2 //
    3 // Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved.
    4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    5 // McNeel & Associates.
    6 //
    7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    10 //
    11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    12 //
    13 ////////////////////////////////////////////////////////////////
    14 */
    15 #if !defined(OPENNURBS_INTERNAL_GLYPH_INC_)
    16 #define OPENNURBS_INTERNAL_GLYPH_INC_
    17 
    19 {
    20 private:
    21  friend class ON_FontGlyph;
    22  friend class ON_GlyphMap;
    24  ~ON_Internal_FontGlyphPool() = default;
    26  ON_Internal_FontGlyphPool operator=(const ON_Internal_FontGlyphPool&) = delete;
    27  static ON_Internal_FontGlyphPool theGlyphItemPool;
    28 };
    29 
    31 {
    32 public:
    33  // List is the only instance of this class.
    35 
    36  const ON_Font* GetFromFontCharacteristics(
    37  const ON_Font& font_characteristics,
    38  bool bCreateIfNotFound
    39  );
    40 
    41  const ON_Font* GetFromAppleFontName(
    42  const wchar_t* apple_font_name,
    43  bool bCreateIfNotFound
    44  );
    45 
    46  const ON_Font* GetFromSerialNumber(
    47  unsigned int managed_font_runtime_serial_number
    48  );
    49 
    50  unsigned int GetList(
    52  );
    53 
    54  /*
    55  Returns:
    56  0: failure
    57  >0: success font glyph id
    58  */
    59  static ON__UINT_PTR GetGlyphMetrics(
    60  const class ON_Font* font,
    61  ON__UINT32 unicode_code_point,
    62  class ON_TextBox& font_unit_glyph_box
    63  );
    64 
    65  static void GetFontMetrics(
    66  const ON_Font* font,
    67  ON_FontMetrics& font_unit_font_metrics
    68  );
    69 
    70 private:
    71  ON_ManagedFonts() = default;
    72  ~ON_ManagedFonts();
    73 
    74  const ON_Font* Internal_AddManagedFont(
    75  const ON_Font* managed_font
    76  );
    77 
    78 private:
    79  ON_SimpleArray<const ON_Font*> m_managed_fonts;
    80  ON_SimpleArray<const ON_Font*> m_managed_fonts_by_serial_number;
    81  unsigned int m_sorted_count = 0;
    82  unsigned int m_sorted_by_serial_number_count = 0;
    83 };
    84 
    85 class ON_CLASS ON_GlyphMap
    86 {
    87 public:
    88  ON_GlyphMap();
    89  ~ON_GlyphMap() = default;
    90 
    91 public:
    92  const class ON_FontGlyph* FindGlyph(
    93  const ON__UINT32 unicode_code_point
    94  ) const;
    95 
    96  // returns pointer to the persistent glyph item
    97  const ON_FontGlyph* InsertGlyph(
    98  const ON_FontGlyph& glyph
    99  );
    100 
    101  unsigned int GlyphCount() const;
    102 
    103 private:
    104  friend class ON_Font;
    105  friend class ON_FontGlyph;
    106  unsigned int m_glyph_count = 0;
    107  unsigned int m_reserved = 0;
    109 };
    110 
    111 #endif
    Definition: opennurbs_font.h:1988
    static ON_ManagedFonts List
    List is the only instance of this class.
    Definition: opennurbs_internal_glyph.h:34
    Definition: opennurbs_array.h:36
    Definition: opennurbs_internal_glyph.h:30
    Definition: opennurbs_fsp.h:19
    Definition: opennurbs_internal_glyph.h:18
    -
    Definition: opennurbs_font.h:2224
    +
    Definition: opennurbs_font.h:2115
    Definition: opennurbs_font.h:18
    -
    Definition: opennurbs_internal_glyph.h:80
    -
    const ON_Font * GetFromSerialNumber(unsigned int managed_font_runtime_serial_number)
    +
    Definition: opennurbs_internal_glyph.h:85
    An ON_Font is a face in a font family. It corresponds to a Windows LOGFONT, a .NET System...
    Definition: opennurbs_font.h:225
    -
    static ON__UINT_PTR GetGlyphMetrics(const class ON_Font *font, ON__UINT32 unicode_code_point, class ON_TextBox &font_unit_glyph_box)
    -
    static void GetFontMetrics(const ON_Font *font, ON_FontMetrics &font_unit_font_metrics)
    -
    unsigned int GetList(ON_SimpleArray< const ON_Font * > &managed_fonts)
    +
    friend class ON_GlyphMap
    Definition: opennurbs_internal_glyph.h:22
    diff --git a/6/da/d83/class_o_n___surface_properties-members.html b/6/da/d83/class_o_n___surface_properties-members.html index bb8bca15..0f3c1ea2 100644 --- a/6/da/d83/class_o_n___surface_properties-members.html +++ b/6/da/d83/class_o_n___surface_properties-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/da/d8b/opennurbs__texture__mapping_8h_source.html b/6/da/d8b/opennurbs__texture__mapping_8h_source.html index 9673ad9a..4deb6461 100644 --- a/6/da/d8b/opennurbs__texture__mapping_8h_source.html +++ b/6/da/d8b/opennurbs__texture__mapping_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_texture_mapping.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_texture_mapping.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_texture_mapping.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // defines ON_TextureMapping
    20 //
    21 ////////////////////////////////////////////////////////////////
    22 
    23 #if !defined(OPENNURBS_TEXTURE_MAPPING_INC_)
    24 #define OPENNURBS_TEXTURE_MAPPING_INC_
    25 
    26 ///////////////////////////////////////////////////////////////////////////////
    27 //
    28 // Class ON_TextureMapping
    29 //
    30 class ON_Line;
    31 class ON_BrepFace;
    32 class ON_3dPoint;
    33 
    34 typedef int ( *TEXMAP_INTERSECT_LINE_SURFACE )( const ON_Line*, const ON_BrepFace*, ON_SimpleArray<ON_X_EVENT>& );
    35 typedef bool ( *TEXMAP_BREP_FACE_CLOSEST_POINT )( const ON_BrepFace*, const ON_3dPoint*, ON_3dPoint& );
    36 
    37 class ON_CLASS ON_TextureMapping : public ON_ModelComponent
    38 {
    39  ON_OBJECT_DECLARE(ON_TextureMapping);
    40 
    41 public:
    42 
    43  static const ON_TextureMapping Unset; // nil id
    44 
    45  // ON_TextureMapping::SurfaceParameterTextureMapping
    46  // has m_type = ON_TextureMapping::srfp_mapping and m_id = nil;
    48 
    49  /*
    50  Parameters:
    51  model_component_reference - [in]
    52  none_return_value - [in]
    53  value to return if ON_Material::Cast(model_component_ref.ModelComponent())
    54  is nullptr
    55  Returns:
    56  If ON_Material::Cast(model_component_ref.ModelComponent()) is not nullptr,
    57  that pointer is returned. Otherwise, none_return_value is returned.
    58  */
    59  static const ON_TextureMapping* FromModelComponentRef(
    60  const class ON_ModelComponentReference& model_component_reference,
    61  const ON_TextureMapping* none_return_value
    62  );
    63 
    64 public:
    65  //////////////////////////////////////////////////////////
    66  //
    67  // Mapping types:
    68  //
    69  // You can either calculate texture coordinates based on
    70  // the parameterization of the surface used to create a mesh,
    71  // or project the natural parameterization from a mapping
    72  // primitive, like a plane, sphere, box, or cylinder.
    73  //
    74  // Do not change TYPE enum values - they are saved in 3dm files.
    75  //
    76  enum class TYPE : unsigned int
    77  {
    78  no_mapping = 0,
    79  srfp_mapping = 1, // u,v = linear transform of surface params,w = 0
    80  plane_mapping = 2, // u,v,w = 3d coordinates wrt frame
    81  cylinder_mapping = 3, // u,v,w = logitude, height, radius
    82  sphere_mapping = 4, // (u,v,w) = longitude,latitude,radius
    83  box_mapping = 5,
    84  mesh_mapping_primitive = 6, // m_mapping_primitive is an ON_Mesh
    85  srf_mapping_primitive = 7, // m_mapping_primitive is an ON_Surface
    86  brep_mapping_primitive = 8 // m_mapping_primitive is an ON_Brep
    87  };
    88 
    89  static ON_TextureMapping::TYPE TypeFromUnsigned(
    90  unsigned int type_as_unsigned
    91  );
    92 
    93  static const ON_wString TypeToString(
    94  ON_TextureMapping::TYPE texture_mapping_type
    95  );
    96 
    97  //////////////////////////////////////////////////////////
    98  //
    99  // Projection:
    100  //
    101  // When a mapping primitive, like a plane, sphere, box,
    102  // or cylinder, is used, there are two projection options.
    103  //
    104  // clspt_projection: world xyz maps to the point on the
    105  // mapping primitive that is closest to xyz.
    106  // In this case, ON_TextureMapping::Evaluate
    107  // ignores the vector argument.
    108  //
    109  // ray_projection: world xyz + world vector defines a world line.
    110  // The world line is intersected with the mapping
    111  // primitive and the intersection point that is
    112  // closest to the world xyz point is used to
    113  // calculate the mapping parameters.
    114  //
    115  // The value of m_projection can be changed as needed.
    116  //
    117  // If m_type = srfp_mapping, then m_projection is ignored.
    118  //
    119  enum class PROJECTION : unsigned int
    120  {
    121  no_projection = 0,
    122  clspt_projection = 1,
    123  ray_projection = 2
    124  };
    125 
    126  static ON_TextureMapping::PROJECTION ProjectionFromUnsigned(
    127  unsigned int projection_as_unsigned
    128  );
    129 
    130  static const ON_wString ProjectionToString(
    131  ON_TextureMapping::PROJECTION texture_mapping_projection
    132  );
    133 
    134  //////////////////////////////////////////////////////////
    135  //
    136  // Texture space
    137  //
    138  // When a mapping primitive is a box or a capped cylinder,
    139  // there are two options for the mapping. Either the sides
    140  // all map to (0,1)x(0,1) (so the either texture map appears
    141  // on each side, or the sides map to distinct regions of the
    142  // texture space.
    143  //
    144  enum class TEXTURE_SPACE : unsigned int
    145  {
    146  single = 0, // sides and caps map to same texture space
    147  divided = 1 // sides and caps map to distinct vertical
    148  // regions of texture space.
    149  // (0, 1/4, 2/4, 3/4, 1) for uncapped boxes.
    150  // (0, 1/6, 2/6, 3/6, 4/6, 5/6, 1) for capped boxes.
    151  // (0, 4/6, 5/6, 1) for capped cylinders.
    152  };
    153 
    154  static ON_TextureMapping::TEXTURE_SPACE TextureSpaceFromUnsigned(
    155  unsigned int texture_space_as_unsigned
    156  );
    157 
    158  static const ON_wString SpaceToString(
    159  ON_TextureMapping::TEXTURE_SPACE texture_mapping_space
    160  );
    161 
    162 public:
    163  ON_TextureMapping() ON_NOEXCEPT;
    165  virtual ~ON_TextureMapping();
    166  ON_TextureMapping& operator=(const ON_TextureMapping& src);
    167 
    168 private:
    169  void Internal_CopyFrom(
    170  const ON_TextureMapping& src
    171  );
    172 
    173  void Internal_Destroy();
    174 
    175  bool Internal_WriteV5(
    176  ON_BinaryArchive& binary_archive
    177  ) const;
    178 
    179  bool Internal_ReadV5(
    180  ON_BinaryArchive& binary_archive
    181  );
    182 
    183 public:
    184  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    185 
    186  void Dump( ON_TextLog& ) const override;
    187 
    188  unsigned int SizeOf() const override;
    189 
    190  bool Write(
    191  ON_BinaryArchive& binary_archive
    192  ) const override;
    193 
    194  bool Read(
    195  ON_BinaryArchive& binary_archive
    196  ) override;
    197 
    198  /*
    199  Determines whether the mapping, as currently set up, requires vertex normals to be present on the
    200  mesh in order to evaluate the mapping correctly.
    201  */
    202  bool RequiresVertexNormals() const;
    203  bool IsPeriodic(void) const;
    204 
    205  /*
    206  Description:
    207  Create a mapping that will convert surface parameters into
    208  normalized (0,1)x(0,1) texture coordinates.
    209  */
    210  bool SetSurfaceParameterMapping(void);
    211 
    212  /*
    213  Description:
    214  Create a planar projection texture mapping.
    215  Parameters:
    216  plane - [in]
    217  dx - [in] portion of the plane's x axis that is mapped to [0,1]
    218  (can be a decreasing interval)
    219  dy - [in] portion of the plane's x axis that is mapped to [0,1]
    220  (can be a decreasing interval)
    221  dz - [in] portion of the plane's x axis that is mapped to [0,1]
    222  (can be a decreasing interval)
    223  projection_method - [in]
    224  1: Closest point mapping.
    225  A target point P is mapped to the point on the plane
    226  that is closest to P. The target normal is ignored.
    227  2: Target line mapping. A target point-vector pair
    228  (P, N), are mapped to the point on the plane
    229  where the line through P, parallel to N, intersects
    230  the plane. If the line is parallel to the plane,
    231  the closest point mapping is used.
    232  Example:
    233  Create a mapping that maps the world axis aligned rectangle in
    234  the world yz plane with corners at (0,3,5) and (0,7,19) to the
    235  texture coordinate unit square.
    236 
    237  ON_3dVector plane_xaxis(0.0,1.0,0.0);
    238  ON_3dVector plane_yaxis(0.0,0,0,1.0);
    239  ON_3dPoint plane_origin(0.0,2.0,4.0);
    240  ON_Plane plane(plane_origin,plane_xaxis,plane_yaxis);
    241  ON_Interval dx( 0.0, 7.0 - 3.0);
    242  ON_Interval dy( 0.0, 19.0 - 5.0);
    243  ON_Interval dz( 0.0, 1.0 );
    244  ON_TextureMapping mapping;
    245  mapping.CreatePlaneMapping(plane,dx,dy,dz);
    246 
    247  Returns:
    248  True if input is valid.
    249  */
    250  bool SetPlaneMapping(
    251  const ON_Plane& plane,
    252  const ON_Interval& dx,
    253  const ON_Interval& dy,
    254  const ON_Interval& dz
    255  );
    256 
    257  /*
    258  Description:
    259  Create a cylindrical projection texture mapping.
    260  Parameters:
    261  cylinder - [in]
    262  cylinder in world space used to define a cylindrical
    263  coordinate system. The angular parameter maps (0,2pi)
    264  to texture "u" (0,1), The height parameter maps
    265  (height[0],height[1]) to texture "v" (0,1), and
    266  the radial parameter maps (0,r) to texture "w" (0,1).
    267  bIsCapped - [in]
    268  If true, the cylinder is treated as a finite
    269  capped cylinder.
    270  Returns:
    271  True if input is valid.
    272  Remarks:
    273  When the cylinder is capped and m_texture_space = divided,
    274  the cylinder is mapped to texture space as follows:
    275  The side is mapped to 0 <= "u" <= 2/3.
    276  The bottom is mapped to 2/3 <= "u" <= 5/6.
    277  The top is mapped to 5/6 <= "u" <= 5/6.
    278  This is the same convention box mapping uses.
    279  */
    280  bool SetCylinderMapping(
    281  const ON_Cylinder& cylinder,
    282  bool bIsCapped
    283  );
    284 
    285  /*
    286  Description:
    287  Create a spherical projection texture mapping.
    288  Parameters:
    289  sphere - [in]
    290  sphere in world space used to define a spherical
    291  coordinate system. The longitude parameter maps
    292  (0,2pi) to texture "u" (0,1). The latitude paramter
    293  maps (-pi/2,+pi/2) to texture "v" (0,1).
    294  The radial parameter maps (0,r) to texture "w" (0,1).
    295  Returns:
    296  True if input is valid.
    297  */
    298  bool SetSphereMapping(
    299  const ON_Sphere& sphere
    300  );
    301 
    302  /*
    303  Description:
    304  Create a box projection texture mapping.
    305  Parameters:
    306  plane - [in]
    307  The sides of the box the box are parallel to the
    308  plane's coordinate planes. The dx, dy, dz intervals
    309  determine the location of the sides.
    310  dx - [in]
    311  Determines the location of the front and back planes.
    312  The vector plane.xaxis is perpendicular to these planes
    313  and they pass through plane.PointAt(dx[0],0,0) and
    314  plane.PointAt(dx[1],0,0), respectivly.
    315  dy - [in]
    316  Determines the location of the left and right planes.
    317  The vector plane.yaxis is perpendicular to these planes
    318  and they pass through plane.PointAt(0,dy[0],0) and
    319  plane.PointAt(0,dy[1],0), respectivly.
    320  dz - [in]
    321  Determines the location of the top and bottom planes.
    322  The vector plane.zaxis is perpendicular to these planes
    323  and they pass through plane.PointAt(0,0,dz[0]) and
    324  plane.PointAt(0,0,dz[1]), respectivly.
    325  bIsCapped - [in]
    326  If true, the box is treated as a finite
    327  capped box.
    328  Returns:
    329  True if input is valid.
    330  Remarks:
    331  When m_texture_space = divided, the box is mapped to texture
    332  space as follows:
    333 
    334  If the box is not capped, then each side maps to 1/4 of the texture map.
    335 
    336  v=1+---------+---------+---------+---------+
    337  | x=dx[1] | y=dy[1] | x=dx[0] | y=dy[0] |
    338  | Front | Right | Back | Left |
    339  | --y-> | <-x-- | <-y-- | --x-> |
    340  v=0+---------+---------+---------+---------+
    341  0/4 <=u<= 1/4 <=u<= 2/4 <=u<= 3/4 <=u<= 4/4
    342 
    343  If the box is capped, then each side and cap gets 1/6 of the texture map.
    344 
    345  v=1+---------+---------+---------+---------+---------+---------+
    346  | x=dx[1] | y=dy[1] | x=dx[0] | y=dy[0] | z=dx[1] | z=dz[0] |
    347  | Front | Right | Back | Left | Top | Bottom |
    348  | --y-> | <-x-- | <-y-- | --x-> | --x-> | --x-> |
    349  v=0+---------+---------+---------+---------+---------+---------+
    350  0/6 <=u<= 1/6 <=u<= 2/6 <=u<= 3/6 <=u<= 4/6 <=u<= 5/6 <=u<= 6/6
    351  */
    352  bool SetBoxMapping(
    353  const ON_Plane& plane,
    354  ON_Interval dx,
    355  ON_Interval dy,
    356  ON_Interval dz,
    357  bool bIsCapped
    358  );
    359 
    360  /*
    361  Description:
    362  Get plane mapping parameters from this texture mapping.
    363  Parameters:
    364  plane - [out]
    365  dx - [out]
    366  Portion of the plane's x axis that is mapped to [0,1]
    367  dy - [out]
    368  Portion of the plane's y axis that is mapped to [0,1]
    369  dz - [out]
    370  Portion of the plane's z axis that is mapped to [0,1]
    371  Returns:
    372  True if valid plane mapping parameters were returned.
    373  Remarks:
    374  NOTE WELL:
    375  Generally, GetMappingPlane will not return the same
    376  parameters passed to SetPlaneMapping. However, the
    377  location of the plane will be the same.
    378  */
    379  bool GetMappingPlane(
    380  ON_Plane& plane,
    381  ON_Interval& dx,
    382  ON_Interval& dy,
    383  ON_Interval& dz
    384  ) const;
    385 
    386  /*
    387  Description:
    388  Get a cylindrical projection parameters from this texture mapping.
    389  Parameters:
    390  cylinder - [out]
    391  Returns:
    392  True if a valid cylinder is returned.
    393  Remarks:
    394  Generally, GetMappingCylinder will not return the same
    395  parameters passed to SetCylinderMapping. However, the
    396  location of the cylinder will be the same.
    397  If this mapping is not cylindrical, the cylinder will
    398  approximate the actual mapping primitive.
    399  */
    400  bool GetMappingCylinder(
    401  ON_Cylinder& cylinder
    402  ) const;
    403 
    404  /*
    405  Description:
    406  Get a spherical projection parameters from this texture mapping.
    407  Parameters:
    408  sphere - [out]
    409  Returns:
    410  True if a valid sphere is returned.
    411  Remarks:
    412  Generally, GetMappingShere will not return the same
    413  parameters passed to SetSphereMapping. However, the
    414  location of the sphere will be the same.
    415  If this mapping is not cylindrical, the cylinder will
    416  approximate the actual mapping primitive.
    417  */
    418  bool GetMappingSphere(
    419  ON_Sphere& sphere
    420  ) const;
    421 
    422  /*
    423  Get a box projection from the texture mapping.
    424  Parameters:
    425  plane - [out]
    426  The center of the box is at plane.origin and the sides
    427  of the box are parallel to the plane's coordinate planes.
    428  dx - [out]
    429  The "front" and "back" sides of the box are in spanned
    430  by the vectors plane.yaxis and plane.zaxis. The back
    431  plane contains the point plane.PointAt(dx[0],0,0) and
    432  the front plane contains the point plane.PointAt(dx[1],0,0).
    433  dy - [out]
    434  The "left" and "right" sides of the box are in spanned
    435  by the vectors plane.zaxis and plane.xaxis. The left
    436  plane contains the point plane.PointAt(0,dx[0],0) and
    437  the back plane contains the point plane.PointAt(0,dy[1],0).
    438  dz - [out]
    439  The "top" and "bottom" sides of the box are in spanned
    440  by the vectors plane.xaxis and plane.yaxis. The bottom
    441  plane contains the point plane.PointAt(0,0,dz[0]) and
    442  the top plane contains the point plane.PointAt(0,0,dz[1]).
    443  Returns:
    444  True if a valid box is returned.
    445  Remarks:
    446  Generally, GetMappingBox will not return the same
    447  parameters passed to SetBoxMapping. However, the
    448  location of the box will be the same.
    449  */
    450  bool GetMappingBox(
    451  ON_Plane& plane,
    452  ON_Interval& dx,
    453  ON_Interval& dy,
    454  ON_Interval& dz
    455  ) const;
    456 
    457 
    458  /*
    459  Description:
    460  Reverses the texture in the specified direction.
    461  Parameters:
    462  dir - [in] 0 = reverse "u", 1 = reverse "v", 2 = reverse "w".
    463  Remarks:
    464  Modies m_uvw so that the spedified direction transforms
    465  the texture coordinate t to 1-t.
    466  Returns:
    467  True if input is valid.
    468  */
    469  bool ReverseTextureCoordinate( int dir );
    470 
    471  /*
    472  Description:
    473  Swaps the specified texture coordinates.
    474  Parameters:
    475  i - [in]
    476  j - [in]
    477  Remarks:
    478  Modifies m_uvw so that the specified texture coordinates are swapped.
    479  Returns:
    480  True if input is valid.
    481  */
    482  bool SwapTextureCoordinate( int i, int j );
    483 
    484  /*
    485  Description:
    486  Tiles the specified texture coordinates.
    487  Parameters:
    488  dir - [in] 0 = "u", 1 = "v", 2 = "w".
    489  count - [in] number of tiles
    490  offset - [in] offset of the tile
    491  Remarks:
    492  Modies m_uvw so that the specified texture coordinate is
    493  tiled.
    494  Returns:
    495  True if input is valid.
    496  */
    497  bool TileTextureCoordinate( int dir, double count, double offset );
    498 
    499  /*
    500  Description:
    501  Evaluate the mapping to get a texture coordinate.
    502  Parameters:
    503  P - [in] Vertex location
    504  N - [in] If the mapping projection is ray_projection,
    505  then this is the vertex unit normal. Otherwise
    506  N is ignored.
    507  T - [out] Texture coordinate (u,v,w)
    508 
    509  P_xform -[in]
    510  Transformation to be applied to P before performing
    511  the mapping calculation.
    512  N_xform - [in]
    513  Transformation to be applied to N before performing
    514  the mapping calculation. One way to calculate N_xform
    515  is to use the call P_xform::GetVectorTransform(N_xform).
    516 
    517  Returns:
    518  Nonzero if evaluation is successful. When the mapping
    519  is a box or capped cylinder mapping, the value indicates
    520  which side was evaluated.
    521 
    522  Cylinder mapping:
    523  1 = cylinder wall, 2 = bottom cap, 3 = top cap
    524  Box mapping:
    525  1 = front
    526  2 = right
    527  3 = back
    528  4 = left
    529  5 = bottom
    530  6 = top
    531 
    532  See Also:
    533  ON_TextureMapping::GetTextureCoordinates
    534  ON_Mesh::SetTextureCoordinates
    535  */
    536  virtual
    537  int Evaluate(
    538  const ON_3dPoint& P,
    539  const ON_3dVector& N,
    540  ON_3dPoint* T
    541  ) const;
    542 
    543  virtual
    544  int Evaluate(
    545  const ON_3dPoint& P,
    546  const ON_3dVector& N,
    547  ON_3dPoint* T,
    548  const ON_Xform& P_xform,
    549  const ON_Xform& N_xform
    550  ) const;
    551 
    552  int EvaluatePlaneMapping(
    553  const ON_3dPoint& P,
    554  const ON_3dVector& N,
    555  ON_3dPoint* T
    556  ) const;
    557 
    558  int EvaluateSphereMapping(
    559  const ON_3dPoint& P,
    560  const ON_3dVector& N,
    561  ON_3dPoint* T
    562  ) const;
    563 
    564  int EvaluateCylinderMapping(
    565  const ON_3dPoint& P,
    566  const ON_3dVector& N,
    567  ON_3dPoint* T
    568  ) const;
    569 
    570  int EvaluateBoxMapping(
    571  const ON_3dPoint& P,
    572  const ON_3dVector& N,
    573  ON_3dPoint* T
    574  ) const;
    575 
    576 
    577  /*
    578  Description:
    579  Quickly check to see if a mesh or tag has texture coordinates
    580  set by this mapping.
    581  Parameters:
    582  mesh - [in]
    583  tag - [in]
    584  object_xform - [in] (optional)
    585  If this transform is not nullptr, then true will be
    586  returned only if the mapping function is the same and
    587  the tag's m_mesh_xform field is the same as mesh_xform.
    588  This parameter is typically nullptr or the value of
    589  ON_MappingRef::m_object_xform.
    590  Returns:
    591  True if the meshes texture coordinates were set by this
    592  mapping.
    593  */
    594  bool HasMatchingTextureCoordinates(
    595  const ON_Mesh& mesh,
    596  const ON_Xform* object_xform = nullptr
    597  ) const;
    598 
    599  bool HasMatchingTextureCoordinates(
    600  const class ON_MappingTag& tag,
    601  const ON_Xform* object_xform = nullptr
    602  ) const;
    603 
    604  /*
    605  Description:
    606  Get texture coordinates. This calculation is
    607  expensive. When possible, use a MappingMatch()
    608  query to avoid unnecessary calculations.
    609  Parameters:
    610  mesh - [in]
    611  T - [out] Texture coordinates returned here.
    612  mesh_xform - [in] (optional)
    613  If the mesh has been transformed since the texture mapping was set
    614  up, pass the transformation here. Typically this is the value
    615  of ON_Mesh::m_mapping_xform or ON_MappingRef::m_object_xform
    616  bLazy - [in]
    617  If true and the mesh.m_T[] values were calculated using
    618  this mapping, they are simply copied to the T[] array
    619  and no calculations are performed. If you are calling
    620  the 3d point version and you care about the z-coordinate,
    621  then do not use the lazy option (meshes only store
    622  2d texture coordinates).
    623  Tside - [out]
    624  In the case of divided textures, side information is returned
    625  here if a lazy mapping is not done. Otherwise Tside->Count()
    626  will be zero.
    627  Cylinder mapping:
    628  1 = cylinder wall, 2 = bottom cap, 3 = top cap
    629  Box mapping:
    630  1 = front
    631  2 = right
    632  3 = back
    633  4 = left
    634  5 = bottom
    635  6 = top
    636  Example:
    637 
    638  ON_TextureMapping mapping = ...;
    639  const ON_Mesh* mesh = ...;
    640  bool bLazy = true;
    641  ON_SimpleArray<ON_3dPoint> T(mesh->VertexCount());
    642  T.SetCount(mesh->m_VertexCount());
    643  if ( !mapping.GetTextureCoordinates(mesh,3,3,&T[0].x,bLazy) )
    644  T.SetCount(0).
    645 
    646  Returns:
    647  True if successful.
    648  */
    649  bool GetTextureCoordinates(
    650  const ON_Mesh& mesh,
    652  const ON_Xform* mesh_xform = 0,
    653  bool bLazy = false,
    654  ON_SimpleArray<int>* Tside = 0
    655  ) const;
    656 
    657  bool GetTextureCoordinates(
    658  const ON_Mesh& mesh,
    660  const ON_Xform* mesh_xform = 0,
    661  bool bLazy = false,
    662  ON_SimpleArray<int>* Tside = 0
    663  ) const;
    664 
    665 public:
    666 
    667 
    668 public:
    670  ON_TextureMapping::PROJECTION m_projection = ON_TextureMapping::PROJECTION::no_projection;
    672 
    673  // The m_bCapped applies to planar, cylinder and box mappings.
    674  // If m_bCapped is false, the cylinder or box is "infinite", if m_bCapped is true, they are finite.
    675  // In planar mappings, m_bCapped=false means "the Z texture coordinate will always be 0.0"
    676  // this is now the default behaviour in Rhino 5.0 - it's what users expect apparently.
    677  bool m_bCapped = false;
    678 
    679  //////////////////////////////////////////////////////////
    680  //
    681  // For primitive based mappings, these transformations are
    682  // used to map the world coordinate (x,y,z) point P and
    683  // surface normal N before it is projected to the normalized
    684  // mapping primitive. The surface normal transformation,
    685  // m_Nxyz, is always calculated from m_Pxyz. It is a
    686  // runtime setting that is not saved in 3dm files.
    687  // If m_type is srfp_mapping, then m_Pxyz and m_Nxyz are
    688  // ignored.
    689  ON_Xform m_Pxyz = ON_Xform::IdentityTransformation;
    690  ON_Xform m_Nxyz = ON_Xform::IdentityTransformation;
    691 
    692  // Transform applied to mapping coordinate (u,v,w) to
    693  // convert it into a texture coordinate.
    694  ON_Xform m_uvw = ON_Xform::IdentityTransformation;
    695 
    696  ON__UINT32 MappingCRC() const;
    697 
    698  // Custom mapping primitive.
    699  // Returns nullptr if no custom mapping primitive is stored in this texture mapping definition.
    700  const ON_Object* CustomMappingPrimitive(void) const;
    701 
    702  //Returns a valid mesh if the custom mapping primitive is a mesh. Otherwise nullptr.
    703  //Implementation is return ON_Mesh::Cast(CustomMappingPrimitive());
    704  const ON_Mesh* CustomMappingMeshPrimitive(void) const;
    705 
    706  //Returns a valid brep if the custom mapping primitive is a brep. Otherwise nullptr.
    707  //Implementation is return ON_Brep::Cast(CustomMappingPrimitive());
    708  const ON_Brep* CustomMappingBrepPrimitive(void) const;
    709 
    710  //Returns a valid surface if the custom mapping primitive is a surface. Otherwise nullptr.
    711  //Implementation is return ON_Surface::Cast(CustomMappingPrimitive());
    712  const ON_Surface* CustomMappingSurfacePrimitive(void) const;
    713 
    714  void SetCustomMappingPrimitive(ON_Object*);
    715 
    716 private:
    717 #pragma ON_PRAGMA_WARNING_PUSH
    718 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    719  // C4251: ... needs to have dll-interface to be used by clients of class ...
    720  // m_mapping_primitive is private and all code that manages m_mapping_primitive is explicitly implemented in the DLL.
    721 private:
    722  std::shared_ptr<ON_Object> m_mapping_primitive = nullptr;
    723 #pragma ON_PRAGMA_WARNING_POP
    724 };
    725 
    726 #if defined(ON_DLL_TEMPLATE)
    727 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_TextureMapping*>;
    728 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_TextureMapping*>;
    729 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_TextureMapping>;
    730 #endif
    731 
    732 #endif
    733 
    Definition: opennurbs_brep.h:937
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // defines ON_TextureMapping
    20 //
    21 ////////////////////////////////////////////////////////////////
    22 
    23 #if !defined(OPENNURBS_TEXTURE_MAPPING_INC_)
    24 #define OPENNURBS_TEXTURE_MAPPING_INC_
    25 
    26 ///////////////////////////////////////////////////////////////////////////////
    27 //
    28 // Class ON_TextureMapping
    29 //
    30 class ON_Line;
    31 class ON_BrepFace;
    32 class ON_3dPoint;
    33 
    34 typedef int ( *TEXMAP_INTERSECT_LINE_SURFACE )( const ON_Line*, const ON_BrepFace*, ON_SimpleArray<ON_X_EVENT>& );
    35 typedef bool ( *TEXMAP_BREP_FACE_CLOSEST_POINT )( const ON_BrepFace*, const ON_3dPoint*, ON_3dPoint& );
    36 
    37 class ON_CLASS ON_TextureMapping : public ON_ModelComponent
    38 {
    39  ON_OBJECT_DECLARE(ON_TextureMapping);
    40 
    41 public:
    42 
    43  static const ON_TextureMapping Unset; // nil id
    44 
    45  // ON_TextureMapping::SurfaceParameterTextureMapping
    46  // has m_type = ON_TextureMapping::srfp_mapping and m_id = nil;
    48 
    49  /*
    50  Parameters:
    51  model_component_reference - [in]
    52  none_return_value - [in]
    53  value to return if ON_Material::Cast(model_component_ref.ModelComponent())
    54  is nullptr
    55  Returns:
    56  If ON_Material::Cast(model_component_ref.ModelComponent()) is not nullptr,
    57  that pointer is returned. Otherwise, none_return_value is returned.
    58  */
    59  static const ON_TextureMapping* FromModelComponentRef(
    60  const class ON_ModelComponentReference& model_component_reference,
    61  const ON_TextureMapping* none_return_value
    62  );
    63 
    64 public:
    65  //////////////////////////////////////////////////////////
    66  //
    67  // Mapping types:
    68  //
    69  // You can either calculate texture coordinates based on
    70  // the parameterization of the surface used to create a mesh,
    71  // or project the natural parameterization from a mapping
    72  // primitive, like a plane, sphere, box, or cylinder.
    73  //
    74  // Do not change TYPE enum values - they are saved in 3dm files.
    75  //
    76  enum class TYPE : unsigned int
    77  {
    78  no_mapping = 0,
    79  srfp_mapping = 1, // u,v = linear transform of surface params,w = 0
    80  plane_mapping = 2, // u,v,w = 3d coordinates wrt frame
    81  cylinder_mapping = 3, // u,v,w = logitude, height, radius
    82  sphere_mapping = 4, // (u,v,w) = longitude,latitude,radius
    83  box_mapping = 5,
    84  mesh_mapping_primitive = 6, // m_mapping_primitive is an ON_Mesh
    85  srf_mapping_primitive = 7, // m_mapping_primitive is an ON_Surface
    86  brep_mapping_primitive = 8 // m_mapping_primitive is an ON_Brep
    87  };
    88 
    89  static ON_TextureMapping::TYPE TypeFromUnsigned(
    90  unsigned int type_as_unsigned
    91  );
    92 
    93  static const ON_wString TypeToString(
    94  ON_TextureMapping::TYPE texture_mapping_type
    95  );
    96 
    97  //////////////////////////////////////////////////////////
    98  //
    99  // Projection:
    100  //
    101  // When a mapping primitive, like a plane, sphere, box,
    102  // or cylinder, is used, there are two projection options.
    103  //
    104  // clspt_projection: world xyz maps to the point on the
    105  // mapping primitive that is closest to xyz.
    106  // In this case, ON_TextureMapping::Evaluate
    107  // ignores the vector argument.
    108  //
    109  // ray_projection: world xyz + world vector defines a world line.
    110  // The world line is intersected with the mapping
    111  // primitive and the intersection point that is
    112  // closest to the world xyz point is used to
    113  // calculate the mapping parameters.
    114  //
    115  // The value of m_projection can be changed as needed.
    116  //
    117  // If m_type = srfp_mapping, then m_projection is ignored.
    118  //
    119  enum class PROJECTION : unsigned int
    120  {
    121  no_projection = 0,
    122  clspt_projection = 1,
    123  ray_projection = 2
    124  };
    125 
    126  static ON_TextureMapping::PROJECTION ProjectionFromUnsigned(
    127  unsigned int projection_as_unsigned
    128  );
    129 
    130  static const ON_wString ProjectionToString(
    131  ON_TextureMapping::PROJECTION texture_mapping_projection
    132  );
    133 
    134  //////////////////////////////////////////////////////////
    135  //
    136  // Texture space
    137  //
    138  // When a mapping primitive is a box or a capped cylinder,
    139  // there are two options for the mapping. Either the sides
    140  // all map to (0,1)x(0,1) (so the either texture map appears
    141  // on each side, or the sides map to distinct regions of the
    142  // texture space.
    143  //
    144  enum class TEXTURE_SPACE : unsigned int
    145  {
    146  single = 0, // sides and caps map to same texture space
    147  divided = 1 // sides and caps map to distinct vertical
    148  // regions of texture space.
    149  // (0, 1/4, 2/4, 3/4, 1) for uncapped boxes.
    150  // (0, 1/6, 2/6, 3/6, 4/6, 5/6, 1) for capped boxes.
    151  // (0, 4/6, 5/6, 1) for capped cylinders.
    152  };
    153 
    154  static ON_TextureMapping::TEXTURE_SPACE TextureSpaceFromUnsigned(
    155  unsigned int texture_space_as_unsigned
    156  );
    157 
    158  static const ON_wString SpaceToString(
    159  ON_TextureMapping::TEXTURE_SPACE texture_mapping_space
    160  );
    161 
    162 public:
    163  ON_TextureMapping() ON_NOEXCEPT;
    165  virtual ~ON_TextureMapping();
    166  ON_TextureMapping& operator=(const ON_TextureMapping& src);
    167 
    168 private:
    169  void Internal_CopyFrom(
    170  const ON_TextureMapping& src
    171  );
    172 
    173  void Internal_Destroy();
    174 
    175  bool Internal_WriteV5(
    176  ON_BinaryArchive& binary_archive
    177  ) const;
    178 
    179  bool Internal_ReadV5(
    180  ON_BinaryArchive& binary_archive
    181  );
    182 
    183 public:
    184  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    185 
    186  void Dump( ON_TextLog& ) const override;
    187 
    188  unsigned int SizeOf() const override;
    189 
    190  bool Write(
    191  ON_BinaryArchive& binary_archive
    192  ) const override;
    193 
    194  bool Read(
    195  ON_BinaryArchive& binary_archive
    196  ) override;
    197 
    198  /*
    199  Determines whether the mapping, as currently set up, requires vertex normals to be present on the
    200  mesh in order to evaluate the mapping correctly.
    201  */
    202  bool RequiresVertexNormals() const;
    203  bool IsPeriodic(void) const;
    204 
    205  /*
    206  Description:
    207  Create a mapping that will convert surface parameters into
    208  normalized (0,1)x(0,1) texture coordinates.
    209  */
    210  bool SetSurfaceParameterMapping(void);
    211 
    212  /*
    213  Description:
    214  Create a planar projection texture mapping.
    215  Parameters:
    216  plane - [in]
    217  dx - [in] portion of the plane's x axis that is mapped to [0,1]
    218  (can be a decreasing interval)
    219  dy - [in] portion of the plane's x axis that is mapped to [0,1]
    220  (can be a decreasing interval)
    221  dz - [in] portion of the plane's x axis that is mapped to [0,1]
    222  (can be a decreasing interval)
    223  projection_method - [in]
    224  1: Closest point mapping.
    225  A target point P is mapped to the point on the plane
    226  that is closest to P. The target normal is ignored.
    227  2: Target line mapping. A target point-vector pair
    228  (P, N), are mapped to the point on the plane
    229  where the line through P, parallel to N, intersects
    230  the plane. If the line is parallel to the plane,
    231  the closest point mapping is used.
    232  Example:
    233  Create a mapping that maps the world axis aligned rectangle in
    234  the world yz plane with corners at (0,3,5) and (0,7,19) to the
    235  texture coordinate unit square.
    236 
    237  ON_3dVector plane_xaxis(0.0,1.0,0.0);
    238  ON_3dVector plane_yaxis(0.0,0,0,1.0);
    239  ON_3dPoint plane_origin(0.0,2.0,4.0);
    240  ON_Plane plane(plane_origin,plane_xaxis,plane_yaxis);
    241  ON_Interval dx( 0.0, 7.0 - 3.0);
    242  ON_Interval dy( 0.0, 19.0 - 5.0);
    243  ON_Interval dz( 0.0, 1.0 );
    244  ON_TextureMapping mapping;
    245  mapping.CreatePlaneMapping(plane,dx,dy,dz);
    246 
    247  Returns:
    248  True if input is valid.
    249  */
    250  bool SetPlaneMapping(
    251  const ON_Plane& plane,
    252  const ON_Interval& dx,
    253  const ON_Interval& dy,
    254  const ON_Interval& dz
    255  );
    256 
    257  /*
    258  Description:
    259  Create a cylindrical projection texture mapping.
    260  Parameters:
    261  cylinder - [in]
    262  cylinder in world space used to define a cylindrical
    263  coordinate system. The angular parameter maps (0,2pi)
    264  to texture "u" (0,1), The height parameter maps
    265  (height[0],height[1]) to texture "v" (0,1), and
    266  the radial parameter maps (0,r) to texture "w" (0,1).
    267  bIsCapped - [in]
    268  If true, the cylinder is treated as a finite
    269  capped cylinder.
    270  Returns:
    271  True if input is valid.
    272  Remarks:
    273  When the cylinder is capped and m_texture_space = divided,
    274  the cylinder is mapped to texture space as follows:
    275  The side is mapped to 0 <= "u" <= 2/3.
    276  The bottom is mapped to 2/3 <= "u" <= 5/6.
    277  The top is mapped to 5/6 <= "u" <= 5/6.
    278  This is the same convention box mapping uses.
    279  */
    280  bool SetCylinderMapping(
    281  const ON_Cylinder& cylinder,
    282  bool bIsCapped
    283  );
    284 
    285  /*
    286  Description:
    287  Create a spherical projection texture mapping.
    288  Parameters:
    289  sphere - [in]
    290  sphere in world space used to define a spherical
    291  coordinate system. The longitude parameter maps
    292  (0,2pi) to texture "u" (0,1). The latitude paramter
    293  maps (-pi/2,+pi/2) to texture "v" (0,1).
    294  The radial parameter maps (0,r) to texture "w" (0,1).
    295  Returns:
    296  True if input is valid.
    297  */
    298  bool SetSphereMapping(
    299  const ON_Sphere& sphere
    300  );
    301 
    302  /*
    303  Description:
    304  Create a box projection texture mapping.
    305  Parameters:
    306  plane - [in]
    307  The sides of the box the box are parallel to the
    308  plane's coordinate planes. The dx, dy, dz intervals
    309  determine the location of the sides.
    310  dx - [in]
    311  Determines the location of the front and back planes.
    312  The vector plane.xaxis is perpendicular to these planes
    313  and they pass through plane.PointAt(dx[0],0,0) and
    314  plane.PointAt(dx[1],0,0), respectivly.
    315  dy - [in]
    316  Determines the location of the left and right planes.
    317  The vector plane.yaxis is perpendicular to these planes
    318  and they pass through plane.PointAt(0,dy[0],0) and
    319  plane.PointAt(0,dy[1],0), respectivly.
    320  dz - [in]
    321  Determines the location of the top and bottom planes.
    322  The vector plane.zaxis is perpendicular to these planes
    323  and they pass through plane.PointAt(0,0,dz[0]) and
    324  plane.PointAt(0,0,dz[1]), respectivly.
    325  bIsCapped - [in]
    326  If true, the box is treated as a finite
    327  capped box.
    328  Returns:
    329  True if input is valid.
    330  Remarks:
    331  When m_texture_space = divided, the box is mapped to texture
    332  space as follows:
    333 
    334  If the box is not capped, then each side maps to 1/4 of the texture map.
    335 
    336  v=1+---------+---------+---------+---------+
    337  | x=dx[1] | y=dy[1] | x=dx[0] | y=dy[0] |
    338  | Front | Right | Back | Left |
    339  | --y-> | <-x-- | <-y-- | --x-> |
    340  v=0+---------+---------+---------+---------+
    341  0/4 <=u<= 1/4 <=u<= 2/4 <=u<= 3/4 <=u<= 4/4
    342 
    343  If the box is capped, then each side and cap gets 1/6 of the texture map.
    344 
    345  v=1+---------+---------+---------+---------+---------+---------+
    346  | x=dx[1] | y=dy[1] | x=dx[0] | y=dy[0] | z=dx[1] | z=dz[0] |
    347  | Front | Right | Back | Left | Top | Bottom |
    348  | --y-> | <-x-- | <-y-- | --x-> | --x-> | --x-> |
    349  v=0+---------+---------+---------+---------+---------+---------+
    350  0/6 <=u<= 1/6 <=u<= 2/6 <=u<= 3/6 <=u<= 4/6 <=u<= 5/6 <=u<= 6/6
    351  */
    352  bool SetBoxMapping(
    353  const ON_Plane& plane,
    354  ON_Interval dx,
    355  ON_Interval dy,
    356  ON_Interval dz,
    357  bool bIsCapped
    358  );
    359 
    360  /*
    361  Description:
    362  Get plane mapping parameters from this texture mapping.
    363  Parameters:
    364  plane - [out]
    365  dx - [out]
    366  Portion of the plane's x axis that is mapped to [0,1]
    367  dy - [out]
    368  Portion of the plane's y axis that is mapped to [0,1]
    369  dz - [out]
    370  Portion of the plane's z axis that is mapped to [0,1]
    371  Returns:
    372  True if valid plane mapping parameters were returned.
    373  Remarks:
    374  NOTE WELL:
    375  Generally, GetMappingPlane will not return the same
    376  parameters passed to SetPlaneMapping. However, the
    377  location of the plane will be the same.
    378  */
    379  bool GetMappingPlane(
    380  ON_Plane& plane,
    381  ON_Interval& dx,
    382  ON_Interval& dy,
    383  ON_Interval& dz
    384  ) const;
    385 
    386  /*
    387  Description:
    388  Get a cylindrical projection parameters from this texture mapping.
    389  Parameters:
    390  cylinder - [out]
    391  Returns:
    392  True if a valid cylinder is returned.
    393  Remarks:
    394  Generally, GetMappingCylinder will not return the same
    395  parameters passed to SetCylinderMapping. However, the
    396  location of the cylinder will be the same.
    397  If this mapping is not cylindrical, the cylinder will
    398  approximate the actual mapping primitive.
    399  */
    400  bool GetMappingCylinder(
    401  ON_Cylinder& cylinder
    402  ) const;
    403 
    404  /*
    405  Description:
    406  Get a spherical projection parameters from this texture mapping.
    407  Parameters:
    408  sphere - [out]
    409  Returns:
    410  True if a valid sphere is returned.
    411  Remarks:
    412  Generally, GetMappingShere will not return the same
    413  parameters passed to SetSphereMapping. However, the
    414  location of the sphere will be the same.
    415  If this mapping is not cylindrical, the cylinder will
    416  approximate the actual mapping primitive.
    417  */
    418  bool GetMappingSphere(
    419  ON_Sphere& sphere
    420  ) const;
    421 
    422  /*
    423  Get a box projection from the texture mapping.
    424  Parameters:
    425  plane - [out]
    426  The center of the box is at plane.origin and the sides
    427  of the box are parallel to the plane's coordinate planes.
    428  dx - [out]
    429  The "front" and "back" sides of the box are in spanned
    430  by the vectors plane.yaxis and plane.zaxis. The back
    431  plane contains the point plane.PointAt(dx[0],0,0) and
    432  the front plane contains the point plane.PointAt(dx[1],0,0).
    433  dy - [out]
    434  The "left" and "right" sides of the box are in spanned
    435  by the vectors plane.zaxis and plane.xaxis. The left
    436  plane contains the point plane.PointAt(0,dx[0],0) and
    437  the back plane contains the point plane.PointAt(0,dy[1],0).
    438  dz - [out]
    439  The "top" and "bottom" sides of the box are in spanned
    440  by the vectors plane.xaxis and plane.yaxis. The bottom
    441  plane contains the point plane.PointAt(0,0,dz[0]) and
    442  the top plane contains the point plane.PointAt(0,0,dz[1]).
    443  Returns:
    444  True if a valid box is returned.
    445  Remarks:
    446  Generally, GetMappingBox will not return the same
    447  parameters passed to SetBoxMapping. However, the
    448  location of the box will be the same.
    449  */
    450  bool GetMappingBox(
    451  ON_Plane& plane,
    452  ON_Interval& dx,
    453  ON_Interval& dy,
    454  ON_Interval& dz
    455  ) const;
    456 
    457 
    458  /*
    459  Description:
    460  Reverses the texture in the specified direction.
    461  Parameters:
    462  dir - [in] 0 = reverse "u", 1 = reverse "v", 2 = reverse "w".
    463  Remarks:
    464  Modies m_uvw so that the spedified direction transforms
    465  the texture coordinate t to 1-t.
    466  Returns:
    467  True if input is valid.
    468  */
    469  bool ReverseTextureCoordinate( int dir );
    470 
    471  /*
    472  Description:
    473  Swaps the specified texture coordinates.
    474  Parameters:
    475  i - [in]
    476  j - [in]
    477  Remarks:
    478  Modifies m_uvw so that the specified texture coordinates are swapped.
    479  Returns:
    480  True if input is valid.
    481  */
    482  bool SwapTextureCoordinate( int i, int j );
    483 
    484  /*
    485  Description:
    486  Tiles the specified texture coordinates.
    487  Parameters:
    488  dir - [in] 0 = "u", 1 = "v", 2 = "w".
    489  count - [in] number of tiles
    490  offset - [in] offset of the tile
    491  Remarks:
    492  Modies m_uvw so that the specified texture coordinate is
    493  tiled.
    494  Returns:
    495  True if input is valid.
    496  */
    497  bool TileTextureCoordinate( int dir, double count, double offset );
    498 
    499  /*
    500  Description:
    501  Evaluate the mapping to get a texture coordinate.
    502  Parameters:
    503  P - [in] Vertex location
    504  N - [in] If the mapping projection is ray_projection,
    505  then this is the vertex unit normal. Otherwise
    506  N is ignored.
    507  T - [out] Texture coordinate (u,v,w)
    508 
    509  P_xform -[in]
    510  Transformation to be applied to P before performing
    511  the mapping calculation.
    512  N_xform - [in]
    513  Transformation to be applied to N before performing
    514  the mapping calculation. One way to calculate N_xform
    515  is to use the call P_xform::GetVectorTransform(N_xform).
    516 
    517  Returns:
    518  Nonzero if evaluation is successful. When the mapping
    519  is a box or capped cylinder mapping, the value indicates
    520  which side was evaluated.
    521 
    522  Cylinder mapping:
    523  1 = cylinder wall, 2 = bottom cap, 3 = top cap
    524  Box mapping:
    525  1 = front
    526  2 = right
    527  3 = back
    528  4 = left
    529  5 = bottom
    530  6 = top
    531 
    532  See Also:
    533  ON_TextureMapping::GetTextureCoordinates
    534  ON_Mesh::SetTextureCoordinates
    535  */
    536  virtual
    537  int Evaluate(
    538  const ON_3dPoint& P,
    539  const ON_3dVector& N,
    540  ON_3dPoint* T
    541  ) const;
    542 
    543  virtual
    544  int Evaluate(
    545  const ON_3dPoint& P,
    546  const ON_3dVector& N,
    547  ON_3dPoint* T,
    548  const ON_Xform& P_xform,
    549  const ON_Xform& N_xform
    550  ) const;
    551 
    552  int EvaluatePlaneMapping(
    553  const ON_3dPoint& P,
    554  const ON_3dVector& N,
    555  ON_3dPoint* T
    556  ) const;
    557 
    558  int EvaluateSphereMapping(
    559  const ON_3dPoint& P,
    560  const ON_3dVector& N,
    561  ON_3dPoint* T
    562  ) const;
    563 
    564  int EvaluateCylinderMapping(
    565  const ON_3dPoint& P,
    566  const ON_3dVector& N,
    567  ON_3dPoint* T
    568  ) const;
    569 
    570  int EvaluateBoxMapping(
    571  const ON_3dPoint& P,
    572  const ON_3dVector& N,
    573  ON_3dPoint* T
    574  ) const;
    575 
    576 
    577  /*
    578  Description:
    579  Quickly check to see if a mesh or tag has texture coordinates
    580  set by this mapping.
    581  Parameters:
    582  mesh - [in]
    583  tag - [in]
    584  object_xform - [in] (optional)
    585  If this transform is not nullptr, then true will be
    586  returned only if the mapping function is the same and
    587  the tag's m_mesh_xform field is the same as mesh_xform.
    588  This parameter is typically nullptr or the value of
    589  ON_MappingRef::m_object_xform.
    590  Returns:
    591  True if the meshes texture coordinates were set by this
    592  mapping.
    593  */
    594  bool HasMatchingTextureCoordinates(
    595  const ON_Mesh& mesh,
    596  const ON_Xform* object_xform = nullptr
    597  ) const;
    598 
    599  bool HasMatchingTextureCoordinates(
    600  const class ON_MappingTag& tag,
    601  const ON_Xform* object_xform = nullptr
    602  ) const;
    603 
    604  /*
    605  Description:
    606  Get texture coordinates. This calculation is
    607  expensive. When possible, use a MappingMatch()
    608  query to avoid unnecessary calculations.
    609  Parameters:
    610  mesh - [in]
    611  T - [out] Texture coordinates returned here.
    612  mesh_xform - [in] (optional)
    613  If the mesh has been transformed since the texture mapping was set
    614  up, pass the transformation here. Typically this is the value
    615  of ON_Mesh::m_mapping_xform or ON_MappingRef::m_object_xform
    616  bLazy - [in]
    617  If true and the mesh.m_T[] values were calculated using
    618  this mapping, they are simply copied to the T[] array
    619  and no calculations are performed. If you are calling
    620  the 3d point version and you care about the z-coordinate,
    621  then do not use the lazy option (meshes only store
    622  2d texture coordinates).
    623  Tside - [out]
    624  In the case of divided textures, side information is returned
    625  here if a lazy mapping is not done. Otherwise Tside->Count()
    626  will be zero.
    627  Cylinder mapping:
    628  1 = cylinder wall, 2 = bottom cap, 3 = top cap
    629  Box mapping:
    630  1 = front
    631  2 = right
    632  3 = back
    633  4 = left
    634  5 = bottom
    635  6 = top
    636  Example:
    637 
    638  ON_TextureMapping mapping = ...;
    639  const ON_Mesh* mesh = ...;
    640  bool bLazy = true;
    641  ON_SimpleArray<ON_3dPoint> T(mesh->VertexCount());
    642  T.SetCount(mesh->m_VertexCount());
    643  if ( !mapping.GetTextureCoordinates(mesh,3,3,&T[0].x,bLazy) )
    644  T.SetCount(0).
    645 
    646  Returns:
    647  True if successful.
    648  */
    649  bool GetTextureCoordinates(
    650  const ON_Mesh& mesh,
    652  const ON_Xform* mesh_xform = 0,
    653  bool bLazy = false,
    654  ON_SimpleArray<int>* Tside = 0
    655  ) const;
    656 
    657  bool GetTextureCoordinates(
    658  const ON_Mesh& mesh,
    660  const ON_Xform* mesh_xform = 0,
    661  bool bLazy = false,
    662  ON_SimpleArray<int>* Tside = 0
    663  ) const;
    664 
    665 public:
    666 
    667 
    668 public:
    672 
    673  // The m_bCapped applies to planar, cylinder and box mappings.
    674  // If m_bCapped is false, the cylinder or box is "infinite", if m_bCapped is true, they are finite.
    675  // In planar mappings, m_bCapped=false means "the Z texture coordinate will always be 0.0"
    676  // this is now the default behaviour in Rhino 5.0 - it's what users expect apparently.
    677  bool m_bCapped = false;
    678 
    679  //////////////////////////////////////////////////////////
    680  //
    681  // For primitive based mappings, these transformations are
    682  // used to map the world coordinate (x,y,z) point P and
    683  // surface normal N before it is projected to the normalized
    684  // mapping primitive. The surface normal transformation,
    685  // m_Nxyz, is always calculated from m_Pxyz. It is a
    686  // runtime setting that is not saved in 3dm files.
    687  // If m_type is srfp_mapping, then m_Pxyz and m_Nxyz are
    688  // ignored.
    691 
    692  // Transform applied to mapping coordinate (u,v,w) to
    693  // convert it into a texture coordinate.
    695 
    696  ON__UINT32 MappingCRC() const;
    697 
    698  // Custom mapping primitive.
    699  // Returns nullptr if no custom mapping primitive is stored in this texture mapping definition.
    700  const ON_Object* CustomMappingPrimitive(void) const;
    701 
    702  //Returns a valid mesh if the custom mapping primitive is a mesh. Otherwise nullptr.
    703  //Implementation is return ON_Mesh::Cast(CustomMappingPrimitive());
    704  const ON_Mesh* CustomMappingMeshPrimitive(void) const;
    705 
    706  //Returns a valid brep if the custom mapping primitive is a brep. Otherwise nullptr.
    707  //Implementation is return ON_Brep::Cast(CustomMappingPrimitive());
    708  const ON_Brep* CustomMappingBrepPrimitive(void) const;
    709 
    710  //Returns a valid surface if the custom mapping primitive is a surface. Otherwise nullptr.
    711  //Implementation is return ON_Surface::Cast(CustomMappingPrimitive());
    712  const ON_Surface* CustomMappingSurfacePrimitive(void) const;
    713 
    714  void SetCustomMappingPrimitive(ON_Object*);
    715 
    716 private:
    717 #pragma ON_PRAGMA_WARNING_PUSH
    718 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    719  // C4251: ... needs to have dll-interface to be used by clients of class ...
    720  // m_mapping_primitive is private and all code that manages m_mapping_primitive is explicitly implemented in the DLL.
    721 private:
    722  std::shared_ptr<ON_Object> m_mapping_primitive = nullptr;
    723 #pragma ON_PRAGMA_WARNING_POP
    724 };
    725 
    726 #if defined(ON_DLL_TEMPLATE)
    727 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_TextureMapping*>;
    728 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_TextureMapping*>;
    729 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_TextureMapping>;
    730 #endif
    731 
    732 #endif
    733 
    Definition: opennurbs_brep.h:937
    Definition: opennurbs_model_component.h:25
    Definition: opennurbs_mesh.h:2173
    +
    sides and caps map to same texture space
    TEXTURE_SPACE
    Definition: opennurbs_texture_mapping.h:144
    Definition: opennurbs_array.h:36
    static const ON_TextureMapping SurfaceParameterTextureMapping
    Definition: opennurbs_texture_mapping.h:47
    TYPE
    Definition: opennurbs_texture_mapping.h:76
    static const ON_TextureMapping Unset
    nil id
    Definition: opennurbs_texture_mapping.h:43
    Definition: opennurbs_cylinder.h:28
    -
    Definition: opennurbs_fpoint.h:216
    Definition: opennurbs_array.h:732
    Definition: opennurbs_string.h:2089
    +
    static const ON_Xform IdentityTransformation
    ON_Xform IdentityTransformation diagonal = (1,1,1,1)
    Definition: opennurbs_xform.h:32
    PROJECTION
    Definition: opennurbs_texture_mapping.h:119
    Definition: opennurbs_xform.h:28
    + +
    Definition: opennurbs_mesh.h:2241
    Definition: opennurbs_texture_mapping.h:37
    Definition: opennurbs_line.h:20
    @@ -90,7 +91,6 @@ $(function() {
    Definition: opennurbs_object.h:433
    Definition: opennurbs_textlog.h:20
    < use for generic serialization of binary data
    Definition: opennurbs_archive.h:1866
    -
    Definition: opennurbs_fpoint.h:38
    Definition: opennurbs_model_component.h:1686
    Definition: opennurbs_point.h:480
    Definition: opennurbs_plane.h:20
    @@ -101,9 +101,9 @@ $(function() {
    diff --git a/6/da/d8d/class_o_n___angle_unit_name.html b/6/da/d8d/class_o_n___angle_unit_name.html index 071ab884..af93d52a 100644 --- a/6/da/d8d/class_o_n___angle_unit_name.html +++ b/6/da/d8d/class_o_n___angle_unit_name.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_AngleUnitName Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/da/d8e/class_o_n___mesh_topology.html b/6/da/d8e/class_o_n___mesh_topology.html index 47e83a6c..4da0fc86 100644 --- a/6/da/d8e/class_o_n___mesh_topology.html +++ b/6/da/d8e/class_o_n___mesh_topology.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshTopology Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d94/opennurbs__bitmap_8h_source.html b/6/da/d94/opennurbs__bitmap_8h_source.html index d4379a2f..1eb50006 100644 --- a/6/da/d94/opennurbs__bitmap_8h_source.html +++ b/6/da/d94/opennurbs__bitmap_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_bitmap.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_bitmap.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_bitmap.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // Defines ON_WindowsBITMAPINFO class that is used to provide OS independent
    20 // serialization of Windows device independent bitmaps (BITMAPINFO) used
    21 // to store preview images.
    22 //
    23 ////////////////////////////////////////////////////////////////
    24 
    25 #if !defined(OPENNURBS_BITMAP_INC_)
    26 #define OPENNURBS_BITMAP_INC_
    27 
    28 class ON_CLASS ON_Bitmap : public ON_ModelComponent
    29 {
    30  ON_OBJECT_DECLARE(ON_Bitmap);
    31 
    32 public:
    33  ON_Bitmap() ON_NOEXCEPT;
    34  ~ON_Bitmap() = default;
    35  ON_Bitmap(const ON_Bitmap&);
    36  ON_Bitmap& operator=(const ON_Bitmap&) = default;
    37 
    38  static const ON_Bitmap Unset;
    39 
    40  /*
    41  Parameters:
    42  model_component_reference - [in]
    43  none_return_value - [in]
    44  value to return if ON_Layer::Cast(model_component_ref.ModelComponent())
    45  is nullptr
    46  Returns:
    47  If ON_Layer::Cast(model_component_ref.ModelComponent()) is not nullptr,
    48  that pointer is returned. Otherwise, none_return_value is returned.
    49  */
    50  static const ON_Bitmap* FromModelComponentRef(
    51  const class ON_ModelComponentReference& model_component_reference,
    52  const ON_Bitmap* none_return_value
    53  );
    54 
    55  void Dump(
    56  ON_TextLog&
    57  ) const override;
    58 
    59  bool Write( class ON_BinaryArchive& ) const override;
    60  bool Read( class ON_BinaryArchive& ) override;
    61 
    62  unsigned int SizeOf() const override;
    63 
    64  virtual
    65  int Width() const;
    66 
    67  virtual
    68  int Height() const; // >0 means it's a bottom-up bitmap with origin at lower right
    69  // <0 means it's a top-down bitmap with origin at upper left
    70  virtual
    71  int BitsPerPixel() const; // bits per pixel
    72 
    73  virtual
    74  size_t SizeofScan() const; // number of bytes per scan line
    75 
    76  virtual
    77  size_t SizeofImage() const; // size of current map in bytes
    78 
    79  virtual
    80  unsigned char* Bits(
    81  int scan_line_index
    82  );
    83 
    84  virtual
    85  const unsigned char* Bits(
    86  int scan_line_index
    87  ) const;
    88 
    89  const ON_FileReference& FileReference() const;
    90  void SetFileReference(
    91  const ON_FileReference& file_reference
    92  );
    93  void SetFileFullPath(
    94  const wchar_t* file_full_path,
    95  bool bSetContentHash
    96  );
    97 
    98 private:
    99  ON_FileReference m_file_reference;
    100 };
    101 
    102 #if defined(ON_DLL_TEMPLATE)
    103 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Bitmap*>;
    104 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_Bitmap*>;
    105 #endif
    106 
    107 #if !defined(ON_OS_WINDOWS_GDI)
    108 
    109 // These are the values of the Windows defines mentioned
    110 // in the comment below. If you're running on Windows,
    111 // they get defined by Windows system header files.
    112 // If you aren't running on Windows, then you don't
    113 // need them.
    114 //#define BI_RGB 0L
    115 //#define BI_RLE8 1L
    116 //#define BI_RLE4 2L
    117 //#define BI_BITFIELDS 3L
    118 
    119 // Windows sizeof(ON_WindowsRGBQUAD) = 4.
    121  // Mimics Windows RGBQUAD structure.
    122  // For details searh for "RGBQUAD" at http://msdn.microsoft.com/default.asp
    123  unsigned char rgbBlue; // BYTE
    124  unsigned char rgbGreen; // BYTE
    125  unsigned char rgbRed; // BYTE
    126  unsigned char rgbReserved; // BYTE
    127 };
    128 
    129 // Windows packs BITMAPFILEHEADER
    130 #pragma pack(push,2)
    132  unsigned short bfType; // WORD = file type, must be BM
    133  unsigned int bfSize; // DWORD = size, in bytes, of the bitmap file
    134  unsigned short bfReserved1; // WORD Reserved; must be zero
    135  unsigned short bfReserved2; // WORD Reserved; must be zero
    136  unsigned int bfOffBits; // DWORD = offset, in bytes, from the beginning of the BITMAPFILEHEADER structure to the bitmap bits
    137 };
    138 #pragma pack(pop)
    139 
    140 // Mimics Windows BITMAPINFOHEADER structure.
    141 // For details searh for "BITMAPINFOHEADER" at http://msdn.microsoft.com/default.asp
    142 // Windows sizeof(BITMAPINFOHEADER) = 80.
    144 {
    145  unsigned int biSize; // DWORD = sizeof(BITMAPINFOHEADER)
    146  int biWidth; // LONG = width (in pixels) of (decompressed) bitmap
    147  int biHeight; // LONG = height (in pixels) of (decompressed) bitmap
    148  // >0 means it's a bottom-up bitmap with origin
    149  // in the lower left corner.
    150  // <0 means it's a top-down bitmap with origin
    151  // in the upper left corner.
    152  unsigned short biPlanes; // WORD = number of planes
    153  // (always 1 in current Windows versions)
    154  unsigned short biBitCount; // WORD = bits per pixel (0,1,4,8,16,24,32 are valid)
    155  // 1 See http://msdn.microsoft.com/default.asp
    156  // 4 See http://msdn.microsoft.com/default.asp
    157  // 8 The bitmap has a maximum of 256 colors,
    158  // and the bmiColors member contains up
    159  // to 256 entries. In this case, each byte
    160  // in the array represents a single pixel.
    161  // 16 See http://msdn.microsoft.com/default.asp
    162  // 24 If biClrUsed=0 and biCompression=BI_RGB(0),
    163  // then each 3-byte triplet in the bitmap
    164  // array represents the relative intensities
    165  // of blue, green, and red, respectively, for
    166  // a pixel. For other possibilities, see
    167  // http://msdn.microsoft.com/default.asp
    168  // 32 If biClrUsed=0 and biCompression=BI_RGB(0),
    169  // then each 4-byte DWORD in the bitmap
    170  // array represents the relative intensities
    171  // of blue, green, and red, respectively, for
    172  // a pixel. The high byte in each DWORD is not
    173  // used.
    174  // If biClrUsed=3, biCompression=BITFIELDS(3),
    175  // biColors[0] = red mask (0x00FF0000),
    176  // biColors[1] = green mask (0x0000FF00), and
    177  // biColors[2] = blue mask (0x000000FF),
    178  // then tese masks are used with each 4-byte
    179  // DWORD in the bitmap array to determine
    180  // the pixel's relative intensities. //
    181  // For other possibilities, see
    182  // http://msdn.microsoft.com/default.asp
    183  unsigned int biCompression; // DWORD Currently, Windows defines the following
    184  // types of compression.
    185  // =0 BI_RGB (no compression)
    186  // =1 BI_RLE8 (run length encoded used for 8 bpp)
    187  // =2 BI_RLE4 (run length encoded used for 4 bpp)
    188  // =3 BI_BITFIELDS Specifies that the bitmap is
    189  // not compressed and that the color table
    190  // consists of three DWORD color masks that
    191  // specify the red, green, and blue components,
    192  // respectively, of each pixel. This is valid
    193  // when used with 16- and 32-bit-per-pixel
    194  // bitmaps.
    195  // =4 BI_JPEG (not supported in Win 95/NT4)
    196  //
    197  unsigned int biSizeImage; // DWORD = bytes in image
    198  int biXPelsPerMeter; // LONG
    199  int biYPelsPerMeter; // LONG
    200  unsigned int biClrUsed; // DWORD = 0 or true length of bmiColors[] array. If 0,
    201  // then the value of biBitCount determines the
    202  // length of the bmiColors[] array.
    203  unsigned int biClrImportant; // DWORD
    204 };
    205 
    207 {
    208  // Mimics Windows BITMAPINFO structure.
    209  // For details searh for "BITMAPINFO" at http://msdn.microsoft.com/default.asp
    211  ON_WindowsRGBQUAD bmiColors[1]; // The "[1]" is for the compiler. In
    212  // practice this array commonly has
    213  // length 0, 3, or 256 and a BITMAPINFO*
    214  // points to a contiguous piece of memory
    215  // that contains
    216  //
    217  // BITMAPINFOHEADER
    218  // RGBQUAD[length determined by flags]
    219  // unsigned char[biSizeImage]
    220  //
    221  // See the ON_WindowsBITMAPINFOHEADER comments
    222  // and http://msdn.microsoft.com/default.asp
    223  // for more details.
    224 };
    225 
    226 #endif
    227 
    228 class ON_CLASS ON_WindowsBitmap : public ON_Bitmap
    229 {
    230  ON_OBJECT_DECLARE(ON_WindowsBitmap);
    231  // Uncompressed 8 bpp, 24 bpp, or 32 bpp Windows device
    232  // independent bitmaps (DIB)
    233 public:
    234  ON_WindowsBitmap() = default;
    235  ~ON_WindowsBitmap();
    237  ON_WindowsBitmap& operator=(const ON_WindowsBitmap&);
    238 
    239  static const ON_WindowsBitmap Unset;
    240 
    241  /*
    242  Parameters:
    243  width - [in]
    244  height - [in]
    245  bits_per_pixel - [in]
    246  1, 2, 4, 8, 16, 24, or 32
    247  */
    248  bool Create(
    249  int width,
    250  int height,
    251  int bits_per_pixel
    252  );
    253 
    254  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    255 
    256  bool IsEmpty() const;
    257 
    258  bool Write( ON_BinaryArchive& ) const override; // writes compressed image
    259  bool Read( ON_BinaryArchive& ) override; // reads compressed image
    260  unsigned int SizeOf() const override;
    261 
    262 public:
    263  bool WriteCompressed( ON_BinaryArchive& ) const;
    264  bool ReadCompressed( ON_BinaryArchive& );
    265  bool WriteUncompressed( ON_BinaryArchive& ) const;
    266  bool ReadUncompressed( ON_BinaryArchive& );
    267 
    268 public:
    269  int Width() const override;
    270  int Height() const override; // >0 means it's a bottom-up bitmap with origin at lower right
    271  // <0 means it's a top-down bitmap with origin at upper left
    272 
    273  int PaletteColorCount() const; // number of colors in palette
    274  int SizeofPalette() const; // number of bytes in palette
    275 
    276  int BitsPerPixel() const override;
    277  size_t SizeofScan() const override; // number of bytes per scan line
    278  size_t SizeofImage() const override; // number of bytes in image
    279 
    280  unsigned char* Bits(
    281  int // index of scan line
    282  ) override;
    283  const unsigned char* Bits(
    284  int // index of scan line
    285  ) const override;
    286 
    287  //int PaletteIndex( ON_Color ) const; // for 8bpp bitmaps
    288 
    289  ON_Color Pixel(
    290  int, // 0 <= i < width
    291  int // 0 <= j < height
    292  ) const;
    293  ON_Color Pixel(
    294  int, // 0 <= i < width
    295  const unsigned char* // value of Bits( j )
    296  ) const;
    297 
    298  //bool SetColor( // sets entire map to specified color
    299  // ON_Color
    300  // );
    301 
    302 #if defined(ON_OS_WINDOWS_GDI)
    303 
    304  /*
    305  Description:
    306  Create an ON_WindowsBitmap from a contiguous bitmap.
    307  Copies src.
    308  Parameters:
    309  src - [in] contiguous Windows device independent bitmap.
    310  Remarks:
    311  If the current Windows BITMAPINFO is identical to ON_WindowsBITMAPINFO,
    312  then the result of this call is identical to
    313 
    314  int color_count = number of colors in bitmap's palette;
    315  ON_WindowsBitmap::Create( &src, &src.bmiColors[color_count], true ).
    316 
    317  See Also:
    318  ON_WindowsBitmap::Create
    319  */
    320  ON_WindowsBitmap( const BITMAPINFO& src );
    321 
    322  /*
    323  Description:
    324  Create an ON_WindowsBitmap from a contiguous bitmap.
    325  Shares bitmap memory with src.
    326  Parameters:
    327  src - [in] contiguous Windows device independent bitmap.
    328  See Also:
    329  ON_WindowsBitmap::Create
    330  Remarks:
    331  ~ON_WindowsBitmap will not delete src.
    332  */
    333  ON_WindowsBitmap( const BITMAPINFO* src );
    334 
    335  /*
    336  Description:
    337  Create an ON_WindowsBitmap from a contiguous bitmap.
    338  Copies src.
    339  Parameters:
    340  src - [in] contiguous Windows device independent bitmap.
    341  See Also:
    342  ON_WindowsBitmap::Create
    343  */
    344  ON_WindowsBitmap& operator=( const BITMAPINFO& src );
    345 
    346  /*
    347  Description:
    348  Create and ON_WindowsBitmap from a Windows BITMAPINFO pointer
    349  and a pointer to the bits.
    350 
    351  This is intended to make it easy to write compressed bimaps.
    352  For ON_WindowsBitmap classes created with ON_WindowsBitmap::Share,
    353  ON_WindowsBitmap::Destroy and ~ON_WindowsBitmap will
    354  not free the bmi and bits memory.
    355 
    356  Parameters:
    357  bmi - [in] valid BITMAPINFO
    358  bits - [in] bits for BITMAPINFO
    359  bCopy - [in] If true, the bmi and bits are copied into a contiguous
    360  bitmap that will be deleted by ~ON_WindowsBitmap.
    361  If false, the m_bmi and m_bits pointers on this class
    362  are simply set to bmi and bits. In this case,
    363  ~ON_WindowsBitmap will not free the bmi or bits
    364  memory.
    365 
    366  Example:
    367 
    368  ON_BinaryArchive archive = ...;
    369  BITMAPINFO* bmi = 0;
    370  unsigned char* bits = 0;
    371  int color_count = ...; // number of colors in palette
    372 
    373  int sizeof_palette = sizeof(bmi->bmiColors[0]) * color_count;
    374 
    375  BITMAPINFO* bmi = (LPBITMAPINFO)calloc( 1, sizeof(*bmi) + sizeof_palette );
    376 
    377  bmi->bmiHeader.biSize = sizeof(bmi->bmiHeader);
    378  bmi->bmiHeader.biWidth = width;
    379  bmi->bmiHeader.biHeight = height;
    380  bmi->bmiHeader.biPlanes = 1;
    381  bmi->bmiHeader.biBitCount = (USHORT)color_depth;
    382  bmi->bmiHeader.biCompression = BI_RGB;
    383  bmi->bmiHeader.biXPelsPerMeter = 0;
    384  bmi->bmiHeader.biYPelsPerMeter = 0;
    385  bmi->bmiHeader.biClrUsed = 0;
    386  bmi->bmiHeader.biClrImportant = 0;
    387  bmi->bmiHeader.biSizeImage = GetStorageSize();
    388 
    389  // initialize palette
    390  ...
    391 
    392  HBITMAP hbm = ::CreateDIBSection( nullptr, bmi, ..., (LPVOID*)&bits, nullptr, 0);
    393 
    394  {
    395  // Use ON_WindowsBitmap to write a compressed bitmap to
    396  // archive. Does not modify bmi or bits.
    397  ON_WindowsBitmap onbm;
    398  onbm.Create(bmi,bit,false);
    399  onbm.Write( arcive );
    400  }
    401 
    402  */
    403  bool Create(
    404  const BITMAPINFO* bmi,
    405  const unsigned char* bits,
    406  bool bCopy
    407  );
    408 
    409 #endif
    410 
    411  /*
    412  Returns:
    413  True if m_bmi and m_bits are in a single contiguous
    414  block of memory.
    415  False if m_bmi and m_bits are in two blocks of memory.
    416  */
    417  bool IsContiguous() const;
    418 
    419 #if defined(ON_OS_WINDOWS_GDI)
    420  BITMAPINFO* m_bmi = nullptr;
    421 #else
    422  struct ON_WindowsBITMAPINFO* m_bmi = nullptr;
    423 
    424  /*
    425 Description:
    426  Create an ON_WindowsBitmap from a contiguous bitmap ON_WindowsBITMAPINFO.
    427  Parameters:
    428  src - [in]
    429  A contiguous Windows device independent bitmap. This means that the
    430  "bits" in the bitmap begin at the memory location &m_bits->bmiColors[0].
    431  See Also:
    432  Remarks:
    433  ~ON_WindowsBitmap will not delete src.
    434  */
    435  bool Create (
    436  const struct ON_WindowsBITMAPINFO* src
    437  );
    438 #endif
    439 
    440  unsigned char* m_bits = nullptr;
    441 
    442 private:
    443  int m_bFreeBMI = 0; // 0 m_bmi and m_bits are not freed by ON_WindowsBitmap::Destroy
    444  // 1 m_bmi memory is freed by ON_WindowsBitmap::Destroy
    445  // 2 m_bits memory is freed by ON_WindowsBitmap::Destroy
    446  // 3 m_bmi and m_bits memory is freed by ON_WindowsBitmap::Destroy
    447 
    448 private:
    449  bool Internal_WriteV5( ON_BinaryArchive& ) const;
    450  bool Internal_ReadV5( ON_BinaryArchive& );
    451 
    452 protected:
    453  void Internal_Destroy();
    454  void Internal_Copy(
    455  const ON_WindowsBitmap& src
    456  );
    457 };
    458 
    459 /*
    460 Description:
    461  ON_WindowsBitmapEx is identical to ON_WindowsBitmap except that
    462  it's Read/Write functions save bitmap names.
    463 */
    464 class ON_CLASS ON_WindowsBitmapEx : public ON_WindowsBitmap
    465 {
    466  ON_OBJECT_DECLARE(ON_WindowsBitmapEx);
    467 public:
    468  ON_WindowsBitmapEx() = default;
    469  ~ON_WindowsBitmapEx() = default;
    470  ON_WindowsBitmapEx(const ON_WindowsBitmapEx&) = default;
    471  ON_WindowsBitmapEx& operator=(const ON_WindowsBitmapEx&) = default;
    472 
    473  static const ON_WindowsBitmapEx Unset;
    474 
    475  bool Write( ON_BinaryArchive& ) const override; // writes compressed image
    476  bool Read( ON_BinaryArchive& ) override; // reads compressed image
    477 
    478 private:
    479  bool Internal_WriteV5( ON_BinaryArchive& ) const; // writes compressed image
    480  bool Internal_ReadV5( ON_BinaryArchive& ); // reads compressed image
    481 };
    482 
    483 class ON_CLASS ON_EmbeddedBitmap : public ON_Bitmap
    484 {
    485  ON_OBJECT_DECLARE(ON_EmbeddedBitmap);
    486 public:
    487  ON_EmbeddedBitmap() = default;
    490  ON_EmbeddedBitmap& operator=(const ON_EmbeddedBitmap&);
    491 
    492  static const ON_EmbeddedBitmap Unset;
    493 
    494  void Create(
    495  size_t sizeof_buffer
    496  );
    497 
    498  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    499 
    500  bool Write( ON_BinaryArchive& ) const override;
    501  bool Read( ON_BinaryArchive& ) override;
    502  unsigned int SizeOf() const override;
    503 
    504  size_t SizeofImage() const override;
    505  unsigned char* Bits(int) override;
    506  const unsigned char* Bits(int) const override;
    507 
    508  const void* m_buffer = nullptr;
    509  size_t m_sizeof_buffer = 0;
    510  bool m_managed_buffer = false; // true means the ON_EmbeddedBitmap class manages m_buffer memory.
    511  ON__UINT32 m_buffer_crc32 = 0; // 32 bit crc from ON_CRC32
    512 
    513 private:
    514  bool Internal_WriteV5( ON_BinaryArchive& ) const;
    515  bool Internal_ReadV5( ON_BinaryArchive& );
    516 
    517 private:
    518  void Internal_Destroy();
    519  void Internal_Copy(
    520  const ON_EmbeddedBitmap& src
    521  );
    522 };
    523 
    524 #endif
    unsigned int bfSize
    DWORD = size, in bytes, of the bitmap file.
    Definition: opennurbs_bitmap.h:133
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // Defines ON_WindowsBITMAPINFO class that is used to provide OS independent
    20 // serialization of Windows device independent bitmaps (BITMAPINFO) used
    21 // to store preview images.
    22 //
    23 ////////////////////////////////////////////////////////////////
    24 
    25 #if !defined(OPENNURBS_BITMAP_INC_)
    26 #define OPENNURBS_BITMAP_INC_
    27 
    28 class ON_CLASS ON_Bitmap : public ON_ModelComponent
    29 {
    30  ON_OBJECT_DECLARE(ON_Bitmap);
    31 
    32 public:
    33  ON_Bitmap() ON_NOEXCEPT;
    34  ~ON_Bitmap() = default;
    35  ON_Bitmap(const ON_Bitmap&);
    36  ON_Bitmap& operator=(const ON_Bitmap&) = default;
    37 
    38  static const ON_Bitmap Unset;
    39 
    40  /*
    41  Parameters:
    42  model_component_reference - [in]
    43  none_return_value - [in]
    44  value to return if ON_Layer::Cast(model_component_ref.ModelComponent())
    45  is nullptr
    46  Returns:
    47  If ON_Layer::Cast(model_component_ref.ModelComponent()) is not nullptr,
    48  that pointer is returned. Otherwise, none_return_value is returned.
    49  */
    50  static const ON_Bitmap* FromModelComponentRef(
    51  const class ON_ModelComponentReference& model_component_reference,
    52  const ON_Bitmap* none_return_value
    53  );
    54 
    55  void Dump(
    56  ON_TextLog&
    57  ) const override;
    58 
    59  bool Write( class ON_BinaryArchive& ) const override;
    60  bool Read( class ON_BinaryArchive& ) override;
    61 
    62  unsigned int SizeOf() const override;
    63 
    64  virtual
    65  int Width() const;
    66 
    67  virtual
    68  int Height() const; // >0 means it's a bottom-up bitmap with origin at lower right
    69  // <0 means it's a top-down bitmap with origin at upper left
    70  virtual
    71  int BitsPerPixel() const; // bits per pixel
    72 
    73  virtual
    74  size_t SizeofScan() const; // number of bytes per scan line
    75 
    76  virtual
    77  size_t SizeofImage() const; // size of current map in bytes
    78 
    79  virtual
    80  unsigned char* Bits(
    81  int scan_line_index
    82  );
    83 
    84  virtual
    85  const unsigned char* Bits(
    86  int scan_line_index
    87  ) const;
    88 
    89  const ON_FileReference& FileReference() const;
    90  void SetFileReference(
    91  const ON_FileReference& file_reference
    92  );
    93  void SetFileFullPath(
    94  const wchar_t* file_full_path,
    95  bool bSetContentHash
    96  );
    97 
    98 private:
    99  ON_FileReference m_file_reference;
    100 };
    101 
    102 #if defined(ON_DLL_TEMPLATE)
    103 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Bitmap*>;
    104 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_Bitmap*>;
    105 #endif
    106 
    107 #if !defined(ON_OS_WINDOWS_GDI)
    108 
    109 // These are the values of the Windows defines mentioned
    110 // in the comment below. If you're running on Windows,
    111 // they get defined by Windows system header files.
    112 // If you aren't running on Windows, then you don't
    113 // need them.
    114 //#define BI_RGB 0L
    115 //#define BI_RLE8 1L
    116 //#define BI_RLE4 2L
    117 //#define BI_BITFIELDS 3L
    118 
    119 // Windows sizeof(ON_WindowsRGBQUAD) = 4.
    121  // Mimics Windows RGBQUAD structure.
    122  // For details searh for "RGBQUAD" at http://msdn.microsoft.com/default.asp
    123  unsigned char rgbBlue; // BYTE
    124  unsigned char rgbGreen; // BYTE
    125  unsigned char rgbRed; // BYTE
    126  unsigned char rgbReserved; // BYTE
    127 };
    128 
    129 // Windows packs BITMAPFILEHEADER
    130 #pragma pack(push,2)
    132  unsigned short bfType; // WORD = file type, must be BM
    133  unsigned int bfSize; // DWORD = size, in bytes, of the bitmap file
    134  unsigned short bfReserved1; // WORD Reserved; must be zero
    135  unsigned short bfReserved2; // WORD Reserved; must be zero
    136  unsigned int bfOffBits; // DWORD = offset, in bytes, from the beginning of the BITMAPFILEHEADER structure to the bitmap bits
    137 };
    138 #pragma pack(pop)
    139 
    140 // Mimics Windows BITMAPINFOHEADER structure.
    141 // For details searh for "BITMAPINFOHEADER" at http://msdn.microsoft.com/default.asp
    142 // Windows sizeof(BITMAPINFOHEADER) = 80.
    144 {
    145  unsigned int biSize; // DWORD = sizeof(BITMAPINFOHEADER)
    146  int biWidth; // LONG = width (in pixels) of (decompressed) bitmap
    147  int biHeight; // LONG = height (in pixels) of (decompressed) bitmap
    148  // >0 means it's a bottom-up bitmap with origin
    149  // in the lower left corner.
    150  // <0 means it's a top-down bitmap with origin
    151  // in the upper left corner.
    152  unsigned short biPlanes; // WORD = number of planes
    153  // (always 1 in current Windows versions)
    154  unsigned short biBitCount; // WORD = bits per pixel (0,1,4,8,16,24,32 are valid)
    155  // 1 See http://msdn.microsoft.com/default.asp
    156  // 4 See http://msdn.microsoft.com/default.asp
    157  // 8 The bitmap has a maximum of 256 colors,
    158  // and the bmiColors member contains up
    159  // to 256 entries. In this case, each byte
    160  // in the array represents a single pixel.
    161  // 16 See http://msdn.microsoft.com/default.asp
    162  // 24 If biClrUsed=0 and biCompression=BI_RGB(0),
    163  // then each 3-byte triplet in the bitmap
    164  // array represents the relative intensities
    165  // of blue, green, and red, respectively, for
    166  // a pixel. For other possibilities, see
    167  // http://msdn.microsoft.com/default.asp
    168  // 32 If biClrUsed=0 and biCompression=BI_RGB(0),
    169  // then each 4-byte DWORD in the bitmap
    170  // array represents the relative intensities
    171  // of blue, green, and red, respectively, for
    172  // a pixel. The high byte in each DWORD is not
    173  // used.
    174  // If biClrUsed=3, biCompression=BITFIELDS(3),
    175  // biColors[0] = red mask (0x00FF0000),
    176  // biColors[1] = green mask (0x0000FF00), and
    177  // biColors[2] = blue mask (0x000000FF),
    178  // then tese masks are used with each 4-byte
    179  // DWORD in the bitmap array to determine
    180  // the pixel's relative intensities. //
    181  // For other possibilities, see
    182  // http://msdn.microsoft.com/default.asp
    183  unsigned int biCompression; // DWORD Currently, Windows defines the following
    184  // types of compression.
    185  // =0 BI_RGB (no compression)
    186  // =1 BI_RLE8 (run length encoded used for 8 bpp)
    187  // =2 BI_RLE4 (run length encoded used for 4 bpp)
    188  // =3 BI_BITFIELDS Specifies that the bitmap is
    189  // not compressed and that the color table
    190  // consists of three DWORD color masks that
    191  // specify the red, green, and blue components,
    192  // respectively, of each pixel. This is valid
    193  // when used with 16- and 32-bit-per-pixel
    194  // bitmaps.
    195  // =4 BI_JPEG (not supported in Win 95/NT4)
    196  //
    197  unsigned int biSizeImage; // DWORD = bytes in image
    198  int biXPelsPerMeter; // LONG
    199  int biYPelsPerMeter; // LONG
    200  unsigned int biClrUsed; // DWORD = 0 or true length of bmiColors[] array. If 0,
    201  // then the value of biBitCount determines the
    202  // length of the bmiColors[] array.
    203  unsigned int biClrImportant; // DWORD
    204 };
    205 
    207 {
    208  // Mimics Windows BITMAPINFO structure.
    209  // For details searh for "BITMAPINFO" at http://msdn.microsoft.com/default.asp
    211  ON_WindowsRGBQUAD bmiColors[1]; // The "[1]" is for the compiler. In
    212  // practice this array commonly has
    213  // length 0, 3, or 256 and a BITMAPINFO*
    214  // points to a contiguous piece of memory
    215  // that contains
    216  //
    217  // BITMAPINFOHEADER
    218  // RGBQUAD[length determined by flags]
    219  // unsigned char[biSizeImage]
    220  //
    221  // See the ON_WindowsBITMAPINFOHEADER comments
    222  // and http://msdn.microsoft.com/default.asp
    223  // for more details.
    224 };
    225 
    226 #endif
    227 
    228 class ON_CLASS ON_WindowsBitmap : public ON_Bitmap
    229 {
    230  ON_OBJECT_DECLARE(ON_WindowsBitmap);
    231  // Uncompressed 8 bpp, 24 bpp, or 32 bpp Windows device
    232  // independent bitmaps (DIB)
    233 public:
    234  ON_WindowsBitmap() = default;
    235  ~ON_WindowsBitmap();
    238 
    239  static const ON_WindowsBitmap Unset;
    240 
    241  /*
    242  Parameters:
    243  width - [in]
    244  height - [in]
    245  bits_per_pixel - [in]
    246  1, 2, 4, 8, 16, 24, or 32
    247  */
    248  bool Create(
    249  int width,
    250  int height,
    251  int bits_per_pixel
    252  );
    253 
    254  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    255 
    256  bool IsEmpty() const;
    257 
    258  bool Write( ON_BinaryArchive& ) const override; // writes compressed image
    259  bool Read( ON_BinaryArchive& ) override; // reads compressed image
    260  unsigned int SizeOf() const override;
    261 
    262 public:
    263  bool WriteCompressed( ON_BinaryArchive& ) const;
    264  bool ReadCompressed( ON_BinaryArchive& );
    265  bool WriteUncompressed( ON_BinaryArchive& ) const;
    266  bool ReadUncompressed( ON_BinaryArchive& );
    267 
    268 public:
    269  int Width() const override;
    270  int Height() const override; // >0 means it's a bottom-up bitmap with origin at lower right
    271  // <0 means it's a top-down bitmap with origin at upper left
    272 
    273  int PaletteColorCount() const; // number of colors in palette
    274  int SizeofPalette() const; // number of bytes in palette
    275 
    276  int BitsPerPixel() const override;
    277  size_t SizeofScan() const override; // number of bytes per scan line
    278  size_t SizeofImage() const override; // number of bytes in image
    279 
    280  unsigned char* Bits(
    281  int // index of scan line
    282  ) override;
    283  const unsigned char* Bits(
    284  int // index of scan line
    285  ) const override;
    286 
    287  //int PaletteIndex( ON_Color ) const; // for 8bpp bitmaps
    288 
    289  ON_Color Pixel(
    290  int, // 0 <= i < width
    291  int // 0 <= j < height
    292  ) const;
    293  ON_Color Pixel(
    294  int, // 0 <= i < width
    295  const unsigned char* // value of Bits( j )
    296  ) const;
    297 
    298  //bool SetColor( // sets entire map to specified color
    299  // ON_Color
    300  // );
    301 
    302 #if defined(ON_OS_WINDOWS_GDI)
    303 
    304  /*
    305  Description:
    306  Create an ON_WindowsBitmap from a contiguous bitmap.
    307  Copies src.
    308  Parameters:
    309  src - [in] contiguous Windows device independent bitmap.
    310  Remarks:
    311  If the current Windows BITMAPINFO is identical to ON_WindowsBITMAPINFO,
    312  then the result of this call is identical to
    313 
    314  int color_count = number of colors in bitmap's palette;
    315  ON_WindowsBitmap::Create( &src, &src.bmiColors[color_count], true ).
    316 
    317  See Also:
    318  ON_WindowsBitmap::Create
    319  */
    320  ON_WindowsBitmap( const BITMAPINFO& src );
    321 
    322  /*
    323  Description:
    324  Create an ON_WindowsBitmap from a contiguous bitmap.
    325  Shares bitmap memory with src.
    326  Parameters:
    327  src - [in] contiguous Windows device independent bitmap.
    328  See Also:
    329  ON_WindowsBitmap::Create
    330  Remarks:
    331  ~ON_WindowsBitmap will not delete src.
    332  */
    333  ON_WindowsBitmap( const BITMAPINFO* src );
    334 
    335  /*
    336  Description:
    337  Create an ON_WindowsBitmap from a contiguous bitmap.
    338  Copies src.
    339  Parameters:
    340  src - [in] contiguous Windows device independent bitmap.
    341  See Also:
    342  ON_WindowsBitmap::Create
    343  */
    344  ON_WindowsBitmap& operator=( const BITMAPINFO& src );
    345 
    346  /*
    347  Description:
    348  Create and ON_WindowsBitmap from a Windows BITMAPINFO pointer
    349  and a pointer to the bits.
    350 
    351  This is intended to make it easy to write compressed bimaps.
    352  For ON_WindowsBitmap classes created with ON_WindowsBitmap::Share,
    353  ON_WindowsBitmap::Destroy and ~ON_WindowsBitmap will
    354  not free the bmi and bits memory.
    355 
    356  Parameters:
    357  bmi - [in] valid BITMAPINFO
    358  bits - [in] bits for BITMAPINFO
    359  bCopy - [in] If true, the bmi and bits are copied into a contiguous
    360  bitmap that will be deleted by ~ON_WindowsBitmap.
    361  If false, the m_bmi and m_bits pointers on this class
    362  are simply set to bmi and bits. In this case,
    363  ~ON_WindowsBitmap will not free the bmi or bits
    364  memory.
    365 
    366  Example:
    367 
    368  ON_BinaryArchive archive = ...;
    369  BITMAPINFO* bmi = 0;
    370  unsigned char* bits = 0;
    371  int color_count = ...; // number of colors in palette
    372 
    373  int sizeof_palette = sizeof(bmi->bmiColors[0]) * color_count;
    374 
    375  BITMAPINFO* bmi = (LPBITMAPINFO)calloc( 1, sizeof(*bmi) + sizeof_palette );
    376 
    377  bmi->bmiHeader.biSize = sizeof(bmi->bmiHeader);
    378  bmi->bmiHeader.biWidth = width;
    379  bmi->bmiHeader.biHeight = height;
    380  bmi->bmiHeader.biPlanes = 1;
    381  bmi->bmiHeader.biBitCount = (USHORT)color_depth;
    382  bmi->bmiHeader.biCompression = BI_RGB;
    383  bmi->bmiHeader.biXPelsPerMeter = 0;
    384  bmi->bmiHeader.biYPelsPerMeter = 0;
    385  bmi->bmiHeader.biClrUsed = 0;
    386  bmi->bmiHeader.biClrImportant = 0;
    387  bmi->bmiHeader.biSizeImage = GetStorageSize();
    388 
    389  // initialize palette
    390  ...
    391 
    392  HBITMAP hbm = ::CreateDIBSection( nullptr, bmi, ..., (LPVOID*)&bits, nullptr, 0);
    393 
    394  {
    395  // Use ON_WindowsBitmap to write a compressed bitmap to
    396  // archive. Does not modify bmi or bits.
    397  ON_WindowsBitmap onbm;
    398  onbm.Create(bmi,bit,false);
    399  onbm.Write( arcive );
    400  }
    401 
    402  */
    403  bool Create(
    404  const BITMAPINFO* bmi,
    405  const unsigned char* bits,
    406  bool bCopy
    407  );
    408 
    409 #endif
    410 
    411  /*
    412  Returns:
    413  True if m_bmi and m_bits are in a single contiguous
    414  block of memory.
    415  False if m_bmi and m_bits are in two blocks of memory.
    416  */
    417  bool IsContiguous() const;
    418 
    419 #if defined(ON_OS_WINDOWS_GDI)
    420  BITMAPINFO* m_bmi = nullptr;
    421 #else
    422  struct ON_WindowsBITMAPINFO* m_bmi = nullptr;
    423 
    424  /*
    425 Description:
    426  Create an ON_WindowsBitmap from a contiguous bitmap ON_WindowsBITMAPINFO.
    427  Parameters:
    428  src - [in]
    429  A contiguous Windows device independent bitmap. This means that the
    430  "bits" in the bitmap begin at the memory location &m_bits->bmiColors[0].
    431  See Also:
    432  Remarks:
    433  ~ON_WindowsBitmap will not delete src.
    434  */
    435  bool Create (
    436  const struct ON_WindowsBITMAPINFO* src
    437  );
    438 #endif
    439 
    440  unsigned char* m_bits = nullptr;
    441 
    442 private:
    443  int m_bFreeBMI = 0; // 0 m_bmi and m_bits are not freed by ON_WindowsBitmap::Destroy
    444  // 1 m_bmi memory is freed by ON_WindowsBitmap::Destroy
    445  // 2 m_bits memory is freed by ON_WindowsBitmap::Destroy
    446  // 3 m_bmi and m_bits memory is freed by ON_WindowsBitmap::Destroy
    447 
    448 private:
    449  bool Internal_WriteV5( ON_BinaryArchive& ) const;
    450  bool Internal_ReadV5( ON_BinaryArchive& );
    451 
    452 protected:
    453  void Internal_Destroy();
    454  void Internal_Copy(
    455  const ON_WindowsBitmap& src
    456  );
    457 };
    458 
    459 /*
    460 Description:
    461  ON_WindowsBitmapEx is identical to ON_WindowsBitmap except that
    462  it's Read/Write functions save bitmap names.
    463 */
    464 class ON_CLASS ON_WindowsBitmapEx : public ON_WindowsBitmap
    465 {
    466  ON_OBJECT_DECLARE(ON_WindowsBitmapEx);
    467 public:
    468  ON_WindowsBitmapEx() = default;
    469  ~ON_WindowsBitmapEx() = default;
    470  ON_WindowsBitmapEx(const ON_WindowsBitmapEx&) = default;
    472 
    473  static const ON_WindowsBitmapEx Unset;
    474 
    475  bool Write( ON_BinaryArchive& ) const override; // writes compressed image
    476  bool Read( ON_BinaryArchive& ) override; // reads compressed image
    477 
    478 private:
    479  bool Internal_WriteV5( ON_BinaryArchive& ) const; // writes compressed image
    480  bool Internal_ReadV5( ON_BinaryArchive& ); // reads compressed image
    481 };
    482 
    483 class ON_CLASS ON_EmbeddedBitmap : public ON_Bitmap
    484 {
    485  ON_OBJECT_DECLARE(ON_EmbeddedBitmap);
    486 public:
    487  ON_EmbeddedBitmap() = default;
    491 
    492  static const ON_EmbeddedBitmap Unset;
    493 
    494  void Create(
    495  size_t sizeof_buffer
    496  );
    497 
    498  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    499 
    500  bool Write( ON_BinaryArchive& ) const override;
    501  bool Read( ON_BinaryArchive& ) override;
    502  unsigned int SizeOf() const override;
    503 
    504  size_t SizeofImage() const override;
    505  unsigned char* Bits(int) override;
    506  const unsigned char* Bits(int) const override;
    507 
    508  const void* m_buffer = nullptr;
    509  size_t m_sizeof_buffer = 0;
    510  bool m_managed_buffer = false; // true means the ON_EmbeddedBitmap class manages m_buffer memory.
    511  ON__UINT32 m_buffer_crc32 = 0; // 32 bit crc from ON_CRC32
    512 
    513 private:
    514  bool Internal_WriteV5( ON_BinaryArchive& ) const;
    515  bool Internal_ReadV5( ON_BinaryArchive& );
    516 
    517 private:
    518  void Internal_Destroy();
    519  void Internal_Copy(
    520  const ON_EmbeddedBitmap& src
    521  );
    522 };
    523 
    524 #endif
    unsigned int bfSize
    DWORD = size, in bytes, of the bitmap file.
    Definition: opennurbs_bitmap.h:133
    unsigned int biClrUsed
    Definition: opennurbs_bitmap.h:200
    Definition: opennurbs_bitmap.h:483
    unsigned short biPlanes
    Definition: opennurbs_bitmap.h:152
    @@ -78,6 +76,7 @@ $(function() {
    void Dump(ON_TextLog &) const override
    unsigned int biSize
    DWORD = sizeof(BITMAPINFOHEADER)
    Definition: opennurbs_bitmap.h:145
    Definition: opennurbs_array.h:36
    +
    bool IsValid(class ON_TextLog *text_log=nullptr) const override
    static const ON_EmbeddedBitmap Unset
    Definition: opennurbs_bitmap.h:492
    unsigned short bfType
    WORD = file type, must be BM.
    Definition: opennurbs_bitmap.h:132
    Definition: opennurbs_color.h:24
    @@ -117,9 +116,9 @@ $(function() {
    diff --git a/6/da/d95/opennurbs__dll__resource_8h_source.html b/6/da/d95/opennurbs__dll__resource_8h_source.html index da44e63d..b9b5c54e 100644 --- a/6/da/d95/opennurbs__dll__resource_8h_source.html +++ b/6/da/d95/opennurbs__dll__resource_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_dll_resource.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_dll_resource.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    1 //{{NO_DEPENDENCIES}}
    2 // Microsoft Visual C++ generated include file.
    3 // Used by opennurbs.rc
    4 
    5 // Next default values for new objects
    6 //
    7 #ifdef APSTUDIO_INVOKED
    8 #ifndef APSTUDIO_READONLY_SYMBOLS
    9 #define _APS_NEXT_RESOURCE_VALUE 101
    10 #define _APS_NEXT_COMMAND_VALUE 40001
    11 #define _APS_NEXT_CONTROL_VALUE 1001
    12 #define _APS_NEXT_SYMED_VALUE 101
    13 #endif
    14 #endif
    diff --git a/6/da/d96/class_o_n___sum-members.html b/6/da/d96/class_o_n___sum-members.html index d51159c8..105e4b58 100644 --- a/6/da/d96/class_o_n___sum-members.html +++ b/6/da/d96/class_o_n___sum-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d97/class_o_n___dim_angular.html b/6/da/d97/class_o_n___dim_angular.html index f3d5cc04..24a9b22b 100644 --- a/6/da/d97/class_o_n___dim_angular.html +++ b/6/da/d97/class_o_n___dim_angular.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_DimAngular Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    enum  ForceArrow : unsigned int { ForceArrow::Auto = 0, ForceArrow::Inside = 1, ForceArrow::Outside = 2 - } - Arrowheads forced Inside, or Outside of extension lines, or moved to fit. More...
    + } Arrowheads forced Inside, or Outside of extension lines, or moved to fit. More...
    +   enum  ForceText : unsigned int { ForceText::Auto = 0, ForceText::Inside = 1, ForceText::Right = 2, ForceText::Left = 3 - } - Text forced Inside, Right or Left of extension lines, or moved to fit (Auto). More...
    + } Text forced Inside, Right or Left of extension lines, or moved to fit (Auto). More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -2569,8 +2567,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -2726,9 +2724,9 @@ Additional Inherited Members diff --git a/6/da/d99/class_o_n__3dm_render_settings.html b/6/da/d99/class_o_n__3dm_render_settings.html index 5a334b41..3bc6f831 100644 --- a/6/da/d99/class_o_n__3dm_render_settings.html +++ b/6/da/d99/class_o_n__3dm_render_settings.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: ON_3dmRenderSettings Class Reference @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archiveserialize definition to binary archive
    openNURBS SDK Help +  6.0
    - + +
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -1278,9 +1276,9 @@ Static Public Attributes
    diff --git a/6/da/d9a/class_o_n___hash32_table-members.html b/6/da/d9a/class_o_n___hash32_table-members.html index 0680fef1..451b2677 100644 --- a/6/da/d9a/class_o_n___hash32_table-members.html +++ b/6/da/d9a/class_o_n___hash32_table-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/d9f/class_o_n___uuid_index_list.html b/6/da/d9f/class_o_n___uuid_index_list.html index d72afc3c..79af644c 100644 --- a/6/da/d9f/class_o_n___uuid_index_list.html +++ b/6/da/d9f/class_o_n___uuid_index_list.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UuidIndexList Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Adds a uuid-index pair to the list. Parameters: uuid - [in] id to add.
    - This uuid cannot be ON_max_uuid because ON_max_uuid is bCheckForDupicates - [in] if true, then the uuid is not added if it is already in the list. If you are certain that the uuid is not in the list and you have a have a large collection of uuids, then setting bCheckForDupicates=false will speed up the addition of uuids. Returns: True if uuid was added. False if uuid was not added because it is already in the collection.

    +

    Description: Adds a uuid-index pair to the list. Parameters: uuid - [in] id to add. This uuid cannot be ON_max_uuid because ON_max_uuid is bCheckForDupicates - [in] if true, then the uuid is not added if it is already in the list. If you are certain that the uuid is not in the list and you have a have a large collection of uuids, then setting bCheckForDupicates=false will speed up the addition of uuids. Returns: True if uuid was added. False if uuid was not added because it is already in the collection.

    @@ -446,9 +443,9 @@ Public Member Functions diff --git a/6/da/da0/class_o_n___surface.html b/6/da/da0/class_o_n___surface.html index cccaed00..8ee9993c 100644 --- a/6/da/da0/class_o_n___surface.html +++ b/6/da/da0/class_o_n___surface.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Surface Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    N_iso = 6, iso_count = 7
    - } - pure virtual class for surface objects More...
    + } pure virtual class for surface objects More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -495,8 +493,7 @@ Additional Inherited Members
    -

    Description: Overrides virtual ON_Geometry::HasBrepForm.
    - Uses ON_Brep::Create( ON_Surface&* ) to create a brep form. The surface is copied for use in the returned brep. Parameters: brep - [in] if not nullptr, brep is used to store the brep form of the surface. Result: Returns a pointer to on ON_Brep or nullptr. If the brep parameter is not nullptr, then brep is returned if the surface has a brep form and nullptr is returned if the geometry does not have a brep form. Remarks: The caller is responsible for managing the brep memory.

    +

    Description: Overrides virtual ON_Geometry::HasBrepForm. Uses ON_Brep::Create( ON_Surface&* ) to create a brep form. The surface is copied for use in the returned brep. Parameters: brep - [in] if not nullptr, brep is used to store the brep form of the surface. Result: Returns a pointer to on ON_Brep or nullptr. If the brep parameter is not nullptr, then brep is returned if the surface has a brep form and nullptr is returned if the geometry does not have a brep form. Remarks: The caller is responsible for managing the brep memory.

    Reimplemented from ON_Geometry.

    @@ -642,8 +639,7 @@ Additional Inherited Members
    -

    Description: Get a duplicate of the surface. Returns: A duplicate of the surface.
    -Remarks: The caller must delete the returned surface. For non-ON_SurfaceProxy objects, this simply duplicates the surface using ON_Object::Duplicate. For ON_SurfaceProxy objects, this duplicates the actual proxy surface geometry and, if necessary, transposes the result to that the returned surfaces's parameterization and locus match the proxy surface's.

    +

    Description: Get a duplicate of the surface. Returns: A duplicate of the surface. Remarks: The caller must delete the returned surface. For non-ON_SurfaceProxy objects, this simply duplicates the surface using ON_Object::Duplicate. For ON_SurfaceProxy objects, this duplicates the actual proxy surface geometry and, if necessary, transposes the result to that the returned surfaces's parameterization and locus match the proxy surface's.

    Reimplemented in ON_SurfaceProxy.

    @@ -1215,8 +1211,7 @@ Remarks: The caller must delete the returned surface. For non-ON_SurfaceProxy ob
    -

    Description: Pure virtual function. Default returns false. Where possible, analytically extends surface to include domain. Parameters: dir - [in] 0 new Domain(0) will include domain. (the first surface parameter). 1 new Domain(1) will include domain. (the second surface parameter). domain - [in] if domain is not included in surface domain, surface will be extended so that its domain includes domain.
    - Will not work if surface is closed in direction dir. Original surface is identical to the restriction of the resulting surface to the original surface domain, Returns: true if successful.

    +

    Description: Pure virtual function. Default returns false. Where possible, analytically extends surface to include domain. Parameters: dir - [in] 0 new Domain(0) will include domain. (the first surface parameter). 1 new Domain(1) will include domain. (the second surface parameter). domain - [in] if domain is not included in surface domain, surface will be extended so that its domain includes domain. Will not work if surface is closed in direction dir. Original surface is identical to the restriction of the resulting surface to the original surface domain, Returns: true if successful.

    Reimplemented in ON_NurbsSurface, ON_SumSurface, ON_RevSurface, ON_PlaneSurface, and ON_Extrusion.

    @@ -1373,8 +1368,7 @@ Remarks: The caller must delete the returned surface. For non-ON_SurfaceProxy ob
    -

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search.
    - dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    +

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search. dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    true if a parametric discontinuity was found strictly between t0 and t1. Note well that all curves are parametrically continuous at the ends of their domains.

    Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous):

    true if a locus discontinuity was found strictly between t0 and t1 or at t1 is the at the end of a curve. Note well that all open curves (IsClosed()=false) are locus discontinuous at the ends of their domains. All closed curves (IsClosed()=true) are at least C0_locus_continuous at the ends of their domains.

    @@ -1756,8 +1750,7 @@ Remarks: The caller must delete the returned surface. For non-ON_SurfaceProxy ob
    -

    virtual ON_Geometry functions
    -Description: Overrides virtual ON_Geometry::HasBrepForm and returns true. Result: Returns true. See Also: ON_Brep::Create( ON_Surface&* )

    +

    virtual ON_Geometry functions Description: Overrides virtual ON_Geometry::HasBrepForm and returns true. Result: Returns true. See Also: ON_Brep::Create( ON_Surface&* )

    Reimplemented from ON_Geometry.

    @@ -1785,8 +1778,7 @@ Description: Overrides virtual -

    Description: Is there a NURBS surface representation of this surface. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the surface's 2 success - NURBS point locus matches the surface's and the domain of the NURBS surface is correct.
    - However, This surface's parameterization and the NURBS surface parameterization may not match. This situation happens when getting NURBS representations of surfaces that have a transendental parameterization like spheres, cylinders, and cones. Remarks: This is a low-level virtual function. See Also:
    ON_Surface::GetNurbForm ON_Surface::NurbsSurface

    +

    Description: Is there a NURBS surface representation of this surface. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the surface's 2 success - NURBS point locus matches the surface's and the domain of the NURBS surface is correct. However, This surface's parameterization and the NURBS surface parameterization may not match. This situation happens when getting NURBS representations of surfaces that have a transendental parameterization like spheres, cylinders, and cones. Remarks: This is a low-level virtual function. See Also: ON_Surface::GetNurbForm ON_Surface::NurbsSurface

    Reimplemented in ON_NurbsSurface, ON_RevSurface, ON_PlaneSurface, ON_SumSurface, ON_SurfaceProxy, and ON_Extrusion.

    @@ -2755,9 +2747,9 @@ Description: Overrides virtual diff --git a/6/da/db3/class_o_n___clipping_region.html b/6/da/db3/class_o_n___clipping_region.html index c28912e9..15872f95 100644 --- a/6/da/db3/class_o_n___clipping_region.html +++ b/6/da/db3/class_o_n___clipping_region.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ClippingRegion Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    -

    Returns: 3d world coordinates tolerance to use when testing objects to see if the planes in m_clip_plane[] hide the objects.
    -Remarks: The constructor sets this value to zero. Rhino uses values around 1e-5.

    +

    Returns: 3d world coordinates tolerance to use when testing objects to see if the planes in m_clip_plane[] hide the objects. Remarks: The constructor sets this value to zero. Rhino uses values around 1e-5.

    @@ -669,9 +666,7 @@ Remarks: The constructor sets this value to zero. Rhino uses values around 1e-5.
    -

    Parameters: clip_plane_tolerance - [in]
    - 3d world coordinates tolerance to use when testing objects to see if the planes in m_clip_plane[] hide the objects.
    -Remarks: The constructor sets this value to zero. Rhino uses values around 1e-5.

    +

    Parameters: clip_plane_tolerance - [in] 3d world coordinates tolerance to use when testing objects to see if the planes in m_clip_plane[] hide the objects. Remarks: The constructor sets this value to zero. Rhino uses values around 1e-5.

    @@ -737,8 +732,7 @@ Remarks: The constructor sets this value to zero. Rhino uses values around 1e-5.
    -

    Description: Transform a pont and return the clipping information. Parameters: P - [in] point ot transform Q - [out] transformed point Returns: 0 when the point is in the visible region.
    - Otherwise the bits are set to indicate which planes clip the intput point. 0x01 left of the view frusturm 0x02 right of the view frustum 0x04 below the view frustum 0x08 above the view frustum 0x10 behind the view frustum (too far) 0x20 in front of the view frustum (too near)

    +

    Description: Transform a pont and return the clipping information. Parameters: P - [in] point ot transform Q - [out] transformed point Returns: 0 when the point is in the visible region. Otherwise the bits are set to indicate which planes clip the intput point. 0x01 left of the view frusturm 0x02 right of the view frustum 0x04 below the view frustum 0x08 above the view frustum 0x10 behind the view frustum (too far) 0x20 in front of the view frustum (too near)

    0x10 below m_clip_plane[0] 0x20 below m_clip_plane[1] ... 0x40000000 below m_clip_plane[24]

    0x80000000 transformation created a non-positive weight

    @@ -825,8 +819,7 @@ Remarks: The constructor sets this value to zero. Rhino uses values around 1e-5.
    -

    Description: Transform a list of 4d homogenous points while testing for visibility. Parameters: count - [in] number of points p - [in/out] array of points to test and transform If 0 is returned, some of the points may not be transformed. In all other cases, the output points are transformed by m_xform. pflags - [out] 0 when the point is in the visible region.
    - Otherwise the bits are set to indicate which planes clip the intput point. 0x01 left of the view frusturm 0x02 right of the view frustum 0x04 below the view frustum 0x08 above the view frustum 0x10 behind the view frustum (too far) 0x20 in front of the view frustum (too near)

    +

    Description: Transform a list of 4d homogenous points while testing for visibility. Parameters: count - [in] number of points p - [in/out] array of points to test and transform If 0 is returned, some of the points may not be transformed. In all other cases, the output points are transformed by m_xform. pflags - [out] 0 when the point is in the visible region. Otherwise the bits are set to indicate which planes clip the intput point. 0x01 left of the view frusturm 0x02 right of the view frustum 0x04 below the view frustum 0x08 above the view frustum 0x10 behind the view frustum (too far) 0x20 in front of the view frustum (too near)

    0x10 below m_clip_plane[0] 0x20 below m_clip_plane[1] ... 0x40000000 below m_clip_plane[24]

    0x80000000 transformation created a non-positive weight Returns: 0 = convex hull of the points is not in the region. The m_cull_bits field reports which plane or planes culled the point set. 1 = a portion of the convex hull is in the region. The m_cull_bits field reports which plane or planes culled the point set. 2 = all points are in the region. The m_cull_bits field will be zero.

    @@ -901,9 +894,9 @@ Remarks: The constructor sets this value to zero. Rhino uses values around 1e-5.
    diff --git a/6/da/dcd/class_o_n___uuid_pair_list-members.html b/6/da/dcd/class_o_n___uuid_pair_list-members.html index 222c9838..c0ec1d12 100644 --- a/6/da/dcd/class_o_n___uuid_pair_list-members.html +++ b/6/da/dcd/class_o_n___uuid_pair_list-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/dce/struct_o_n___r_tree_b_box.html b/6/da/dce/struct_o_n___r_tree_b_box.html index 54fff3ea..94c004e1 100644 --- a/6/da/dce/struct_o_n___r_tree_b_box.html +++ b/6/da/dce/struct_o_n___r_tree_b_box.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RTreeBBox Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/dd0/class_o_n___mesh_vertex_face_map-members.html b/6/da/dd0/class_o_n___mesh_vertex_face_map-members.html index 4768f72e..cef8083a 100644 --- a/6/da/dd0/class_o_n___mesh_vertex_face_map-members.html +++ b/6/da/dd0/class_o_n___mesh_vertex_face_map-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/dd9/class_o_n___mesh_vertex_face_map.html b/6/da/dd9/class_o_n___mesh_vertex_face_map.html index abd2922c..896fb270 100644 --- a/6/da/dd9/class_o_n___mesh_vertex_face_map.html +++ b/6/da/dd9/class_o_n___mesh_vertex_face_map.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshVertexFaceMap Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/dda/struct_o_n___brep_trim_point.html b/6/da/dda/struct_o_n___brep_trim_point.html index 5453a7f7..4fa6e1ee 100644 --- a/6/da/dda/struct_o_n___brep_trim_point.html +++ b/6/da/dda/struct_o_n___brep_trim_point.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepTrimPoint Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/de3/class_o_n___name_hash.html b/6/da/de3/class_o_n___name_hash.html index 6f208f83..25488567 100644 --- a/6/da/de3/class_o_n___name_hash.html +++ b/6/da/de3/class_o_n___name_hash.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_NameHash Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/de3/class_o_n___r_tree-members.html b/6/da/de3/class_o_n___r_tree-members.html index 960311e3..2dbf2295 100644 --- a/6/da/de3/class_o_n___r_tree-members.html +++ b/6/da/de3/class_o_n___r_tree-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/de3/opennurbs__texture_8h_source.html b/6/da/de3/opennurbs__texture_8h_source.html index 571b68bf..9550809e 100644 --- a/6/da/de3/opennurbs__texture_8h_source.html +++ b/6/da/de3/opennurbs__texture_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_texture.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_texture.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/dec/union_o_n___u-members.html b/6/da/dec/union_o_n___u-members.html index 47ed9290..2a9a20e5 100644 --- a/6/da/dec/union_o_n___u-members.html +++ b/6/da/dec/union_o_n___u-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/ded/opennurbs__sumsurface_8h_source.html b/6/da/ded/opennurbs__sumsurface_8h_source.html index 01f390b7..f4ac29cb 100644 --- a/6/da/ded/opennurbs__sumsurface_8h_source.html +++ b/6/da/ded/opennurbs__sumsurface_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_sumsurface.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_sumsurface.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/ded/struct_o_n___r_tree_node-members.html b/6/da/ded/struct_o_n___r_tree_node-members.html index 9d557b04..40290d3f 100644 --- a/6/da/ded/struct_o_n___r_tree_node-members.html +++ b/6/da/ded/struct_o_n___r_tree_node-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/df1/opennurbs__geometry_8h_source.html b/6/da/df1/opennurbs__geometry_8h_source.html index fa2059e2..10a798ac 100644 --- a/6/da/df1/opennurbs__geometry_8h_source.html +++ b/6/da/df1/opennurbs__geometry_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_geometry.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_geometry.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/dfa/class_o_n___cone-members.html b/6/da/dfa/class_o_n___cone-members.html index 8ccaea1c..e9e39813 100644 --- a/6/da/dfa/class_o_n___cone-members.html +++ b/6/da/dfa/class_o_n___cone-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/dfb/class_o_n___brep_region_topology.html b/6/da/dfb/class_o_n___brep_region_topology.html index 8cbc1e5d..d06e6ae6 100644 --- a/6/da/dfb/class_o_n___brep_region_topology.html +++ b/6/da/dfb/class_o_n___brep_region_topology.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepRegionTopology Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/da/dff/class_o_n___m_d5___hash.html b/6/da/dff/class_o_n___m_d5___hash.html index 021839f5..ebeadee6 100644 --- a/6/da/dff/class_o_n___m_d5___hash.html +++ b/6/da/dff/class_o_n___m_d5___hash.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MD5_Hash Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
     

    Detailed Description

    -

    / / Copyright (c) 1993-2015 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////
    -The ON_MD5 class is based on code that is modified from C code with the following copyright.

    +

    / / Copyright (c) 1993-2015 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// The ON_MD5 class is based on code that is modified from C code with the following copyright.

    Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved.

    License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function.

    @@ -740,9 +735,9 @@ The ON_MD5 class is
    diff --git a/6/db/d0e/opennurbs__offsetsurface_8h_source.html b/6/db/d0e/opennurbs__offsetsurface_8h_source.html index d7db0332..ea0f31f4 100644 --- a/6/db/d0e/opennurbs__offsetsurface_8h_source.html +++ b/6/db/d0e/opennurbs__offsetsurface_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_offsetsurface.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_offsetsurface.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/db/d0f/class_o_n___plane-members.html b/6/db/d0f/class_o_n___plane-members.html index e3f38062..4d5f99c9 100644 --- a/6/db/d0f/class_o_n___plane-members.html +++ b/6/db/d0f/class_o_n___plane-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/db/d11/class_o_n__3dm_construction_plane_grid_defaults.html b/6/db/d11/class_o_n__3dm_construction_plane_grid_defaults.html index 6cef0770..0d80a64e 100644 --- a/6/db/d11/class_o_n__3dm_construction_plane_grid_defaults.html +++ b/6/db/d11/class_o_n__3dm_construction_plane_grid_defaults.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmConstructionPlaneGridDefaults Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d11/opennurbs__text_8h_source.html b/6/db/d11/opennurbs__text_8h_source.html index 04c683ae..5d5c60ec 100644 --- a/6/db/d11/opennurbs__text_8h_source.html +++ b/6/db/d11/opennurbs__text_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_text.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_text.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d13/class_o_n___content_hash.html b/6/db/d13/class_o_n___content_hash.html index b5dc6a42..84926563 100644 --- a/6/db/d13/class_o_n___content_hash.html +++ b/6/db/d13/class_o_n___content_hash.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ContentHash Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    CompareResult::FileDoesNotExist = 5, CompareResult::FileSystemFailure = 6
    - } - ON_ContentHash::Compare are the possible results of calling ON_ContentHash::CompareFile(). More...
    + } ON_ContentHash::Compare are the possible results of calling ON_ContentHash::CompareFile(). More...
    +  

    Returns: Time the hashed content was last modifed in seconds since January 1, 1970 UCT. 0 is returned if this time is not known.

    This time should be used for important decisions as a last resort.

    -

    When hash values differ, this time may be considered to which content is newer (or most recently copied).
    - Unfortunately, in many cases this time is often unknown and incorrectly set. For example, some file systems set the last modified time of a copy of an "old" file to the time the copy was created. Thus a copy of "old" content may appear to be newer than "new" content that has not been copied.

    +

    When hash values differ, this time may be considered to which content is newer (or most recently copied).

    +

    Unfortunately, in many cases this time is often unknown and incorrectly set. For example, some file systems set the last modified time of a copy of an "old" file to the time the copy was created. Thus a copy of "old" content may appear to be newer than "new" content that has not been copied.

    @@ -581,8 +579,7 @@ Static Public Attributes

    @@ -482,8 +480,8 @@ Static Public Attributes

    -

    Descripton: Create an ON_ContentHash from a memory buffer. Parameters: sha1_name_hash - [in] A SHA-1 hash of the name associated with this content. If the buffer has no name, pass ON_SHA1_Hash::ZeroDigest. If the buffer has an empty name, pass ON_SHA1_Hash::EmptyContentHash. buffer - [in]
    - byte_count - [in] number of bytes in buffer[] Returns: An ON_ContentHash with size and SHA-1 hash calculated from the parameters, hash time = now, and content last modified time = 0.

    +

    Descripton: Create an ON_ContentHash from a memory buffer. Parameters: sha1_name_hash - [in] A SHA-1 hash of the name associated with this content. If the buffer has no name, pass ON_SHA1_Hash::ZeroDigest. If the buffer has an empty name, pass ON_SHA1_Hash::EmptyContentHash. buffer - [in] byte_count - [in] number of bytes in buffer[] Returns: An ON_ContentHash with size and SHA-1 hash calculated from the parameters, hash time = now, and content last modified time = 0.

    @@ -848,8 +845,7 @@ Static Public Attributes
    -

    Description: Test a buffer to see if it has a matching size and SHA-1 hash. Parameters: buffer - [in]
    - byte_count - [in] number of bytes in buffer[] Returns: True if the buffer has a matching byte_count and SHA-1 hash.

    +

    Description: Test a buffer to see if it has a matching size and SHA-1 hash. Parameters: buffer - [in] byte_count - [in] number of bytes in buffer[] Returns: True if the buffer has a matching byte_count and SHA-1 hash.

    @@ -1033,9 +1029,9 @@ Static Public Attributes diff --git a/6/db/d13/class_o_n___uuid_list-members.html b/6/db/d13/class_o_n___uuid_list-members.html index f2d17735..fb6de42d 100644 --- a/6/db/d13/class_o_n___uuid_list-members.html +++ b/6/db/d13/class_o_n___uuid_list-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d16/class_o_n___binary_archive.html b/6/db/d16/class_o_n___binary_archive.html index d814357b..ca887fd9 100644 --- a/6/db/d16/class_o_n___binary_archive.html +++ b/6/db/d16/class_o_n___binary_archive.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BinaryArchive Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Parameters: plugin_id - [out] id of plug-in that wrote the user table bLastSavedAsGoo - [out] True if this table was saved into this archive as goo because the plug-in was not present at the time of the save. archive_3dm_version - [out] Version of the archive the plug-in wrote to. When bLastSavedAsGoo is true, this number can be different from Archive3dmVersion(). archive_opennurbs_version - [out] Version of opennurbs the plug-in used to write the archive.
    - When bLastSavedAsGoo is true, this number can be different from ArchiveOpenNURBSVersion().
    -Returns: False when there are no more user tables or an IO error occurs.

    +

    Parameters: plugin_id - [out] id of plug-in that wrote the user table bLastSavedAsGoo - [out] True if this table was saved into this archive as goo because the plug-in was not present at the time of the save. archive_3dm_version - [out] Version of the archive the plug-in wrote to. When bLastSavedAsGoo is true, this number can be different from Archive3dmVersion(). archive_opennurbs_version - [out] Version of opennurbs the plug-in used to write the archive. When bLastSavedAsGoo is true, this number can be different from ArchiveOpenNURBSVersion(). Returns: False when there are no more user tables or an IO error occurs.

    @@ -2444,8 +2440,7 @@ Returns: False when there are no more user tables or an IO error occurs.

    -

    Step 17: OPTIONAL - Write/Read 0 or more user tables
    -Description: Write the user table header information that must precede the user table information written by a plug-in. Parameters: plugin_id - [in] bSavingGoo - [in] Set to false if a plug-in will be used to write the user table. Set to true if a user table written by a missing plug-in is being resaved. In this case, goo_3dm_version and goo_opennurbs_version must also be set. In practice, you should use Write3dmAnonymousUserTableRecord() to handle writing "goo" and use this function only when the plug-in in present. goo_3dm_version - [in] If bSavingGoo is false, this parameter must be zero and ON_BinaryArchive::Archive3dmVersion() will be used. If bSavingGoo is true, this parameter must be the version of the 3dm archive (1,2,3,4,5,50,...) the plug-in code used to write the user table. goo_opennurbs_version - [in] If bSavingGoo is false, this parameter must be zero and ON_BinaryArchive::ArchiveOpenNURBSVersion() will be used. If bSavingGoo is true, this parameter must be the version of the opennurbs the plug-in code used to write the user table. Returns: True if the the user information can be written. False if user informtion should not be written.

    +

    Step 17: OPTIONAL - Write/Read 0 or more user tables Description: Write the user table header information that must precede the user table information written by a plug-in. Parameters: plugin_id - [in] bSavingGoo - [in] Set to false if a plug-in will be used to write the user table. Set to true if a user table written by a missing plug-in is being resaved. In this case, goo_3dm_version and goo_opennurbs_version must also be set. In practice, you should use Write3dmAnonymousUserTableRecord() to handle writing "goo" and use this function only when the plug-in in present. goo_3dm_version - [in] If bSavingGoo is false, this parameter must be zero and ON_BinaryArchive::Archive3dmVersion() will be used. If bSavingGoo is true, this parameter must be the version of the 3dm archive (1,2,3,4,5,50,...) the plug-in code used to write the user table. goo_opennurbs_version - [in] If bSavingGoo is false, this parameter must be zero and ON_BinaryArchive::ArchiveOpenNURBSVersion() will be used. If bSavingGoo is true, this parameter must be the version of the opennurbs the plug-in code used to write the user table. Returns: True if the the user information can be written. False if user informtion should not be written.

    @@ -2498,8 +2493,7 @@ Description: Write the user table header information that must precede the user
    -

    Tools for dictionary IO (used in .NET)
    -Description: Begins writing a dictionary. Parameters: dictionary_id - [in] version - [in] It is suggested that you use ON_VersionNumberConstruct() to create a version number. dictionary_name - [in] You may pass nullptr. Remarks: Begins a new chunk with tcode TCODE_DICTIONARY and then writes a TCODE_DICTIONARY_ID chunk containing the id, version and name. After calling this function, you may either write entries by calling BeginWriteDictionaryEntry(); write entry definition... EndWriteDictionaryEntry(); or you may finish writing the dictionay by calling EndWriteDictionary();

    +

    Tools for dictionary IO (used in .NET) Description: Begins writing a dictionary. Parameters: dictionary_id - [in] version - [in] It is suggested that you use ON_VersionNumberConstruct() to create a version number. dictionary_name - [in] You may pass nullptr. Remarks: Begins a new chunk with tcode TCODE_DICTIONARY and then writes a TCODE_DICTIONARY_ID chunk containing the id, version and name. After calling this function, you may either write entries by calling BeginWriteDictionaryEntry(); write entry definition... EndWriteDictionaryEntry(); or you may finish writing the dictionay by calling EndWriteDictionary();

    @@ -2737,8 +2731,7 @@ Description: Begins writing a dictionary. Parameters: dictionary_id - [in] versi
    -

    3DM Interface - ignore if not reading/writing a 3DM file this is here so that the infrastructure for writing 3dm archives is available for any type of serialization device.
    -Description: Specify which types of objects (ON_Brep, ON_Extrusion, ON_SubD, ...) save render meshes in the 3dm file.

    +

    3DM Interface - ignore if not reading/writing a 3DM file this is here so that the infrastructure for writing 3dm archives is available for any type of serialization device. Description: Specify which types of objects (ON_Brep, ON_Extrusion, ON_SubD, ...) save render meshes in the 3dm file.

    Parameters: object_type_flags - [in] The bits in object_type_flags correspond to ON::object_type values and identify the object types the setting will be applied to.

    Remarks: Saving render meshes increases file size, sometimes dramatically.

    Creating ON_Brep analysis meshes is often slow. Disable saving ON_Brep analysis meshes when IO speed or file size is a critical issue, the time expense of recreating the ON_Brep meshes when the file is read is acceptable, and the file will be read by Rhino. Enable when the file size is not an issue or the file will be used by other applications that may not be able to create meshes.

    @@ -5706,12 +5699,9 @@ Description: Specify which types of objects ( -

    ReadCompressedBuffer()/WriteCompressedBuffer() use zlib 1.1.3 to inflate/deflate the data buffer. Care must be used to get an endian independent file.
    -
    -See ON_Mesh::Read()/ON_Mesh::Write() for an example of an endian independent use of compression. See also ToggleByteOrder() and Endian().

    +

    ReadCompressedBuffer()/WriteCompressedBuffer() use zlib 1.1.3 to inflate/deflate the data buffer. Care must be used to get an endian independent file. See ON_Mesh::Read()/ON_Mesh::Write() for an example of an endian independent use of compression. See also ToggleByteOrder() and Endian().

    To read data archived by WriteCompressedBuffer( sizeof_buffer, buffer ) do something like:

    -

    size_t sizeof_buffer = 0; ReadCompressedBufferSize(&sizeof_buffer); buffer = something with sizeof_buffer bytes. int bFailedCRC = false; bool ok = ReadCompressedBuffer( sizeof_buffer, buffer, &bFailedCRC );
    -Description: Red the size of a compressed buffer. Parameters: sizeof__outbuffer - [out] size of the uncompressed buffer in bytes Returns: True if read was successful.

    +

    size_t sizeof_buffer = 0; ReadCompressedBufferSize(&sizeof_buffer); buffer = something with sizeof_buffer bytes. int bFailedCRC = false; bool ok = ReadCompressedBuffer( sizeof_buffer, buffer, &bFailedCRC ); Description: Red the size of a compressed buffer. Parameters: sizeof__outbuffer - [out] size of the uncompressed buffer in bytes Returns: True if read was successful.

    @@ -6106,8 +6096,7 @@ Description: Red the size of a compressed buffer. Parameters: sizeof__outbuffer
    -

    Description: Reads the attributes the Write() function writes. Parameters: model_component - [in/out] component_filter - [out] A bitfield that reports which attributes were read. If the corresponding component on model_component is locked, the read value is discared. Returns: false: critical failure. true: reading can continue.
    -Remarks: If locked attributes are read, thire values are ignored.

    +

    Description: Reads the attributes the Write() function writes. Parameters: model_component - [in/out] component_filter - [out] A bitfield that reports which attributes were read. If the corresponding component on model_component is locked, the read value is discared. Returns: false: critical failure. true: reading can continue. Remarks: If locked attributes are read, thire values are ignored.

    @@ -6126,8 +6115,7 @@ Remarks: If locked attributes are read, thire values are ignored.

    -

    Read/Write classes derived from ON_Object
    -Description: Reads and object from a 3dm archive; Parameters: ppObject - [out] object is allocated and a pointer to the allocated object is returned as *ppObject; Returns: 0: failure - unable to read object because of file IO problems 1: success 3: unable to read object because it's UUID is not registered this could happen in cases where old code is attempting to read new objects.

    +

    Read/Write classes derived from ON_Object Description: Reads and object from a 3dm archive; Parameters: ppObject - [out] object is allocated and a pointer to the allocated object is returned as *ppObject; Returns: 0: failure - unable to read object because of file IO problems 1: success 3: unable to read object because it's UUID is not registered this could happen in cases where old code is attempting to read new objects.

    @@ -7399,8 +7387,7 @@ Description: Reads and object from a 3dm archive; Parameters: ppObject - [out] o
    -

    Description: A non-zero storage device error terminates reading or writing. See the ON_BinaryArchive::eStorageDeviceError for values. Parameter: storage_device_error - [in] A non-zero code that identifies an error the terminates reading or writing.
    - See ON_BinaryArchive::CriticalErrorCodes for values Remarks: Once set, the storage_device_error value cannot be changed.

    +

    Description: A non-zero storage device error terminates reading or writing. See the ON_BinaryArchive::eStorageDeviceError for values. Parameter: storage_device_error - [in] A non-zero code that identifies an error the terminates reading or writing. See ON_BinaryArchive::CriticalErrorCodes for values Remarks: Once set, the storage_device_error value cannot be changed.

    @@ -8719,8 +8706,7 @@ Description: Reads and object from a 3dm archive; Parameters: ppObject - [out] o
    -

    Step 1: REQUIRED - Write/Read Start Section
    -Parameters: version - [in] 0, 2, 3, 4, 5, 50 or 60 (5 is treated as 50)

    +

    Step 1: REQUIRED - Write/Read Start Section Parameters: version - [in] 0, 2, 3, 4, 5, 50 or 60 (5 is treated as 50)

    If version is 0, then the value of ON_BinaryArchive::CurrentArchiveVersion() is used.

    Use either 0 or the value of ON_BinaryArchive::CurrentArchiveVersion() for the version parameter when you want your code to write the most up to date file version.

    sStartSectionComment - [in] nullptr or a UTF-8 encoded string with application name, et cetera. This information is primarily used when debugging files that contain problems. McNeel and Associates stores application name, application version, compile date, and the OS in use when file was written.

    @@ -10813,9 +10799,9 @@ Parameters: version - [in] 0, 2, 3, 4, 5, 50 or 60 (5 is treated as 50)

    diff --git a/6/db/d18/class_o_n___rtf_string_builder-members.html b/6/db/d18/class_o_n___rtf_string_builder-members.html index e904e639..8750a5a1 100644 --- a/6/db/d18/class_o_n___rtf_string_builder-members.html +++ b/6/db/d18/class_o_n___rtf_string_builder-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d2a/class_o_n___ellipse-members.html b/6/db/d2a/class_o_n___ellipse-members.html index a1f33350..bfb26f01 100644 --- a/6/db/d2a/class_o_n___ellipse-members.html +++ b/6/db/d2a/class_o_n___ellipse-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d2a/opennurbs__color_8h_source.html b/6/db/d2a/opennurbs__color_8h_source.html index 46e72517..107055bf 100644 --- a/6/db/d2a/opennurbs__color_8h_source.html +++ b/6/db/d2a/opennurbs__color_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_color.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_color.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d2b/class_o_n__3d_vector-members.html b/6/db/d2b/class_o_n__3d_vector-members.html index e46f51e4..bb6e56b1 100644 --- a/6/db/d2b/class_o_n__3d_vector-members.html +++ b/6/db/d2b/class_o_n__3d_vector-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d30/class_o_n___nurbs_surface-members.html b/6/db/d30/class_o_n___nurbs_surface-members.html index ea0b417e..f4aaf3f8 100644 --- a/6/db/d30/class_o_n___nurbs_surface-members.html +++ b/6/db/d30/class_o_n___nurbs_surface-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d36/class_o_n___internal___font_glyph_pool.html b/6/db/d36/class_o_n___internal___font_glyph_pool.html index cb45c3a3..d9ebd784 100644 --- a/6/db/d36/class_o_n___internal___font_glyph_pool.html +++ b/6/db/d36/class_o_n___internal___font_glyph_pool.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Internal_FontGlyphPool Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
     

    Detailed Description

    -

    / / Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Friends And Related Function Documentation

    ◆ ON_FontGlyph

    @@ -138,9 +135,9 @@ Friends
    diff --git a/6/db/d38/class_o_n___write3dm_buffer_archive.html b/6/db/d38/class_o_n___write3dm_buffer_archive.html index 7cfaf42b..185743fa 100644 --- a/6/db/d38/class_o_n___write3dm_buffer_archive.html +++ b/6/db/d38/class_o_n___write3dm_buffer_archive.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Write3dmBufferArchive Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/db/d3b/class_o_n___box.html b/6/db/d3b/class_o_n___box.html index 37f929af..d41fcc5c 100644 --- a/6/db/d3b/class_o_n___box.html +++ b/6/db/d3b/class_o_n___box.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Box Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_Box() [1/2]

    @@ -732,9 +728,9 @@ Public Attributes
    diff --git a/6/db/d40/class_o_n__3f_point_array-members.html b/6/db/d40/class_o_n__3f_point_array-members.html index de2621ff..8f4d98b6 100644 --- a/6/db/d40/class_o_n__3f_point_array-members.html +++ b/6/db/d40/class_o_n__3f_point_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d41/class_o_n__2i_vector.html b/6/db/d41/class_o_n__2i_vector.html index bb153318..e6bdc28f 100644 --- a/6/db/d41/class_o_n__2i_vector.html +++ b/6/db/d41/class_o_n__2i_vector.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2iVector Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d49/struct_o_n___r_tree_leaf-members.html b/6/db/d49/struct_o_n___r_tree_leaf-members.html index 12d60f39..584386ba 100644 --- a/6/db/d49/struct_o_n___r_tree_leaf-members.html +++ b/6/db/d49/struct_o_n___r_tree_leaf-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d4c/examples__linking__pragmas_8h_source.html b/6/db/d4c/examples__linking__pragmas_8h_source.html index cc7c179d..3e18d334 100644 --- a/6/db/d4c/examples__linking__pragmas_8h_source.html +++ b/6/db/d4c/examples__linking__pragmas_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/examples_linking_pragmas.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/examples_linking_pragmas.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 #if defined(ON_COMPILER_MSC)
    2 
    3 // This file is specific to Micrsoft's compiler.
    4 // It contains linking pragmas for building the opennurbs examples.
    5 
    6 #pragma once
    7 
    8 #if defined(OPENNURBS_EXPORTS) || defined(ON_COMPILING_OPENNURBS)
    9 // If you get the following error, your compiler settings
    10 // indicate you are building an opennurbs library.
    11 // This file is used for linking with opennurbs libraries
    12 // that have been previously built.
    13 #error This file contains linking pragmas for using the opennurbs library.
    14 #endif
    15 
    16 #if defined(OPENNURBS_IMPORTS)
    17 #pragma message( " --- dynamically linking opennurbs (DLL)." )
    18 #pragma comment(lib, "\"" OPENNURBS_OUTPUT_DIR "/" "opennurbs_public.lib" "\"")
    19 #else
    20 #pragma message( " --- statically linking opennurbs." )
    21 #pragma comment(lib, "\"" OPENNURBS_OUTPUT_DIR "/" "opennurbs_public_staticlib.lib" "\"")
    22 #pragma comment(lib, "\"" OPENNURBS_OUTPUT_DIR "/" "zlib.lib" "\"")
    23 #pragma comment(lib, "\"" OPENNURBS_OUTPUT_DIR "/" "freetype263.lib" "\"")
    24 #pragma comment(lib, "rpcrt4.lib")
    25 #pragma comment(lib, "shlwapi.lib")
    26 #endif
    27 
    28 #endif
    diff --git a/6/db/d4d/class_o_n___string_buffer.html b/6/db/d4d/class_o_n___string_buffer.html index 6768c378..8433a2cf 100644 --- a/6/db/d4d/class_o_n___string_buffer.html +++ b/6/db/d4d/class_o_n___string_buffer.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_StringBuffer Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d51/class_o_n___compressed_buffer-members.html b/6/db/d51/class_o_n___compressed_buffer-members.html index 78437624..d002362e 100644 --- a/6/db/d51/class_o_n___compressed_buffer-members.html +++ b/6/db/d51/class_o_n___compressed_buffer-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d53/class_o_n___quaternion-members.html b/6/db/d53/class_o_n___quaternion-members.html index da21e8ad..ad9c1a5a 100644 --- a/6/db/d53/class_o_n___quaternion-members.html +++ b/6/db/d53/class_o_n___quaternion-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d55/class_o_n___text_builder.html b/6/db/d55/class_o_n___text_builder.html index ddb27144..581b0872 100644 --- a/6/db/d55/class_o_n___text_builder.html +++ b/6/db/d55/class_o_n___text_builder.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextBuilder Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d5d/class_o_n___bounding_box_cache-members.html b/6/db/d5d/class_o_n___bounding_box_cache-members.html index ca404235..357ace25 100644 --- a/6/db/d5d/class_o_n___bounding_box_cache-members.html +++ b/6/db/d5d/class_o_n___bounding_box_cache-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d60/opennurbs__bezier_8h_source.html b/6/db/d60/opennurbs__bezier_8h_source.html index e1f9f170..8e4bac28 100644 --- a/6/db/d60/opennurbs__bezier_8h_source.html +++ b/6/db/d60/opennurbs__bezier_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_bezier.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_bezier.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d65/opennurbs_8h_source.html b/6/db/d65/opennurbs_8h_source.html index 3afc4555..0f61de5c 100644 --- a/6/db/d65/opennurbs_8h_source.html +++ b/6/db/d65/opennurbs_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // Includes all openNURBS toolkit headers required to use the
    20 // openNURBS toolkit library. See readme.txt for details.
    21 //
    22 ////////////////////////////////////////////////////////////////
    23 
    24 #if !defined(OPENNURBS_INC_)
    25 #define OPENNURBS_INC_
    26 
    27 #define OPENNURBS_INC_IN_PROGRESS
    28 
    29 #include "opennurbs_system.h" /* system headers used by openNURBS code */
    30 
    31 #include "opennurbs_wip.h" /* works in progress defines that control availability */
    32 
    33 #include "opennurbs_3dm.h" /* 3DM typecode (TCODE) definitions */
    34 
    35 #include "opennurbs_defines.h" /* openNURBS defines and enums */
    36 #include "opennurbs_error.h" /* error handling */
    37 #include "opennurbs_memory.h" /* memory managment (onmalloc(), onrealloc(), onfree(), ...) */
    38 #include "opennurbs_rand.h" /* random number generator */
    39 #include "opennurbs_crc.h" /* cyclic redundancy check tool */
    40 #include "opennurbs_uuid.h" /* universally unique identifiers (UUID, a.k.a, GUID) */
    41 #include "opennurbs_unicode.h" /* unicode string conversion */
    42 
    43 #if defined(ON_CPLUSPLUS)
    44 #include "opennurbs_topology.h"
    45 #include "opennurbs_cpp_base.h" // for safe use of STL classes as private data members
    46 #include "opennurbs_locale.h"
    47 #include "opennurbs_date.h"
    48 #include "opennurbs_version_number.h"
    49 #include "opennurbs_compstat.h"
    50 #include "opennurbs_progress_reporter.h" // ON_ProgressReporter class
    51 #include "opennurbs_terminator.h" // ON_Terminator class
    52 #include "opennurbs_lock.h" // simple atomic operation lock setter
    53 #include "opennurbs_fsp.h" // fixed size memory pool
    54 #include "opennurbs_function_list.h" /* list of functions to run */
    55 #include "opennurbs_std_string.h" // std::string utilities
    56 #include "opennurbs_md5.h"
    57 #include "opennurbs_sha1.h"
    58 #include "opennurbs_string.h" // dynamic string classes (single and double byte)
    59 #include "opennurbs_hash_table.h"
    60 #include "opennurbs_file_utilities.h"
    61 #include "opennurbs_array.h" // dynamic array templates
    62 #include "opennurbs_compress.h"
    63 #include "opennurbs_base64.h" // base64 encodeing and decoding
    64 #include "opennurbs_color.h" // R G B color
    65 #include "opennurbs_linestyle.h" // line pattern, scale, and width
    66 #include "opennurbs_point.h" // double precision 2d, 3d, 4d points and 2d, 3d vectors
    67 #include "opennurbs_fpoint.h" // float precision 2d, 3d, 4d points and 2d, 3d vectors
    68 #include "opennurbs_ipoint.h" // 2d integer point, rectangle and size
    69 #include "opennurbs_base32.h" // base32 encodeing and decoding
    70 #include "opennurbs_pluginlist.h"
    71 #include "opennurbs_bounding_box.h" // simple 3d axis aligned bounding box
    72 #include "opennurbs_matrix.h" // general m X n matrix
    73 #include "opennurbs_xform.h" // 4 X 4 transformation matrix
    74 #include "opennurbs_quaternion.h"
    75 #include "opennurbs_workspace.h" // workspace memory allocation
    76 #include "opennurbs_plane.h" // simple 3d plane
    77 #include "opennurbs_circle.h" // simple 3d circle
    78 #include "opennurbs_ellipse.h" // simple 3d ellipse
    79 #include "opennurbs_parse.h" // number, length unit, length, angle, point parsing
    80 #include "opennurbs_string_value.h" // Robust length, angle and scale value information for UI
    81 
    82 
    83 #include "opennurbs_line.h" // simple line
    84 #include "opennurbs_polyline.h" // simple polyline
    85 #include "opennurbs_cylinder.h" // simple 3d elliptical cylinder
    86 #include "opennurbs_cone.h" // simple 3d right circular cone
    87 #include "opennurbs_sphere.h" // simple 3d sphere
    88 #include "opennurbs_box.h" // simple 3d box
    89 #include "opennurbs_torus.h" // simple 3d torus
    90 #include "opennurbs_bezier.h" // simple bezier and polynomial curves and surfaces
    91 #include "opennurbs_math.h" // utilities for performing simple calculations
    92 #include "opennurbs_intersect.h" // utilities for performing simple intersections
    93 #include "opennurbs_optimize.h" // utilities for finding extrema and zeros
    94 #include "opennurbs_knot.h" // utilities for working with NURBS knot vectors
    95 #include "opennurbs_evaluate_nurbs.h" // utilities for evaluating Beziers and NURBS
    96 #include "opennurbs_textlog.h" // text log for dumps, error logs, etc.
    97 #include "opennurbs_rtree.h" // ON_RTree spatial search utility.
    98 #include "opennurbs_mapchan.h"
    99 #include "opennurbs_rendering.h"
    100 #include "opennurbs_object.h" // virtual base class for all openNURBS objects
    101 #include "opennurbs_model_component.h"
    102 #include "opennurbs_archive.h" // binary arcive objects for serialization to file, memory blocks, etc.
    103 #include "opennurbs_model_geometry.h"
    104 #include "opennurbs_arc.h" // simple 3d circular arc
    105 #include "opennurbs_userdata.h" // class for attaching persistent user information to openNURBS objects
    106 #include "opennurbs_geometry.h" // virtual base class for geometric objects
    107 #include "opennurbs_curve.h" // virtual parametric curve
    108 #include "opennurbs_surface.h" // virtual parametric surface
    109 #include "opennurbs_viewport.h" // simple renering projection
    110 #include "opennurbs_texture_mapping.h" // texture coordinate evaluation
    111 #include "opennurbs_texture.h" // texture definition
    112 #include "opennurbs_material.h" // simple rendering material
    113 #include "opennurbs_layer.h" // layer definition
    114 #include "opennurbs_linetype.h" // linetype definition
    115 #include "opennurbs_group.h" // group name and index
    116 #include "opennurbs_light.h" // light
    117 #include "opennurbs_pointgeometry.h" // single point
    118 #include "opennurbs_pointcloud.h" // point set
    119 #include "opennurbs_curveproxy.h" // proxy curve provides a way to use an existing curve
    120 #include "opennurbs_surfaceproxy.h" // proxy surface provides a way to use another surface
    121 #include "opennurbs_mesh.h" // render mesh object
    122 #include "opennurbs_pointgrid.h" // point grid object
    123 #include "opennurbs_linecurve.h" // line as a paramtric curve object
    124 #include "opennurbs_arccurve.h" // arc/circle as a paramtric curve object
    125 #include "opennurbs_polylinecurve.h" // polyline as a paramtric curve object
    126 #include "opennurbs_nurbscurve.h" // NURBS curve
    127 #include "opennurbs_polycurve.h" // polycurve (composite curve)
    128 #include "opennurbs_curveonsurface.h" // curve on surface (other kind of composite curve)
    129 #include "opennurbs_nurbssurface.h" // NURBS surface
    130 #include "opennurbs_planesurface.h" // plane surface
    131 #include "opennurbs_revsurface.h" // surface of revolution
    132 #include "opennurbs_sumsurface.h" // sum surface
    133 #include "opennurbs_brep.h" // boundary rep
    134 #include "opennurbs_beam.h" // lightweight extrusion object
    135 #include "opennurbs_subd.h" // subdivison surface object
    136 #include "opennurbs_bitmap.h" // Windows and OpenGL bitmaps
    137 #include "opennurbs_instance.h" // instance definitions and references
    138 #include "opennurbs_3dm_properties.h"
    139 #include "opennurbs_3dm_settings.h"
    140 #include "opennurbs_3dm_attributes.h"
    141 #include "opennurbs_textglyph.h"
    142 #include "opennurbs_textcontext.h"
    143 #include "opennurbs_textrun.h"
    144 #include "opennurbs_font.h" // font
    145 #include "opennurbs_text_style.h"
    146 #include "opennurbs_dimensionstyle.h" // dimension style
    147 #include "opennurbs_text.h"
    148 #include "opennurbs_hatch.h" // hatch geometry definitions
    149 #include "opennurbs_hatch.h" // hatch geometry definitions
    150 #include "opennurbs_linetype.h" // linetype pattern definitions
    151 #include "opennurbs_objref.h" // ON_ObjRef definition
    152 #include "opennurbs_offsetsurface.h" // ON_OffsetSurface definition
    153 #include "opennurbs_detail.h" // ON_Detail definition
    154 #include "opennurbs_lookup.h" // ON_SerialNumberTable
    155 #include "opennurbs_object_history.h"
    156 #include "opennurbs_annotationbase.h" // Base class for text, leaders and dimensions
    157 #include "opennurbs_textobject.h"
    158 #include "opennurbs_leader.h"
    159 #include "opennurbs_dimension.h"
    160 #include "opennurbs_dimensionformat.h" // Formatting dimension measurements to strings
    161 
    162 #include "opennurbs_photogrammetry.h"
    163 
    164 #include "opennurbs_extensions.h"
    165 
    166 #include "opennurbs_freetype.h"
    167 
    168 
    169 #endif
    170 
    171 #undef OPENNURBS_INC_IN_PROGRESS
    172 
    173 #endif
    diff --git a/6/db/d66/struct_o_n___r_tree_leaf.html b/6/db/d66/struct_o_n___r_tree_leaf.html index 22cae44f..1b1e97b5 100644 --- a/6/db/d66/struct_o_n___r_tree_leaf.html +++ b/6/db/d66/struct_o_n___r_tree_leaf.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RTreeLeaf Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d69/class_o_n___model_geometry_component.html b/6/db/d69/class_o_n___model_geometry_component.html index 0de37c32..765405e2 100644 --- a/6/db/d69/class_o_n___model_geometry_component.html +++ b/6/db/d69/class_o_n___model_geometry_component.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ModelGeometryComponent Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -538,10 +536,7 @@ Additional Inherited Members  

    Detailed Description

    -

    / / Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////
    -Description: Used to store geometry table object definition and attributes in an ONX_Model.

    +

    / / Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// Description: Used to store geometry table object definition and attributes in an ONX_Model.

    Constructor & Destructor Documentation

    ◆ ON_ModelGeometryComponent() [1/3]

    @@ -855,9 +850,7 @@ Description: Used to store geometry table object definition and attributes in an
    -

    Parameters: no_geometry_return_value - [in] This value is returned if no geometric object has been set. A good choices for this parameter's value depends on the context. Common options are nullptr. Returns: The curve, surface, annotation, detail, light, ... geometry, or no_geometry_return_value if the geometry has not been set.
    - If the geometry is a light, then ComponentType() will return ON_ModelComponent::Type::RenderLight.
    - If the geometry is set and something besides light, then ComponentType() will return ON_ModelComponent::Type::ModelGeometry. Otherwise, ComponentType() will return ON_ModelComponent::Type::ModelGeometry::Unset.

    +

    Parameters: no_geometry_return_value - [in] This value is returned if no geometric object has been set. A good choices for this parameter's value depends on the context. Common options are nullptr. Returns: The curve, surface, annotation, detail, light, ... geometry, or no_geometry_return_value if the geometry has not been set. If the geometry is a light, then ComponentType() will return ON_ModelComponent::Type::RenderLight. If the geometry is set and something besides light, then ComponentType() will return ON_ModelComponent::Type::ModelGeometry. Otherwise, ComponentType() will return ON_ModelComponent::Type::ModelGeometry::Unset.

    @@ -984,9 +977,9 @@ Description: Used to store geometry table object definition and attributes in an diff --git a/6/db/d6c/class_o_n___aerial_photo_image-members.html b/6/db/d6c/class_o_n___aerial_photo_image-members.html index 3fd27245..77211295 100644 --- a/6/db/d6c/class_o_n___aerial_photo_image-members.html +++ b/6/db/d6c/class_o_n___aerial_photo_image-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d70/class_o_n___file_system.html b/6/db/d70/class_o_n___file_system.html index 2318f88e..87a91d57 100644 --- a/6/db/d70/class_o_n___file_system.html +++ b/6/db/d70/class_o_n___file_system.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_FileSystem Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
     

    Detailed Description

    -

    / / Copyright (c) 1993-2015 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2015 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Member Function Documentation

    ◆ IsDirectory() [1/2]

    @@ -369,9 +366,9 @@ Static Public Member Functions
    diff --git a/6/db/d79/struct_o_n___r_tree_b_box-members.html b/6/db/d79/struct_o_n___r_tree_b_box-members.html index 223d0988..a0c33185 100644 --- a/6/db/d79/struct_o_n___r_tree_b_box-members.html +++ b/6/db/d79/struct_o_n___r_tree_b_box-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/db/d7b/opennurbs__freetype__include_8h_source.html b/6/db/d7b/opennurbs__freetype__include_8h_source.html index 0bd4f6b1..e1677dc5 100644 --- a/6/db/d7b/opennurbs__freetype__include_8h_source.html +++ b/6/db/d7b/opennurbs__freetype__include_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_freetype_include.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_freetype_include.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /*
    2 //
    3 // Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved.
    4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    5 // McNeel & Associates.
    6 //
    7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    10 //
    11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    12 //
    13 ////////////////////////////////////////////////////////////////
    14 */
    15 
    16 // opennurbs uses FreeType to calculate font metric, glyph metric, and glyph outline information.
    17 
    18 // FreeType Licensing:
    19 //
    20 //// Retrieved March 22, 2017
    21 //// https://www.freetype.org/freetype2/docs/index.html
    22 ////What is FreeType?
    23 ////
    24 ////FreeType is a software font engine that is designed to be small, efficient,
    25 ////highly customizable, and portable while capable of producing high-quality
    26 ////output (glyph images). It can be used in graphics libraries, display servers,
    27 ////font conversion tools, text image generation tools, and many other products as well.
    28 ////
    29 ////Note that FreeType is a font service and doesn't provide APIs to perform
    30 ////higher-level features like text layout or graphics processing
    31 ////(e.g., colored text rendering, ‘hollowing’, etc.). However, it greatly
    32 ////simplifies these tasks by providing a simple, easy to use, and uniform
    33 ////interface to access the content of font files.
    34 ////
    35 ////FreeType is released under two open-source licenses: our own BSD-like
    36 ////FreeType License and the GNU Public License, Version 2. It can thus
    37 ////be used by any kind of projects, be they proprietary or not.
    38 ////
    39 ////Please note that ‘FreeType’ is also called ‘FreeType 2’, to
    40 ////distinguish it from the old, deprecated ‘FreeType 1’ library,
    41 ////a predecessor no longer maintained and supported.
    42 ////
    43 //// http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/FTL.TXT
    44 ////
    45 //// The FreeType Project LICENSE
    46 //// ----------------------------
    47 ////
    48 //// 2006-Jan-27
    49 ////
    50 //// Copyright 1996-2002, 2006 by
    51 //// David Turner, Robert Wilhelm, and Werner Lemberg
    52 ////
    53 ////
    54 ////
    55 ////Introduction
    56 ////============
    57 ////
    58 //// The FreeType Project is distributed in several archive packages;
    59 //// some of them may contain, in addition to the FreeType font engine,
    60 //// various tools and contributions which rely on, or relate to, the
    61 //// FreeType Project.
    62 ////
    63 //// This license applies to all files found in such packages, and
    64 //// which do not fall under their own explicit license. The license
    65 //// affects thus the FreeType font engine, the test programs,
    66 //// documentation and makefiles, at the very least.
    67 ////
    68 //// This license was inspired by the BSD, Artistic, and IJG
    69 //// (Independent JPEG Group) licenses, which all encourage inclusion
    70 //// and use of free software in commercial and freeware products
    71 //// alike. As a consequence, its main points are that:
    72 ////
    73 //// o We don't promise that this software works. However, we will be
    74 //// interested in any kind of bug reports. (`as is' distribution)
    75 ////
    76 //// o You can use this software for whatever you want, in parts or
    77 //// full form, without having to pay us. (`royalty-free' usage)
    78 ////
    79 //// o You may not pretend that you wrote this software. If you use
    80 //// it, or only parts of it, in a program, you must acknowledge
    81 //// somewhere in your documentation that you have used the
    82 //// FreeType code. (`credits')
    83 ////
    84 //// We specifically permit and encourage the inclusion of this
    85 //// software, with or without modifications, in commercial products.
    86 //// We disclaim all warranties covering The FreeType Project and
    87 //// assume no liability related to The FreeType Project.
    88 ////
    89 ////
    90 //// Finally, many people asked us for a preferred form for a
    91 //// credit/disclaimer to use in compliance with this license. We thus
    92 //// encourage you to use the following text:
    93 ////
    94 //// """
    95 //// Portions of this software are copyright © <year> The FreeType
    96 //// Project (www.freetype.org). All rights reserved.
    97 //// """
    98 ////
    99 //// Please replace <year> with the value from the FreeType version you
    100 //// actually use.
    101 ////
    102 ////
    103 ////Legal Terms
    104 ////===========
    105 ////
    106 ////0. Definitions
    107 ////--------------
    108 ////
    109 //// Throughout this license, the terms `package', `FreeType Project',
    110 //// and `FreeType archive' refer to the set of files originally
    111 //// distributed by the authors (David Turner, Robert Wilhelm, and
    112 //// Werner Lemberg) as the `FreeType Project', be they named as alpha,
    113 //// beta or final release.
    114 ////
    115 //// `You' refers to the licensee, or person using the project, where
    116 //// `using' is a generic term including compiling the project's source
    117 //// code as well as linking it to form a `program' or `executable'.
    118 //// This program is referred to as `a program using the FreeType
    119 //// engine'.
    120 ////
    121 //// This license applies to all files distributed in the original
    122 //// FreeType Project, including all source code, binaries and
    123 //// documentation, unless otherwise stated in the file in its
    124 //// original, unmodified form as distributed in the original archive.
    125 //// If you are unsure whether or not a particular file is covered by
    126 //// this license, you must contact us to verify this.
    127 ////
    128 //// The FreeType Project is copyright (C) 1996-2000 by David Turner,
    129 //// Robert Wilhelm, and Werner Lemberg. All rights reserved except as
    130 //// specified below.
    131 ////
    132 ////1. No Warranty
    133 ////--------------
    134 ////
    135 //// THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY
    136 //// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
    137 //// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    138 //// PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
    139 //// BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO
    140 //// USE, OF THE FREETYPE PROJECT.
    141 ////
    142 ////2. Redistribution
    143 ////-----------------
    144 ////
    145 //// This license grants a worldwide, royalty-free, perpetual and
    146 //// irrevocable right and license to use, execute, perform, compile,
    147 //// display, copy, create derivative works of, distribute and
    148 //// sublicense the FreeType Project (in both source and object code
    149 //// forms) and derivative works thereof for any purpose; and to
    150 //// authorize others to exercise some or all of the rights granted
    151 //// herein, subject to the following conditions:
    152 ////
    153 //// o Redistribution of source code must retain this license file
    154 //// (`FTL.TXT') unaltered; any additions, deletions or changes to
    155 //// the original files must be clearly indicated in accompanying
    156 //// documentation. The copyright notices of the unaltered,
    157 //// original files must be preserved in all copies of source
    158 //// files.
    159 ////
    160 //// o Redistribution in binary form must provide a disclaimer that
    161 //// states that the software is based in part of the work of the
    162 //// FreeType Team, in the distribution documentation. We also
    163 //// encourage you to put an URL to the FreeType web page in your
    164 //// documentation, though this isn't mandatory.
    165 ////
    166 //// These conditions apply to any software derived from or based on
    167 //// the FreeType Project, not just the unmodified files. If you use
    168 //// our work, you must acknowledge us. However, no fee need be paid
    169 //// to us.
    170 ////
    171 ////3. Advertising
    172 ////--------------
    173 ////
    174 //// Neither the FreeType authors and contributors nor you shall use
    175 //// the name of the other for commercial, advertising, or promotional
    176 //// purposes without specific prior written permission.
    177 ////
    178 //// We suggest, but do not require, that you use one or more of the
    179 //// following phrases to refer to this software in your documentation
    180 //// or advertising materials: `FreeType Project', `FreeType Engine',
    181 //// `FreeType library', or `FreeType Distribution'.
    182 ////
    183 //// As you have not signed this license, you are not required to
    184 //// accept it. However, as the FreeType Project is copyrighted
    185 //// material, only this license, or another one contracted with the
    186 //// authors, grants you the right to use, distribute, and modify it.
    187 //// Therefore, by using, distributing, or modifying the FreeType
    188 //// Project, you indicate that you understand and accept all the terms
    189 //// of this license.
    190 ////
    191 ////4. Contacts
    192 ////-----------
    193 ////
    194 //// There are two mailing lists related to FreeType:
    195 ////
    196 //// o freetype@nongnu.org
    197 ////
    198 //// Discusses general use and applications of FreeType, as well as
    199 //// future and wanted additions to the library and distribution.
    200 //// If you are looking for support, start in this list if you
    201 //// haven't found anything to help you in the documentation.
    202 ////
    203 //// o freetype-devel@nongnu.org
    204 ////
    205 //// Discusses bugs, as well as engine internals, design issues,
    206 //// specific licenses, porting, etc.
    207 ////
    208 //// Our home page can be found at
    209 ////
    210 //// http://www.freetype.org
    211 ////
    212 ////--- end of FTL.TXT ---
    213 
    214 
    215 #if !defined(OPENNURBS_FREETYPE_INCLUDE_INC_)
    216 #define OPENNURBS_FREETYPE_INCLUDE_INC_
    217 
    218 // NOTE:
    219 // This header file is not included in opennurbs.h because
    220 // FreeType 2.6.3 has deeply nested includes and uses angle brackets
    221 // in its include files (instead of double quotes and relative paths like opennurbs),
    222 // the directory ./freetype263/include must be in the "system" includes path.
    223 // It is not feasable or reasonable for all projects that include opennurbs.h to have the
    224 // freetype includes directory in the system includes path.
    225 
    226 #if defined(OPENNURBS_FREETYPE_SUPPORT)
    227 
    228 // Angle brackets are used on #include <ft2build.h> because if it fails,
    229 // the following #include FT_FREETYPE_H will fail, but in more mysterious ways.
    230 #if defined(OPENNURBS_EXPORTS) || defined(OPENNURBS_IMPORTS)
    231 // WHen opennurbs is a DLL, freetype is linked as a DLL
    232 #if defined(ON_COMPILER_MSC)
    233 /* Windows DLL */
    234 #define OPENNURBS_FREETYPE_DECL __declspec(dllimport)
    235 #elif defined(ON_COMPILER_CLANG)
    236 /* Apple shared library */
    237 #define OPENNURBS_FREETYPE_DECL __attribute__ ((visibility ("default")))
    238 #endif
    239 #endif
    240 
    241 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    242 #include <ft2build.h>
    243 #include FT_FREETYPE_H
    244 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    245 
    246 #if defined(ON_COMPILER_MSC)
    247 
    248 #if !defined(OPENNURBS_FREETYPE_LIB_DIR)
    249 
    250 #include "opennurbs_input_libsdir.h"
    251 
    252 #if defined(OPENNURBS_INPUT_LIBS_DIR)
    253 // Typically, OPENNURBS_LIB_DIR is defined in opennurbs_msbuild.Cpp.props
    254 #define OPENNURBS_FREETYPE_LIB_DIR OPENNURBS_INPUT_LIBS_DIR
    255 #else
    256 // Define OPENNURBS_FREETYPE_LIB_DIR to be the directory containing freetype263.lib
    257 #error You must define OPENNURBS_FREETYPE_LIB_DIR
    258 #endif
    259 
    260 #endif
    261 
    262 #if defined(_LIB) && !defined(OPENNURBS_IMPORTS) && !defined(OPENNURBS_EXPORTS)
    263 
    264 // Microsoft static library
    265 #if defined(_MT) && !defined(_DLL)
    266 // Microsoft dynamic library freetype263_mt.lib used multithreaded static C-runtime
    267 #pragma message ( "Linking with freetype263_mt.lib in " OPENNURBS_PP2STR(OPENNURBS_FREETYPE_LIB_DIR) )
    268 #pragma comment(lib, "\"" OPENNURBS_FREETYPE_LIB_DIR "/" "freetype263_mt.lib" "\"")
    269 #else
    270 // Microsoft dynamic library freetype263_staticlib.lib uses DLL C-runtime
    271 #pragma message ( "Linking with freetype263_staticlib.lib in " OPENNURBS_PP2STR(OPENNURBS_FREETYPE_LIB_DIR) )
    272 #pragma comment(lib, "\"" OPENNURBS_FREETYPE_LIB_DIR "/" "freetype263_staticlib.lib" "\"")
    273 #endif
    274 
    275 #else
    276 // Microsoft dynamic library freetype263.lib + freetype263.dll
    277 #pragma message ( "Linking with freetype263.lib in " OPENNURBS_PP2STR(OPENNURBS_FREETYPE_LIB_DIR) )
    278 #pragma comment(lib, "\"" OPENNURBS_FREETYPE_LIB_DIR "/" "freetype263.lib" "\"")
    279 #endif
    280 #endif
    281 
    282 #endif
    283 
    284 #endif
    diff --git a/6/db/d80/class_o_n__3f_vector.html b/6/db/d80/class_o_n__3f_vector.html index 30c00c69..eb5f8aa8 100644 --- a/6/db/d80/class_o_n__3f_vector.html +++ b/6/db/d80/class_o_n__3f_vector.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3fVector Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    ◆ operator<()

    +

    ◆ operator<()

    @@ -1588,7 +1586,7 @@ Static Public Attributes
    -

    ◆ operator<=()

    +

    ◆ operator<=()

    @@ -1820,7 +1818,7 @@ Static Public Attributes
    -

    ◆ operator>()

    +

    ◆ operator>()

    @@ -1838,7 +1836,7 @@ Static Public Attributes
    -

    ◆ operator>=()

    +

    ◆ operator>=()

    @@ -2334,9 +2332,9 @@ Static Public Attributes
    diff --git a/6/db/d87/opennurbs__md5_8h_source.html b/6/db/d87/opennurbs__md5_8h_source.html index bc4b6dab..ed046545 100644 --- a/6/db/d87/opennurbs__md5_8h_source.html +++ b/6/db/d87/opennurbs__md5_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_md5.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_md5.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/db/d8b/class_o_n___mesh_face-members.html b/6/db/d8b/class_o_n___mesh_face-members.html index 0b1edd7d..8e2ce654 100644 --- a/6/db/d8b/class_o_n___mesh_face-members.html +++ b/6/db/d8b/class_o_n___mesh_face-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d8c/class_o_n__4f_point.html b/6/db/d8c/class_o_n__4f_point.html index 1f2d7b3b..868c0c5d 100644 --- a/6/db/d8c/class_o_n__4f_point.html +++ b/6/db/d8c/class_o_n__4f_point.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_4fPoint Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d8d/class_o_n_x___model-members.html b/6/db/d8d/class_o_n_x___model-members.html index 99bca55b..a5c430d4 100644 --- a/6/db/d8d/class_o_n_x___model-members.html +++ b/6/db/d8d/class_o_n_x___model-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/d93/class_o_n___m_d5___hash-members.html b/6/db/d93/class_o_n___m_d5___hash-members.html index 0c8de6df..9e6b580d 100644 --- a/6/db/d93/class_o_n___m_d5___hash-members.html +++ b/6/db/d93/class_o_n___m_d5___hash-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/da1/class_o_n___length_unit_name.html b/6/db/da1/class_o_n___length_unit_name.html index 31445e76..e396547f 100644 --- a/6/db/da1/class_o_n___length_unit_name.html +++ b/6/db/da1/class_o_n___length_unit_name.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_LengthUnitName Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/da3/class_o_n___length_unit_name-members.html b/6/db/da3/class_o_n___length_unit_name-members.html index 67519857..78c6d87a 100644 --- a/6/db/da3/class_o_n___length_unit_name-members.html +++ b/6/db/da3/class_o_n___length_unit_name-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/da6/class_o_n___uncompress_stream.html b/6/db/da6/class_o_n___uncompress_stream.html index 31516d5a..78eb3a9d 100644 --- a/6/db/da6/class_o_n___uncompress_stream.html +++ b/6/db/da6/class_o_n___uncompress_stream.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UncompressStream Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Call BeginUnompressStream() one time to initialize the compression calculation. Then call In() one or more times to submit the compressed stream to the uncompression calculation.
    - When you reach the end of the compressed stream, call End(). Returns: true if successful, false if an error occured.

    +

    Description: Call BeginUnompressStream() one time to initialize the compression calculation. Then call In() one or more times to submit the compressed stream to the uncompression calculation. When you reach the end of the compressed stream, call End(). Returns: true if successful, false if an error occured.

    @@ -213,8 +210,7 @@ Public Member Functions
    -

    Description: After the last call to In(), call End().
    - Calling End() may generate zero or more calls to the output stream handler. Returns: true if successful, false if an error occured.

    +

    Description: After the last call to In(), call End(). Calling End() may generate zero or more calls to the output stream handler. Returns: true if successful, false if an error occured.

    @@ -397,9 +393,9 @@ Public Member Functions diff --git a/6/db/dac/opennurbs__polycurve_8h_source.html b/6/db/dac/opennurbs__polycurve_8h_source.html index 134ecfd1..d5fbddf5 100644 --- a/6/db/dac/opennurbs__polycurve_8h_source.html +++ b/6/db/dac/opennurbs__polycurve_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_polycurve.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_polycurve.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/daf/class_o_n___managed_fonts-members.html b/6/db/daf/class_o_n___managed_fonts-members.html index d6ee4308..682eb410 100644 --- a/6/db/daf/class_o_n___managed_fonts-members.html +++ b/6/db/daf/class_o_n___managed_fonts-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    This is the complete list of members for ON_ManagedFonts, including all inherited members.

    - - - - - + + + + + +
    GetFontMetrics(const ON_Font *font, ON_FontMetrics &font_unit_font_metrics)ON_ManagedFontsstatic
    GetFromFontCharacteristics(const ON_Font &font_characteristics, bool bCreateIfNotFound)ON_ManagedFonts
    GetFromSerialNumber(unsigned int managed_font_runtime_serial_number)ON_ManagedFonts
    GetGlyphMetrics(const class ON_Font *font, ON__UINT32 unicode_code_point, class ON_TextBox &font_unit_glyph_box)ON_ManagedFontsstatic
    GetList(ON_SimpleArray< const ON_Font * > &managed_fonts)ON_ManagedFonts
    ListON_ManagedFontsstatic
    GetFromAppleFontName(const wchar_t *apple_font_name, bool bCreateIfNotFound)ON_ManagedFonts
    GetFromFontCharacteristics(const ON_Font &font_characteristics, bool bCreateIfNotFound)ON_ManagedFonts
    GetFromSerialNumber(unsigned int managed_font_runtime_serial_number)ON_ManagedFonts
    GetGlyphMetrics(const class ON_Font *font, ON__UINT32 unicode_code_point, class ON_TextBox &font_unit_glyph_box)ON_ManagedFontsstatic
    GetList(ON_SimpleArray< const ON_Font * > &managed_fonts)ON_ManagedFonts
    ListON_ManagedFontsstatic
    diff --git a/6/db/db0/class_o_n___r_tree_iterator.html b/6/db/db0/class_o_n___r_tree_iterator.html index 2fff8cb6..2865e2a9 100644 --- a/6/db/db0/class_o_n___r_tree_iterator.html +++ b/6/db/db0/class_o_n___r_tree_iterator.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RTreeIterator Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/db3/class_o_n_x___model_component_iterator.html b/6/db/db3/class_o_n_x___model_component_iterator.html index a117a293..efb52d79 100644 --- a/6/db/db3/class_o_n_x___model_component_iterator.html +++ b/6/db/db3/class_o_n_x___model_component_iterator.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ONX_ModelComponentIterator Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/db4/opennurbs__ellipse_8h_source.html b/6/db/db4/opennurbs__ellipse_8h_source.html index 9ea4a2a0..11b7aebe 100644 --- a/6/db/db4/opennurbs__ellipse_8h_source.html +++ b/6/db/db4/opennurbs__ellipse_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_ellipse.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_ellipse.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/dbc/class_o_n___uuid_list.html b/6/db/dbc/class_o_n___uuid_list.html index ab75d794..7863ed7b 100644 --- a/6/db/dbc/class_o_n___uuid_list.html +++ b/6/db/dbc/class_o_n___uuid_list.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_UuidList Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/dbd/class_o_n__2i_size-members.html b/6/db/dbd/class_o_n__2i_size-members.html index 461ad61a..3fca8bcd 100644 --- a/6/db/dbd/class_o_n__2i_size-members.html +++ b/6/db/dbd/class_o_n__2i_size-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/dbf/class_o_n__2d_vector-members.html b/6/db/dbf/class_o_n__2d_vector-members.html index 32f39052..fdbd5e3f 100644 --- a/6/db/dbf/class_o_n__2d_vector-members.html +++ b/6/db/dbf/class_o_n__2d_vector-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/dc0/class_o_n__3d_point-members.html b/6/db/dc0/class_o_n__3d_point-members.html index 4cf0b9e7..90539d5f 100644 --- a/6/db/dc0/class_o_n__3d_point-members.html +++ b/6/db/dc0/class_o_n__3d_point-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/dc1/class_o_n___dim_linear.html b/6/db/dc1/class_o_n___dim_linear.html index 4f3c554c..1537ca06 100644 --- a/6/db/dc1/class_o_n___dim_linear.html +++ b/6/db/dc1/class_o_n___dim_linear.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_DimLinear Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    enum  ForceArrow : unsigned int { ForceArrow::Auto = 0, ForceArrow::Inside = 1, ForceArrow::Outside = 2 - } - Arrowheads forced Inside, or Outside of extension lines, or moved to fit. More...
    + } Arrowheads forced Inside, or Outside of extension lines, or moved to fit. More...
    +   enum  ForceText : unsigned int { ForceText::Auto = 0, ForceText::Inside = 1, ForceText::Right = 2, ForceText::Left = 3 - } - Text forced Inside, Right or Left of extension lines, or moved to fit (Auto). More...
    + } Text forced Inside, Right or Left of extension lines, or moved to fit (Auto). More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -1990,8 +1988,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -2073,9 +2071,9 @@ Additional Inherited Members diff --git a/6/db/dc7/class_o_n___text_run-members.html b/6/db/dc7/class_o_n___text_run-members.html index eb7d4899..91fe56d9 100644 --- a/6/db/dc7/class_o_n___text_run-members.html +++ b/6/db/dc7/class_o_n___text_run-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archiveserialize definition to binary archive
    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/db/dca/class_o_n___hatch_loop.html b/6/db/dca/class_o_n___hatch_loop.html index 69c47d0f..6c5e579c 100644 --- a/6/db/dca/class_o_n___hatch_loop.html +++ b/6/db/dca/class_o_n___hatch_loop.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_HatchLoop Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////
    - class ON_HatchLoop /////////////////////////////////////////////////////////////// Represents a 3d boundary loop curve

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// class ON_HatchLoop /////////////////////////////////////////////////////////////// Represents a 3d boundary loop curve

    Member Enumeration Documentation

    ◆ eLoopType

    @@ -476,9 +469,9 @@ Friends
    diff --git a/6/db/dcf/class_o_n___text_iterator.html b/6/db/dcf/class_o_n___text_iterator.html index 7d901488..2abe7b87 100644 --- a/6/db/dcf/class_o_n___text_iterator.html +++ b/6/db/dcf/class_o_n___text_iterator.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextIterator Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/dd2/class_o_n___surface_curvature-members.html b/6/db/dd2/class_o_n___surface_curvature-members.html index ee7203c4..b2d2ddcd 100644 --- a/6/db/dd2/class_o_n___surface_curvature-members.html +++ b/6/db/dd2/class_o_n___surface_curvature-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/dd2/class_o_n_x___model_component_iterator-members.html b/6/db/dd2/class_o_n_x___model_component_iterator-members.html index c4187ee2..079c863d 100644 --- a/6/db/dd2/class_o_n_x___model_component_iterator-members.html +++ b/6/db/dd2/class_o_n_x___model_component_iterator-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/db/dda/opennurbs__bounding__box_8h_source.html b/6/db/dda/opennurbs__bounding__box_8h_source.html index ffe5211c..c6c626c8 100644 --- a/6/db/dda/opennurbs__bounding__box_8h_source.html +++ b/6/db/dda/opennurbs__bounding__box_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_bounding_box.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_bounding_box.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_bounding_box.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(ON_BOUNDING_BOX_INC_)
    18 #define ON_BOUNDING_BOX_INC_
    19 
    20 ////////////////////////////////////////////////////////////////
    21 //
    22 // ON_BoundingBox - axis aligned bounding box
    23 //
    24 
    25 class ON_CLASS ON_BoundingBox
    26 {
    27 public:
    28  static const ON_BoundingBox EmptyBoundingBox; // ((1.0,0.0,0.0),(-1.0,0.0,0.0))
    29  static const ON_BoundingBox UnsetBoundingBox; // all coordinates are ON_UNSET_VALUE
    30  static const ON_BoundingBox NanBoundingBox; // all coordinates are ON_DBL_QNAN
    31 
    32  ON_BoundingBox() ON_NOEXCEPT; // creates EmptyBoundingBox
    33  ~ON_BoundingBox() = default;
    34  ON_BoundingBox(const ON_BoundingBox&) = default;
    35  ON_BoundingBox& operator=(const ON_BoundingBox&) = default;
    36 
    37  explicit ON_BoundingBox(
    38  const ON_3dPoint&, // min corner of axis aligned bounding box
    39  const ON_3dPoint& // max corner of axis aligned bounding box
    40  );
    41 
    42 
    43  // OBSOLETE
    44  // temporary - use ON_ClippingRegion - this function will be removed soon.
    45  int IsVisible(
    46  const ON_Xform& bbox2c
    47  ) const;
    48 
    49 
    50  // OBSOLETE
    51  void Destroy(); // set this = ON_BoundingBox::EmptyBoundingBox
    52 
    53  // operator[] returns min if index <= 0 and max if indes >= 1
    54  ON_3dPoint& operator[](int);
    55  const ON_3dPoint& operator[](int) const;
    56 
    57  ON_3dPoint Min() const;
    58  ON_3dPoint Max() const;
    59  ON_3dVector Diagonal() const; // max corner - min corner
    60  ON_3dPoint Center() const;
    61  ON_3dPoint Corner( // 8 corners of box
    62  int, // x_index 0 = Min().x, 1 = Max().x
    63  int, // y_index 0 = Min().y, 1 = Max().y
    64  int // z_index 0 = Min().z, 1 = Max().z
    65  ) const;
    66  bool GetCorners(
    67  ON_3dPointArray& box_corners // returns list of 8 corner points
    68  ) const;
    69  bool GetCorners(
    70  ON_3dPoint box_corners[8] // returns list of 8 corner points
    71  ) const;
    72 
    73  /*
    74  Parameters:
    75  edges[] - out
    76  12 edge lines. If the bounding box has no height, width or depth,
    77  then the corresponding edges will have the same "from" and "to"
    78  points.
    79  Returns:
    80  If the bounding box is valid, then true is returned and
    81  12 line segments, some possibly a single point, are returned.
    82  Otherwise false is returned and 12 line segments with "from"
    83  and "to" points set to ON_3dPoint::UnsetPoint are returned.
    84  */
    85  bool GetEdges(
    86  ON_Line edges[12] // returns list of 12 edge segments
    87  ) const;
    88 
    89  // OBSOLETE IsValid() = IsNotEmpty()
    90  bool IsValid() const; // empty boxes are not valid
    91 
    92  bool IsSet() const; // every coordinate is a finite, valid double, not ON_UNSET_VALUE and not ON_UNSET_POSITIVE_VALUE
    93  bool IsUnset() const; // some coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    94  bool IsNan() const; // some coordinate is a NAN
    95  bool IsUnsetOrNan() const; // = IsUnset() or IsNan()
    96 
    97  bool IsEmpty() const; // (m_min.x > m_max.x || m_min.y > m_max.y || m_min.z > m_max.z) && IsSet();
    98  bool IsNotEmpty() const; // (m_min.x <= m_max.x && m_min.y <= m_max.y && m_min.z <= m_max.z) && IsSet()
    99  bool IsPoint() const; // (m_min.x == m_max.x && m_min.y == m_max.y && m_min.z == m_max.z) && IsSet()
    100 
    101  void Dump(class ON_TextLog&) const;
    102 
    103  /*
    104  Description:
    105  Test a bounding box to see if it is degenerate (flat)
    106  in one or more directions.
    107  Parameters:
    108  tolerance - [in] Distances <= tolerance will be considered
    109  to be zero. If tolerance is negative (default), then
    110  a scale invarient tolerance is used.
    111  Returns:
    112  @untitled table
    113  0 box is not degenerate
    114  1 box is a rectangle (degenerate in one direction)
    115  2 box is a line (degenerate in two directions)
    116  3 box is a point (degenerate in three directions)
    117  4 box is not valid
    118  */
    119  int IsDegenerate(
    120  double tolerance = ON_UNSET_VALUE
    121  ) const;
    122 
    123 
    124  //////////
    125  // ON_BoundingBox::Transform() updates the bounding box
    126  // to be the smallest axis aligned bounding box that contains
    127  // the transform of the eight corner points of the input
    128  // bounding box.
    129  bool Transform( const ON_Xform& );
    130 
    131  double Tolerance() const; // rough guess at a tolerance to use for comparing
    132  // objects in this bounding box
    133 
    134 
    135  // All of these Set() functions set or expand a box to enclose the points in the arguments
    136  // If bGrowBox is true, the existing box is expanded, otherwise it is only set to the current point list
    137  bool Set(
    138  int dim,
    139  bool is_rat,
    140  int count,
    141  int stride,
    142  const double* point_array,
    143  int bGrowBox = false
    144  );
    145 
    146  bool Set(
    147  const ON_3dPoint& point,
    148  int bGrowBox = false
    149  );
    150 
    151  bool Set(
    152  const ON_2dPoint& point,
    153  int bGrowBox = false
    154  );
    155 
    156  bool Set(
    157  const ON_SimpleArray<ON_4dPoint>& point_array,
    158  int bGrowBox = false
    159  );
    160 
    161  bool Set(
    162  const ON_SimpleArray<ON_3dPoint>& point_array,
    163  int bGrowBox = false
    164  );
    165 
    166  bool Set(
    167  const ON_SimpleArray<ON_2dPoint>& point_array,
    168  int bGrowBox = false
    169  );
    170 
    171  bool Set(
    172  int dim,
    173  bool is_rat,
    174  int count,
    175  int stride,
    176  const float* point_array,
    177  int bGrowBox = false
    178  );
    179 
    180  bool Set(
    181  const ON_3fPoint& point,
    182  int bGrowBox = false
    183  );
    184 
    185  bool Set(
    186  const ON_2fPoint& point,
    187  int bGrowBox = false
    188  );
    189 
    190  bool Set(
    191  const ON_SimpleArray<ON_4fPoint>& point_array,
    192  int bGrowBox = false
    193  );
    194 
    195  bool Set(
    196  const ON_SimpleArray<ON_3fPoint>& point_array,
    197  int bGrowBox = false
    198  );
    199 
    200  bool Set(
    201  const ON_SimpleArray<ON_2fPoint>& point_array,
    202  int bGrowBox = false
    203  );
    204 
    205  bool IsPointIn(
    206  const ON_3dPoint& test_point, // point to test
    207  int bStrictlyIn = false
    208  // true to test for strict ( min < point < max )
    209  // false to test for (min <= point <= max)
    210  //
    211  ) const;
    212 
    213  //////////
    214  // Point on or in the box that is closest to test_point.
    215  // If test_point is in or on the box, the test_point is returned.
    216  ON_3dPoint ClosestPoint(
    217  const ON_3dPoint& test_point
    218  ) const;
    219 
    220 
    221  /*
    222  Description:
    223  Quickly find a lower bound on the distance
    224  between the point and this bounding box.
    225  Parameters:
    226  P - [in]
    227  Returns:
    228  A distance that is less than or equal to the shortest
    229  distance from the line to this bounding box.
    230  Put another way, if Q is any point in this bounding box,
    231  then P.DistanceTo(Q) >= MinimumDistanceTo(bbox).
    232  */
    233  double MinimumDistanceTo( const ON_3dPoint& P ) const;
    234 
    235  /*
    236  Description:
    237  Quickly find an upper bound on the distance
    238  between the point and this bounding box.
    239  Parameters:
    240  P - [in]
    241  Returns:
    242  A distance that is greater than or equal to the
    243  longest distance from the point P to this bounding box.
    244  Put another way, if Q is any point in this bounding box,
    245  then P.DistanceTo(Q) <= MaximumDistanceTo(bbox).
    246  */
    247  double MaximumDistanceTo( const ON_3dPoint& P ) const;
    248 
    249 
    250  /*
    251  Description:
    252  Quickly find a lower bound on the distance
    253  between this and the other bounding box.
    254  Parameters:
    255  other - [in]
    256  Returns:
    257  A distance that is less than or equal to the shortest
    258  distance between the bounding boxes.
    259  Put another way, if Q is any point in this bounding box
    260  and P is any point in the other bounding box,
    261  then P.DistanceTo(Q) >= MinimumDistanceTo(bbox).
    262  */
    263  double MinimumDistanceTo( const ON_BoundingBox& other ) const;
    264 
    265  /*
    266  Description:
    267  Quickly find an upper bound on the distance
    268  between this and the other bounding box.
    269  Parameters:
    270  other - [in]
    271  Returns:
    272  A distance that is greater than or equal to the longest
    273  distance between the bounding boxes.
    274  Put another way, if Q is any point in this bounding box
    275  and P is any point in the other bounding box,
    276  then P.DistanceTo(Q) <= MaximumDistanceTo(bbox).
    277  */
    278  double MaximumDistanceTo( const ON_BoundingBox& other ) const;
    279 
    280  /*
    281  Description:
    282  Quickly find a lower bound on the distance
    283  between the line segment and this bounding box.
    284  Parameters:
    285  line - [in]
    286  Returns:
    287  A distance that is less than or equal to the shortest
    288  distance from the line to this bounding box.
    289  Put another way, if Q is any point on line
    290  and P is any point in this bounding box, then
    291  P.DistanceTo(Q) >= MinimumDistanceTo(bbox).
    292  */
    293  double MinimumDistanceTo( const ON_Line& line ) const;
    294 
    295  /*
    296  Description:
    297  Quickly find a tight lower bound on the distance
    298  between the plane and this bounding box.
    299  Parameters:
    300  plane - [in]
    301  Returns:
    302  The minimum distance between a point on the plane
    303  and a point on the bounding box.
    304  See Also:
    305  ON_PlaneEquation::MimimumValueAt
    306  ON_PlaneEquation::MaximumValueAt
    307  */
    308  double MinimumDistanceTo( const ON_Plane& plane ) const;
    309  double MinimumDistanceTo( const ON_PlaneEquation& plane_equation ) const;
    310 
    311  /*
    312  Description:
    313  Quickly find an upper bound on the distance
    314  between the line segment and this bounding box.
    315  Parameters:
    316  line - [in]
    317  Returns:
    318  A distance that is greater than or equal to the
    319  longest distance from the line to this bounding box.
    320  Put another way, if Q is any point on the line
    321  and P is any point in this bounding box, then
    322  P.DistanceTo(Q) <= MaximumDistanceTo(bbox).
    323  */
    324  double MaximumDistanceTo( const ON_Line& line ) const;
    325 
    326  /*
    327  Description:
    328  Quickly find a tight upper bound on the distance
    329  between the plane and this bounding box.
    330  Parameters:
    331  plane - [in]
    332  Returns:
    333  A distance that is equal to the longest distance from
    334  the plane to this bounding box. Put another way,
    335  if Q is any point on the plane and P is any point
    336  in this bounding box, then
    337  P.DistanceTo(Q) <= MaximumDistanceTo(bbox) and there
    338  is at least one point on the bounding box where the
    339  distance is equal to the returned value.
    340  See Also:
    341  ON_PlaneEquation::MaximumValueAt
    342  */
    343  double MaximumDistanceTo( const ON_Plane& plane ) const;
    344  double MaximumDistanceTo( const ON_PlaneEquation& plane_equation ) const;
    345 
    346 
    347  /*
    348  Description:
    349  Quickly determine if the shortest distance from
    350  the point P to the bounding box is greater than d.
    351  Parameters:
    352  d - [in] distance (> 0.0)
    353  P - [in]
    354  Returns:
    355  True if if the shortest distance from the point P
    356  to the bounding box is greater than d.
    357  */
    358  bool IsFartherThan( double d, const ON_3dPoint& P ) const;
    359 
    360  /*
    361  Description:
    362  Quickly determine if the shortest distance from the line
    363  to the bounding box is greater than d.
    364  Parameters:
    365  d - [in] distance (> 0.0)
    366  line - [in]
    367  Returns:
    368  True if the shortest distance from the line
    369  to the bounding box is greater than d. It is not the
    370  case that false means that the shortest distance
    371  is less than or equal to d.
    372  */
    373  bool IsFartherThan( double d, const ON_Line& line ) const;
    374 
    375  /*
    376  Description:
    377  Quickly determine if the shortest distance from the plane
    378  to the bounding box is greater than d.
    379  Parameters:
    380  d - [in] distance (> 0.0)
    381  plane - [in]
    382  Returns:
    383  True if the shortest distance from the plane
    384  to the bounding box is greater than d, and false
    385  if the shortest distance is less than or equal to d.
    386  */
    387  bool IsFartherThan( double d, const ON_Plane& plane ) const;
    388 
    389  /*
    390  Description:
    391  Quickly determine if the shortest distance from the plane
    392  to the bounding box is greater than d.
    393  Parameters:
    394  d - [in] distance (> 0.0)
    395  plane_equation - [in] (the first three coefficients
    396  are assumed to be a unit vector.
    397  If not, adjust your d accordingly.)
    398  Returns:
    399  True if the shortest distance from the plane
    400  to the bounding box is greater than d, and false
    401  if the shortest distance is less than or equal to d.
    402  */
    403  bool IsFartherThan( double d, const ON_PlaneEquation& plane_equation ) const;
    404 
    405  /*
    406  Description:
    407  Quickly determine if the shortest distance this bounding
    408  box to another bounding box is greater than d.
    409  Parameters:
    410  d - [in] distance (> 0.0)
    411  other - [in] other bounding box
    412  Returns:
    413  True if if the shortest distance from this bounding
    414  box to the other bounding box is greater than d.
    415  */
    416  bool IsFartherThan( double d, const ON_BoundingBox& other ) const;
    417 
    418 
    419  // Description:
    420  // Get point in a bounding box that is closest to a line
    421  // segment.
    422  // Parameters:
    423  // line - [in] line segment
    424  // box_point - [out] point in box that is closest to line
    425  // segment point at t0.
    426  // t0 - [out] parameter of point on line that is closest to
    427  // the box.
    428  // t1 - [out] parameter of point on line that is closest to
    429  // the box.
    430  // Returns:
    431  // 3 success - line segments intersects box in a segment
    432  // from line(t0) to line(t1) (t0 < t1)
    433  // 2 success - line segments intersects box in a single point
    434  // at line(t0) (t0==t1)
    435  // 1 success - line segment does not intersect box. Closest
    436  // point on the line is at line(t0) (t0==t1)
    437  // 0 failure - box is invalid.
    438  // Remarks:
    439  // The box is treated as a solid box. If the intersection
    440  // of the line segment, then 3 is returned.
    441  int GetClosestPoint(
    442  const ON_Line&, // line
    443  ON_3dPoint&, // box_point
    444  double*, // t0
    445  double* // t1
    446  ) const;
    447 
    448  //////////
    449  // Get points on bounding boxes that are closest to each other.
    450  // If the boxes intersect, then the point at the centroid of the
    451  // intersection is returned for both points.
    452  bool GetClosestPoint(
    453  const ON_BoundingBox&, // "other" bounding box
    454  ON_3dPoint&, // point on "this" box that is closest to "other" box
    455  ON_3dPoint& // point on "other" box that is closest to "this" box
    456  ) const;
    457 
    458  //////////
    459  // Point on the box that is farthest from the test_point.
    460  ON_3dPoint FarPoint(
    461  const ON_3dPoint& // test_point
    462  ) const;
    463 
    464  //////////
    465  // Get points on bounding boxes that are farthest from each other.
    466  bool GetFarPoint(
    467  const ON_BoundingBox&, // "other" bounding box
    468  ON_3dPoint&, // point on "this" box that is farthest from "other" box
    469  ON_3dPoint& // point on "other" box that is farthest from "this" box
    470  ) const;
    471 
    472  /*
    473  Description:
    474  Intersect this with other_bbox and save intersection in this.
    475  Parameters:
    476  other_bbox - [in]
    477  Returns:
    478  True if this-intesect-other_bbox is a non-empty valid bounding box
    479  and this is set. False if the intersection is empty, in which case
    480  "this" is set to an invalid bounding box.
    481  Remarks:
    482  If "this" or other_bbox is invalid, they are treated as
    483  the empty set, and false is returned.
    484  */
    485  bool Intersection(
    486  const ON_BoundingBox& other_bbox
    487  );
    488 
    489  /*
    490  Description:
    491  Set "this" to the intersection of bbox_A and bbox_B.
    492  Parameters:
    493  bbox_A - [in]
    494  bbox_B - [in]
    495  Returns:
    496  True if the "this" is a non-empty valid bounding box.
    497  False if the intersection is empty, in which case
    498  "this" is set to an invalid bounding box.
    499  Remarks:
    500  If bbox_A or bbox_B is invalid, they are treated as
    501  the empty set, and false is returned.
    502  */
    503  bool Intersection( // this = intersection of two args
    504  const ON_BoundingBox& bbox_A,
    505  const ON_BoundingBox& bbox_B
    506  );
    507 
    508  bool Intersection( //Returns true when intersect is non-empty.
    509  const ON_Line&, //Infinite Line segment to intersect with
    510  double* =nullptr , // t0 parameter of first intersection point
    511  double* =nullptr // t1 parameter of last intersection point (t0<=t1)
    512  ) const;
    513 
    514  /*
    515  Description:
    516  Test a box to see if it is contained in this box.
    517  Parameters:
    518  other - [in] box to test
    519  bProperSubSet - [in] if true, then the test is for a proper inclusion.
    520  Returns:
    521  If bProperSubSet is false, then the result is true when
    522  this->m_min[i] <= other.m_min[i] and other.m_max[i] <= this->m_max[i].
    523  for i=0,1 and 2.
    524  If bProperSubSet is true, then the result is true when
    525  the above condition is true and at least one of the inequalities is strict.
    526  */
    527  bool Includes(
    528  const ON_BoundingBox& other,
    529  bool bProperSubSet = false
    530  ) const;
    531 
    532  double Volume() const;
    533 
    534  double Area() const;
    535 
    536  // Union() returns true if union is not empty.
    537  // Invalid boxes are treated as the empty set.
    538  bool Union( // this = this union arg
    539  const ON_BoundingBox&
    540  );
    541 
    542  bool Union( // this = union of two args
    543  const ON_BoundingBox&,
    544  const ON_BoundingBox&
    545  );
    546 
    547  /*
    548  Description:
    549  Test to see if "this" and other_bbox are disjoint (do not intersect).
    550  Parameters:
    551  other_bbox - [in]
    552  Returns:
    553  True if "this" and other_bbox are disjoint.
    554  Remarks:
    555  If "this" or other_bbox is invalid, then true is returned.
    556  */
    557  bool IsDisjoint(
    558  const ON_BoundingBox& other_bbox
    559  ) const;
    560 
    561  bool SwapCoordinates( int, int );
    562 
    563  ON_3dPoint m_min;
    564  ON_3dPoint m_max;
    565 };
    566 
    567 /*
    568 Returns:
    569  True if lhs and rhs are identical.
    570 */
    571 ON_DECL
    572 bool operator==( const ON_BoundingBox& lhs, const ON_BoundingBox& rhs );
    573 
    574 /*
    575 Returns:
    576  True if lhs and rhs are not equal.
    577 */
    578 ON_DECL
    579 bool operator!=( const ON_BoundingBox& lhs, const ON_BoundingBox& rhs );
    580 
    581 class ON_CLASS ON_BoundingBoxAndHash
    582 {
    583 public:
    584  ON_BoundingBoxAndHash() = default;
    585  ~ON_BoundingBoxAndHash() = default;
    587  ON_BoundingBoxAndHash& operator=(const ON_BoundingBoxAndHash&) = default;
    588 
    589 public:
    590  // This hash depends on the context and is a hash
    591  // of the information used to calculte the bounding box.
    592  // It is not the hash of the box values
    593 
    594  void Set(
    595  const ON_BoundingBox& bbox,
    596  const ON_SHA1_Hash& hash
    597  );
    598 
    599  const ON_BoundingBox& BoundingBox() const;
    600 
    601  const ON_SHA1_Hash& Hash() const;
    602 
    603  /*
    604  Returns:
    605  True if bounding box IsSet() is true and hash is not EmptyContentHash.
    606  */
    607  bool IsSet() const;
    608 
    609  bool Write(
    610  class ON_BinaryArchive& archive
    611  ) const;
    612 
    613  bool Read(
    614  class ON_BinaryArchive& archive
    615  );
    616 
    617  private:
    620 };
    621 
    622 /*
    623 A class that caches 8 bounding box - hash pairs and keeps the most frequently
    624 used bounding boxes.
    625 */
    626 class ON_CLASS ON_BoundingBoxCache
    627 {
    628 public:
    629  ON_BoundingBoxCache() = default;
    630  ~ON_BoundingBoxCache() = default;
    631  ON_BoundingBoxCache(const ON_BoundingBoxCache&) = default;
    632  ON_BoundingBoxCache& operator=(const ON_BoundingBoxCache&) = default;
    633 
    634 public:
    635  /*
    636  Description:
    637  Add a bounding box that can be found from a hash value.
    638  Parameters:
    639  bbox - [in]
    640  hash - [in]
    641  A hash of the information needed to create this bounding box.
    642  */
    643  void AddBoundingBox(
    644  const ON_BoundingBox& bbox,
    645  const ON_SHA1_Hash& hash
    646  );
    647 
    648  void AddBoundingBox(
    649  const ON_BoundingBoxAndHash& bbox_and_hash
    650  );
    651 
    652  /*
    653  Description:
    654  Get a cached bounding box.
    655  Parameters:
    656  hash - [in]
    657  bbox - [out]
    658  If the hash identifies a bounding box in the cache, then
    659  that bounding box is returned. Otherwise ON_BoundingBox::NanBoundingBox
    660  is returned.
    661  Returns:
    662  true - cached bounding box returned
    663  false - bounding box not in cache.
    664  */
    665  bool GetBoundingBox(
    666  const ON_SHA1_Hash& hash,
    667  ON_BoundingBox& bbox
    668  ) const;
    669 
    670  /*
    671  Description:
    672  Remove a bounding box that can be found from a hash value.
    673  Parameters:
    674  hash - [in]
    675  Returns:
    676  true - hash was in the cache and removed.
    677  false - hash was not in the cache.
    678  Remarks:
    679  If the hash values you are using are correctly computed and include
    680  all information that the bouding box depends on, then
    681  you never need to remove bounding boxes. Unused ones will get
    682  removed as new ones are added.
    683  */
    684  bool RemoveBoundingBox(
    685  const ON_SHA1_Hash& hash
    686  );
    687 
    688  /*
    689  Description:
    690  Removes all bounding boxes.
    691  Remarks:
    692  If the hash values you are using are correctly computed and include
    693  all information that the bouding box depends on, then
    694  you never need to remove bounding boxes. Unused ones will get
    695  removed as new ones are added.
    696  If the hash does not include all information required to compute
    697  the bounding boxes, then call RemoveAllBoundingBoxes() when the
    698  non-hashed information changes.
    699  */
    700  void RemoveAllBoundingBoxes();
    701 
    702  /*
    703  Returns:
    704  Number of cached boxes.
    705  */
    706  unsigned int BoundingBoxCount() const;
    707 
    708  bool Write(
    709  class ON_BinaryArchive& archive
    710  ) const;
    711 
    712  bool Read(
    713  class ON_BinaryArchive& archive
    714  );
    715 
    716 private:
    717  // number of boxes set in m_cache[]
    718  unsigned int m_count = 0;
    719 
    720  // capacity of m_cache[] - set when needed
    721  unsigned int m_capacity = 0;
    722 
    723  // Bounding box cache. Most recently used boxes are first.
    724  mutable ON_BoundingBoxAndHash m_cache[8];
    725 
    726  /*
    727  Returns:
    728  m_cache[] array index of box with the hash.
    729  ON_UNSET_UINT_INDEX if hash is not present in m_cache[] array.
    730  */
    731  unsigned int Internal_CacheIndex(const ON_SHA1_Hash& hash) const;
    732 };
    733 
    734 #if defined(ON_DLL_TEMPLATE)
    735 
    736 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_BoundingBox>;
    737 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_BoundingBoxAndHash>;
    738 
    739 #endif
    740 
    741 /*
    742 Description:
    743  Get a tight bounding box that contains the points.
    744 Parameters:
    745  dim - [in] (>=1)
    746  is_rat - [in] true if points are rational
    747  count - [in] number of points
    748  stride - [in] stride between points
    749  point_list - [in]
    750  bbox - [in/out]
    751  bGrowBox - [in] (default = false)
    752  If the input bbox is valid and bGrowBox is true,
    753  then the output bbox is the union of the input
    754  bbox and the bounding box of the point list.
    755  xform - [in] (default = nullptr)
    756  If not null, the bounding box of the transformed
    757  points is calculated. The points are not modified.
    758 Returns:
    759  True if the output bbox is valid.
    760 */
    761 ON_DECL
    762 bool ON_GetPointListBoundingBox(
    763  int dim,
    764  bool is_rat,
    765  int count,
    766  int stride,
    767  const double* point_list,
    768  ON_BoundingBox& bbox,
    769  int bGrowBox = false,
    770  const ON_Xform* xform = 0
    771  );
    772 
    773 ON_DECL
    774 bool ON_GetPointListBoundingBox(
    775  int dim,
    776  bool is_rat,
    777  int count,
    778  int stride,
    779  const float* point_list,
    780  ON_BoundingBox& bbox,
    781  int bGrowBox = false,
    782  const ON_Xform* xform = 0
    783  );
    784 
    785 ON_DECL
    786 bool ON_GetPointListBoundingBox(
    787  int dim,
    788  bool is_rat,
    789  int count,
    790  int stride,
    791  const double* point_list,
    792  double* boxmin, // min[dim]
    793  double* boxmax, // max[dim]
    794  int bGrowBox
    795  );
    796 
    797 ON_DECL
    798 ON_BoundingBox ON_PointListBoundingBox(
    799  int dim,
    800  bool is_rat,
    801  int count,
    802  int stride,
    803  const double* point_list
    804  );
    805 
    806 ON_DECL
    807 bool ON_GetPointListBoundingBox(
    808  int dim,
    809  bool is_rat,
    810  int count,
    811  int stride,
    812  const float* point_list,
    813  float* boxmin, // min[dim]
    814  float* boxmax, // max[dim]
    815  int bGrowBox
    816  );
    817 
    818 ON_DECL
    819 ON_BoundingBox ON_PointListBoundingBox( // low level workhorse function
    820  int dim,
    821  bool is_rat,
    822  int count,
    823  int stride,
    824  const float* point_list
    825  );
    826 
    827 ON_DECL
    828 bool ON_GetPointGridBoundingBox(
    829  int dim,
    830  bool is_rat,
    831  int point_count0, int point_count1,
    832  int point_stride0, int point_stride1,
    833  const double* point_grid,
    834  double* boxmin, // min[dim]
    835  double* boxmax, // max[dim]
    836  int bGrowBox
    837  );
    838 
    839 ON_DECL
    840 ON_BoundingBox ON_PointGridBoundingBox(
    841  int dim,
    842  bool is_rat,
    843  int point_count0, int point_count1,
    844  int point_stride0, int point_stride1,
    845  const double* point_grid
    846  );
    847 
    848 ON_DECL
    849 double ON_BoundingBoxTolerance(
    850  int dim,
    851  const double* bboxmin,
    852  const double* bboxmax
    853  );
    854 
    855 /*
    856 Description:
    857  Determine if an object is too large or too far
    858  from the origin for single precision coordinates
    859  to be useful.
    860 Parameters:
    861  bbox - [in]
    862  Bounding box of an object with single precision
    863  coordinates. An ON_Mesh is an example of an
    864  object with single precision coordinates.
    865  xform - [out]
    866  If this function returns false and xform is not
    867  null, then the identity transform is returned.
    868  If this function returns true and xform is not
    869  null, then the transform moves the region
    870  contained in bbox to a location where single
    871  precision coordinates will have enough
    872  information for the object to be useful.
    873 Returns:
    874  true:
    875  The region contained in bbox is too large
    876  or too far from the origin for single
    877  precision coordinates to be useful.
    878  false:
    879  A single precision object contained in bbox
    880  will be satisfactory for common calculations.
    881 */
    882 ON_DECL
    883 bool ON_BeyondSinglePrecision( const ON_BoundingBox& bbox, ON_Xform* xform );
    884 
    885 ON_DECL
    886 bool ON_WorldBBoxIsInTightBBox(
    887  const ON_BoundingBox& tight_bbox,
    888  const ON_BoundingBox& world_bbox,
    889  const ON_Xform* xform
    890  );
    891 
    892 #endif
    Definition: opennurbs_bounding_box.h:581
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(ON_BOUNDING_BOX_INC_)
    18 #define ON_BOUNDING_BOX_INC_
    19 
    20 ////////////////////////////////////////////////////////////////
    21 //
    22 // ON_BoundingBox - axis aligned bounding box
    23 //
    24 
    25 class ON_CLASS ON_BoundingBox
    26 {
    27 public:
    28  static const ON_BoundingBox EmptyBoundingBox; // ((1.0,0.0,0.0),(-1.0,0.0,0.0))
    29  static const ON_BoundingBox UnsetBoundingBox; // all coordinates are ON_UNSET_VALUE
    30  static const ON_BoundingBox NanBoundingBox; // all coordinates are ON_DBL_QNAN
    31 
    32  ON_BoundingBox() ON_NOEXCEPT; // creates EmptyBoundingBox
    33  ~ON_BoundingBox() = default;
    34  ON_BoundingBox(const ON_BoundingBox&) = default;
    35  ON_BoundingBox& operator=(const ON_BoundingBox&) = default;
    36 
    37  explicit ON_BoundingBox(
    38  const ON_3dPoint&, // min corner of axis aligned bounding box
    39  const ON_3dPoint& // max corner of axis aligned bounding box
    40  );
    41 
    42 
    43  // OBSOLETE
    44  // temporary - use ON_ClippingRegion - this function will be removed soon.
    45  int IsVisible(
    46  const ON_Xform& bbox2c
    47  ) const;
    48 
    49 
    50  // OBSOLETE
    51  void Destroy(); // set this = ON_BoundingBox::EmptyBoundingBox
    52 
    53  // operator[] returns min if index <= 0 and max if indes >= 1
    54  ON_3dPoint& operator[](int);
    55  const ON_3dPoint& operator[](int) const;
    56 
    57  ON_3dPoint Min() const;
    58  ON_3dPoint Max() const;
    59  ON_3dVector Diagonal() const; // max corner - min corner
    60  ON_3dPoint Center() const;
    61  ON_3dPoint Corner( // 8 corners of box
    62  int, // x_index 0 = Min().x, 1 = Max().x
    63  int, // y_index 0 = Min().y, 1 = Max().y
    64  int // z_index 0 = Min().z, 1 = Max().z
    65  ) const;
    66  bool GetCorners(
    67  ON_3dPointArray& box_corners // returns list of 8 corner points
    68  ) const;
    69  bool GetCorners(
    70  ON_3dPoint box_corners[8] // returns list of 8 corner points
    71  ) const;
    72 
    73  /*
    74  Parameters:
    75  edges[] - out
    76  12 edge lines. If the bounding box has no height, width or depth,
    77  then the corresponding edges will have the same "from" and "to"
    78  points.
    79  Returns:
    80  If the bounding box is valid, then true is returned and
    81  12 line segments, some possibly a single point, are returned.
    82  Otherwise false is returned and 12 line segments with "from"
    83  and "to" points set to ON_3dPoint::UnsetPoint are returned.
    84  */
    85  bool GetEdges(
    86  ON_Line edges[12] // returns list of 12 edge segments
    87  ) const;
    88 
    89  // OBSOLETE IsValid() = IsNotEmpty()
    90  bool IsValid() const; // empty boxes are not valid
    91 
    92  bool IsSet() const; // every coordinate is a finite, valid double, not ON_UNSET_VALUE and not ON_UNSET_POSITIVE_VALUE
    93  bool IsUnset() const; // some coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
    94  bool IsNan() const; // some coordinate is a NAN
    95  bool IsUnsetOrNan() const; // = IsUnset() or IsNan()
    96 
    97  bool IsEmpty() const; // (m_min.x > m_max.x || m_min.y > m_max.y || m_min.z > m_max.z) && IsSet();
    98  bool IsNotEmpty() const; // (m_min.x <= m_max.x && m_min.y <= m_max.y && m_min.z <= m_max.z) && IsSet()
    99  bool IsPoint() const; // (m_min.x == m_max.x && m_min.y == m_max.y && m_min.z == m_max.z) && IsSet()
    100 
    101  void Dump(class ON_TextLog&) const;
    102 
    103  /*
    104  Description:
    105  Test a bounding box to see if it is degenerate (flat)
    106  in one or more directions.
    107  Parameters:
    108  tolerance - [in] Distances <= tolerance will be considered
    109  to be zero. If tolerance is negative (default), then
    110  a scale invarient tolerance is used.
    111  Returns:
    112  @untitled table
    113  0 box is not degenerate
    114  1 box is a rectangle (degenerate in one direction)
    115  2 box is a line (degenerate in two directions)
    116  3 box is a point (degenerate in three directions)
    117  4 box is not valid
    118  */
    119  int IsDegenerate(
    120  double tolerance = ON_UNSET_VALUE
    121  ) const;
    122 
    123 
    124  //////////
    125  // ON_BoundingBox::Transform() updates the bounding box
    126  // to be the smallest axis aligned bounding box that contains
    127  // the transform of the eight corner points of the input
    128  // bounding box.
    129  bool Transform( const ON_Xform& );
    130 
    131  double Tolerance() const; // rough guess at a tolerance to use for comparing
    132  // objects in this bounding box
    133 
    134 
    135  // All of these Set() functions set or expand a box to enclose the points in the arguments
    136  // If bGrowBox is true, the existing box is expanded, otherwise it is only set to the current point list
    137  bool Set(
    138  int dim,
    139  bool is_rat,
    140  int count,
    141  int stride,
    142  const double* point_array,
    143  int bGrowBox = false
    144  );
    145 
    146  bool Set(
    147  const ON_3dPoint& point,
    148  int bGrowBox = false
    149  );
    150 
    151  bool Set(
    152  const ON_2dPoint& point,
    153  int bGrowBox = false
    154  );
    155 
    156  bool Set(
    157  const ON_SimpleArray<ON_4dPoint>& point_array,
    158  int bGrowBox = false
    159  );
    160 
    161  bool Set(
    162  const ON_SimpleArray<ON_3dPoint>& point_array,
    163  int bGrowBox = false
    164  );
    165 
    166  bool Set(
    167  const ON_SimpleArray<ON_2dPoint>& point_array,
    168  int bGrowBox = false
    169  );
    170 
    171  bool Set(
    172  int dim,
    173  bool is_rat,
    174  int count,
    175  int stride,
    176  const float* point_array,
    177  int bGrowBox = false
    178  );
    179 
    180  bool Set(
    181  const ON_3fPoint& point,
    182  int bGrowBox = false
    183  );
    184 
    185  bool Set(
    186  const ON_2fPoint& point,
    187  int bGrowBox = false
    188  );
    189 
    190  bool Set(
    191  const ON_SimpleArray<ON_4fPoint>& point_array,
    192  int bGrowBox = false
    193  );
    194 
    195  bool Set(
    196  const ON_SimpleArray<ON_3fPoint>& point_array,
    197  int bGrowBox = false
    198  );
    199 
    200  bool Set(
    201  const ON_SimpleArray<ON_2fPoint>& point_array,
    202  int bGrowBox = false
    203  );
    204 
    205  bool IsPointIn(
    206  const ON_3dPoint& test_point, // point to test
    207  int bStrictlyIn = false
    208  // true to test for strict ( min < point < max )
    209  // false to test for (min <= point <= max)
    210  //
    211  ) const;
    212 
    213  //////////
    214  // Point on or in the box that is closest to test_point.
    215  // If test_point is in or on the box, the test_point is returned.
    216  ON_3dPoint ClosestPoint(
    217  const ON_3dPoint& test_point
    218  ) const;
    219 
    220 
    221  /*
    222  Description:
    223  Quickly find a lower bound on the distance
    224  between the point and this bounding box.
    225  Parameters:
    226  P - [in]
    227  Returns:
    228  A distance that is less than or equal to the shortest
    229  distance from the line to this bounding box.
    230  Put another way, if Q is any point in this bounding box,
    231  then P.DistanceTo(Q) >= MinimumDistanceTo(bbox).
    232  */
    233  double MinimumDistanceTo( const ON_3dPoint& P ) const;
    234 
    235  /*
    236  Description:
    237  Quickly find an upper bound on the distance
    238  between the point and this bounding box.
    239  Parameters:
    240  P - [in]
    241  Returns:
    242  A distance that is greater than or equal to the
    243  longest distance from the point P to this bounding box.
    244  Put another way, if Q is any point in this bounding box,
    245  then P.DistanceTo(Q) <= MaximumDistanceTo(bbox).
    246  */
    247  double MaximumDistanceTo( const ON_3dPoint& P ) const;
    248 
    249 
    250  /*
    251  Description:
    252  Quickly find a lower bound on the distance
    253  between this and the other bounding box.
    254  Parameters:
    255  other - [in]
    256  Returns:
    257  A distance that is less than or equal to the shortest
    258  distance between the bounding boxes.
    259  Put another way, if Q is any point in this bounding box
    260  and P is any point in the other bounding box,
    261  then P.DistanceTo(Q) >= MinimumDistanceTo(bbox).
    262  */
    263  double MinimumDistanceTo( const ON_BoundingBox& other ) const;
    264 
    265  /*
    266  Description:
    267  Quickly find an upper bound on the distance
    268  between this and the other bounding box.
    269  Parameters:
    270  other - [in]
    271  Returns:
    272  A distance that is greater than or equal to the longest
    273  distance between the bounding boxes.
    274  Put another way, if Q is any point in this bounding box
    275  and P is any point in the other bounding box,
    276  then P.DistanceTo(Q) <= MaximumDistanceTo(bbox).
    277  */
    278  double MaximumDistanceTo( const ON_BoundingBox& other ) const;
    279 
    280  /*
    281  Description:
    282  Quickly find a lower bound on the distance
    283  between the line segment and this bounding box.
    284  Parameters:
    285  line - [in]
    286  Returns:
    287  A distance that is less than or equal to the shortest
    288  distance from the line to this bounding box.
    289  Put another way, if Q is any point on line
    290  and P is any point in this bounding box, then
    291  P.DistanceTo(Q) >= MinimumDistanceTo(bbox).
    292  */
    293  double MinimumDistanceTo( const ON_Line& line ) const;
    294 
    295  /*
    296  Description:
    297  Quickly find a tight lower bound on the distance
    298  between the plane and this bounding box.
    299  Parameters:
    300  plane - [in]
    301  Returns:
    302  The minimum distance between a point on the plane
    303  and a point on the bounding box.
    304  See Also:
    305  ON_PlaneEquation::MimimumValueAt
    306  ON_PlaneEquation::MaximumValueAt
    307  */
    308  double MinimumDistanceTo( const ON_Plane& plane ) const;
    309  double MinimumDistanceTo( const ON_PlaneEquation& plane_equation ) const;
    310 
    311  /*
    312  Description:
    313  Quickly find an upper bound on the distance
    314  between the line segment and this bounding box.
    315  Parameters:
    316  line - [in]
    317  Returns:
    318  A distance that is greater than or equal to the
    319  longest distance from the line to this bounding box.
    320  Put another way, if Q is any point on the line
    321  and P is any point in this bounding box, then
    322  P.DistanceTo(Q) <= MaximumDistanceTo(bbox).
    323  */
    324  double MaximumDistanceTo( const ON_Line& line ) const;
    325 
    326  /*
    327  Description:
    328  Quickly find a tight upper bound on the distance
    329  between the plane and this bounding box.
    330  Parameters:
    331  plane - [in]
    332  Returns:
    333  A distance that is equal to the longest distance from
    334  the plane to this bounding box. Put another way,
    335  if Q is any point on the plane and P is any point
    336  in this bounding box, then
    337  P.DistanceTo(Q) <= MaximumDistanceTo(bbox) and there
    338  is at least one point on the bounding box where the
    339  distance is equal to the returned value.
    340  See Also:
    341  ON_PlaneEquation::MaximumValueAt
    342  */
    343  double MaximumDistanceTo( const ON_Plane& plane ) const;
    344  double MaximumDistanceTo( const ON_PlaneEquation& plane_equation ) const;
    345 
    346 
    347  /*
    348  Description:
    349  Quickly determine if the shortest distance from
    350  the point P to the bounding box is greater than d.
    351  Parameters:
    352  d - [in] distance (> 0.0)
    353  P - [in]
    354  Returns:
    355  True if if the shortest distance from the point P
    356  to the bounding box is greater than d.
    357  */
    358  bool IsFartherThan( double d, const ON_3dPoint& P ) const;
    359 
    360  /*
    361  Description:
    362  Quickly determine if the shortest distance from the line
    363  to the bounding box is greater than d.
    364  Parameters:
    365  d - [in] distance (> 0.0)
    366  line - [in]
    367  Returns:
    368  True if the shortest distance from the line
    369  to the bounding box is greater than d. It is not the
    370  case that false means that the shortest distance
    371  is less than or equal to d.
    372  */
    373  bool IsFartherThan( double d, const ON_Line& line ) const;
    374 
    375  /*
    376  Description:
    377  Quickly determine if the shortest distance from the plane
    378  to the bounding box is greater than d.
    379  Parameters:
    380  d - [in] distance (> 0.0)
    381  plane - [in]
    382  Returns:
    383  True if the shortest distance from the plane
    384  to the bounding box is greater than d, and false
    385  if the shortest distance is less than or equal to d.
    386  */
    387  bool IsFartherThan( double d, const ON_Plane& plane ) const;
    388 
    389  /*
    390  Description:
    391  Quickly determine if the shortest distance from the plane
    392  to the bounding box is greater than d.
    393  Parameters:
    394  d - [in] distance (> 0.0)
    395  plane_equation - [in] (the first three coefficients
    396  are assumed to be a unit vector.
    397  If not, adjust your d accordingly.)
    398  Returns:
    399  True if the shortest distance from the plane
    400  to the bounding box is greater than d, and false
    401  if the shortest distance is less than or equal to d.
    402  */
    403  bool IsFartherThan( double d, const ON_PlaneEquation& plane_equation ) const;
    404 
    405  /*
    406  Description:
    407  Quickly determine if the shortest distance this bounding
    408  box to another bounding box is greater than d.
    409  Parameters:
    410  d - [in] distance (> 0.0)
    411  other - [in] other bounding box
    412  Returns:
    413  True if if the shortest distance from this bounding
    414  box to the other bounding box is greater than d.
    415  */
    416  bool IsFartherThan( double d, const ON_BoundingBox& other ) const;
    417 
    418 
    419  // Description:
    420  // Get point in a bounding box that is closest to a line
    421  // segment.
    422  // Parameters:
    423  // line - [in] line segment
    424  // box_point - [out] point in box that is closest to line
    425  // segment point at t0.
    426  // t0 - [out] parameter of point on line that is closest to
    427  // the box.
    428  // t1 - [out] parameter of point on line that is closest to
    429  // the box.
    430  // Returns:
    431  // 3 success - line segments intersects box in a segment
    432  // from line(t0) to line(t1) (t0 < t1)
    433  // 2 success - line segments intersects box in a single point
    434  // at line(t0) (t0==t1)
    435  // 1 success - line segment does not intersect box. Closest
    436  // point on the line is at line(t0) (t0==t1)
    437  // 0 failure - box is invalid.
    438  // Remarks:
    439  // The box is treated as a solid box. If the intersection
    440  // of the line segment, then 3 is returned.
    441  int GetClosestPoint(
    442  const ON_Line&, // line
    443  ON_3dPoint&, // box_point
    444  double*, // t0
    445  double* // t1
    446  ) const;
    447 
    448  //////////
    449  // Get points on bounding boxes that are closest to each other.
    450  // If the boxes intersect, then the point at the centroid of the
    451  // intersection is returned for both points.
    452  bool GetClosestPoint(
    453  const ON_BoundingBox&, // "other" bounding box
    454  ON_3dPoint&, // point on "this" box that is closest to "other" box
    455  ON_3dPoint& // point on "other" box that is closest to "this" box
    456  ) const;
    457 
    458  //////////
    459  // Point on the box that is farthest from the test_point.
    460  ON_3dPoint FarPoint(
    461  const ON_3dPoint& // test_point
    462  ) const;
    463 
    464  //////////
    465  // Get points on bounding boxes that are farthest from each other.
    466  bool GetFarPoint(
    467  const ON_BoundingBox&, // "other" bounding box
    468  ON_3dPoint&, // point on "this" box that is farthest from "other" box
    469  ON_3dPoint& // point on "other" box that is farthest from "this" box
    470  ) const;
    471 
    472  /*
    473  Description:
    474  Intersect this with other_bbox and save intersection in this.
    475  Parameters:
    476  other_bbox - [in]
    477  Returns:
    478  True if this-intesect-other_bbox is a non-empty valid bounding box
    479  and this is set. False if the intersection is empty, in which case
    480  "this" is set to an invalid bounding box.
    481  Remarks:
    482  If "this" or other_bbox is invalid, they are treated as
    483  the empty set, and false is returned.
    484  */
    485  bool Intersection(
    486  const ON_BoundingBox& other_bbox
    487  );
    488 
    489  /*
    490  Description:
    491  Set "this" to the intersection of bbox_A and bbox_B.
    492  Parameters:
    493  bbox_A - [in]
    494  bbox_B - [in]
    495  Returns:
    496  True if the "this" is a non-empty valid bounding box.
    497  False if the intersection is empty, in which case
    498  "this" is set to an invalid bounding box.
    499  Remarks:
    500  If bbox_A or bbox_B is invalid, they are treated as
    501  the empty set, and false is returned.
    502  */
    503  bool Intersection( // this = intersection of two args
    504  const ON_BoundingBox& bbox_A,
    505  const ON_BoundingBox& bbox_B
    506  );
    507 
    508  bool Intersection( //Returns true when intersect is non-empty.
    509  const ON_Line&, //Infinite Line segment to intersect with
    510  double* =nullptr , // t0 parameter of first intersection point
    511  double* =nullptr // t1 parameter of last intersection point (t0<=t1)
    512  ) const;
    513 
    514  /*
    515  Description:
    516  Test a box to see if it is contained in this box.
    517  Parameters:
    518  other - [in] box to test
    519  bProperSubSet - [in] if true, then the test is for a proper inclusion.
    520  Returns:
    521  If bProperSubSet is false, then the result is true when
    522  this->m_min[i] <= other.m_min[i] and other.m_max[i] <= this->m_max[i].
    523  for i=0,1 and 2.
    524  If bProperSubSet is true, then the result is true when
    525  the above condition is true and at least one of the inequalities is strict.
    526  */
    527  bool Includes(
    528  const ON_BoundingBox& other,
    529  bool bProperSubSet = false
    530  ) const;
    531 
    532  double Volume() const;
    533 
    534  double Area() const;
    535 
    536  // Union() returns true if union is not empty.
    537  // Invalid boxes are treated as the empty set.
    538  bool Union( // this = this union arg
    539  const ON_BoundingBox&
    540  );
    541 
    542  bool Union( // this = union of two args
    543  const ON_BoundingBox&,
    544  const ON_BoundingBox&
    545  );
    546 
    547  /*
    548  Description:
    549  Test to see if "this" and other_bbox are disjoint (do not intersect).
    550  Parameters:
    551  other_bbox - [in]
    552  Returns:
    553  True if "this" and other_bbox are disjoint.
    554  Remarks:
    555  If "this" or other_bbox is invalid, then true is returned.
    556  */
    557  bool IsDisjoint(
    558  const ON_BoundingBox& other_bbox
    559  ) const;
    560 
    561  bool SwapCoordinates( int, int );
    562 
    563  ON_3dPoint m_min;
    564  ON_3dPoint m_max;
    565 };
    566 
    567 /*
    568 Returns:
    569  True if lhs and rhs are identical.
    570 */
    571 ON_DECL
    572 bool operator==( const ON_BoundingBox& lhs, const ON_BoundingBox& rhs );
    573 
    574 /*
    575 Returns:
    576  True if lhs and rhs are not equal.
    577 */
    578 ON_DECL
    579 bool operator!=( const ON_BoundingBox& lhs, const ON_BoundingBox& rhs );
    580 
    581 class ON_CLASS ON_BoundingBoxAndHash
    582 {
    583 public:
    584  ON_BoundingBoxAndHash() = default;
    585  ~ON_BoundingBoxAndHash() = default;
    586  ON_BoundingBoxAndHash(const ON_BoundingBoxAndHash&) = default;
    587  ON_BoundingBoxAndHash& operator=(const ON_BoundingBoxAndHash&) = default;
    588 
    589 public:
    590  // This hash depends on the context and is a hash
    591  // of the information used to calculte the bounding box.
    592  // It is not the hash of the box values
    593 
    594  void Set(
    595  const ON_BoundingBox& bbox,
    596  const ON_SHA1_Hash& hash
    597  );
    598 
    599  const ON_BoundingBox& BoundingBox() const;
    600 
    601  const ON_SHA1_Hash& Hash() const;
    602 
    603  /*
    604  Returns:
    605  True if bounding box IsSet() is true and hash is not EmptyContentHash.
    606  */
    607  bool IsSet() const;
    608 
    609  bool Write(
    610  class ON_BinaryArchive& archive
    611  ) const;
    612 
    613  bool Read(
    614  class ON_BinaryArchive& archive
    615  );
    616 
    617  private:
    618  ON_BoundingBox m_bbox = ON_BoundingBox::UnsetBoundingBox;
    620 };
    621 
    622 /*
    623 A class that caches 8 bounding box - hash pairs and keeps the most frequently
    624 used bounding boxes.
    625 */
    626 class ON_CLASS ON_BoundingBoxCache
    627 {
    628 public:
    629  ON_BoundingBoxCache() = default;
    630  ~ON_BoundingBoxCache() = default;
    631  ON_BoundingBoxCache(const ON_BoundingBoxCache&) = default;
    632  ON_BoundingBoxCache& operator=(const ON_BoundingBoxCache&) = default;
    633 
    634 public:
    635  /*
    636  Description:
    637  Add a bounding box that can be found from a hash value.
    638  Parameters:
    639  bbox - [in]
    640  hash - [in]
    641  A hash of the information needed to create this bounding box.
    642  */
    643  void AddBoundingBox(
    644  const ON_BoundingBox& bbox,
    645  const ON_SHA1_Hash& hash
    646  );
    647 
    648  void AddBoundingBox(
    649  const ON_BoundingBoxAndHash& bbox_and_hash
    650  );
    651 
    652  /*
    653  Description:
    654  Get a cached bounding box.
    655  Parameters:
    656  hash - [in]
    657  bbox - [out]
    658  If the hash identifies a bounding box in the cache, then
    659  that bounding box is returned. Otherwise ON_BoundingBox::NanBoundingBox
    660  is returned.
    661  Returns:
    662  true - cached bounding box returned
    663  false - bounding box not in cache.
    664  */
    665  bool GetBoundingBox(
    666  const ON_SHA1_Hash& hash,
    667  ON_BoundingBox& bbox
    668  ) const;
    669 
    670  /*
    671  Description:
    672  Remove a bounding box that can be found from a hash value.
    673  Parameters:
    674  hash - [in]
    675  Returns:
    676  true - hash was in the cache and removed.
    677  false - hash was not in the cache.
    678  Remarks:
    679  If the hash values you are using are correctly computed and include
    680  all information that the bouding box depends on, then
    681  you never need to remove bounding boxes. Unused ones will get
    682  removed as new ones are added.
    683  */
    684  bool RemoveBoundingBox(
    685  const ON_SHA1_Hash& hash
    686  );
    687 
    688  /*
    689  Description:
    690  Removes all bounding boxes.
    691  Remarks:
    692  If the hash values you are using are correctly computed and include
    693  all information that the bouding box depends on, then
    694  you never need to remove bounding boxes. Unused ones will get
    695  removed as new ones are added.
    696  If the hash does not include all information required to compute
    697  the bounding boxes, then call RemoveAllBoundingBoxes() when the
    698  non-hashed information changes.
    699  */
    700  void RemoveAllBoundingBoxes();
    701 
    702  /*
    703  Returns:
    704  Number of cached boxes.
    705  */
    706  unsigned int BoundingBoxCount() const;
    707 
    708  bool Write(
    709  class ON_BinaryArchive& archive
    710  ) const;
    711 
    712  bool Read(
    713  class ON_BinaryArchive& archive
    714  );
    715 
    716 private:
    717  // number of boxes set in m_cache[]
    718  unsigned int m_count = 0;
    719 
    720  // capacity of m_cache[] - set when needed
    721  unsigned int m_capacity = 0;
    722 
    723  // Bounding box cache. Most recently used boxes are first.
    724  mutable ON_BoundingBoxAndHash m_cache[8];
    725 
    726  /*
    727  Returns:
    728  m_cache[] array index of box with the hash.
    729  ON_UNSET_UINT_INDEX if hash is not present in m_cache[] array.
    730  */
    731  unsigned int Internal_CacheIndex(const ON_SHA1_Hash& hash) const;
    732 };
    733 
    734 #if defined(ON_DLL_TEMPLATE)
    735 
    736 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_BoundingBox>;
    737 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_BoundingBoxAndHash>;
    738 
    739 #endif
    740 
    741 /*
    742 Description:
    743  Get a tight bounding box that contains the points.
    744 Parameters:
    745  dim - [in] (>=1)
    746  is_rat - [in] true if points are rational
    747  count - [in] number of points
    748  stride - [in] stride between points
    749  point_list - [in]
    750  bbox - [in/out]
    751  bGrowBox - [in] (default = false)
    752  If the input bbox is valid and bGrowBox is true,
    753  then the output bbox is the union of the input
    754  bbox and the bounding box of the point list.
    755  xform - [in] (default = nullptr)
    756  If not null, the bounding box of the transformed
    757  points is calculated. The points are not modified.
    758 Returns:
    759  True if the output bbox is valid.
    760 */
    761 ON_DECL
    762 bool ON_GetPointListBoundingBox(
    763  int dim,
    764  bool is_rat,
    765  int count,
    766  int stride,
    767  const double* point_list,
    768  ON_BoundingBox& bbox,
    769  int bGrowBox = false,
    770  const ON_Xform* xform = 0
    771  );
    772 
    773 ON_DECL
    774 bool ON_GetPointListBoundingBox(
    775  int dim,
    776  bool is_rat,
    777  int count,
    778  int stride,
    779  const float* point_list,
    780  ON_BoundingBox& bbox,
    781  int bGrowBox = false,
    782  const ON_Xform* xform = 0
    783  );
    784 
    785 ON_DECL
    786 bool ON_GetPointListBoundingBox(
    787  int dim,
    788  bool is_rat,
    789  int count,
    790  int stride,
    791  const double* point_list,
    792  double* boxmin, // min[dim]
    793  double* boxmax, // max[dim]
    794  int bGrowBox
    795  );
    796 
    797 ON_DECL
    798 ON_BoundingBox ON_PointListBoundingBox(
    799  int dim,
    800  bool is_rat,
    801  int count,
    802  int stride,
    803  const double* point_list
    804  );
    805 
    806 ON_DECL
    807 bool ON_GetPointListBoundingBox(
    808  int dim,
    809  bool is_rat,
    810  int count,
    811  int stride,
    812  const float* point_list,
    813  float* boxmin, // min[dim]
    814  float* boxmax, // max[dim]
    815  int bGrowBox
    816  );
    817 
    818 ON_DECL
    819 ON_BoundingBox ON_PointListBoundingBox( // low level workhorse function
    820  int dim,
    821  bool is_rat,
    822  int count,
    823  int stride,
    824  const float* point_list
    825  );
    826 
    827 ON_DECL
    828 bool ON_GetPointGridBoundingBox(
    829  int dim,
    830  bool is_rat,
    831  int point_count0, int point_count1,
    832  int point_stride0, int point_stride1,
    833  const double* point_grid,
    834  double* boxmin, // min[dim]
    835  double* boxmax, // max[dim]
    836  int bGrowBox
    837  );
    838 
    839 ON_DECL
    840 ON_BoundingBox ON_PointGridBoundingBox(
    841  int dim,
    842  bool is_rat,
    843  int point_count0, int point_count1,
    844  int point_stride0, int point_stride1,
    845  const double* point_grid
    846  );
    847 
    848 ON_DECL
    849 double ON_BoundingBoxTolerance(
    850  int dim,
    851  const double* bboxmin,
    852  const double* bboxmax
    853  );
    854 
    855 /*
    856 Description:
    857  Determine if an object is too large or too far
    858  from the origin for single precision coordinates
    859  to be useful.
    860 Parameters:
    861  bbox - [in]
    862  Bounding box of an object with single precision
    863  coordinates. An ON_Mesh is an example of an
    864  object with single precision coordinates.
    865  xform - [out]
    866  If this function returns false and xform is not
    867  null, then the identity transform is returned.
    868  If this function returns true and xform is not
    869  null, then the transform moves the region
    870  contained in bbox to a location where single
    871  precision coordinates will have enough
    872  information for the object to be useful.
    873 Returns:
    874  true:
    875  The region contained in bbox is too large
    876  or too far from the origin for single
    877  precision coordinates to be useful.
    878  false:
    879  A single precision object contained in bbox
    880  will be satisfactory for common calculations.
    881 */
    882 ON_DECL
    883 bool ON_BeyondSinglePrecision( const ON_BoundingBox& bbox, ON_Xform* xform );
    884 
    885 ON_DECL
    886 bool ON_WorldBBoxIsInTightBBox(
    887  const ON_BoundingBox& tight_bbox,
    888  const ON_BoundingBox& world_bbox,
    889  const ON_Xform* xform
    890  );
    891 
    892 #endif
    Definition: opennurbs_bounding_box.h:581
    Definition: opennurbs_bounding_box.h:626
    static const ON_BoundingBox EmptyBoundingBox
    ((1.0,0.0,0.0),(-1.0,0.0,0.0))
    Definition: opennurbs_bounding_box.h:28
    static const ON_SHA1_Hash EmptyContentHash
    SHA-1 hash of zero bytes.
    Definition: opennurbs_sha1.h:23
    @@ -95,9 +93,9 @@ $(function() {
    diff --git a/6/db/df7/opennurbs__mesh_8h_source.html b/6/db/df7/opennurbs__mesh_8h_source.html index beebddc1..83102d33 100644 --- a/6/db/df7/opennurbs__mesh_8h_source.html +++ b/6/db/df7/opennurbs__mesh_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_mesh.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_mesh.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    opennurbs_mesh.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_MESH_INC_)
    18 #define OPENNURBS_MESH_INC_
    19 
    20 ///////////////////////////////////////////////////////////////////////////////
    21 //
    22 // Class ON_Mesh
    23 //
    24 class ON_CLASS ON_MeshParameters
    25 {
    26  // surface meshing perameters
    27 public:
    28 
    29  // The Rhino legacy mesher is the mesher used in Rhino 1, 2, 3, 4, 5, 6.
    30  // {F15F67AA-4AF9-4B25-A3B8-517CEDDAB134}
    32 
    33  // {EB6F6F3F-F975-4546-9D1C-64E9423BEB7F}
    34  static const ON_UUID PangolinMesherId;
    35 
    36  enum class MESH_STYLE : unsigned char
    37  {
    38  // All of these enum values must be in the range 0-255 because
    39  // unsigned chars are use for storage in some locations.
    40  unset_mesh_style = 0,
    41  render_mesh_fast = 1, // Use ON_MeshParameters::FastRenderMesh
    42  render_mesh_quality = 2, // Use ON_MeshParameters::QualityRenderMesh
    43  // 3 - 8 reserved for future predefined render mesh styles
    44  render_mesh_custom = 9,// Use ON_3dmSettings::m_CustomRenderMeshSettings
    45  render_mesh_per_object = 10 // Use ON_Object::GetMeshParameters().
    46  };
    47 
    48  static ON_MeshParameters::MESH_STYLE MeshStyleFromUnsigned(
    49  unsigned int mesh_style_as_unsigned
    50  );
    51 
    52 
    53  //////////////////////////////////////////////////////////////
    54  //
    55  // The MESH_PARAMETER_ID enum values are used to identify
    56  // mesh creation parameters.
    57  //
    58  enum class MESH_PARAMETER_ID : unsigned int
    59  {
    60  unspecified_mesh_parameter_id = 0,
    61 
    62  ////////////////////////////////////////////////////////
    63  // BEGIN Legacy parameters.
    64  //
    65 
    66  bComputeCurvature_parameter_id = 1,
    67  bSimplePlanes_parameter_id = 2,
    68  bRefine_parameter_id = 3,
    69  bJaggedSeams_parameter_id = 4,
    70  bDoublePrecision_parameter_id = 5,
    71  mesher_parameter_id = 6,
    72  texture_range_parameter_id = 7,
    73  tolerance_parameter_id = 8,
    74  relative_tolerance_parameter_id = 9,
    75  min_tolerance_parameter_id = 10,
    76  min_edge_length_parameter_id = 11,
    77  max_edge_length_parameter_id = 12,
    78  grid_aspect_ratio_parameter_id = 13,
    79  grid_min_count_parameter_id = 14,
    80  grid_max_count_parameter_id = 15,
    81  grid_angle_parameter_id = 16,
    82  grid_amplification_parameter_id = 17,
    83  refine_angle_parameter_id = 18,
    84  face_type_parameter_id = 19,
    85  srf_domain_parameter_id = 20,
    86  bClosedObjectPostProcess_id = 21,
    87 
    88  //
    89  // END Legacy parameters.
    90  ////////////////////////////////////////////////////////
    91 
    92  // UUID parameter identifying what mesher code created the mesh.
    93  mesher_id = 22,
    94 
    95  ////////////////////////////////////////////////////////
    96  // BEGIN Pangolin parameters
    97  //
    98 
    99  crv_tess_min_num_segments_parameter_id = 23,
    100  crv_tess_angle_tol_in_degrees_parameter_id = 24,
    101  crv_tess_max_dist_between_points_parameter_id = 25, // Not same as 'max_edge_length_parameter_id' since
    102  // 'curve_tess_max_dist_between_points' is only for
    103  // curves, not surfaces.
    104  crv_tess_min_parametric_ratio_parameter_id = 26,
    105  bEvaluatorBasedTessellation_parameter_id = 27,
    106  srf_tess_chord_height_parameter_id = 28, // Not same as 'tolerance_parameter_id' since
    107  // 'surface_tess_chord_height' is only for
    108  // surfaces, not curves.
    109  srf_tess_angle_tol_in_degrees_parameter_id = 29,
    110  srf_tess_max_edge_length_parameter_id = 30,
    111  srf_tess_min_edge_length_parameter_id = 31,
    112  srf_tess_min_edge_length_ratio_uv_parameter_id = 32,
    113  srf_tess_max_aspect_ratio_parameter_id = 33,
    114  smoothing_passes_parameter_id = 34,
    115 
    116  //
    117  // END Pangolin parameters
    118  ////////////////////////////////////////////////////////
    119 
    120  max_mesh_parameter_id
    121  };
    122 
    123  static ON_MeshParameters::MESH_PARAMETER_ID MeshParameterIdFromUnsigned(
    124  unsigned int mesh_parameter_id_as_unsigned
    125  );
    126 
    127  /*
    128  Description:
    129  Mesh creationg parameters to create the default render mesh.
    130  */
    131  static
    133 
    134  /*
    135  Description:
    136  Mesh creationg parameters to create the a render mesh
    137  when meshing speed is prefered over mesh quality.
    138  */
    139  static
    141 
    142  /*
    143  Description:
    144  Mesh creationg parameters to create the a render mesh
    145  when mesh quality is prefered over meshing speed.
    146  */
    147  static
    149 
    150  /*
    151  Description:
    152  Mesh creationg parameters to create the default analysis mesh.
    153  */
    154  static
    156 
    157  /*
    158  Description:
    159  Get a value to use for tolerance based on the relative_tolerance
    160  and actual size.
    161  Parameters:
    162  relative_tolerance - [in]
    163  See m_relative_tolerance field
    164  actual_size - [in]
    165  Length of object's bounding box diagonal or some similar
    166  measure of the object's 3d size.
    167  Returns:
    168  A value that can be used for m_tolerance if no
    169  user specified value is available.
    170  */
    171  static
    172  double ToleranceFromObjectSize( double relative_tolerance, double actual_size );
    173 
    174  /*
    175  Description:
    176  Get a value to use for minimum edge length base on max_edge_length
    177  and tolerance settings.
    178  Parameters:
    179  max_edge_length - [in]
    180  3d maximum edge length used to create mesh.
    181  tolerance - [in]
    182  3d distance tolerance used to create mesh.
    183  Returns:
    184  A value that can be used for m_min_edge_length if no
    185  user specified value is available.
    186  */
    187  static
    188  double MinimumEdgeLengthFromTolerance( double max_edge_length, double tolerance );
    189 
    190  ON_MeshParameters() = default;
    191  ~ON_MeshParameters() = default;
    192  ON_MeshParameters(const ON_MeshParameters&) = default;
    193  ON_MeshParameters& operator=(const ON_MeshParameters&) = default;
    194 
    195  /*
    196  Description:
    197  Tool for provding a simple slider interface.
    198  Parameters:
    199  density - [in] 0.0 <= density <= 1.0
    200  0 quickly creates coarse meshes.
    201  1 slowly creates dense meshes.
    202  min_edge_length - [in]
    203  > 0.0 custom value
    204  ON_UNSET_VALUE: for default (0.0001)
    205  */
    207  double density,
    208  double min_edge_length = ON_UNSET_VALUE
    209  );
    210 
    211  // C++ default works fine // ON_MeshParameters(const ON_MeshParameters& );
    212  // C++ default works fine // ON_MeshParameters& operator=(const ON_MeshParameters&);
    213 
    214  void Dump( ON_TextLog& test_log ) const;
    215 
    216 
    217  /*
    218  */
    219  static int Compare(
    220  const ON_MeshParameters& a,
    221  const ON_MeshParameters& b
    222  );
    223 
    224  /*
    225  Description:
    226  Compares all meshing parameters that control mesh geometry.
    227  Does not compare m_bCustomSettings, CustomSettingsEnabled(),
    228  m_bComputeCurvature, m_bDoublePrecision, MinimumTolerance(),
    229  m_texture_range, m_srf_domain0 and m_srf_domain1.
    230  */
    231  static int CompareGeometrySettings(
    232  const ON_MeshParameters& a,
    233  const ON_MeshParameters& b
    234  );
    235 
    236  ON_SHA1_Hash ContentHash() const;
    237  ON_SHA1_Hash GeometrySettingsHash() const;
    238 
    239  ON_UUID MesherId() const;
    240  void SetMesherId(
    241  ON_UUID
    242  );
    243 
    244 
    245  /*
    246  Returns:
    247  ON_MeshParameters::render_mesh_fast
    248  ON_MeshParameters::FastRenderMesh and this have the same geometry settings
    249  ON_MeshParameters::render_mesh_quality
    250  ON_MeshParameters::QualityRenderMesh and this have the same geometry settings
    251  ON_MeshParameters::render_mesh_custom
    252  custom_mp is not null and has the same geometry settings
    253  no_match_found_result
    254  otherwise
    255  */
    256  const ON_MeshParameters::MESH_STYLE GeometrySettingsRenderMeshStyle(
    257  const ON_MeshParameters* custom_mp,
    258  ON_MeshParameters::MESH_STYLE no_match_found_result
    259  ) const;
    260 
    261  /*
    262  Returns:
    263  n in the range 0 to 100, inclusive, when
    264  (0 == ON_MeshParameters::CompareGeometrySettings(*this,ON_MeshParameters(n/100.0))
    265  no_match_found_result:
    266  otherwise
    267  */
    268  const int GeometrySettingsDensityPercentage(
    269  int no_match_found_result
    270  ) const;
    271 
    272  bool Write( ON_BinaryArchive& ) const;
    273  bool Read( ON_BinaryArchive& );
    274 
    275  ON__UINT32 DataCRC(ON__UINT32) const;
    276 
    277  //////////////////////////////////////////////////////////////
    278  //
    279  // The CustomSettings() parameter applies when these mesh
    280  // creation parameters specify how an object's mesh should
    281  // be created and these parameters should override the
    282  // the model or application default mesh creation parameters.
    283  //
    284  // When CustomSettings() is true, it indicates these mesh
    285  // creation parameters are explictily set for the object
    286  // and context in question and should override the model
    287  // or application defaults.
    288  //
    289  // When CustomSettings() is false, it indicates these mesh
    290  // creation parameters were inherited from from model or
    291  // application defaults and any mesh created with these
    292  // parameters should be updated when these parameters
    293  // differ from the current model or application defaults.
    294  //
    295  const bool CustomSettings() const;
    296  void SetCustomSettings(
    297  bool bCustomSettings
    298  );
    299 
    300  //////////////////////////////////////////////////////////////
    301  //
    302  // The CustomSettingsEnabled() value applies to mesh creation
    303  // parameters that are on ON_3dmObjectAttributes and have
    304  // CustomSettings() = true. In this situation:
    305  //
    306  // If CustomSettingsEnabled() is true, then the use of
    307  // these mesh creation parameters is enabled.
    308  //
    309  // If CustomSettingsEnabled() is false, then these mesh
    310  // creation parameters should be gnored.
    311  //
    312  const bool CustomSettingsEnabled() const;
    313  void SetCustomSettingsEnabled(
    314  bool bCustomSettingsEnabled
    315  );
    316 
    317 
    318  //////////////////////////////////////////////////////////////
    319  //
    320  // Meshing happens in two stages. The first stage creates a
    321  // rectangular grid. The second stage refines the grid until
    322  // the mesh meets all meshing requirements. The third stage
    323  // combines coincident vertices if the resulting mesh is a composite.
    324  //
    325 
    326 
    327  // false - (default) - ON_Mesh::m_K[] not computed
    328  // true - ON_Mesh::m_K[] computed bool ComputeCurvature() const;
    329  const bool ComputeCurvature() const;
    330  void SetComputeCurvature(
    331  bool bComputeCurvature
    332  );
    333 
    334  // false - (default) planar surfaces are meshed
    335  // using the controls below.
    336  // true - planar surfaces are meshed using
    337  // minimal number of triangles and
    338  // aspect/edge controls are ignored.
    339  const bool SimplePlanes() const;
    340  void SetSimplePlanes(
    341  bool bSimplePlanes
    342  );
    343 
    344 public:
    345  // false - skip stage 2 mesh refinement step
    346  // true - (default) do stage 2 mesh refinement step
    347  const bool Refine() const;
    348  void SetRefine(
    349  bool bRefine
    350  );
    351 
    352 public:
    353  // false - (default) edges of meshes of joined
    354  // b-rep faces match with no gaps or
    355  // "T" joints.
    356  // true - faces in b-reps are meshed independently.
    357  // This is faster but results in gaps and
    358  // "T" joints along seams between faces.
    359  const bool JaggedSeams() const;
    360  void SetJaggedSeams(
    361  bool bJaggedSeams
    362  );
    363 
    364 public:
    365  // false - (default) the mesh vertices will be
    366  // float precision values in the m_V[] array.
    367  // true - The mesh vertices will be double precision
    368  // values in the DoublePrecisionVertices()
    369  // array. Float precision values will also
    370  // be returned in the m_V[] array.
    371  const bool DoublePrecision() const;
    372  void SetDoublePrecision(
    373  bool bDoublePrecision
    374  );
    375 
    376  // 0 = slow mesher, 1 = fast mesher
    377  const unsigned int Mesher() const;
    378  void SetMesher(
    379  unsigned int mesher
    380  );
    381 
    382  // 1: unpacked, unscaled, normalized
    383  // each face has a normalized texture range [0,1]x[0,1].
    384  // The normalized coordinate is calculated using the
    385  // entire surface domain. For meshes of trimmed
    386  // surfaces when the active area is a small subset of
    387  // the entire surface, there will be large regions of
    388  // unsued texture space in [0,1]x[0,1]. When the 3d region
    389  // being meshed is far from being sqaure-ish, there will be
    390  // a substantual amount of distortion mapping [0,1]x[0,1]
    391  // texture space to the 3d mesh.
    392  //
    393  // 2: packed, scaled, normalized (default)
    394  // each face is assigned a texture range that is a
    395  // subrectangle of [0,1]x[0,1]. The subrectangles are
    396  // mutually disjoint and packed into into [0,1]x[0,1]
    397  // in a way that minimizes distortion and maximizes the
    398  // coverage of [0,1]x[0,1].
    399  // When the surface or surfaces being meshed are trimmed,
    400  // this option takes into account only the region of the
    401  // base surface the mesh covers and uses as much of
    402  // [0,1]x[0,1] as possible. unsigned int TextureRange() const;
    403  const unsigned int TextureRange() const;
    404  void SetTextureRange(
    405  unsigned int texture_range
    406  );
    407  const bool TextureRangeIsValid() const;
    408  void SetTextureRangePictureFrameHack();
    409 
    410  // If the object being meshed is closed, m_bClosedObjectPostProcess is true,
    411  // m_bJaggedSeams = false, and the resultig mesh is not closed, then a post meshing process
    412  // is applied to find and close gaps in the mesh. Typically the resulting mesh
    413  // is not closed because the input object has a geometric flaw like loops in
    414  // trimming curves.
    415  const bool ClosedObjectPostProcess() const;
    416  void SetClosedObjectPostProcess(
    417  bool bClosedObjectPostProcess
    418  );
    419 
    420  // These controls are used in both stages
    421 
    422  // approximate maximum distance from center of edge to surface
    423  const double Tolerance() const;
    424  void SetTolerance(
    425  double tolerance
    426  );
    427 
    428  /*
    429  If 0.0 < RelativeTolerance() < 1.0,
    430  then the maximum distance from the
    431  center of an edge to the surface will
    432  be <= T, where T is the larger of
    433  (MinimumTolerance(),d*RelativeTolerance()),
    434  where d is an esimate of the size of the
    435  object being meshed.
    436  */
    437  const double RelativeTolerance() const;
    438  void SetRelativeTolerance(
    439  double relative_tolerance
    440  );
    441 
    442  const double MinimumTolerance() const;
    443  void SetMinimumTolerance(
    444  double minimum_tolerance
    445  );
    446 
    447  // edges shorter than MinimumEdgeLength() will
    448  // not be split even if the do not meet other
    449  // meshing requirements
    450  const double MinimumEdgeLength() const;
    451  void SetMinimumEdgeLength(
    452  double minimum_edge_length
    453  );
    454 
    455  /*
    456  Returns:
    457  SubD display mesh density.
    458  Example:
    459  Use ON_MeshParameters to control the density of a SubD limit mesh.
    460  ON_MeshParameters mp = ...;
    461  ON_Mesh* mesh = subd->GetLimitSurfaceMesh(
    462  ON_SubDDisplayParameters::CreateFromDisplayDensity( mp.SubDDisplayMeshDensity() ),
    463  nullptr
    464  );
    465  */
    466  unsigned int SubDDisplayMeshDensity() const;
    467 
    468 public:
    469  // edges longer than MaximumEdgeLength() will
    470  // be split even when they meet all other
    471  // meshing requirements
    472  const double MaximumEdgeLength() const;
    473  void SetMaximumEdgeLength(
    474  double maximum_edge_length
    475  );
    476 
    477  ////////////////////////////////////////////////////////////////////////////////////
    478  //
    479  // These controls are used during stage 1 to generate the grid
    480  //
    481 
    482 
    483  // desired aspect ratio of quads in grid
    484  // 0.0 = any aspect ratio is acceptable
    485  // values >0 and < sqrt(2) are treated as sqrt(2)
    486  const double GridAspectRatio() const;
    487  void SetGridAspectRatio(
    488  double grid_aspect_ratio
    489  );
    490 
    491  // minimum number of quads in initial grid
    492  const int GridMinCount() const;
    493  void SetGridMinCount(
    494  int grid_min_count
    495  );
    496 
    497  // desired masimum number of quads in initial grid
    498  const int GridMaxCount() const;
    499  void SetGridMaxCount(
    500  int grid_max_count
    501  );
    502 
    503  // maximum angle (radians) between surface
    504  // normal evaluated at adjacent vertices.
    505  // 0.0 is treated as pi.
    506  const double GridAngleRadians() const;
    507  void SetGridAngleRadians(
    508  double grid_angle_radians
    509  );
    510 
    511  // maximum angle (degrees) between surface
    512  // normal evaluated at adjacent vertices.
    513  // 0.0 is treated as 180.0.
    514  const double GridAngleDegrees() const;
    515  void SetGridAngleDegrees(
    516  double grid_angle_degrees
    517  );
    518 
    519  // The parameters above generate a grid.
    520  // If you want fewer quads, set m_grid_amplification
    521  // to a value < 1. If you want more quads,
    522  // set m_grid_amplification to a value > 1.
    523  // default = 1 and values <= 0 are treated as 1.
    524  const double GridAmplification() const;
    525  void SetGridAmplification(
    526  double grid_amplification
    527  );
    528 
    529  ////////////////////////////////////////////////////////////////////////////
    530  //
    531  // These controls are used during stage 2 to refine the grid
    532  //
    533 
    534 
    535  // (in radians) maximum angle in radians between
    536  // surface normal evaluated at adjacent vertices.
    537  const double RefineAngleRadians() const;
    538  void SetRefineAngleRadians(
    539  double refine_angle_radians
    540  );
    541  const double RefineAngleDegrees() const;
    542  void SetRefineAngleDegrees(
    543  double refine_angle_degrees
    544  );
    545 
    546  ////////////////////////////////////////////////////////////////////////////
    547  //
    548  // These controls are used during stage 3
    549  //
    550 
    551  // 0 = mixed triangle and quads
    552  // 1 = all triangles
    553  // 2 = all quads
    554  const unsigned int FaceType() const;
    555  void SetFaceType(
    556  unsigned int face_type
    557  );
    558 
    559 
    560 private:
    561  void Internal_SetBoolHelper(bool b, bool* dest);
    562  void Internal_SetCharHelper(unsigned int u, unsigned char minc, unsigned char maxc, unsigned char*);
    563  void Internal_SetDoubleHelper(double x, double minx, double maxx, double* dest);
    564  void Internal_SetIntHelper(int i, int mini, int maxi, int* dest);
    565 
    566 private:
    567  //////////////////////////////////////////////////////////
    568  //
    569  // BEGIN Rhino Legacy parameters
    570  //
    571  bool m_bCustomSettings = false;
    572  bool m_bCustomSettingsEnabled = true;
    573  bool m_bComputeCurvature = false;
    574  bool m_bSimplePlanes = false;
    575 
    576  bool m_bRefine = true;
    577  bool m_bJaggedSeams = false;
    578  bool m_bDoublePrecision = false;
    579  bool m_bClosedObjectPostProcess = false;
    580 
    581  ON_UUID m_mesher_id = ON_nil_uuid;
    582 
    583  unsigned char m_mesher = 0;
    584  unsigned char m_texture_range = 2;
    585  unsigned char m_face_type = 0;
    586 
    587  unsigned char m_reserved1 = 0;
    588 
    589  int m_grid_min_count = 0;
    590  int m_grid_max_count = 0;
    591  mutable ON_SHA1_Hash m_geometry_settings_hash = ON_SHA1_Hash::ZeroDigest;
    592 
    593  ON__UINT32 m_reserved2 = 0;
    594 
    595  double m_tolerance = 0.0;
    596  double m_relative_tolerance = 0.0;
    597  double m_min_tolerance = 0.0;
    598  double m_min_edge_length = 0.0001;
    599  double m_max_edge_length = 0.0;
    600  double m_grid_aspect_ratio = 6.0;
    601  double m_grid_angle_radians = 20.0*ON_PI/180.0;
    602  double m_grid_amplification = 1.0;
    603  double m_refine_angle_radians = 20.0*ON_PI/180.0;
    604  //
    605  // BEGIN Rhino Legacy parameters
    606  //
    607  //////////////////////////////////////////////////////////
    608 
    609 private:
    610  bool m_reserved3 = false;
    611  bool m_reserved4 = false;
    612 
    613 private:
    614  //////////////////////////////////////////////////////////
    615  //
    616  // BEGIN Pangolin parameters
    617  //
    618 
    619  bool m_bEvaluatorBasedTessellation = false;
    620  int m_curve_tess_min_num_segments = 0;
    621  double m_curve_tess_angle_tol_in_degrees = 20.0;
    622  double m_curve_tess_max_dist_between_points = 0.0;
    623  double m_curve_tess_min_parametric_ratio = 0.00001;
    624  double m_surface_tess_angle_tol_in_degrees = 20.0;
    625  double m_surface_tess_max_edge_length = 0.0;
    626  double m_surface_tess_min_edge_length = 0.0;
    627  double m_surface_tess_min_edge_length_ratio_uv = 0.0001;
    628  double m_surface_tess_max_aspect_ratio = 0.0;
    629  int m_smoothing_passes = 0;
    630 
    631 private:
    632  void Internal_AccumulatePangolinParameters(
    633  const ON_MeshParameters& pangolin_defaults,
    634  class ON_SHA1& sha1
    635  ) const;
    636 
    637  //
    638  // END Pangolin parameters
    639  //
    640  //////////////////////////////////////////////////////////
    641 
    642 private:
    643  ON__UINT_PTR m_reserved5 = 0;
    644 };
    645 
    646 ON_DECL
    647 bool operator!=(const ON_MeshParameters& a, const ON_MeshParameters& b);
    648 
    649 ON_DECL
    650 bool operator==(const ON_MeshParameters& a, const ON_MeshParameters& b);
    651 
    652 class ON_CLASS ON_MeshCurvatureStats
    653 {
    654 public:
    658  ON_MeshCurvatureStats& operator=(const ON_MeshCurvatureStats&);
    659 
    660  void Destroy();
    661  void EmergencyDestroy();
    662 
    663  bool Set( ON::curvature_style,
    664  int, // Kcount,
    665  const ON_SurfaceCurvature*, // K[]
    666  const ON_3fVector*, // N[] surface normals needed for normal sectional curvatures
    667  double = 0.0 // if > 0, value is used for "infinity"
    668  );
    669 
    670  bool Write( ON_BinaryArchive& ) const;
    671  bool Read( ON_BinaryArchive& );
    672 
    673  ON::curvature_style m_style;
    674 
    675  double m_infinity; // curvature values >= this are considered infinite
    676  // and not used to compute the m_average or m_adev
    677  int m_count_infinite; // number of "infinte" values
    678  int m_count; // count of "finite" values
    679  double m_mode; // mode of "finite" values
    680  double m_average; // average of "finite" values
    681  double m_adev; // average deviation of "finite" values
    682 
    684 };
    685 
    686 ///////////////////////////////////////////////////////////////////////////////
    687 //
    688 // Class ON_MeshTopology
    689 //
    690 
    692 {
    693  // m_tope_count = number of topological edges that begin or
    694  // end at this topological vertex.
    696 
    697  // m_topei[] is an array of length m_tope_count with the indices
    698  // of the topological edges that begin or end at this topological
    699  // vertex. Generally, these edges are listed in no particular
    700  // order. If you want the edges listed "radially", then call
    701  // ON_MeshTopology::SortVertexEdges.
    702  const int* m_topei;
    703 
    704  // m_v_count = number of ON_Mesh vertices that correspond to
    705  // this topological vertex.
    707 
    708  // m_vi[] is an array of length m_v_count with the indices of the
    709  // ON_Mesh vertices that correspond to this topological vertex.
    710  const int* m_vi;
    711 };
    712 
    714 {
    715  // m_topvi[] = indices of the topological verteices where the
    716  // edge begins and ends.
    717  int m_topvi[2];
    718 
    719  // m_topf_count = number of topological faces tat share this topological edge
    721 
    722  // m_topfi[] is an array of length m_topf_count with the indices of the
    723  // topological faces that share this topological edge.
    724  const int* m_topfi;
    725 };
    726 
    727 struct ON_CLASS ON_MeshTopologyFace
    728 {
    729  /*
    730  m_topei[] = indices of the topological edges that bound the face.
    731  If m_topei[2] = m_topei[3], then the face is a triangle, otherwise
    732  the face is a quad.
    733 
    734  NOTE WELL:
    735  The topological edge with index m_topei[k] ENDS at the
    736  vertex corresponding to ON_MeshFace.vi[k]. So, ...
    737 
    738  If the face is a quad, (ON_MeshFace.vi[2]!=ON_MeshFace.vi[3]),
    739  the topological edge with index m_topei[0] STARTS at
    740  ON_MeshFace.vi[3] and ENDS at ON_MeshFace.vi[0],
    741  the topological edge with index m_topei[1] STARTS at
    742  ON_MeshFace.vi[0] and ENDS at ON_MeshFace.vi[1],
    743  the topological edge with index m_topei[2] STARTS at
    744  ON_MeshFace.vi[1] and ENDS at ON_MeshFace.vi[2], and
    745  the topological edge with index m_topei[3] STARTS at
    746  ON_MeshFace.vi[2] and ENDS at ON_MeshFace.vi[3],
    747 
    748  If the face is a triangle, (ON_MeshFace.vi[2]==ON_MeshFace.vi[3]),
    749  the topological edge with index m_topei[0] STARTS at
    750  ON_MeshFace.vi[2] and ENDS at ON_MeshFace.vi[0],
    751  the topological edge with index m_topei[1] STARTS at
    752  ON_MeshFace.vi[0] and ENDS at ON_MeshFace.vi[1],
    753  the topological edge with index m_topei[2] STARTS at
    754  ON_MeshFace.vi[1] and ENDS at ON_MeshFace.vi[2].
    755  */
    756  int m_topei[4];
    757 
    758  /*
    759  If m_reve[i] is 0, then the orientation of the edge matches the
    760  orientation of the face. If m_reve[i] is 1, then the orientation
    761  of the edge is opposite that of the face.
    762  */
    763  char m_reve[4];
    764 
    765  /*
    766  Description:
    767  A topological mesh face is a valid triangle if m_topei[0],
    768  m_topei[1], m_topei[2] are distinct edges and
    769  m_topei[3]=m_topei[2].
    770  Returns:
    771  True if face is a triangle.
    772  */
    773  bool IsTriangle() const;
    774 
    775  /*
    776  Description:
    777  A topological mesh face is a valid quad if m_topei[0],
    778  m_topei[1], m_topei[2], and m_topei[3] are distinct edges.
    779  Returns:
    780  True if face is a quad.
    781  */
    782  bool IsQuad() const;
    783 
    784  /*
    785  Description:
    786  A topological mesh face is valid if m_topei[0], m_topei[1],
    787  and m_topei[2] are mutually distinct, and m_topei[3] is
    788  either equal to m_topei[2] or mutually distinct from the
    789  first three indices.
    790  Returns:
    791  True if face is valid.
    792  */
    793  bool IsValid( ) const;
    794 };
    795 
    796 class ON_CLASS ON_MeshFace
    797 {
    798 public:
    799  static const ON_MeshFace UnsetMeshFace; // all vi[] values are -1.
    800 
    801 
    802  int vi[4]; // vertex index - vi[2]==vi[3] for tirangles
    803 
    804  /*
    805  Returns:
    806  True if vi[2] == vi[3];
    807  Remarks:
    808  Assumes the face is valid.
    809  */
    810  bool IsTriangle() const;
    811 
    812  /*
    813  Returns:
    814  True if vi[2] != vi[3];
    815  Remarks:
    816  Assumes the face is valid.
    817  */
    818  bool IsQuad() const;
    819 
    820  /*
    821  Description:
    822  Determine if a face is valid by checking that the vertices
    823  are distinct.
    824  Parameters:
    825  mesh_vertex_count - [in]
    826  number of vertices in the mesh
    827  V - [in]
    828  optional array of mesh_vertex_count vertex locations.
    829  Returns:
    830  true
    831  The face is valid.
    832  false
    833  The face is not valid. It may be possible to repair the
    834  face by calling ON_MeshFace::Repair().
    835  */
    836  bool IsValid(
    837  int mesh_vertex_count
    838  ) const;
    839  bool IsValid(
    840  unsigned int mesh_vertex_count
    841  ) const;
    842  bool IsValid(
    843  int mesh_vertex_count,
    844  const ON_3fPoint* V
    845  ) const;
    846  bool IsValid(
    847  int mesh_vertex_count,
    848  const ON_3dPoint* V
    849  ) const;
    850 
    851  /*
    852  Description:
    853  Reverses the order of the vertices in v[].
    854  vi[0] is not changed.
    855  */
    856  void Flip();
    857 
    858  /*
    859  Description:
    860  If IsValid() returns false, then you can use Repair()
    861  to attempt to create a valid triangle.
    862  Parameters:
    863  mesh_vertex_count - [in]
    864  number of vertices in the mesh
    865  V - [in]
    866  optional array of mesh_vertex_count vertex locations.
    867  Returns:
    868  true
    869  repair was successful and v[0], v[1], vi[2] have distinct valid
    870  values and v[2] == v[3].
    871  false
    872  this face's vi[] values cannot be repaired
    873  */
    874  bool Repair(
    875  int mesh_vertex_count
    876  );
    877  bool Repair(
    878  int mesh_vertex_count,
    879  const ON_3fPoint* V
    880  );
    881  bool Repair(
    882  int mesh_vertex_count,
    883  const ON_3dPoint* V
    884  );
    885 
    886  /*
    887  Description:
    888  Compute the face normal
    889  Parameters:
    890  dV - [in] double precision vertex array for the mesh
    891  fV - [in] float precision vertex array for the mesh
    892  FN - [out] face normal
    893  Returns:
    894  true if FN is valid.
    895  */
    896  bool ComputeFaceNormal( const ON_3dPoint* dV, ON_3dVector& FN ) const;
    897  bool ComputeFaceNormal( const ON_3fPoint* fV, ON_3dVector& FN ) const;
    898  bool ComputeFaceNormal( const class ON_3dPointListRef& vertex_list, ON_3dVector& FN ) const;
    899 
    900  /*
    901  Parameters:
    902  planar_tolerance - [in]
    903  If planar_tolerance >= 0 and
    904  (maximum plane equation value - minimum plane equation value) > planar_tolerance,
    905  then false is returned.
    906  angle_tolerance_radians - [in]
    907  If angle_tolerance_radians >= 0.0 and the angle between opposite
    908  corner normals is > angle_tolerance_radians, then false is returned.
    909  A corner normal is the normal to the triangle formed by two
    910  adjacent edges and the diagonal connecting their endpoints.
    911  A quad has four corner normals.
    912  Passing in ON_PI/2 is a good way will result in false being
    913  returned for non-convex quads
    914  face_plane_equation - [out]
    915  If not null, the equation used to test planarity is returned here.
    916  Returns:
    917  True if the face is planar
    918  */
    919  bool IsPlanar(
    920  double planar_tolerance,
    921  double angle_tolerance_radians,
    922  const class ON_3dPointListRef& vertex_list,
    923  ON_PlaneEquation* face_plane_equation
    924  ) const;
    925 
    926  /*
    927  Description:
    928  Get corner normals.
    929  Parameters:
    930  vertex_list - [in]
    931  corner_normals[4] - [out]
    932  For a triangle, all values are identical.
    933  If a corner normal cannot be calculated, ON_3dVector::UnsetVector
    934  is returned.
    935  Returns:
    936  Number of corner normals that are valid.
    937  */
    938  unsigned int GetCornerNormals(
    939  const class ON_3dPointListRef& vertex_list,
    940  ON_3dVector corner_normals[4]
    941  ) const;
    942 
    943  bool GetPlaneEquation(
    944  const class ON_3dPointListRef& vertex_list,
    945  ON_PlaneEquation& face_plane_equation
    946  ) const;
    947 
    948 };
    949 
    950 
    951 class ON_CLASS ON_MeshTriangle
    952 {
    953 public:
    954  static const ON_MeshTriangle UnsetMeshTriangle; // all vi[] values are ON_UNSET_UINT_INDEX.
    955 
    956  unsigned int m_vi[3]; // vertex index list
    957 
    958  /*
    959  Description:
    960  Determine if a triangle is valid by checking that the vertices
    961  are distinct.
    962  Parameters:
    963  mesh_vertex_count - [in]
    964  number of vertices in the mesh
    965  vertex_list - [in]
    966  optional list of mesh vertex locations.
    967  Returns:
    968  true
    969  The triangle is valid.
    970  false
    971  The triangle is not valid.
    972  */
    973  bool IsValid(
    974  size_t mesh_vertex_count
    975  ) const;
    976 
    977  bool IsValid(
    978  size_t mesh_vertex_count,
    979  const class ON_3fPoint* vertex_list
    980  ) const;
    981 
    982  bool IsValid(
    983  size_t mesh_vertex_count,
    984  const class ON_3dPoint* vertex_list
    985  ) const;
    986 
    987  bool IsValid(
    988  const class ON_3dPointListRef& vertex_list
    989  ) const;
    990 
    991  /*
    992  Description:
    993  Swaps the values of m_vi[1] and m_vi[2]. m_vi[0] is not changed.
    994  */
    995  void Flip();
    996 
    997 
    998  /*
    999  Description:
    1000  Compute the triangle normal
    1001  Parameters:
    1002  dV - [in] double precision vertex array for the mesh
    1003  fV - [in] float precision vertex array for the mesh
    1004  vertex_list - [in] vertex locations
    1005  triangle_normal - [out] triangle normal
    1006  Returns:
    1007  true if triangle_normal is valid.
    1008  */
    1009  bool GetTriangleNormal(
    1010  const class ON_3dPoint* dV,
    1011  class ON_3dVector& triangle_normal
    1012  ) const;
    1013 
    1014  bool GetTriangleNormal(
    1015  const class ON_3fPoint* fV,
    1016  class ON_3dVector& triangle_normal
    1017  ) const;
    1018 
    1019  bool GetTriangleNormal(
    1020  const class ON_3dPointListRef& vertex_list,
    1021  class ON_3dVector& triangle_normal
    1022  ) const;
    1023 
    1024  static bool GetTriangleNormal(
    1025  ON_3dPoint point0,
    1026  ON_3dPoint point1,
    1027  ON_3dPoint point2,
    1028  class ON_3dVector& triangle_normal
    1029  );
    1030 
    1031 };
    1032 
    1033 class ON_CLASS ON_MeshFaceList
    1034 {
    1035 public:
    1037  : m_bQuadFaces(false)
    1038  , m_face_count(0)
    1039  , m_face_stride(0)
    1040  , m_faces(0)
    1041  {}
    1042 
    1044  const ON_Mesh* mesh
    1045  );
    1046 
    1048 
    1049  unsigned int SetFromTriangleList(
    1050  size_t triangle_count,
    1051  size_t triangle_stride,
    1052  const unsigned int* triangles
    1053  );
    1054 
    1055  unsigned int SetFromQuadList(
    1056  size_t quad_count,
    1057  size_t quad_stride,
    1058  const unsigned int* quads
    1059  );
    1060 
    1061  unsigned int SetFromMesh(
    1062  const ON_Mesh* mesh
    1063  );
    1064 
    1065  inline const unsigned int* Fvi(unsigned int face_index) const
    1066  {
    1067  return (face_index < m_face_count) ? (m_faces + (face_index*m_face_stride)) : 0;
    1068  }
    1069 
    1070  inline unsigned int* QuadFvi(unsigned int face_index, unsigned int buffer[4]) const
    1071  {
    1072  if ( face_index < m_face_count )
    1073  {
    1074  const unsigned int* p = m_faces + (face_index*m_face_stride);
    1075  buffer[0] = *p;
    1076  buffer[1] = *(++p);
    1077  buffer[2] = *(++p);
    1078  buffer[3] = m_bQuadFaces ? *(++p) : buffer[2];
    1079  }
    1080  else
    1081  {
    1082  buffer[0] = buffer[1] = buffer[2] = buffer[3] = 0;
    1083  }
    1084  return buffer;
    1085  }
    1086 
    1087 
    1088  inline bool IsQuad(unsigned int face_index) const
    1089  {
    1090  if ( m_bQuadFaces && face_index < m_face_count )
    1091  {
    1092  const unsigned int* p = m_faces + (face_index*m_face_stride);
    1093  return p[2] != p[3];
    1094  }
    1095  return false;
    1096  }
    1097 
    1098  inline unsigned int FaceCount() const
    1099  {
    1100  return m_face_count;
    1101  }
    1102 
    1103  inline unsigned int FaceVertexCount() const
    1104  {
    1105  return m_bQuadFaces?4:3;
    1106  }
    1107 
    1108  size_t FaceStride() const
    1109  {
    1110  return m_face_stride;
    1111  }
    1112 
    1113  /*
    1114  Description:
    1115  Get the minimum and maximum vertex indices referenced by a face in the list.
    1116  Parameters:
    1117  minimum_valid_vertex_index - [in]
    1118  Any face with a vertex index < minimum_valid_vertex_index will be ignored.
    1119  maximum_valid_vertex_index - [in]
    1120  Any face with a vertex index > maximum_valid_vertex_index will be ignored.
    1121  minimum_vertex_index - [out]
    1122  maximum_vertex_index - [out]
    1123  If there are no valid faces, then both output values are 0.
    1124  Returns:
    1125  Number of valid faces.
    1126  */
    1127  unsigned int GetVertexIndexInterval(
    1128  unsigned int minimum_valid_vertex_index,
    1129  unsigned int maximum_valid_vertex_index,
    1130  unsigned int* minimum_vertex_index,
    1131  unsigned int* maximum_vertex_index
    1132  ) const;
    1133 
    1134 private:
    1135  bool m_bQuadFaces;
    1136  unsigned int m_face_count;
    1137  unsigned int m_face_stride;
    1138  const unsigned int* m_faces;
    1139 };
    1140 
    1141 class ON_CLASS ON_MeshVertexFaceMap
    1142 {
    1143 public:
    1144  ON_MeshVertexFaceMap() ON_NOEXCEPT;
    1147  ON_MeshVertexFaceMap& operator=(const ON_MeshVertexFaceMap&);
    1148 
    1149 #if defined(ON_HAS_RVALUEREF)
    1150  // rvalue copy constructor
    1151  ON_MeshVertexFaceMap( ON_MeshVertexFaceMap&& ) ON_NOEXCEPT;
    1152  ON_MeshVertexFaceMap& operator=( ON_MeshVertexFaceMap&& ) ON_NOEXCEPT;
    1153 #endif
    1154 
    1155  bool SetFromMesh(
    1156  const ON_Mesh* mesh,
    1157  bool bMapInvalidFaces
    1158  );
    1159 
    1160  bool SetFromFaceList(
    1161  unsigned int vertex_count,
    1162  const class ON_MeshFaceList& face_list,
    1163  bool bMapInvalidFaces
    1164  );
    1165 
    1166  void Destroy();
    1167 
    1168  /*
    1169  Returns:
    1170  Number a vertices.
    1171  */
    1172  unsigned int VertexCount() const;
    1173 
    1174  /*
    1175  Returns:
    1176  Number a faces.
    1177  */
    1178  unsigned int FaceCount() const;
    1179 
    1180  /*
    1181  Parameters:
    1182  vertex_index - [in]
    1183  Index of a vertex.
    1184  Returns:
    1185  The number of faces that reference the vertex.
    1186  Remarks:
    1187  If vertex_index is out of range, then zero is returned.
    1188  */
    1189  unsigned int VertexFaceCount(
    1190  unsigned int vertex_index
    1191  ) const;
    1192 
    1193  /*
    1194  Parameters:
    1195  vertex_index - [in]
    1196  Index of a vertex.
    1197  Returns:
    1198  An array of indices of faces that reference the vertex.
    1199  The array has length VertexFaceCount(vertex_index).
    1200  When the value of VertexFaceCount(vertex_index) is zero,
    1201  this function returns a null pointer.
    1202  Remarks:
    1203  If vertex_index is out of range, then null is returned.
    1204  */
    1205  const unsigned int* VertexFaceList(
    1206  unsigned int vertex_index
    1207  ) const;
    1208 
    1209  /*
    1210  Description:
    1211  Expert user function for situations where rapid access to the
    1212  vertex face list information is required.
    1213  Returns:
    1214  An array of VertexCount() unsigned int arrays that list the
    1215  indices of faces that reference each vertex.
    1216  VertexFaceMap()[vertex_index] is null if zero faces reference the
    1217  indicated vertex. Otherwise, VertexFaceMap()[vertex_index][0] is
    1218  the number of faces that reference the vertex and
    1219  VertexFaceMap()[vertex_index][1,...,n] are the indices of those faces,
    1220  where "n" is the value of VertexFaceMap()[vertex_index][0].
    1221  */
    1222  const unsigned int *const* VertexFaceMap() const;
    1223 
    1224 private:
    1225  unsigned int m_vertex_count;
    1226  unsigned int m_face_count;
    1227  const unsigned int *const* m_vertex_face_map;
    1228  void* m_p;
    1229  void m_copy(const ON_MeshVertexFaceMap&);
    1230  void* m_alloc(size_t);
    1231 };
    1232 
    1233 
    1234 class ON_CLASS ON_MeshNgonBuffer
    1235 {
    1236  // An ON_MeshNgonBuffer provides memory for
    1237  // creating an ON_MeshNgon that is a triangle or quad.
    1238 public:
    1240  const class ON_MeshNgon* Ngon() const;
    1241 
    1242  const class ON_MeshNgon* CreateFromMeshFaceIndex(
    1243  const class ON_Mesh* mesh,
    1244  unsigned int face_index
    1245  );
    1246 
    1247  const class ON_MeshNgon* CreateFromMeshFace(
    1248  const class ON_MeshFace* mesh_face,
    1249  unsigned int face_index
    1250  );
    1251 
    1252  const class ON_MeshNgon* CreateFromTriangle(
    1253  const unsigned int triangle_vertex_indices[3],
    1254  unsigned int face_index
    1255  );
    1256 
    1257  const class ON_MeshNgon* CreateFromQuad(
    1258  const unsigned int quad_vertex_indices[4],
    1259  unsigned int face_index
    1260  );
    1261 
    1262 public:
    1263  ON__UINT_PTR m_ngon_buffer[10];
    1264 };
    1265 
    1266 class ON_CLASS ON_MeshNgon
    1267 {
    1268 public:
    1269  // Number of N-gon corners (N >= 3)
    1270  unsigned int m_Vcount; // number of vertices and sides (the "n" in n-gon)
    1271  unsigned int m_Fcount; // number of faces
    1272 
    1273  // N-gon vertex indices
    1274  // An array of m_Vcount indices into the mesh's m_V[] vertex array.
    1275  // Unset elements have the value ON_UNSET_UINT_INDEX. If the ngon
    1276  // in managed by an ON_NgonAllocator, then the memory for m_vi[]
    1277  // is also managed by that ON_NgonAllocator.
    1278  unsigned int* m_vi;
    1279 
    1280  // N-gon face indices
    1281  // An array of m_Fcount indices into the mesh's m_F[] face array.
    1282  // Unset elements have the value ON_UNSET_UINT_INDEX. If the ngon
    1283  // in managed by an ON_NgonAllocator, then the memory for m_fi[]
    1284  // is also managed by that ON_NgonAllocator.
    1285  unsigned int* m_fi;
    1286 
    1287  /*
    1288  Returns:
    1289  0: This n-gon is not managed by an ON_MeshNgonAllocator.
    1290  >=0: The maximum capcity (maximum m_Vcount+m_Fcount) for this N-gon
    1291  */
    1292  unsigned int Capacity() const;
    1293 
    1294  static int Compare(
    1295  const ON_MeshNgon* A,
    1296  const ON_MeshNgon* B
    1297  );
    1298 
    1299  /*
    1300  Returns:
    1301  32-bit cyclic redundancy check that can be used as a hash code.
    1302  */
    1303  ON__UINT32 CRC32() const;
    1304 
    1305  /*
    1306  Returns:
    1307  A SHA-1 has of the vertex and face indices.
    1308  */
    1309  ON_SHA1_Hash ContentHash() const;
    1310 
    1311  /*
    1312  Parameters:
    1313  mesh_face_list - [in]
    1314  faces referenced by this n-gon.
    1315  Returns:
    1316  Total number of boundary edges, including interior edges.
    1317  */
    1318  unsigned int BoundaryEdgeCount(
    1319  const ON_MeshFaceList& mesh_face_list
    1320  ) const;
    1321 
    1322  /*
    1323  Parameters:
    1324  mesh - [in]
    1325  mesh referenced by this n-gon.
    1326  Returns:
    1327  Total number of boundary edges, including interior edges.
    1328  */
    1329  unsigned int BoundaryEdgeCount(
    1330  const ON_Mesh* mesh
    1331  ) const;
    1332 
    1333  /*
    1334  Returns:
    1335  Total number of outer boundary edges.
    1336  */
    1337  unsigned int OuterBoundaryEdgeCount() const;
    1338 
    1339  /*
    1340  Pamameters:
    1341  mesh_face_list - [in]
    1342  ON_Mesh face list.
    1343  bPermitHoles - [in]
    1344  true if the ngon is permitted to have interior holes
    1345  false otherwise.
    1346  Description:
    1347  Determine if the ngon's boundary orientation matches that of the set of faces it is made from.
    1348  Returns:
    1349  1: The ngon does not have holes, the ngon's faces are compatibly oriented,
    1350  and the ngon's outer boundary orientation matches the faces' orientation.
    1351  -1: The ngon does not have holes, the ngon's faces are compatibly oriented,
    1352  and the ngon's outer boundary orientation is opposite the faces' orientation.
    1353  0: Otherwise. The ngon may be invalid, have holes, the ngon's faces may not be compatibly oriented,
    1354  the ngons edges may not have a consistent orientation with respect to the faces, or some other issue.
    1355  */
    1356  int Orientation(
    1357  const ON_MeshFaceList& mesh_face_list,
    1358  bool bPermitHoles
    1359  ) const;
    1360 
    1361  /*
    1362  Pamameters:
    1363  mesh_face_list - [in]
    1364  ON_Mesh face list.
    1365  bPermitHoles - [in]
    1366  true if the ngon is permitted to have interior holes
    1367  false otherwise.
    1368  Description:
    1369  Determine if the ngon's boundary orientation matches that of the set of faces it is made from.
    1370  Returns:
    1371  1: The ngon does not have holes, the ngon's faces are compatibly oriented,
    1372  and the ngon's outer boundary orientation matches the faces' orientation.
    1373  -1: The ngon does not have holes, the ngon's faces are compatibly oriented,
    1374  and the ngon's outer boundary orientation is opposite the faces' orientation.
    1375  0: Otherwise. The ngon may be invalid, have holes, the ngon's faces may not be compatibly oriented,
    1376  the ngons edges may not have a consistent orientation with respect to the faces, or some other issue.
    1377  */
    1378  int Orientation(
    1379  const ON_Mesh* mesh,
    1380  bool bPermitHoles
    1381  ) const;
    1382 
    1383  /*
    1384  Description:
    1385  Reverse the order of the m_vi[] array.
    1386  */
    1387  void ReverseOuterBoundary();
    1388 
    1389  /*
    1390  Description:
    1391  Use the ngon m_vi[] array to get a list of 3d points from
    1392  mesh_vertex_list.
    1393  Parameters:
    1394  mesh_vertex_list - [in]
    1395  bAppendStartPoint - [in]
    1396  If true, the initial point in the boundary will be added
    1397  as the first point of ngon_boundary_points[] and then
    1398  added again as the last point of ngon_boundary_points[].
    1399  This is useful when you need a closed polyline.
    1400  ngon_boundary_points - [out]
    1401  An array of ngon->m_Vcount + (bAppendStartPoint ? 1 : 0)
    1402  points.
    1403  Returns:
    1404  Number of points added to ngon_boundary_points[] or 0 if invalid
    1405  input is encountered.
    1406  */
    1407  unsigned int GetOuterBoundaryPoints(
    1408  const class ON_3dPointListRef& mesh_vertex_list,
    1409  bool bAppendStartPoint,
    1410  ON_SimpleArray<ON_3dPoint>& ngon_boundary_points
    1411  ) const;
    1412 
    1413  /*
    1414  Description:
    1415  Use the ngon m_vi[] array to get a list of 3d points from
    1416  mesh_vertex_list.
    1417  Parameters:
    1418  mesh_vertex_list - [in]
    1419  bAppendStartPoint - [in]
    1420  If true, the initial point in the boundary will be added
    1421  as the first point of ngon_boundary_points[] and then
    1422  added again as the last point of ngon_boundary_points[].
    1423  This is useful when you need a closed polyline.
    1424  ngon_boundary_points - [out]
    1425  An array of ngon->m_Vcount + (bAppendStartPoint ? 1 : 0) points
    1426  is returned in ngon_boundary_points[]. The caller must insure
    1427  that ngon_boundary_points[] has room for this many elements.
    1428  Returns:
    1429  Number of points added to ngon_boundary_points[] or 0 if invalid
    1430  input is encountered.
    1431  */
    1432  unsigned int GetOuterBoundaryPoints(
    1433  const class ON_3dPointListRef& mesh_vertex_list,
    1434  bool bAppendStartPoint,
    1435  ON_3dPoint* ngon_boundary_points
    1436  ) const;
    1437 
    1438 
    1439  /*
    1440  Description:
    1441  Use the ngon m_fi[] array to get a list of ngon boundary sides.
    1442  Parameters:
    1443  mesh_face_list - [in]
    1444  ngon_boundary_sides - [out]
    1445  ngon_boundary_sides[i]/8 = ON_MeshNon.m_fi[] array index
    1446  ngon_boundary_sides[i]%4 = side index
    1447  side index 0 identifies the side that runs from the first face
    1448  vertex to the second face vertex.
    1449  ngon_boundary_sides[i]&4 != 0 means the face side is reversed
    1450  when used as an ngon boundary segment.
    1451  Returns:
    1452  Number of elements added to ngon_boundary_sides[] or 0 if invalid
    1453  input is encountered.
    1454  */
    1455  unsigned int GetBoundarySides(
    1456  const class ON_MeshFaceList& mesh_face_list,
    1457  ON_SimpleArray<unsigned int>& ngon_boundary_sides
    1458  ) const;
    1459 
    1460 
    1461  //////////////////////////////////////////////////////////////
    1462  //
    1463  // Tools for finding a making n-gons
    1464  //
    1465  static unsigned int FindPlanarNgons(
    1466  const class ON_3dPointListRef& vertex_list,
    1467  const class ON_MeshFaceList& face_list,
    1468  const unsigned int *const* vertex_face_map,
    1469  double planar_tolerance,
    1470  unsigned int minimum_ngon_vertex_count,
    1471  unsigned int minimum_ngon_face_count,
    1472  bool bAllowHoles,
    1473  class ON_MeshNgonAllocator& NgonAllocator,
    1476  );
    1477 
    1478  /*
    1479  Description:
    1480  Get a list of vertices that form the boundary of a set of faces.
    1481  Parameters:
    1482  mesh_vertex_list - [in]
    1483  mesh_face_list - [in]
    1484  vertex_face_map - [in]
    1485  null or a vertex map made from the information in
    1486  mesh_vertex_list and mesh_face_list.
    1487  ngon_fi_count - [in]
    1488  length of ngon_fi[] array
    1489  ngon_fi - [in]
    1490  An array of length ngon_fi_count that contains the indices
    1491  of the faces that form the ngon.
    1492  ngon_vi - [out]
    1493  An array of vertex indices that make the ngon boundary.
    1494  Returns:
    1495  Number of vertices in the ngon outer boundary or 0 if the input is
    1496  not valid.
    1497  */
    1498  static unsigned int FindNgonOuterBoundary(
    1499  const class ON_3dPointListRef& mesh_vertex_list,
    1500  const class ON_MeshFaceList& mesh_face_list,
    1501  const unsigned int *const* vertex_face_map,
    1502  size_t ngon_fi_count,
    1503  const unsigned int* ngon_fi,
    1505  );
    1506 
    1507  /*
    1508  Description:
    1509  Create an ngon pointer that contains a triangle (3-gon)
    1510  or quad (4-gon) from a mesh face.
    1511  This is handy when your code needs to handle both
    1512  ngons and faces because it lets you convert a face to its
    1513  ngon format and the rest of the code can work exclusively with
    1514  ngons.
    1515  Parameters:
    1516  buffer - [in]
    1517  an array with a capacity for at least 9 ON__UINT_PTR elements.
    1518  The returned ngon information will be stored in this memory.
    1519  mesh_face_index - [in]
    1520  fvi - [in]
    1521  mesh face vertex indices.
    1522  If "f" is an ON_MeshFace, then pass (const unsigned int*)f.vi.
    1523  Returns:
    1524  If the input is valid, the returned ngon pointer is is the
    1525  face's triangle or quad. All returned information is in the
    1526  buffer[].
    1527  null - invalid input.
    1528  See Also:
    1529  ON_Mesh::NgonFromComponentIndex()
    1530  */
    1531  static class ON_MeshNgon* NgonFromMeshFace(
    1532  class ON_MeshNgonBuffer& ngon_buffer,
    1533  unsigned int mesh_face_index,
    1534  const unsigned int* fvi
    1535  );
    1536 
    1537  /*
    1538  Description:
    1539  Create an array of a single ngon pointer that contains
    1540  a triangle (3-gon) or quad (4-gon) from a mesh face.
    1541  This is handy when your code needs to handle both
    1542  ngons and faces because it lets you convert a face to its
    1543  ngon format and the rest of the code can work exclusively with
    1544  ngons.
    1545  Parameters:
    1546  ngon_buffer - [in]
    1547  memory used to create ngon classan array with a capacity for at least 10 ON__UINT_PTR elements.
    1548  mesh_face_index - [in]
    1549  fvi - [in]
    1550  mesh face vertex indices.
    1551  If "f" is an ON_MeshFace, then pass (const unsigned int*)f.vi.
    1552  Returns:
    1553  If the input is valid, the returned pointer is an array of a single ngon
    1554  that is the face's triangle or quad. All returned information is in the
    1555  buffer[].
    1556  null - invalid input.
    1557  */
    1558  static class ON_MeshNgon** NgonListFromMeshFace(
    1559  class ON_MeshNgonBuffer& ngon_buffer,
    1560  unsigned int mesh_face_index,
    1561  const unsigned int* fvi
    1562  );
    1563 
    1564  /*
    1565  Description:
    1566  If a component index identifies a face or ngon, Get an array Create an array of a single ngon pointer that contains
    1567  a triangle (3-gon) or quad (4-gon) from a mesh face.
    1568  This is handy when your code needs to handle both
    1569  ngons and faces because it lets you convert a face to its
    1570  ngon format and the rest of the code can work exclusively with
    1571  ngons.
    1572  Parameters:
    1573  ngon_buffer - [in]
    1574  memory used to create ON_MeshNgon class
    1575  ci - [in]
    1576  mesh - [in]
    1577  ngon_list - [out]
    1578  An array of ngon pointers. Some pointers may be null.
    1579  Returns:
    1580  Number of ngon pointers in ngon_list.
    1581  */
    1582  static unsigned int NgonListFromMeshFaceOrNgonComponent(
    1583  class ON_MeshNgonBuffer& ngon_buffer,
    1584  ON_COMPONENT_INDEX ci,
    1585  const class ON_Mesh* mesh,
    1586  const class ON_MeshNgon* const *& ngon_list
    1587  );
    1588 
    1589  ////////////////////////////////////////////////////////////////////
    1590  //
    1591  // Tools for text output
    1592  //
    1593  ON_String ToString() const;
    1594 
    1595  ON_wString ToWideString() const;
    1596 
    1597  void Dump(
    1598  class ON_TextLog& text_log
    1599  )const;
    1600 
    1601  void AppendToString(
    1602  class ON_String& s
    1603  )const;
    1604 
    1605  void AppendToString(
    1606  class ON_wString& s
    1607  )const;
    1608 
    1609 
    1610  ////////////////////////////////////////////////////////////////////
    1611  //
    1612  // Tools for validation output
    1613  //
    1614 
    1615  /*
    1616  Description:
    1617  Test ngon to see if the vertex and face references are valid and
    1618  pass partial boundary validity checks,
    1619  Parameters:
    1620  ngon - [in]
    1621  ngon to test
    1622  ngon_index - [in]
    1623  This index is used in messages sent to text_log
    1624  text_log - [in]
    1625  nullptr or a place to send information about problems.
    1626  mesh_vertex_count - [in]
    1627  Number of vertices in the mesh
    1628  mesh_face_count - [in]
    1629  Number of face in the mesh
    1630  mesh_F - [in]
    1631  nullptr of mesh faces - required for boundary checks
    1632  workspace_buffer - [in]
    1633  If you are passing in mesh_F and you are testing testing multple
    1634  ngons, then consider providing a workspace_buffer that will be automatically
    1635  reused for successive ngons.
    1636  Returns:
    1637  0: ngon is not valid
    1638  >0: number of boundary edges.
    1639  If this number is > ngon->m_V_count, then the ngon has inner boundaries
    1640  or duplicate vertices.
    1641  */
    1642  static unsigned int IsValid(
    1643  const ON_MeshNgon* ngon,
    1644  unsigned int ngon_index,
    1645  ON_TextLog* text_log,
    1646  unsigned int mesh_vertex_count,
    1647  unsigned int mesh_face_count,
    1648  const ON_MeshFace* mesh_F
    1649  );
    1650 
    1651  static unsigned int IsValid(
    1652  const ON_MeshNgon* ngon,
    1653  unsigned int ngon_index,
    1654  ON_TextLog* text_log,
    1655  unsigned int mesh_vertex_count,
    1656  unsigned int mesh_face_count,
    1657  const ON_MeshFace* mesh_F,
    1658  ON_SimpleArray< unsigned int >& workspace_buffer
    1659  );
    1660 };
    1661 
    1662 class ON_CLASS ON_MeshNgonAllocator
    1663 {
    1664 public:
    1665  ON_MeshNgonAllocator() ON_NOEXCEPT;
    1667 
    1668  /*
    1669  Parameters:
    1670  Vcount - [in] >= 3
    1671  Fcount - [in] >= 0
    1672  */
    1673  ON_MeshNgon* AllocateNgon(
    1674  unsigned int Vcount,
    1675  unsigned int Fcount
    1676  );
    1677 
    1678  /*
    1679  Parameters:
    1680  Vcount - [in] >= 3
    1681  Fcount - [in] >= 0
    1682  */
    1683  ON_MeshNgon* ReallocateNgon(
    1684  ON_MeshNgon* ngon,
    1685  unsigned int Vcount,
    1686  unsigned int Fcount
    1687  );
    1688 
    1689  /*
    1690  Parameters:
    1691  ngon - in]
    1692  An ngon pointer value that was previously returned by
    1693  this allocator's AllocateNgon() or CopyNgon() function.
    1694  */
    1695  bool DeallocateNgon(
    1696  ON_MeshNgon* ngon
    1697  );
    1698 
    1699  /*
    1700  Description:
    1701  Returns a copy of ngon.
    1702  Parameters:
    1703  ngon - [in]
    1704  Returns:
    1705  If
    1706  */
    1707  ON_MeshNgon* CopyNgon(
    1708  const ON_MeshNgon* ngon
    1709  );
    1710 
    1711  /*
    1712  Description:
    1713  Deallocate every n-gon managed by this allocator.
    1714  */
    1715  void DeallocateAllNgons();
    1716 
    1717 #if defined(ON_HAS_RVALUEREF)
    1720 #endif
    1721 
    1722 private:
    1723 
    1724  ON_FixedSizePool m_7; // Vcount+Fcount <= 7
    1725  ON_FixedSizePool m_15; // Vcount+Fcount <= 15
    1726  void* m_31; // available for Vcount+Fcount <= 31
    1727  void* m_63; // available for Vcount+Fcount <= 63
    1728  void* m_active; // active Vcount+Fcount >= 16
    1729 
    1730 private:
    1731  // prohibit copy construction. No implentation.
    1732  ON_MeshNgonAllocator(const ON_MeshNgonAllocator&) = delete;
    1733 
    1734  // prohibit operator=. No implentation.
    1735  ON_MeshNgonAllocator& operator=(const ON_MeshNgonAllocator&) = delete;
    1736 };
    1737 
    1739 {
    1740 public:
    1741  unsigned int m_vi[2]; // vertex indices or ids (equal values indicate unset)
    1742  unsigned int m_fi; // face index or id
    1743  unsigned char m_side; // triangles use 0,1,3, quads use 0,1,2,3
    1744  // m_side 0 connect face vertex 0 to face vertex 1.
    1745  unsigned char m_dir; // 0 = counterclockwise, 1 = clockwise (reversed)
    1746  unsigned short m_value; // Use depends on context.
    1747  unsigned int m_id; // Use depends on context - typically identifies and edge or ngon
    1748 
    1749  static const ON_MeshFaceSide Unset; // all values are zero
    1750 
    1751  /*
    1752  Description:
    1753  Compare a and b in dictionary order comparing the field values in the order
    1754  m_fi
    1755  m_vi[0]
    1756  m_vi[1]
    1757  m_side
    1758  m_dir
    1759  Parameters:
    1760  a - [in]
    1761  b - [in]
    1762  Returns:
    1763  -1: *a < *b
    1764  0: *a < *b
    1765  1: *a > *b
    1766  Remarks:
    1767  The function is thread safe.
    1768  */
    1769  static int CompareFaceIndex(
    1770  const ON_MeshFaceSide* a,
    1771  const ON_MeshFaceSide* b
    1772  );
    1773 
    1774  /*
    1775  Description:
    1776  Compare a and b in dictionary order comparing the field values in the order
    1777  m_vi[0]
    1778  m_vi[1]
    1779  m_fi
    1780  m_side
    1781  m_dir
    1782  Parameters:
    1783  a - [in]
    1784  b - [in]
    1785  Returns:
    1786  -1: *a < *b
    1787  0: *a < *b
    1788  1: *a > *b
    1789  Remarks:
    1790  The function is thread safe.
    1791  */
    1792  static int CompareVertexIndex(
    1793  const ON_MeshFaceSide* a,
    1794  const ON_MeshFaceSide* b
    1795  );
    1796 
    1797  /*
    1798  Description:
    1799  Sort the face_sides[] using the compare function
    1800  ON_MeshFaceSide::CompareVertexIndex().
    1801  Paramters:
    1802  face_sides - [in/out]
    1803  array to sort
    1804  face_sides_count - [in]
    1805  number of elements in the face_sides[] array.
    1806  Remarks:
    1807  The function is thread safe.
    1808  */
    1809  static void SortByVertexIndex(
    1810  ON_MeshFaceSide* face_sides,
    1811  size_t face_sides_count
    1812  );
    1813 
    1814  /*
    1815  Description:
    1816  Sort the face_sides[] using the compare function
    1817  ON_MeshFaceSide::CompareFaceIndex().
    1818  Paramters:
    1819  face_sides - [in/out]
    1820  array to sort
    1821  face_sides_count - [in]
    1822  number of elements in the face_sides[] array.
    1823  Remarks:
    1824  The function is thread safe.
    1825  */
    1826  static void SortByFaceIndex(
    1827  ON_MeshFaceSide* face_sides,
    1828  size_t face_sides_count
    1829  );
    1830 
    1831  /*
    1832  Description:
    1833  Get a list of mesh face sides.
    1834  Parameters:
    1835  mesh_vertex_count - [in]
    1836  Number of vertices in the mesh.
    1837  This value is used to validate vertex index values in mesh_face_list.
    1838  mesh_face_list - [in]
    1839  Mesh faces
    1840  fi_list - [in]
    1841  - If fi_list null, then sides for every face in mesh_face_list will
    1842  be added and the ON_MeshFaceSide.m_fi values will be the
    1843  mesh_face_list[] index.
    1844  - If fi_list is not null, then fi_list[] is an array of mesh_face_list[]
    1845  indices and the ON_MeshFaceSide.m_fi values will be fi_list[] array
    1846  indices. For example, you may pass ON_MeshNon.m_fi as this parameter
    1847  when you want a list of sides of faces in an ngon.
    1848  fi_list_count - [in]
    1849  - If fi_list is not null, then fi_list_count is the number of elements
    1850  in the fi_list[] array.
    1851  - If fi_list is null, then fi_list_count is ignored.
    1852  vertex_id_map - [in] (can be null)
    1853  - If vertex_id_map is null, then the ON_MeshFaceSide::m_vi[] values
    1854  are the vertex index values from mesh_face_list[].
    1855  - If vertex_id_map is not null, then vertex_id_map[] is an array
    1856  with the mesh_vertex_count elements and ON_MeshFaceSide::m_vi[] values
    1857  are vertex_id_map[mesh_face_list[] vertex indices]. A vertex_id_map[]
    1858  is commonly used when coincident vertices need to be treated as
    1859  a single topological entity.
    1860  face_side_list - [out]
    1861  - If the input value of face_side_list is not null, then face_side_list[]
    1862  must be long enough to hold the returned face_side_list list.
    1863  The maximum posssible length is 4*mesh_face_list.FaceCount().
    1864  - If the input falue of face_side_list is null, memory will be allocated
    1865  using onmalloc() and the caller is responsible for calling onfree() at
    1866  an appropriate time.
    1867  The returned is face_side_list[] is dictionary sorted by ON_MeshFaceSide.m_fi
    1868  and then ON_MeshFaceSide.m_si. The vertex ids satisfy
    1869  ON_MeshFaceSide.m_vi[0] < ON_MeshFaceSide.m_vi[1]. ON_MeshFaceSide.m_dir
    1870  is 0 if the face vertex order is the same and 1 if the face vertex order
    1871  is opposite. The static sorting functions on ON_MeshFaceSide can be used
    1872  to change this ordering.
    1873  Returns:
    1874  Number of elements set in face_side_list[].
    1875  Remarks:
    1876  Faces in mesh_face_list with vertex indices that are >= mesh_vertex_count
    1877  are ignored. Degenerate faces are processed, but degenerate sides
    1878  (equal vertex ids) are not added to face_side_list[].
    1879  */
    1880  static unsigned int GetFaceSideList(
    1881  size_t mesh_vertex_count,
    1882  const class ON_MeshFaceList& mesh_face_list,
    1883  const unsigned int* fi_list,
    1884  size_t fi_list_count,
    1885  const unsigned int* vertex_id_map,
    1886  ON_MeshFaceSide*& face_side_list
    1887  );
    1888 };
    1889 
    1890 
    1892 {
    1893  // ON_Mesh faces with indices fi[0] <= i < fi[1] reference
    1894  // vertices with indices vi[0] <= j < vi[1].
    1895  int vi[2]; // subinterval of mesh m_V[] array
    1896  int fi[2]; // subinterval of mesh m_F[] array
    1897  int vertex_count; // = vi[1] - vi[0];
    1898  int triangle_count; // tris + 2*quads >= fi[1] - fi[0]
    1899 };
    1900 
    1901 #if defined(ON_DLL_TEMPLATE)
    1902 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_MeshFace>;
    1903 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_MeshNgon*>;
    1904 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_MeshTopologyVertex>;
    1905 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_MeshTopologyEdge>;
    1906 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_MeshTopologyFace>;
    1907 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<struct ON_MeshPart>;
    1908 #endif
    1909 
    1910 class ON_CLASS ON_MeshTopology
    1911 {
    1912  // A mesh topology class is always associated with an ON_Mesh
    1913  // and can be retrieved by calling ON_Mesh::Topology()
    1914 public:
    1915  ON_MeshTopology();
    1916  ~ON_MeshTopology();
    1917 
    1918  bool IsValid() const;
    1919 
    1920  void Dump( ON_TextLog& ) const;
    1921 
    1922  //////////
    1923  // The parent ON_Mesh geometry used to compute this mesh topology.
    1924  const ON_Mesh* m_mesh;
    1925 
    1926  //////////
    1927  // number of topoligical vertices (<= m_mesh.VertexCount())
    1928  int TopVertexCount() const;
    1929 
    1930  //////////
    1931  // number of topoligical edges
    1932  int TopEdgeCount() const;
    1933 
    1934  //////////
    1935  // number of topoligical faces (same as m_mesh.FaceCount())
    1936  int TopFaceCount() const;
    1937 
    1938  class ON_MeshComponentRef MeshComponentRef(
    1939  ON_COMPONENT_INDEX ci
    1940  ) const;
    1941 
    1942  /*
    1943  Description:
    1944  Get the 3d point location of a vertex.
    1945  Parameters:
    1946  topv_index - [in];
    1947  Returns:
    1948  Location of vertex.
    1949  */
    1950  ON_3dPoint TopVertexPoint(
    1951  int topv_index
    1952  ) const;
    1953 
    1954  /*
    1955  Description:
    1956  Get the 3d line along an edge.
    1957  Parameters:
    1958  tope_index - [in];
    1959  Returns:
    1960  Line along edge. If input is not valid,
    1961  the line.from and to are ON_3dPoint::UnsetPoint
    1962  */
    1963  ON_Line TopEdgeLine(
    1964  int tope_index
    1965  ) const;
    1966 
    1967  ////////
    1968  // returns index of edge that connects topological vertices
    1969  // returns -1 if no edge is found.
    1970  int TopEdge(
    1971  int vtopi0,
    1972  int vtopi1 // ON_MeshTopology vertex topology indices
    1973  ) const;
    1974 
    1975  ////////
    1976  // returns ON_MeshTopology vertex topology index of a face
    1977  // corner. The face is triangle iv TopFaceVertex(2) = TopFaceVertex(3)
    1978  bool GetTopFaceVertices(
    1979  int topfi, // ON_MeshTopology face topology index (= ON_Mesh face index)
    1980  int topvi[4] // ON_MeshTopology vertex indices returned here
    1981  ) const;
    1982 
    1983  /*
    1984  Parameters:
    1985  topvi - [in]
    1986  Topology vertex index
    1987  mesh_facedex_to_ngondex_map - [in]
    1988  If null, Mesh().NgonMap() will be used. In cases where Mesh().NgonMap()
    1989  does not exist and cannot be created, an expert user may pass in
    1990  a local map that converts a face index into an ngon index.
    1991  Returns:
    1992  If the vertex is interior to a single ngon, then the index of the
    1993  ngon is returned. Otherwise ON_UNSET_UINT_INDEX is returned.
    1994  */
    1995  unsigned int NgonIndexFromTopologyVertexIndex(
    1996  unsigned int topvi,
    1997  const unsigned int* mesh_facedex_to_ngondex_map
    1998  ) const;
    1999 
    2000  /*
    2001  Parameters:
    2002  topei - [in]
    2003  Topology edge index
    2004  mesh_facedex_to_ngondex_map - [in]
    2005  If null, Mesh().NgonMap() will be used. In cases where Mesh().NgonMap()
    2006  does not exist and cannot be created, an expert user may pass in
    2007  a local map that converts a face index into an ngon index.
    2008  Returns:
    2009  If the vertex is interior to a single ngon, then the index of the
    2010  ngon is returned. Otherwise ON_UNSET_UINT_INDEX is returned.
    2011  */
    2012  unsigned int NgonIndexFromTopologyEdgeIndex(
    2013  unsigned int topei,
    2014  const unsigned int* mesh_facedex_to_ngondex_map
    2015  ) const;
    2016 
    2017  /*
    2018  Description:
    2019  Sort the m_topei[] list of a mesh topology vertex so that
    2020  the edges are in radial order. The "const" is a white
    2021  lie to make this function easier to call.
    2022  Parameter:
    2023  topvi - [in] index of vertex in m_topv[] array.
    2024  Remarks:
    2025  A nonmanifold edge is treated as a boundary edge with respect
    2026  to sorting. If any boundary or nonmanifold edges end at the
    2027  vertex, then the first edge will be a boundary or nonmanifold
    2028  edge.
    2029  */
    2030  bool SortVertexEdges( int topvi ) const;
    2031 
    2032  /*
    2033  Description:
    2034  Sort the m_topei[] list of every mesh topology vertex so
    2035  that the edges are in radial order. The "const" is a white
    2036  lie to make this function easier to call.
    2037  Remarks:
    2038  Same as
    2039  for ( int topvi = 0; topvi < m_topv.Count(); topvi++ )
    2040  SortVertexEdges(topvi);
    2041  */
    2042  bool SortVertexEdges() const;
    2043 
    2044  /*
    2045  Description:
    2046  Returns true if the topological vertex is hidden.
    2047  Parameters:
    2048  topvi - [in] mesh topology vertex index.
    2049  Returns:
    2050  True if mesh topology vertex is hidden.
    2051  Remarks:
    2052  The mesh topology vertex is hidden if and only if
    2053  all the ON_Mesh vertices it represents is hidden.
    2054  */
    2055  bool TopVertexIsHidden( int topvi ) const;
    2056 
    2057  /*
    2058  Description:
    2059  Returns true if the topological edge is hidden.
    2060  Parameters:
    2061  topei - [in] mesh topology edge index.
    2062  Returns:
    2063  True if mesh topology edge is hidden.
    2064  Remarks:
    2065  The mesh topology edge is hidden if and only if
    2066  either of its mesh topology vertices is hidden.
    2067  */
    2068  bool TopEdgeIsHidden( int topei ) const;
    2069 
    2070  /*
    2071  Description:
    2072  Returns true if the topological face is hidden.
    2073  Parameters:
    2074  topfi - [in] mesh topology face index.
    2075  Returns:
    2076  True if mesh topology face is hidden.
    2077  Remarks:
    2078  The mesh topology face is hidden if and only if
    2079  any of its mesh topology edges are hidden.
    2080  */
    2081  bool TopFaceIsHidden( int topfi ) const;
    2082 
    2083  //////////
    2084  // m_topv_map[] has length m_mesh.VertexCount() and
    2085  // m_topv[m_topv_map[vi]] is the topological mesh vertex that is assocated
    2086  // the with the mesh vertex m_mesh.m_V[vi].
    2088 
    2089  ////////////
    2090  // Array of topological mesh vertices. See the comments in the definition
    2091  // of ON_MeshTopologyVertex for details.
    2093 
    2094  ////////////
    2095  // Array of topological mesh edges. See the comments in the definition
    2096  // of ON_MeshTopologyEdge for details.
    2098 
    2099  ////////////
    2100  // Array of topological mesh faces. The topological face
    2101  // m_topf[fi] corresponds to the mesh face ON_Mesh.m_F[fi].
    2102  // See the comments in the definition of ON_MeshTopologyFace
    2103  // for details. To get the indices of the mesh topology
    2104  // vertices at the face corners use
    2105  // topvi = m_topv_map[m_mesh.m_F[fi].vi[n]]
    2107 
    2108  /*
    2109  Description:
    2110  Expert user function for efficiently getting the
    2111  integer arrays used by the ON_MeshTopologyVertex
    2112  and ON_MeshTopologyEdge classes.
    2113  Parameters:
    2114  count - [in] number of integers in array
    2115  Returns:
    2116  pointer to integer array. The array memory
    2117  will be freed by ~ON_MeshTopology()
    2118  */
    2119  int* GetIntArray(int count);
    2120 
    2121 private:
    2122  friend class ON_Mesh;
    2123 
    2124  bool Create();
    2125  void Destroy();
    2126  void EmergencyDestroy();
    2127 
    2128  // efficient workspaces for
    2129  struct memchunk
    2130  {
    2131  struct memchunk* next;
    2132  } *m_memchunk;
    2133 
    2134  // NOTE: this field is a bool with valid values of 0 and 1.
    2135  volatile int m_b32IsValid; // sizeof(m_bIsValid) must be 4 - it is used in sleep locks.
    2136  // 0: Not Valid
    2137  // 1: Valid
    2138  // -1: Sleep locked - ON_Mesh::Topology() calculation is in progress
    2139  int WaitUntilReady(int sleep_value) const; // waits until m_b32IsValid >= 0
    2140 
    2141 private:
    2142  // no implementation
    2144  ON_MeshTopology& operator=(const ON_MeshTopology&);
    2145 };
    2146 
    2147 
    2148 
    2149 class ON_CLASS ON_MeshPartition
    2150 {
    2151 public:
    2152  ON_MeshPartition();
    2153  ~ON_MeshPartition();
    2154 
    2155  // maximum number of vertices in a partition
    2157  // maximum number of triangles in a partition (quads count as 2 triangles)
    2159 
    2160  // Partition i uses
    2161  // vertices m_V[j] where
    2162  //
    2163  // m_part[i].vi[0] <= j < m_part[i].vi[1]
    2164  //
    2165  // and uses faces m_F[k] where
    2166  //
    2167  // m_part[i].fi[0] <= k < m_part[i].fi[1]
    2169 };
    2170 
    2171 
    2172 
    2173 class ON_CLASS ON_MappingTag
    2174 {
    2175 public:
    2176  ON_MappingTag();
    2177  void Default();
    2178  bool Write(ON_BinaryArchive&) const;
    2179  bool Read(ON_BinaryArchive&);
    2180  void Dump( ON_TextLog& ) const;
    2181  void Transform( const ON_Xform& xform );
    2182  void Set(const ON_TextureMapping& mapping);
    2183 
    2184  /*
    2185  Description:
    2186  Sets the tag to the value the meshes have that
    2187  come out of ON_Brep::CreateMesh().
    2188  */
    2189  void SetDefaultSurfaceParameterMappingTag();
    2190 
    2191  int Compare( const ON_MappingTag& other,
    2192  bool bCompareId = true,
    2193  bool bCompareCRC = true,
    2194  bool bCompareXform = true
    2195  ) const;
    2196 
    2197  /*
    2198  Returns:
    2199  True if the mapping tag is set.
    2200  */
    2201  bool IsSet() const;
    2202 
    2203  /*
    2204  Returns:
    2205  True if the mapping tag is for a mapping with
    2206  type ON_TextureMapping::srfp_mapping with
    2207  m_uvw = identity.
    2208  */
    2209  bool IsDefaultSurfaceParameterMapping() const;
    2210 
    2211  // Identifies the mapping used to create the texture
    2212  // coordinates and records transformations applied
    2213  // to the mesh after the texture coordinates were
    2214  // calculated. If the texture mapping does not
    2215  // change when the mesh is transformed, then set
    2216  // m_mesh_xform to zero so that compares will work right.
    2217  //
    2218  //
    2219  ON_UUID m_mapping_id; // ON_TextureMapping::m_mapping_id
    2220  ON_TextureMapping::TYPE m_mapping_type; // ON_TextureMapping::m_type
    2221  ON__UINT32 m_mapping_crc; // ON_TextureMapping::MappingCRC()
    2223 };
    2224 
    2226 {
    2227 public:
    2229 
    2231  int m_dim; // 1, 2, or 3
    2232  ON_SimpleArray<ON_3fPoint> m_T; // texture coordinates
    2233 };
    2234 
    2235 
    2236 #if defined(ON_DLL_TEMPLATE)
    2237 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_MappingTag>;
    2238 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_TextureCoordinates>;
    2239 #endif
    2240 
    2241 class ON_CLASS ON_Mesh : public ON_Geometry
    2242 {
    2243  ON_OBJECT_DECLARE(ON_Mesh);
    2244 
    2245 public:
    2246  ON_Mesh();
    2247  ON_Mesh(
    2248  int initial_face_array_capacity, // initial face array capacity
    2249  int initial_vertex_array_capacity, // initial vertex array capacity
    2250  bool has_vertex_normals, // true if mesh has vertex normals
    2251  bool has_texture_coordinates // true if mesh has texture coordinates
    2252  );
    2253  ON_Mesh( const ON_Mesh& );
    2254  ON_Mesh& operator=( const ON_Mesh& );
    2255  ~ON_Mesh();
    2256 
    2257 
    2258  // Override of virtual ON_Object::MemoryRelocate
    2259  void MemoryRelocate() override;
    2260 
    2261  // virtual ON_Object::DestroyRuntimeCache override
    2262  void DestroyRuntimeCache( bool bDelete = true ) override;
    2263 
    2264  void Destroy();
    2265  void EmergencyDestroy(); // Call only when memory used by this class's
    2266  // members will soon become invalid for reasons
    2267  // beyond your control. EmergencyDestroy() zeros
    2268  // anything that could possibly cause
    2269  // ~ON_Mesh() to crash. Calling
    2270  // EmergencyDestroy() under normal conditions
    2271  // will result in ~ON_Mesh() leaking
    2272  // memory.
    2273 
    2274 
    2275  void DestroyTree( bool bDeleteTree = true );
    2276 
    2277  /////////////////////////////////////////////////////////////////
    2278  // ON_Object overrides
    2279 
    2280  // virtual ON_Object::SizeOf override
    2281  unsigned int SizeOf() const override;
    2282 
    2283  // virtual ON_Object::DataCRC override
    2284  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const override;
    2285 
    2286  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    2287 
    2288  void Dump( ON_TextLog& ) const override; // for debugging
    2289 
    2290  bool Write( ON_BinaryArchive& ) const override;
    2291 
    2292  bool Read( ON_BinaryArchive& ) override;
    2293 
    2294  ON::object_type ObjectType() const override;
    2295 
    2296  /////////////////////////////////////////////////////////////////
    2297  // ON_Geometry overrides
    2298 
    2299  int Dimension() const override;
    2300 
    2301  // virtual ON_Geometry GetBBox override
    2302  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    2303 
    2304  // virtual ON_Geometry GetTightBoundingBox override
    2305  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    2306 
    2307  bool GetTightBoundingBox(
    2308  ON_BoundingBox& tight_bbox,
    2309  bool bGrowBox ,
    2310  const ON_SimpleArray<ON_PlaneEquation>& clipping_planes,
    2311  const ON_Xform* xform = nullptr
    2312  ) const ;
    2313 
    2314  bool Transform(
    2315  const ON_Xform&
    2316  ) override;
    2317 
    2318  // virtual ON_Geometry::IsDeformable() override
    2319  bool IsDeformable() const override;
    2320 
    2321  // virtual ON_Geometry::MakeDeformable() override
    2322  bool MakeDeformable() override;
    2323 
    2324  bool SwapCoordinates(
    2325  int, int // indices of coords to swap
    2326  ) override;
    2327 
    2328 
    2329  // virtual ON_Geometry override
    2330  bool EvaluatePoint( const class ON_ObjRef& objref, ON_3dPoint& P ) const override;
    2331 
    2332 
    2333  /////////////////////////////////////////////////////////////////
    2334  // Interface
    2335  //
    2336 
    2337  /*
    2338  Returns
    2339  true if there are zero vertices or zero faces.
    2340  */
    2341  bool IsEmpty() const;
    2342 
    2343  // creation
    2344  bool SetVertex(
    2345  int, // vertex index
    2346  const ON_3dPoint& // vertex location
    2347  );
    2348  bool SetVertex(
    2349  int, // vertex index
    2350  const ON_3fPoint& // vertex location
    2351  );
    2352  bool SetVertexNormal(
    2353  int, // vertex index
    2354  const ON_3dVector& // unit normal
    2355  );
    2356  bool SetVertexNormal(
    2357  int, // vertex index
    2358  const ON_3fVector& // unit normal
    2359  );
    2360  bool SetTextureCoord(
    2361  int, // vertex index
    2362  double, double // texture coordinates
    2363  );
    2364  bool SetTriangle(
    2365  int, // face index
    2366  int,int,int // vertex indices
    2367  );
    2368  bool SetQuad(
    2369  int, // face index
    2370  int,int,int,int // vertex indices
    2371  );
    2372 
    2373  /*
    2374  Description:
    2375  Use this function to append a duplicate of an existing vertex.
    2376  Parameters:
    2377  vertex_index - [in]
    2378  index of the existing vertex
    2379  Returns:
    2380  If vertex_index is valid, the index of the duplicate is returned.
    2381  Otherwise, ON_UNSET_UINT_INDEX is returned.
    2382  Remarks:
    2383  This function duplicates all information associated with
    2384  the input vertex and is a good way to insure that
    2385  optional vertex information like color, texture, surface
    2386  parameters, curvatures, vertex normals, and so on get
    2387  duplicated as well.
    2388  */
    2389  unsigned int AppendDuplicateVertex(
    2390  unsigned int vertex_index
    2391  );
    2392 
    2393  /*
    2394  Description:
    2395  Increases the capactiy of arrays used to hold vertex information.
    2396  Parameters:
    2397  new_vertex_capacity - [in]
    2398  desired capacity
    2399  Returns:
    2400  true if successful.
    2401  Remarks:
    2402  This function is useful if you are getting ready to add a known number
    2403  of vertices and want to increase the dynamic array capacities before
    2404  you begin adding vertices.
    2405  */
    2406  bool ReserveVertexCapacity(
    2407  size_t new_vertex_capacity
    2408  );
    2409 
    2410  /*
    2411  Parameters:
    2412  ci - [in]
    2413  component index to test
    2414  Returns:
    2415  True if ci identifies a component (vertex, edge, face, ngon) that exists in this mesh.
    2416  */
    2417  bool IsValidMeshComponentIndex(
    2418  ON_COMPONENT_INDEX ci
    2419  ) const;
    2420 
    2421  class ON_MeshComponentRef MeshComponentRef(
    2422  ON_COMPONENT_INDEX ci
    2423  ) const;
    2424 
    2425  /*
    2426  Parameters:
    2427  ci - [in] a component index with type mesh_vertex, meshtop_vertex,
    2428  meshtop_edge, or mesh_face.
    2429  Returns:
    2430  A pointer to an ON_MeshComponentRef
    2431  The caller must delete the returned object when it is no longer
    2432  needed.
    2433  */
    2434  class ON_MeshComponentRef* MeshComponent(
    2435  ON_COMPONENT_INDEX ci
    2436  ) const;
    2437 
    2438  /*
    2439  Description:
    2440  Delete the portions of the mesh identified in ci_list[].
    2441  Parameters:
    2442  ci_list - [in]
    2443  List of components to delete.
    2444  ci_list_count - [in]
    2445  Number of elements in the ci_list[] array.
    2446  Can be zero if you are using this function to remove
    2447  unused vertices or empty ngons.
    2448  bIgnoreInvalidComponents - [in]
    2449  If true, invalid elements in ci_list[] are ignored.
    2450  If false and ci_list[] contains an invalid element,
    2451  then no changes are made and false is returned.
    2452  bRemoveDegenerateFaces - [in]
    2453  If true, remove degenerate faces.
    2454  bCullUnusedVertices - [in]
    2455  Remove vertices that are not referenced by a face.
    2456  Pass true unless you have a good reason for keeping
    2457  unreferenced vertices.
    2458  bRemoveEmptyNgons - [in]
    2459  Remove ngons that are empty.
    2460  Pass true unless you have a good reason for keeping
    2461  empty ngons.
    2462  Returns:
    2463  True: succesful
    2464  False: failure - no changes.
    2465  */
    2466  bool DeleteComponents(
    2467  const ON_COMPONENT_INDEX* ci_list,
    2468  size_t ci_count,
    2469  bool bIgnoreInvalidComponents,
    2470  bool bRemoveDegenerateFaces,
    2471  bool bRemoveUnusedVertices,
    2472  bool bRemoveEmptyNgons
    2473  );
    2474 
    2475  /*
    2476  Description:
    2477  Calls the detailed version of DeleteComponents() with
    2478  bool bIgnoreInvalidComponents = true;
    2479  bool bRemoveDegenerateFaces = false;
    2480  bool bRemoveUnusedVertices = true;
    2481  bool bRemoveEmptyNgons = true;
    2482  */
    2483  bool DeleteComponents(
    2484  const ON_COMPONENT_INDEX* ci_list,
    2485  size_t ci_count
    2486  ) override;
    2487 
    2488  /*
    2489  Description:
    2490  Calls the detailed version of DeleteComponents() with
    2491  bool bIgnoreInvalidComponents = true;
    2492  bool bRemoveDegenerateFaces = false;
    2493  bool bRemoveUnusedVertices = true;
    2494  bool bRemoveEmptyNgons = true;
    2495  */
    2496  bool DeleteComponents(
    2497  const ON_SimpleArray<ON_COMPONENT_INDEX>& ci_list
    2498  );
    2499 
    2500  /*
    2501  Description:
    2502  Calls the detailed version of DeleteComponents() with
    2503  bool bIgnoreInvalidComponents = true;
    2504  bool bRemoveDegenerateFaces = false;
    2505  bool bRemoveUnusedVertices = true;
    2506  bool bRemoveEmptyNgons = true;
    2507  */
    2508  bool DeleteComponent(
    2509  ON_COMPONENT_INDEX ci
    2510  );
    2511 
    2512  /*
    2513  Description:
    2514  Copy the subset of the mesh idenfied in the component list.
    2515  Parameters:
    2516  ci_list - [in]
    2517  ci_count - [in]
    2518  ci_list[] is an array of ci_count components that identify the
    2519  parts of the mesh to copy. If a face or ngon is specified, then
    2520  any vertices or faces needed for a valid copy are automatically
    2521  copied as well.
    2522  destination_mesh - [in]
    2523  If null, a new mesh is allocated for the copy.
    2524  If not null, the copy is put in this mesh.
    2525  Return:
    2526  null - invalid input - no copy created
    2527  not null - a pointer to the copy.
    2528  */
    2529  ON_Mesh* CopyComponents(
    2530  const ON_COMPONENT_INDEX* ci_list,
    2531  size_t ci_count,
    2532  class ON_Mesh* destination_mesh
    2533  ) const;
    2534 
    2535  /*
    2536  Description:
    2537  Copy the subset of the mesh idenfied in the component list.
    2538  Parameters:
    2539  ci_list - [in]
    2540  ci_list[] is an array of ci_count components that identify the
    2541  parts of the mesh to copy. If a face or ngon is specified, then
    2542  any vertices or faces needed for a valid copy are automatically
    2543  copied as well.
    2544  destination_mesh - [in]
    2545  If null, a new mesh is allocated for the copy.
    2546  If not null, the copy is put in this mesh.
    2547  Return:
    2548  null - invalid input - no copy created
    2549  not null - a pointer to the copy.
    2550  */
    2551  ON_Mesh* CopyComponents(
    2552  const ON_SimpleArray<ON_COMPONENT_INDEX>& ci_list,
    2553  class ON_Mesh* destination_mesh
    2554  ) const;
    2555 
    2556  // query
    2557  int VertexCount() const;
    2558  unsigned int VertexUnsignedCount() const;
    2559  int FaceCount() const;
    2560  unsigned int FaceUnsignedCount() const;
    2561  int QuadCount() const; // number of faces that are quads
    2562  int TriangleCount() const; // number of faces that are triangles
    2563  int InvalidFaceCount() const; // number of face that have invalid m_vi[] values.
    2564  bool HasVertexNormals() const; // normals at vertices
    2565  bool HasFaceNormals() const;
    2566  bool HasTextureCoordinates() const;
    2567  bool HasSurfaceParameters() const;
    2568  bool HasPrincipalCurvatures() const;
    2569  bool HasVertexColors() const;
    2570 
    2571  /*
    2572  Returns:
    2573  True if the mesh has ngons.
    2574  */
    2575  bool HasNgons() const;
    2576 
    2577  /*
    2578  Returns:
    2579  Number of vertices that are hidden.
    2580  */
    2581  int HiddenVertexCount() const;
    2582 
    2583  bool GetCurvatureStats(
    2584  ON::curvature_style,
    2586  ) const;
    2587 
    2588  void InvalidateVertexBoundingBox(); // Call if defining geometry is changed by
    2589  // directly manipulating the m_V[] array.
    2590  void InvalidateVertexNormalBoundingBox(); // Call if defining geometry is changed by
    2591  // directly manipulating the m_N[] array.
    2592  void InvalidateTextureCoordinateBoundingBox(); // Call if defining geometry is changed by
    2593  // directly manipulating the m_T[] array.
    2594  void InvalidateCurvatureStats(); // Call if defining geometry is changed by
    2595  // directly manipulating the m_T[] array.
    2596  void InvalidateBoundingBoxes(); // Invalidates all cached bounding box information.
    2597 
    2598 
    2599  void Flip(); // reverses face orientations and flips vertex and face normals
    2600 
    2601  void FlipVertexNormals(); // reverses vertex normals
    2602  void FlipFaceNormals(); // reverses face normals
    2603  void FlipFaceOrientation(); // reverses face orientation (does nothing to normals)
    2604  void FlipNgonOrientation(); // reverses ngon boundary direction
    2605 
    2606  void SetMeshParameters( const ON_MeshParameters& );
    2607  const ON_MeshParameters* MeshParameters() const;
    2608  void DeleteMeshParameters();
    2609 
    2610 
    2611  bool UnitizeVertexNormals();
    2612  bool UnitizeFaceNormals();
    2613  bool CountQuads();
    2614 
    2615  /*
    2616  Description:
    2617  Splits all quads along the short diagonal.
    2618  */
    2619  bool ConvertQuadsToTriangles();
    2620 
    2621  /*
    2622  Description:
    2623  Splits non-planer quads into two triangles.
    2624 
    2625  Parameters:
    2626  planar_tolerance - [in]
    2627  If planar_tolerance >= 0, then a quad is split if its vertices
    2628  are not coplaner.
    2629 
    2630  If both planar_tolerance = ON_UNSET_VALUE and angle_tolerance_radians >= 0.0,
    2631  then the planarity test is skipped.
    2632 
    2633  If both planar_tolerance = ON_UNSET_VALUE and angle_tolerance_radians = ON_UNSET_VALUE,
    2634  then all quads are split.
    2635 
    2636  angle_tolerance_radians - [in]
    2637  If angle_tolerance_radians >= 0.0, then a quad is split if the
    2638  angle between opposite corner normals is > angle_tolerance_radians.
    2639  The corner normal is the normal to the triangle formed by two
    2640  adjacent edges and the diagonal connecting their endpoints.
    2641  A quad has for corner normals.
    2642 
    2643  If both angle_tolerance_radians = ON_UNSET_VALUE and planar_tolerance >= 0.0,
    2644  then the corner normal angle test is skipped.
    2645 
    2646  If both planar_tolerance = ON_UNSET_VALUE and angle_tolerance_radians = ON_UNSET_VALUE,
    2647  then all quads are split.
    2648 
    2649  split_method - [in]
    2650  0 default
    2651  Currently divides along the short diagonal. This may be
    2652  changed as better methods are found or preferences change.
    2653  By passing zero, you let the developers of this code
    2654  decide what's best for you over time.
    2655  1 divide along the short diagonal
    2656  2 divide along the long diagonal
    2657  3 minimize resulting area
    2658  4 maximize resulting area
    2659  5 minimize angle between triangle normals
    2660  6 maximize angle between triangle normals
    2661 
    2662  bDeleteNgonsContainingSplitQuads - [in]
    2663  If true, ngons that contain a split quad are deleted.
    2664 
    2665  Returns:
    2666  Number of quads that were converted to triangles.
    2667  */
    2668  unsigned int ConvertNonPlanarQuadsToTriangles(
    2669  double planar_tolerance,
    2670  double angle_tolerance_radians,
    2671  unsigned int split_method
    2672  );
    2673 
    2674  unsigned int ConvertNonPlanarQuadsToTriangles(
    2675  double planar_tolerance,
    2676  double angle_tolerance_radians,
    2677  unsigned int split_method,
    2678  bool bDeleteNgonsContainingSplitQuads
    2679  );
    2680 
    2681  /*
    2682  Description:
    2683  Joins adjacent triangles into quads if the resulting quad
    2684  is nice.
    2685  Parameters:
    2686  angle_tol_radians - [in] Used to compare adjacent
    2687  triangles' face normals. For two triangles to be considered,
    2688  the angle between their face normals has to be <= angle_tol_radians.
    2689  When in doubt use ON_PI/90.0 (2 degrees).
    2690  min_diagonal_length_ratio - [in] ( <= 1.0) For two triangles to be
    2691  considered the ratio of the resulting quad's diagonals
    2692  (length of the shortest diagonal)/(length of longest diagonal).
    2693  has to be >= min_diagonal_length_ratio.
    2694  When in doubt us .875.
    2695  */
    2696  bool ConvertTrianglesToQuads(
    2697  double angle_tol_radians,
    2698  double min_diagonal_length_ratio
    2699  );
    2700 
    2701  bool ComputeFaceNormals(); // compute face normals for all faces
    2702  bool ComputeFaceNormal(int); // computes face normal of indexed face
    2703 
    2704  /*
    2705  Description:
    2706  Get a list of pairs of faces that clash.
    2707  Parameters:
    2708  max_pair_count - [in]
    2709  If max_pair_count > 0, then at most this many pairs
    2710  will be appended to the clashing_pairs[] array.
    2711  If max_pair_count <= 0, then all clashing pairs
    2712  will be appended to the clashing_pairs[] array.
    2713  clashing_pairs - [out]
    2714  The faces indices of clashing pairs are appended
    2715  to this array.
    2716  Returns:
    2717  Number of pairs appended to clashing_pairs[].
    2718  */
    2719  int GetClashingFacePairs(
    2720  int max_pair_count,
    2721  ON_SimpleArray< ON_2dex >& clashing_pairs
    2722  ) const;
    2723 
    2724  /*
    2725  Description:
    2726  Cull clashing faces from the mesh.
    2727  Parameters:
    2728  what_to_cull - [in]
    2729  0: when a pair of faces clash, cull both faces
    2730  1: when a pair of faces clash, leave the face with the
    2731  longest edge.
    2732  2: when a pair of faces clash, cull the face with the
    2733  longest edge.
    2734  3: when a pair of faces clash, leave the face with
    2735  the largest area.
    2736  4: when a pair of faces clash, cull the face with
    2737  the largest area.
    2738  Returns:
    2739  Number of faces culled from the mesh.
    2740  Remarks:
    2741  If a large face clashes with many small faces, the large
    2742  face and one small face will be removed. When a degenerate
    2743  face is encountered, it is also culled.
    2744  */
    2745  int CullClashingFaces( int what_to_cull );
    2746 
    2747  unsigned int CullDegenerateFaces(); // returns number of degenerate faces
    2748 
    2749  int CullUnusedVertices(); // returns number of culled vertices
    2750 
    2751  // Description:
    2752  // Removes any unreferenced objects from arrays, reindexes as needed,
    2753  // and shrinks arrays to minimum required size.
    2754  bool Compact();
    2755 
    2756  /*
    2757  Description:
    2758  Removes and unsets all possible cached information and
    2759  then calls Compact().
    2760  Parameters:
    2761  bRemoveNgons - [in]
    2762  If true, all n-gon information is removed.
    2763  bRemoveDegenerateFaces - [in]
    2764  If true, CullDegenerateFaces() is used to remove degenerate faces.
    2765  bCompact - [in]
    2766  If true, Compact() is called after removing cached information.
    2767  */
    2768  void Cleanup(
    2769  bool bRemoveNgons,
    2770  bool bRemoveDegenerateFaces,
    2771  bool bCompact
    2772  );
    2773 
    2774  /*
    2775  Description:
    2776  Calls the latest version of the detailed cleanup command passing the value for bRemoveNgons
    2777  and setting all other parameters to true.
    2778  Parameters:
    2779  bRemoveNgons - [in]
    2780  If true, all n-gon information is removed.
    2781  */
    2782  void Cleanup(
    2783  bool bRemoveNgons
    2784  );
    2785 
    2786  bool ComputeVertexNormals(); // uses face normals to cook up a vertex normal
    2787 
    2788  //////////
    2789  // Scales textures so the texture domains are [0,1] and
    2790  // eliminates any texture rotations.
    2791  bool NormalizeTextureCoordinates();
    2792 
    2793  /////////
    2794  // Description:
    2795  // Transposes the texture coordinates
    2796  // Returns
    2797  // true - success
    2798  bool TransposeTextureCoordinates();
    2799  bool TransposeSurfaceParameters();
    2800 
    2801  /////////
    2802  // Description:
    2803  // Reverse one coordinate direction of the texture coordinates, within texture domain m_tex_domain
    2804  // Parameters:
    2805  // dir -[in] - dir=0 first texture coordinate is reversed
    2806  // dir=1 second texture coordinate is reversed
    2807  // Returns
    2808  // true - success
    2809  bool ReverseTextureCoordinates( int dir );
    2810  bool ReverseSurfaceParameters( int dir );
    2811 
    2812 
    2813 
    2814  /*
    2815  Description:
    2816  Use a texture mapping function to set the m_T[] values.
    2817  Parameters:
    2818  mapping - [in]
    2819  mesh_xform - [in]
    2820  If not nullptr, the mapping calculation is performed as
    2821  if the mesh were transformed by mesh_xform; the
    2822  location of the mesh is not changed.
    2823  bLazy - [in]
    2824  If true and the m_T[] values were set using the same
    2825  mapping parameters, then no calculation is performed.
    2826  Returns:
    2827  True if successful.
    2828  See Also:
    2829  ON_TextureMapping::GetTextureCoordinates
    2830  */
    2831  bool SetTextureCoordinates(
    2832  const class ON_TextureMapping& mapping,
    2833  const class ON_Xform* mesh_xform = 0,
    2834  bool bLazy = true
    2835  );
    2836 
    2837  bool HasCachedTextureCoordinates() const;
    2838 
    2839  const ON_TextureCoordinates* CachedTextureCoordinates(
    2840  const ON_UUID& mapping_id
    2841  ) const;
    2842 
    2843  const ON_TextureCoordinates* SetCachedTextureCoordinates(
    2844  const class ON_TextureMapping& mapping,
    2845  const class ON_Xform* mesh_xform = 0,
    2846  bool bLazy = true
    2847  );
    2848 
    2849  bool EvaluateMeshGeometry( const ON_Surface& ); // evaluate surface at tcoords
    2850  // to set mesh geometry
    2851 
    2852  // finds all coincident vertices and merges them if break angle is small enough
    2853  bool CombineCoincidentVertices(
    2854  ON_3fVector, // coordinate tols for considering vertices
    2855  // to be coincident
    2856  double // cosine normal angle tolerance in radians
    2857  // if vertices are coincident, then they are combined
    2858  // if NormalA o NormalB >= this value
    2859  );
    2860 
    2861  /*
    2862  Description:
    2863  Combines identical vertices.
    2864  Parameters:
    2865  bIgnoreVertexNormals - [in] If true, then vertex normals
    2866  are ignored when comparing vertices.
    2867  bIgnoreTextureCoordinates - [in] If true, then vertex
    2868  texture coordinates, colors, and principal curvatures
    2869  are ignored when comparing vertices.
    2870  Returns:
    2871  True if the mesh is changed, in which case the returned
    2872  mesh will have fewer vertices than the input mesh.
    2873  */
    2874  bool CombineIdenticalVertices(
    2875  bool bIgnoreVertexNormals = false,
    2876  bool bIgnoreTextureCoordinates = false
    2877  );
    2878 
    2879  void Append( const ON_Mesh& ); // appends a copy of mesh to this and updates
    2880  // indices of appended mesh parts
    2881 
    2882  /*
    2883  Description:
    2884  Append a list of meshes. This function is much more efficient
    2885  than making repeated calls to ON_Mesh::Append(const ON_Mesh&)
    2886  when lots of meshes are being joined into a single large mesh.
    2887  Parameters:
    2888  count - [in]
    2889  length of meshes[] array.
    2890  meshes - [in]
    2891  array of meshes to append.
    2892  */
    2893  void Append( int count, const ON_Mesh* const* meshes );
    2894 
    2895  /*
    2896  Description:
    2897  Expert user function to set m_is_closed member.
    2898  Setting this value correctly after a mesh is constructed
    2899  can save time when IsClosed() is called.
    2900  This function sets the private member variable m_is_closed.
    2901  Paramters:
    2902  closed - [in]
    2903  0: The mesh is not closed. There is at least one face with an
    2904  edge that is geometrically distinct (as an unoriented line segment)
    2905  from all other edges.
    2906  1: The mesh is closed. Every geometrically distict edge is used
    2907  by two or more faces.
    2908  */
    2909  void SetClosed(int closed);
    2910 
    2911  /*
    2912  Returns:
    2913  True if every mesh "edge" has two or more faces.
    2914  */
    2915  bool IsClosed() const;
    2916 
    2917  /*
    2918  Returns:
    2919  True if every mesh "edge" has at most two faces.
    2920  */
    2921  bool IsManifold() const;
    2922 
    2923  /*
    2924  Returns:
    2925  True if the mesh is manifold and every pair of faces
    2926  that share an "edge" have compatible orientations.
    2927  */
    2928  bool IsOriented() const;
    2929 
    2930  /*
    2931  Description:
    2932  Determine if the mesh is a manifold.
    2933  Parameters:
    2934  bTopologicalTest - [in]
    2935  If true, the query treats coincident vertices as
    2936  the same.
    2937  pbIsOriented - [out]
    2938  If the input pointer is not nullptr, then the returned
    2939  value of *pbIsOriented will be true if the mesh
    2940  is a manifold and adjacent faces have compatible
    2941  face normals.
    2942  pbHasBoundary - [out]
    2943  If the input pointer is not nullptr, then the returned
    2944  value of *pbHasBoundary will be true if the mesh
    2945  is a manifold and there is at least one "edge"
    2946  with no adjacent faces have compatible
    2947  face normals.
    2948  Returns:
    2949  True if every mesh "edge" has at most two adjacent faces.
    2950  */
    2951  bool IsManifold(
    2952  bool bTopologicalTest,
    2953  bool* pbIsOriented = nullptr,
    2954  bool* pbHasBoundary = nullptr
    2955  ) const;
    2956 
    2957  /*
    2958  Description:
    2959  Expert user function to set m_is_solid member.
    2960  Setting this value correctly after a mesh is constructed
    2961  can save time when IsSolid() is called.
    2962  This function sets the private member variable m_is_solid.
    2963  If solid is nonzero, it will set m_is_closed to 1.
    2964  Paramters:
    2965  solid - [in]
    2966  0: The mesh is not an oriented manifold solid mesh. Either
    2967  the mesh is not closed, not manifold, or the faces are
    2968  not oriented compatibly.
    2969  1: The mesh is an oriented manifold solid whose face normals
    2970  point outwards.
    2971  -1: The mesh is an oriented manifold solid whose face normals
    2972  point inwards.
    2973  */
    2974  void SetSolidOrientation(int solid_orientation);
    2975 
    2976  /*
    2977  Description:
    2978  Determine orientation of a mesh.
    2979  Returns:
    2980  +1 mesh is a solid with outward facing normals
    2981  -1 mesh is a solid with inward facing normals
    2982  0 mesh is not a solid
    2983  See Also:
    2984  ON_Mesh::IsSolid
    2985  */
    2986  int SolidOrientation() const;
    2987 
    2988  /*
    2989  Description:
    2990  Test mesh to see if it is a solid. (A "solid" is
    2991  a closed oriented manifold.)
    2992  Returns:
    2993  true mesh is a solid
    2994  fals mesh is not a solid
    2995  See Also:
    2996  ON_Mesh::SolidOrientation
    2997  ON_Mesh::IsManifold
    2998  */
    2999  bool IsSolid() const;
    3000 
    3001  /*
    3002  Description:
    3003  Determine if a point is inside a solid brep.
    3004  Paramters:
    3005  test_point - [in]
    3006  tolerance - [in] >= 0.0
    3007  3d distance tolerance used for ray-mesh intersection
    3008  and determining strict inclusion.
    3009  bStrictlyInside - [in]
    3010  If bStrictlyInside is true, then test_point must be inside mesh
    3011  by at least tolerance in order for this function to return
    3012  true. If bStrictlyInside is false, then this function will return
    3013  true if test_point is inside or the distance from test_point to
    3014  a mesh face is <= tolerance.
    3015  Returns:
    3016  True if test_point is inside the solid mesh.
    3017  Remarks:
    3018  The caller is responsible for making certing the mesh is
    3019  solid before calling this function. If the mesh is not
    3020  solid, the behavior is unpredictable.
    3021  See Also:
    3022  ON_Mesh::IsSolid()
    3023  */
    3024  bool IsPointInside(
    3025  ON_3dPoint test_point,
    3026  double tolerance,
    3027  bool bStrictlyInside
    3028  ) const;
    3029 
    3030  /*
    3031  Description:
    3032  Appends a list of mesh edges that begin or end at the specified
    3033  vertices to the edges[] array.
    3034  Parameters:
    3035  vcount - [in]
    3036  number of vertices
    3037  vertex_index - [in]
    3038  array of vertex indices
    3039  bNoDuplicates - [in]
    3040  If true, then only one edges[] is added for each edge,
    3041  the first vertex index will alwasy be less than the
    3042  second, and the returned elements are sorted in dictionary
    3043  order.
    3044  If false and an edge is shared by multiple faces, then
    3045  there will be an edges[] element added for each face and the
    3046  order of the vertex indicies will indicate the orientation
    3047  of the edge with respect to the face. No sorting is performed
    3048  in this case.
    3049  edges - [out]
    3050  Edges that begin or end at one of the specified vertices are
    3051  appended to this array. Each ON_2dex records the start and
    3052  end vertex index.
    3053  Returns:
    3054  Number of ON_2dex values appended to the edges[] array.
    3055  */
    3056  int GetVertexEdges(
    3057  int vcount,
    3058  const int* vertex_index,
    3059  bool bNoDuplicates,
    3061  ) const;
    3062 
    3063 
    3064  /*
    3065  Description:
    3066  Appends a list of mesh edges to the edges[] array.
    3067  Parameters:
    3068  edges - [out]
    3069  Each edges[] element is a pair of vertex indices. There
    3070  is at least one face in the mesh with an edge running between
    3071  the indicies.
    3072  Returns:
    3073  Number of ON_2dex values appended to the edges[] array.
    3074  */
    3075  int GetMeshEdges(
    3077  ) const;
    3078 
    3079  /*
    3080  Description:
    3081  Assign a unique id to each vertex location. Coincident vertices
    3082  get the same id.
    3083  Parameters:
    3084  first_vid - [in]
    3085  Initial vertex id. Typically 1 or 0.
    3086  Vid - [out]
    3087  If not null, then Vid[] sould be an array of length VertexCount().
    3088  and the vertex ids will be stored in this array. If null,
    3089  the array will be allocated by calling onmalloc(). The returned
    3090  array Vid[i] is the id of the vertex m_V[i]. If m_V[i] and
    3091  m_V[j] are the same 3d point, then Vid[i] and Vid[j] will have
    3092  the same value.
    3093  Vindex - [out] (can be null)
    3094  If Vindex is not null, then it must have length at least m_V.Count()
    3095  and the returned array will be a permutation of (0,1,...,m_V.Count()-1)
    3096  such (Vid[Vindex[0]], Vid[Vindex[1]], ..., Vid[Vindex[m_V.Count()-1]])
    3097  is an increasing list of value.
    3098  Returns:
    3099  null if the mesh has no vertices.
    3100  An array of length VertexCount(). If vertices m_V[i] and m_V[j]
    3101  are coincident, then Vid[i] = Vid[j]. The id values begin at first_vid.
    3102  The maximum vertex id is Vid[Vindex[m_V.Count()-1]]. The number of
    3103  unique vertex locations is (Vid[Vindex[m_V.Count()-1]] - first_vid + 1).
    3104  */
    3105  unsigned int* GetVertexLocationIds(
    3106  unsigned int first_vid,
    3107  unsigned int* Vid,
    3108  unsigned int* Vindex
    3109  ) const;
    3110 
    3111  /*
    3112  Description:
    3113  Get a list of the sides of every face.
    3114  Parameters:
    3115  Vid - [in] (can be null)
    3116  If Vid is null, then the mesh m_V[] index values are used to set
    3117  the ON_MeshFaceSide::vi[] values.
    3118  If Vid is not null, then it must be an array of length VertexCount().
    3119  The value Vid[mesh m_V[] index] will be used to set the
    3120  ON_MeshFaceSide::vi[] values.
    3121  sides - [out]
    3122  If the input value of sides is not null, then sides[] must be long
    3123  enough to hold the returned side list. The maximum posssible length
    3124  is 4*FaceCount() for a mesh contining FaceCount() nondegenerate quads.
    3125  If the input value of sides is null, memory will be allocated using
    3126  onmalloc() and the caller is responsible for calling onfree() at an
    3127  appropriate time. This function fills in the sides[] array
    3128  with face side information. The returned list is sorted by sides[].fi
    3129  and the sides[].side and each element has vi[0] <= vi[1].
    3130  The function ON_SortMeshFaceSidesByVertexIndex() can be used to sort the
    3131  list by the sides[].vi[] values.
    3132  Returns:
    3133  Number of elements added to sides[].
    3134  Remarks:
    3135  Faces with out of range ON_MeshFace.vi[] values are skipped.
    3136  Degenerate faces are processed, but degenerate sides (equal vertex indices)
    3137  are not added to the list.
    3138  */
    3139  unsigned int GetMeshFaceSideList(
    3140  const unsigned int* Vid,
    3141  class ON_MeshFaceSide*& sides
    3142  ) const;
    3143 
    3144 
    3145  ///////////////////////////////////////////////////////////////////////
    3146  //
    3147  // mesh editing
    3148  //
    3149 
    3150  /*
    3151  Description:
    3152  Replace a mesh edge with a vertex at its center and update
    3153  adjacent faces as needed.
    3154  Parameters:
    3155  topei - [in] index of edge in MeshTopology().m_tope[] array
    3156  Returns:
    3157  true if successful.
    3158  */
    3159  bool CollapseEdge( int topei );
    3160 
    3161  /*
    3162  Description:
    3163  Tests a mesh edge to see if it is valid as input to
    3164  ON_Mesh::SwapMeshEdge.
    3165  Parameters:
    3166  topei - [in] index of edge in MeshTopology().m_tope[] array
    3167  Returns:
    3168  true if edge can be swapped by ON_Mesh::SwapMeshEdge.
    3169  See Also:
    3170  ON_Mesh::SwapEdge
    3171  */
    3172  bool IsSwappableEdge( int topei );
    3173 
    3174 
    3175  /*
    3176  Description:
    3177  If the edge is shared by two triangular face, then
    3178  the edge is "swapped".
    3179  Parameters:
    3180  topei - [in] index of edge in MeshTopology().m_tope[] array
    3181  Returns:
    3182  true if successful
    3183  See Also:
    3184  ON_Mesh::IsSwappableEdge
    3185  */
    3186  bool SwapEdge( int topei );
    3187 
    3188  /*
    3189  Description:
    3190  Removes a face from a mesh and does not alter the
    3191  geometry of the remaining mesh.
    3192  Parameters:
    3193  meshfi - [in] index of face in ON_Mesh.m_F[] array
    3194  Remarks:
    3195  This function calls DestroyTopology() and DestroyPartition().
    3196  The caller is responsible for calling Compact() if that step
    3197  is required.
    3198  Returns:
    3199  true if successful
    3200  */
    3201  bool DeleteFace( int meshfi );
    3202 
    3203  /*
    3204  Description:
    3205  Destroys the m_H[] array and sets m_hidden_count=0.
    3206  */
    3207  void DestroyHiddenVertexArray();
    3208 
    3209  /*
    3210  Returns:
    3211  If the mesh has some hidden vertices, then an array
    3212  of length VertexCount() is returned and the i-th
    3213  element is true if the i-th vertex is hidden.
    3214  If no vertices are hidden, nullptr is returned.
    3215  */
    3216  const bool* HiddenVertexArray() const;
    3217 
    3218  /*
    3219  Description:
    3220  Set the runtime vertex hidden flag.
    3221  Parameters:
    3222  meshvi - [in] mesh vertex index
    3223  bHidden - [in] true to hide vertex
    3224  */
    3225  void SetVertexHiddenFlag( int meshvi, bool bHidden );
    3226 
    3227  /*
    3228  Description:
    3229  Returns true if the mesh vertex is hidden. This is a runtime
    3230  setting that is not saved in 3dm files.
    3231  Parameters:
    3232  meshvi - [in] mesh vertex index.
    3233  Returns:
    3234  True if mesh vertex is hidden.
    3235  */
    3236  bool VertexIsHidden( int meshvi ) const;
    3237 
    3238  /*
    3239  Description:
    3240  Returns true if the mesh face is hidden. This is a runtime
    3241  setting that is not saved in 3dm files.
    3242  Parameters:
    3243  meshfi - [in] mesh face index.
    3244  Returns:
    3245  True if mesh face is hidden.
    3246  Remarks:
    3247  A face is hidden if, and only if, at least one of its
    3248  vertices is hidden.
    3249  */
    3250  bool FaceIsHidden( int meshvi ) const;
    3251 
    3252 
    3253  ///////////////////////////////////////////////////////////////////////
    3254  //
    3255  // mesh topology
    3256  //
    3257  // In order to keep the mesh facet definition simple and make the mesh
    3258  // definition easily used in common rendering application, if two facets
    3259  // share a vertex location but have different normals, curvatures,
    3260  // textures, etc., at that common vertex location, then the vertex is
    3261  // duplicated. When the topology of the mesh needs to be known,
    3262  // use Topology() to get a class that provides complete topological
    3263  // information about the mesh.
    3264  const ON_MeshTopology& Topology() const;
    3265 
    3266  ///////////////////////////////////////////////////////////////////////
    3267  // If you modify the mesh in any way that may change its topology,
    3268  // then call DestroyTopology(). Specifically if you add or remove
    3269  // vertices or face, change vertex locations, or change the face m_vi[]
    3270  // values, then you must call DestroyTopology().
    3271  void DestroyTopology();
    3272 
    3273  /*
    3274  Returns:
    3275  This is an expert user function that returns true if the topology
    3276  information is already calculated and cached. It can be used to
    3277  to avoid calling the Topology() function when the expensive creation
    3278  step will be performed.
    3279  */
    3280  /* obsolete - used HasMeshTopology() */ bool TopologyExists() const;
    3281  bool HasMeshTopology() const;
    3282 
    3283  ///////////////////////////////////////////////////////////////////////
    3284  //
    3285  // mesh partitions
    3286  //
    3287  // In ancient times, some rendering engines were only able to process
    3288  // small batches of triangles and th CreatePartition() function was
    3289  // provided to partition the mesh into subsets of vertices and faces
    3290  // that those renering engines could handle.
    3291  //
    3292  const ON_MeshPartition* CreatePartition(
    3293  int, // maximum number of vertices in a partition
    3294  int // maximum number of triangles in a partition
    3295  );
    3296  const ON_MeshPartition* Partition() const;
    3297  void DestroyPartition();
    3298 
    3299  /*
    3300  Description:
    3301  Extract the portion of this mesh defined by mesh_part.
    3302  Parameters:
    3303  mesh_part - [in]
    3304  defines portion of the mesh to extract.
    3305  mesh - [in] (can be null, cannot be = "this).
    3306  If mesh is no null, the extracted mesh will be put into
    3307  this mesh. If mesh is null, the extracted mesh will
    3308  be created in a mesh allocated on the heap using the
    3309  new operator.
    3310  Returns:
    3311  A pointer to the submesh. If the input mesh parameter is null,
    3312  then the caller must delete this mesh when it is no longer needed.
    3313  If the input is invalid, then null is returned.
    3314  */
    3315  ON_Mesh* MeshPart(
    3316  const ON_MeshPart& mesh_part,
    3317  ON_Mesh* mesh
    3318  ) const;
    3319 
    3320  /*
    3321  Description:
    3322  Create a mesh that is a single face of this mesh.
    3323  Parameters:
    3324  Returns:
    3325  A pointer to the submesh. If the input mesh parameter is null,
    3326  then the caller must delete this mesh when it is no longer needed.
    3327  If the input is invalid, then null is returned.
    3328  */
    3329  ON_Mesh* DuplicateFace(
    3330  int face_index,
    3331  ON_Mesh* mesh
    3332  ) const;
    3333 
    3334  ///////////////////////////////////////////////////////////////////////
    3335  //
    3336  // mesh N-gon lists.
    3337  // ON_Mesh objects support faces that are triangle or quads.
    3338  // When a mesh is created from a format that supports N-gons
    3339  // for N larger than 4, an optional N-gon list can be added
    3340  // that specifies the vertices and faces that make up the N-gon.
    3341  //
    3342 
    3343  /*
    3344  Description:
    3345  If the mesh has an N-gon list, return a pointer to it.
    3346  Returns:
    3347  A pointer to the current N-gon list or nullptr.
    3348  */
    3349  const class ON_V4V5_MeshNgonList* V4V5_NgonList() const;
    3350 
    3351  /*
    3352  Description:
    3353  If an N-gon list exists, it is returned and can be modified.
    3354  If no N-gon list exists, a new empty list is returned and
    3355  it can be modified.
    3356  Returns:
    3357  A pointer to the N-gon list that can be modified.
    3358  */
    3359  class ON_V4V5_MeshNgonList* V4V5_ModifyNgonList();
    3360 
    3361  /*
    3362  Description:
    3363  Destroy any existing N-gon list.
    3364  */
    3365  void V4V5_DestroyNgonList();
    3366 
    3367  ///////////////////////////////////////////////////////////////////////
    3368  //
    3369  // mesh components
    3370  // ON_Mesh objects can consist of sets of faces that are isolated
    3371  // from any other sets of faces. The following 2 functions will
    3372  // dissect a mesh into these sets, called components. Not to be
    3373  // confused with ON_COMPONENT_INDEX.
    3374 
    3375  /*
    3376  Description:
    3377  Calculates the components of a mesh and sets a label for each face in
    3378  the facet_component_labels array.
    3379  Parameters:
    3380  bUseVertexConnections- [in]
    3381  If this parameter is true, then facets that share a common vertex
    3382  are considered connected.
    3383  If this parameter is false, then facets must share an edge to
    3384  be considered connected.
    3385  bUseTopologicalConnections - [in]
    3386  If this parameter is true, then geometric location is used
    3387  to determine if facets are connected.
    3388  If this parameter is false, then facets must share the same vertex
    3389  or vertices to be considered connected.
    3390  facet_component_labels- [out]
    3391  facet_component_labels[] will be an array with the same size
    3392  as ON_Mesh.m_F.Count() and facet_component_labels[i]
    3393  is the component id m_F[i] belongs to. The component id
    3394  will be 1 to the number of compoents.
    3395  Returns:
    3396  Number of components on success, 0 on failure
    3397  */
    3398 
    3399  int GetConnectedComponents( bool bUseVertexConnections,
    3400  bool bTopologicalConnections,
    3401  ON_SimpleArray<int>& facet_component_labels
    3402  ) const;
    3403 
    3404  /*
    3405  Description:
    3406  Calculates the components of a mesh and sets a label for each face in
    3407  the facet_component_labels array.
    3408  Parameters:
    3409  bUseVertexConnections- [in]
    3410  If this parameter is true, then facets that share a common vertex
    3411  are considered connected.
    3412  If this parameter is false, then facets must share an edge to
    3413  be considered connected.
    3414  bUseTopologicalConnections - [in]
    3415  If this parameter is true, then geometric location is used
    3416  to determine if facets are connected.
    3417  If this parameter is false, then facets must share the same vertex
    3418  or vertices to be considered connected.
    3419  components - [out]
    3420  New components are appended to this array
    3421  if this parameter is null, then the components are just counted.
    3422  Returns:
    3423  Number of components on success, 0 on failure
    3424  */
    3425 
    3426  int GetConnectedComponents( bool bUseVertexConnections,
    3427  bool bTopologicalConnections,
    3428  ON_SimpleArray<ON_Mesh*>* components
    3429  ) const;
    3430 
    3431 
    3432  /////////////////////////////////////////////////////////////////
    3433  //
    3434  // Double precision vertex support
    3435  //
    3436 
    3437  /*
    3438  Returns:
    3439  True if the mesh vertex count is > 0, the mesh has single and double
    3440  precision vertices, and the values of the locations are synchronized.
    3441  */
    3442  bool HasSynchronizedDoubleAndSinglePrecisionVertices() const;
    3443 
    3444  /*
    3445  Returns:
    3446  True if the mesh has double precision vertices (m_dV.Count() > 0).
    3447  Remarks:
    3448  Use ON_Mesh::UpdateDoublePrecisionVertices()
    3449  or ON_Mesh::UpdateSinglePrecisionVertices() to synchronize
    3450  values of single and double precision vertices.
    3451  */
    3452  bool HasDoublePrecisionVertices() const;
    3453 
    3454  bool HasSinglePrecisionVertices() const;
    3455 
    3456 
    3457  /*
    3458  Description:
    3459  If you modify the values of double precision vertices,
    3460  then you must call UpdateSinglePrecisonVertices().
    3461  Remarks:
    3462  If double precision vertices are not present, this function
    3463  does nothing.
    3464  */
    3465  void UpdateSinglePrecisionVertices();
    3466 
    3467  /*
    3468  Description:
    3469  If you modify the values of the single precision vertices
    3470  in m_V[], then you must call UpdateDoublePrecisionVertices().
    3471  Remarks:
    3472  If double precision vertices are not present, this function
    3473  does nothing.
    3474  */
    3475  void UpdateDoublePrecisionVertices();
    3476 
    3477  /*
    3478  Description:
    3479  The function removes all double precision vertex information.
    3480  */
    3481  void DestroyDoublePrecisionVertices();
    3482 
    3483 
    3484  /////////////////////////////////////////////////////////////////
    3485  // Implementation - mesh geometry
    3486 
    3487  // Vertex locations
    3488  // In a case where adjacent facets share a vertex
    3489  // location but have distinct normals or texture
    3490  // coordinates at that location, the vertex must
    3491  // be duplicated.
    3492 
    3493  /*
    3494  Description:
    3495  Get double precision vertices. If they do not exist,
    3496  they will be created and match the existing single
    3497  precision vertices.
    3498  Returns:
    3499  Array of double precision vertices. If you modify the
    3500  values in this array, you must make the same modifications
    3501  to the single precision vertices, or call
    3502  UpdateSinglePrecisonVertices().
    3503  Example:
    3504 
    3505  // add a bunch of double precision information
    3506  ON_3dPointArray& dv = mesh.DoublePrecisionVertices();
    3507  for ( i = 0; i < lots; i++ )
    3508  {
    3509  dv[i] = ...
    3510  }
    3511  // This call updates the single precison values
    3512  // in m_V[] and sets all the counts and CRCs that
    3513  // are used in validity checking.
    3514  mesh.UpdateSinglePrecisonVertices();
    3515 
    3516  Remarks:
    3517  Avoid mulitple calls to DoublePrecisionVertices().
    3518  It is most efficient to make one call, save a local
    3519  reference, and use the local reference as needed.
    3520  */
    3521  ON_3dPointArray& DoublePrecisionVertices();
    3522  const ON_3dPointArray& DoublePrecisionVertices() const;
    3523 
    3524  /*
    3525  Description:
    3526  m_dV[] double precision vertices.
    3527  m_V[] single precision vertices.
    3528 
    3529  If m_dV[] is not empty, then m_V and m_dV should have the same length
    3530  and HasSynchronizedDoubleAndSinglePrecisionVertices() should be true.
    3531 
    3532  Otherwise a bug incorrectly modified vertex location information.
    3533 
    3534  If m_dV[] and m_V[] are in use and you modify vertex locations or count,
    3535  then your calculation should insure both are properly updated.
    3536  */
    3539 
    3540  /*
    3541  Returns:
    3542  Location of the vertex. If double precision vertices
    3543  are present, the double precision vertex location is
    3544  returned. If vertex_index is out of range,
    3545  ON_UNSET_VALUE is returned.
    3546  */
    3547  ON_3dPoint Vertex(int vertex_index) const;
    3548 
    3549  // m_F[] facets (triangles or quads)
    3551 
    3552  ////////////////////////////////////////////////////////////////////////
    3553  //
    3554  // N-gon
    3555  //
    3556  // An n-gon is a collection of faces that are grouped together.
    3557  // The outer boundary of the face collection must be a closed
    3558  // polyline.
    3559  //
    3560 
    3561  ////////////////////////////////////////////////////////////////////////
    3562  //
    3563  // N-gon interface
    3564  //
    3565 
    3566  /*
    3567  Number of n-gons in this mesh.
    3568  */
    3569  int NgonCount() const;
    3570 
    3571  /*
    3572  Number of n-gons in this mesh.
    3573  */
    3574  unsigned int NgonUnsignedCount() const;
    3575 
    3576  /*
    3577  Returns:
    3578  null - This mesh does ot have n-gon information.
    3579  not null - a pointer to an array of ON_MeshNgon pointers.
    3580  The array has length ON_Mesh::NgonCount().
    3581  Remarks:
    3582  If ON_Mesh::RemoveNgon has been called, then the array
    3583  can contain null pointers.
    3584  */
    3585  const ON_MeshNgon* const * Ngons() const;
    3586 
    3587  /*
    3588  Parameters:
    3589  ngon_index - [in]
    3590  Index of an ngon.
    3591  Returns:
    3592  A pointetr to the indexed n-gon or null if the
    3593  indexed ngon is null or ngon_index is out of range.
    3594  Remarks:
    3595  If ON_Mesh::RemoveNgon has been called, then a null
    3596  pointer can be returned even when ngon_index >= 0
    3597  and ngon_index < ON_Mesh.NgonCount().
    3598  */
    3599  const ON_MeshNgon* Ngon(
    3600  unsigned int ngon_index
    3601  ) const;
    3602 
    3603  /*
    3604  Parameters:
    3605  ngon_index - [in]
    3606  Index of an ngon.
    3607  Returns:
    3608  Total number of boundary edges, including interior edges
    3609  */
    3610  unsigned int NgonBoundaryEdgeCount(
    3611  unsigned int ngon_index
    3612  ) const;
    3613 
    3614  const ON_MeshNgon* NgonFromComponentIndex(
    3615  class ON_MeshNgonBuffer& ngon_buffer,
    3616  ON_COMPONENT_INDEX ci
    3617  ) const;
    3618 
    3619  /*
    3620  Description:
    3621  Add a new ngon to the mesh.
    3622  Parameters:
    3623  Vcount - number of vertices and number of sides in the n-gon
    3624  ngon_vi[] - in
    3625  An array of N distinct ON_Mesh.m_V[] vertex indices
    3626  Fcount - [in]
    3627  Number of face that make up the ngon.
    3628  ngon_fi[]
    3629  An array of N distinct ON_Mesh.m_F[] face indices
    3630  The outer boundary of this group of faces should
    3631  be the list of vertices passes as ngon_vi[]
    3632  Returns:
    3633  index of the new n-gon.
    3634  -1: If input information is not valid.
    3635  */
    3636  int AddNgon(
    3637  unsigned int Vcount,
    3638  const unsigned int* ngon_vi,
    3639  unsigned int Fcount,
    3640  const unsigned int* ngon_fi
    3641  );
    3642 
    3643  bool ModifyNgon(
    3644  unsigned int ngon_index,
    3645  unsigned int Vcount,
    3646  const unsigned int* ngon_vi,
    3647  unsigned int Fcount,
    3648  const unsigned int* ngon_fi
    3649  );
    3650 
    3651  bool ModifyNgon(
    3652  unsigned int ngon_index,
    3653  const ON_MeshNgon* ngon
    3654  );
    3655 
    3656  /*
    3657  Description:
    3658  Insert an n-gon in the ngon list. This is generally
    3659  slow. Use AddNgon or ModifyNgon.
    3660  */
    3661  bool InsertNgon(
    3662  unsigned int ngon_index,
    3663  const ON_MeshNgon* ngon
    3664  );
    3665 
    3666  /*
    3667  Returns:
    3668  Average of the n-gon vertex locations.
    3669  */
    3670  ON_3dPoint NgonCenter(
    3671  unsigned int ngon_index
    3672  ) const;
    3673 
    3674  /*
    3675  Returns:
    3676  Average of the n-gon vertex locations.
    3677  */
    3678  ON_3dPoint NgonCenter(
    3679  const ON_MeshNgon* ngon
    3680  ) const;
    3681 
    3682  /*
    3683  Returns:
    3684  Bounding box of the n-gon vertex locations.
    3685  */
    3686  ON_BoundingBox NgonBoundaryBoundingBox(
    3687  unsigned int ngon_index
    3688  ) const;
    3689 
    3690  /*
    3691  Returns:
    3692  Bounding box of the n-gon vertex locations.
    3693  */
    3694  ON_BoundingBox NgonBoundaryBoundingBox(
    3695  const ON_MeshNgon* ngon
    3696  ) const;
    3697 
    3698  /*
    3699  Parameters:
    3700  ngon - [in]
    3701  bAppendStartPoint - [in]
    3702  If true, the initial point in the boundary will be added
    3703  as the first point of ngon_boundary_points[] and then
    3704  added again as the last point of ngon_boundary_points[].
    3705  This is useful when you need a closed polyline.
    3706  ngon_boundary_points - [out]
    3707  An array of ngon->m_Vcount + (bAppendStartPoint ? 1 : 0)
    3708  points.
    3709  Returns:
    3710  Number of points added to ngon_boundary_points[] or 0 if invalid
    3711  input is encountered.
    3712  */
    3713  unsigned int GetNgonBoundaryPoints(
    3714  const ON_MeshNgon* ngon,
    3715  bool bAppendStartPoint,
    3716  ON_SimpleArray<ON_3dPoint>& ngon_boundary_points
    3717  ) const;
    3718 
    3719  /*
    3720  Parameters:
    3721  ngon - [in]
    3722  bAppendStartPoint - [in]
    3723  If true, the initial point in the boundary will be added
    3724  as the first point of ngon_boundary_points[] and then
    3725  added again as the last point of ngon_boundary_points[].
    3726  This is useful when you need a closed polyline.
    3727  ngon_boundary_points - [out]
    3728  An array of ngon->m_Vcount + (bAppendStartPoint ? 1 : 0) points
    3729  is returned in ngon_boundary_points[]. The caller must insure
    3730  that ngon_boundary_points[] has room for this many elements.
    3731  Returns:
    3732  Number of points added to ngon_boundary_points[] or 0 if invalid
    3733  input is encountered.
    3734  */
    3735  unsigned int GetNgonBoundaryPoints(
    3736  const ON_MeshNgon* ngon,
    3737  bool bAppendStartPoint,
    3738  ON_3dPoint* ngon_boundary_points
    3739  ) const;
    3740 
    3741  /*
    3742  Description:
    3743  If the mesh has ngons with ON_MeshNgon.Orientation() = -1,
    3744  the reverse the ngon's boundary orientation.
    3745  Parameters:
    3746  bPermitHoles - [in]
    3747  ngons may contain holes.
    3748  Returns:
    3749  True if all non-empty ngons have ON_MeshNgon.Orientation()=1 after the call.
    3750  */
    3751  bool OrientNgons(
    3752  bool bPermitHoles
    3753  );
    3754 
    3755  /*
    3756  Description:
    3757  Remove an n-gon.
    3758  Parameters:
    3759  ngon_index - [in]
    3760  Returns:
    3761  True if ngon_index was valid and the corresponding n-gon was removed.
    3762  Remarks:
    3763  The mesh triangles that make up the n-gon are not deleted.
    3764  */
    3765  bool RemoveNgon(
    3766  unsigned int ngon_index
    3767  );
    3768 
    3769  unsigned int RemoveNgons(
    3770  unsigned int ngon_index_count,
    3771  const unsigned int* ngon_index_list
    3772  );
    3773 
    3774  /*
    3775  Description:
    3776  Remove null and empty entries from the ON_Mesh n-gon list.
    3777  */
    3778  void RemoveEmptyNgons();
    3779 
    3780  /*
    3781  Description:
    3782  Remove all entries from the ON_Mesh n-gon list.
    3783  Remarks:
    3784  Same as SetNgonCount(0)
    3785  */
    3786  void RemoveAllNgons();
    3787 
    3788  /*
    3789  Description:
    3790  Set the n-gon count. Null n-gons are be appended
    3791  when ngon_count > current count. Existing n-gons are
    3792  removed when ngon_count < current count.
    3793  Parameters:
    3794  ngon_count - [in]
    3795  Number of n-gons to have.
    3796  0: removes all ngons.
    3797  Remarks:
    3798  The mesh triangles that make up any removed n-gons are not deleted.
    3799  */
    3800  void SetNgonCount(
    3801  unsigned int ngon_count
    3802  );
    3803 
    3804  /*
    3805  Parameters:
    3806  face_index - [in]
    3807  Mesh face ON_Mesh.m_F[] index.
    3808  Returns:
    3809  ON_UNSET_UINT_INDEX:
    3810  The face is not part of an n-gon.
    3811  Otherwise:
    3812  Index of the n-gon the face is part of.
    3813  */
    3814  unsigned int NgonIndexFromFaceIndex(
    3815  unsigned int face_index
    3816  ) const;
    3817 
    3818  /*
    3819  Returns:
    3820  null:
    3821  The ngonMap does not exist.
    3822  an array of length m_F.Count():
    3823  The value of the i-th element is either the index of the n-gon
    3824  the mesh face m_F[i] belongs to or ON_UNSET_UINT_INDEX when
    3825  m_F[i] does not belong to an n-gon.
    3826  */
    3827  const unsigned int* NgonMap() const;
    3828 
    3829  const unsigned int* NgonMap(
    3830  bool bCreateIfMissing
    3831  );
    3832 
    3833  /*
    3834  Returns:
    3835  true if the n-gon information is valid for adding an n-gon to this mesh.
    3836  Parameters:
    3837  Vcount - [in]
    3838  Number of vertices and sides in the n-gon.
    3839  ngon_vi - [in]
    3840  */
    3841  bool IsValidNewNgonInformation(
    3842  unsigned int Vcount,
    3843  const unsigned int* ngon_vi,
    3844  unsigned int Fcount,
    3845  const unsigned int* ngon_fi
    3846  ) const;
    3847 
    3848  /*
    3849  Description:
    3850  For each set of coplanar connected faces in the mesh that
    3851  qualifies as an n-gon, an new ON_MeshNgon will be appended
    3852  to the Ngons[] array. Faces belonging to existing ngons are
    3853  ignored.
    3854  Parameters:
    3855  vertex_face_map - [in]
    3856  - Pass null if you don't have one.
    3857  - See ON_MeshVertexFaceMap for details about making one.
    3858  The only reason to pass one in is because you
    3859  need it for other reasons or you already have one.
    3860  planar_tolerance - [in]
    3861  For faces to be coplanar, all the points in the
    3862  n-gon must be withing planar_tolerance of the plane
    3863  defined by the first face in the n-gon.
    3864  minimum_ngon_vertex_count - [in]
    3865  n-gons must have at least this many sides in order
    3866  to be added.
    3867  minimum_ngon_face_count - [in]
    3868  n-gons must have at least this many faces in order to
    3869  be added.
    3870  bAllowHoles - [in]
    3871  If true, then the added ngons are permitted to have holes.
    3872  bSeparateNgons - [in]
    3873  If true, any face belonging to a new ngon, will not
    3874  share vertices with a face that does not belong to that
    3875  ngon and the vertex normals for all vertices in an ngon will
    3876  be set to the plane's normal.
    3877  bSetNgonVertexNormals - [in]
    3878  If bSeparateNgons and bSetNgonVertexNormals are both true,
    3879  then all vertex normals vertices in a new ngon will be
    3880  set to the ngon's plane normal.
    3881  bRemoveNgonInteriorPoints - [in]
    3882  If true, the new ngons will not have interior vertices.
    3883  This will result in the ngon being retriangluated
    3884  when connected coplanar faces
    3885  Returns:
    3886  The number of new n-gons appended to m_Ngons[]
    3887  */
    3888  unsigned int AddPlanarNgons(
    3889  const unsigned int *const* vertex_face_map,
    3890  double planar_tolerance,
    3891  unsigned int minimum_ngon_vertex_count,
    3892  unsigned int minimum_ngon_face_count,
    3893  bool bAllowHoles
    3894  );
    3895 
    3896  /*
    3897  Description:
    3898  For each ngon with index in the specified range,
    3899  duplicate vertices as needed so that the ngon
    3900  does not share any vertices with faces that do not
    3901  belong to the ngon.
    3902  Parameters:
    3903  vertex_face_map - [in]
    3904  - Pass null if you don't have one.
    3905  - See ON_MeshVertexFaceMap for details about making one.
    3906  The only reason to pass one in is because you
    3907  need it for other reasons or you already have one.
    3908  - Note that if true is returned, then the information
    3909  in this vertex_face_map will be changed and no
    3910  information will be added for the new vertices.
    3911  ngon_index0 - [in]
    3912  ngon_index1 - [in]
    3913  ngons with indices ni satisfying
    3914  ngon_index0 <= ni < ngon_index1 will be separated.
    3915  To separate every ngon in a mesh, pass
    3916  ngon_index0 = 0 and ngon_index1 = mesh->NgonCount().
    3917  Returns:
    3918  true
    3919  one or more vertices were duplicated to separate an ngon
    3920  from it's neighboring faces. This changes the mesh's
    3921  vertex and face information and invalidates any input
    3922  vertex_face_map.
    3923  false
    3924  The mesh was not modified.
    3925  */
    3926  bool SeparateNgons(
    3927  unsigned int** vertex_face_map,
    3928  unsigned int ngon_index0,
    3929  unsigned int ngon_index1
    3930  );
    3931 
    3932  /*
    3933  Description:
    3934  For each ngon with index in the specified range,
    3935  all vertices in the ngon will have their vertex normal
    3936  set to the normal of the first face in the ngon.
    3937  Parameters:
    3938  ngon_index0 - [in]
    3939  ngon_index1 - [in]
    3940  ngons with indices ni satisfying
    3941  ngon_index0 <= ni < ngon_index1 will be separated.
    3942  To separate every ngon in a mesh, pass
    3943  ngon_index0 = 0 and ngon_index1 = mesh->NgonCount().
    3944  Returns:
    3945  true
    3946  one or more vertices were duplicated to separate an ngon
    3947  from it's neighboring faces. This changes the mesh's
    3948  vertex and face information and invalidates any input
    3949  vertex_face_map.
    3950  false
    3951  The mesh was not modified.
    3952  */
    3953  bool SetNgonVertexNormals(
    3954  unsigned int ngon_index0,
    3955  unsigned int ngon_index1
    3956  );
    3957 
    3958  /*
    3959  Description:
    3960  For each ngon with index in the specified range that has
    3961  interior vertices, remove the interior vertices and
    3962  triangluate the ngon.
    3963  Parameters:
    3964  vertex_face_map - [in]
    3965  - Pass null if you don't have one.
    3966  - See ON_MeshVertexFaceMap for details about making one.
    3967  The only reason to pass one in is because you
    3968  need it for other reasons or you already have one.
    3969  - If true is returned, then the information
    3970  in this vertex_face_map will be invalid because
    3971  vertices will be removed.
    3972  ngon_index0 - [in]
    3973  ngon_index1 - [in]
    3974  ngons with indices ni satisfying
    3975  ngon_index0 <= ni < ngon_index1 will be separated.
    3976  To separate every ngon in a mesh, pass
    3977  ngon_index0 = 0 and ngon_index1 = mesh->NgonCount().
    3978  Returns:
    3979  true
    3980  one or more vertices were removed and one or more ngons
    3981  were triangluated. This changes the mesh's vertex and face
    3982  information and invalidates any input vertex_face_map.
    3983  false
    3984  The mesh was not modified.
    3985  Remarks:
    3986  If true is returned and you are finished modify the mesh, then
    3987  call ON_Mesh::Compact() or ON_Mesh::CullUnusedVertices() to remove
    3988  the unreferenced interior vertices.
    3989  */
    3990  bool RemoveNgonInteriorVertices(
    3991  const unsigned int *const* vertex_face_map,
    3992  unsigned int ngon_index0,
    3993  unsigned int ngon_index1
    3994  );
    3995 
    3996  /*
    3997  Descrption:
    3998  Given a group of connected coplanar faces,
    3999  find the n-gon boundary.
    4000  ngon_fi_count - [in]
    4001  number of indices in ngon_fi[]
    4002  ngon_fi - [in]
    4003  Indices of faces in the ON_Mesh.m_F[] array.
    4004  ngon_vi - [out]
    4005  An ordered list of indices of vertices in the ON_Mesh.m_V[]
    4006  array that for the outer boundary of the n-gon. The natural
    4007  counter-clockwise orientation of the first face with a
    4008  boundary edge determines the order of the ngon_vi[] list.
    4009  */
    4010  unsigned int GetNgonOuterBoundary(
    4011  unsigned int ngon_fi_count,
    4012  const unsigned int* ngon_fi,
    4014  ) const;
    4015 
    4016  /*
    4017  Description:
    4018  An expert user function that allocates an ngon from heap
    4019  memory managed by this ON_Mesh.
    4020  Parameters:
    4021  N - [in] (>= 3)
    4022  Fcount - [in]
    4023  Returns:
    4024  A pointer to an uninitialized ngon.
    4025  Use the ON_Mesh::AddNgon(ngon) to add this ngon to the mesh
    4026  or use DeallocateNgon(ngon) to deallocate the ngon.
    4027  */
    4028  ON_MeshNgon* AllocateNgon(
    4029  unsigned int Vcount,
    4030  unsigned int Fcount
    4031  );
    4032 
    4033  /*
    4034  Description:
    4035  An expert user function that deallocates an ngon
    4036  that was created by AllocateNgon().
    4037  Parameters:
    4038  ngon - [in]
    4039  */
    4040  bool DeallocateNgon(
    4041  ON_MeshNgon* ngon
    4042  );
    4043 
    4044  /*
    4045  Description:
    4046  An expert user function that unconditionally appends the ngon
    4047  pointer to ON_Mesh.m_Ngon[].
    4048  Parameters:
    4049  ngon - [in]
    4050  Returns:
    4051  ON_UNSET_UINT_INDEX: invalid input
    4052  < ON_UNSET_UINT_INDEX: index of the new n-gon.
    4053  */
    4054  unsigned int AddNgon(
    4055  ON_MeshNgon* ngon
    4056  );
    4057 
    4058  /*
    4059  Description:
    4060  Expert user function to update n-gon map after the expert user
    4061  does something to make the current one invalid.
    4062  Returns:
    4063  null:
    4064  The mesh does not have ngon-information.
    4065  an array of length m_F.Count() ngon_map[]
    4066  - If ngon_map[fi] >= 0, then ON_MeshFace.m_F[fi] belongs
    4067  to ON_Mesh.Ngon(ngon_map[fi]).
    4068  - Otherwise, ngon_map[fi] = -1.
    4069  */
    4070  const unsigned int* CreateNgonMap();
    4071 
    4072 
    4073  /*
    4074  Description:
    4075  Expert user function to delete n-gon map information
    4076  but leave n-gon definition information unchanged.
    4077  Description:
    4078  Removes any existing n-gon map.
    4079  Does not remove other n-gon information.
    4080  */
    4081  void RemoveNgonMap();
    4082 
    4083  ////////////////////////////////////////////////////////////////////////
    4084  //
    4085  // N-gon implementation
    4086  //
    4087 
    4088  // If ON_Mesh::HasNgons() is true, then the mesh has n-gons.
    4089  // When a mesh has ngons, m_NgonMap[] is used to determine when
    4090  // a face belongs to an n-gon.
    4091  // If m_NgonMap[fi] >= 0, then it is the index of the ngon m_F[]
    4092  // belongs to. Otherwise, m_Fngon[fi] is -1.
    4093  ON_SimpleArray<unsigned int> m_NgonMap; // invalid if m_NgonMap.Count() != m_F.Count()
    4095  ON_MeshNgonAllocator m_NgonAllocator; // use this to allocate elements added to m_Ngon;
    4096 
    4097  ////////////////////////////////////////////////////////////////////////
    4098  //
    4099  // Vertex and Face normal implementation
    4100  //
    4101 
    4102  // m_N[] OPTIONAL vertex unit normals
    4103  // If m_N[] is empty or m_N.Count() != m_V.Count(),
    4104  // Either m_N[] has zero count or it m_N[j] is the
    4105  // the unit vertex normal at m_V[j].
    4107 
    4108  // m_FN[] OPTIONAL face unit normals
    4109  // If m_FN[] is empty or m_FN.Count() != m_F.Count(),
    4110  // then m_FN is ignored. Otherwise m_FN[j] is the
    4111  // unit normal for the facet m_F[j].
    4113 
    4114  /////////////////////////////////////////////////////////////////
    4115  // Implementation - texture coordinates
    4116  //
    4117  // OPTIONAL texture coordinates for each vertex
    4118 
    4119  // It would be nice if this were an ON_TextureCoordinates,
    4120  // but that breaks lots of checked out code that assumes
    4121  // m_T is an array of ON_2fPoints.
    4122  ON_MappingTag m_Ttag; // OPTIONAL tag for values in m_T[]
    4123  ON_2fPointArray m_T; // OPTIONAL texture coordinates for each vertex
    4124 
    4125  // RUNTIME ONLY
    4126  // This array is used to cache texture coordinates used by
    4127  // rendering applications that require 1d texture coordinates,
    4128  // 3d texture coordinates, or multiple sets of texture
    4129  // coordinates (e.g. blended textures with different mappings).
    4130  // Users are responsible for verifying
    4131  // m_TC[i].m_T.Count() = m_V.Count()
    4133 
    4134  // If m_T.Count() == m_V.Count(), then the mesh has texture coordinates
    4135  // and m_T[j] is the texture coordinate for vertex m_V[j].
    4136  //
    4137  // When opennurbs or Rhino meshes an ON_Surface or ON_Brep, the texture
    4138  // coordinates have a "canonical" linear relationship with the surface
    4139  // parameters that is described in the next section. However, various
    4140  // mappings, spherical, planar, cylindrical, etc., can be applied that
    4141  // change the values of the texture coordinates.
    4142  //
    4143  // If a texture mapping function was used to set the m_T[] values,
    4144  // then the id and serial number of the mapping function is saved
    4145  // in m_mapping_id and m_mapping_sn. The intended use of these fields
    4146  // is to make it easy to avoid unnecessary recalculation.
    4147  // If a mesh is modified, then m_mapping_id should be set to nil
    4148  // and m_mapping_crc should be set to 0.
    4149  //
    4150  /////////////////////////////////////////////////////////////////
    4151 
    4152 
    4153  /////////////////////////////////////////////////////////////////
    4154  // Implementation - surface parameters and packed texture
    4155  // information
    4156  //
    4157  // If m_S.Count() == m_V.Count(), then the mesh is a tesselation
    4158  // of a parameteric surface and m_S[j] is the surface parameter at
    4159  // m_V[j]. Storing values in m_S[] is OPTIONAL.
    4160  //
    4161  // If m_srf_scale[] has positive values, then they report
    4162  // the world coordinate size of a rectangle that would
    4163  // minimize texture distortion if it were mapped to the
    4164  // mesh using normalized surface evaluation parameters.
    4165  // This information is used to calculate high quality
    4166  // packed texture coordinates.
    4168  ON_Interval m_srf_domain[2]; // surface evaluation domain.
    4169  double m_srf_scale[2];
    4170 
    4171 
    4172  // Packed texture information.
    4173  //
    4174  // If either of the m_packed_tex_domain[] intervals is a
    4175  // proper subinterval of (0,1), then a texture packing
    4176  // calculation assigned this subrectangle to this mesh.
    4177 
    4178  ON_Interval m_packed_tex_domain[2];
    4179 
    4180  // The m_packed_tex_rotate setting is valid only when
    4181  // m_S, m_srf_domain, m_packed_scale[] and
    4182  // m_packed_tex_domain[] are all valid and the texture
    4183  // coordinates are based on surface evaluation parameters.
    4184  // In this special situation, this boolean records the
    4185  // correspondence between the the surface parameters, (u,v),
    4186  // and the packed texture coordinates, (s,t),
    4187  //
    4188  // m_packed_tex_rotate = false:
    4189  // a = m_srf_domain[0].NormalizedParameterAt(u);
    4190  // b = m_srf_domain[1].NormalizedParameterAt(v);
    4191  // s = m_packed_tex_domain[0].ParameterAt(a);
    4192  // t = m_packed_tex_domain[1].ParameterAt(b);
    4193  //
    4194  // x = m_packed_tex_domain[0].NormalizedParameterAt(s);
    4195  // y = m_packed_tex_domain[1].NormalizedParameterAt(t);
    4196  // u = m_srf_domain[0].ParameterAt(x);
    4197  // v = m_srf_domain[1].ParameterAt(y);
    4198  //
    4199  // m_packed_tex_rotate = true:
    4200  // a = m_srf_domain[0].NormalizedParameterAt(u);
    4201  // b = m_srf_domain[1].NormalizedParameterAt(v);
    4202  // s = m_packed_tex_domain[0].ParameterAt(a);
    4203  // t = m_packed_tex_domain[1].ParameterAt(1.0-b);
    4204  //
    4205  // x = m_packed_tex_domain[0].NormalizedParameterAt(s);
    4206  // y = m_packed_tex_domain[1].NormalizedParameterAt(t);
    4207  // u = m_srf_domain[0].ParameterAt(y);
    4208  // v = m_srf_domain[1].ParameterAt(1.0 - x);
    4210 
    4211  /*
    4212  Returns:
    4213  True if the m_srf_scale[] values are positive and
    4214  the m_packed_tex_domain[] intervals are set to values
    4215  that describe a proper subrectangle of (0,1)x(0,1).
    4216  True does not necessarily mean the current values in
    4217  m_T[] are packed texture coordinates.
    4218  */
    4219  bool HasPackedTextureRegion() const;
    4220 
    4221  /*
    4222  Description:
    4223  If the mesh does not have surface evaulation parameters,
    4224  has texture coordinates, and the surface parameters can
    4225  be set in a way so the existing texture coordinates can
    4226  be computed from the surface parameters, then this function
    4227  sets the surface parameters. This is useful when meshes
    4228  that have texture coordinates and do not have surface
    4229  parameters want ot set the surface parameters in a way
    4230  so that the texture mapping
    4231  ON_TextureMapping::SurfaceParameterTextureMapping
    4232  will restore the texture coordinates.
    4233  Returns:
    4234  true - successful
    4235  false - failure - no changes made to the mesh.
    4236  */
    4237  bool SetSurfaceParamtersFromTextureCoodinates();
    4238 
    4239 
    4240  /////////////////////////////////////////////////////////////////
    4241  // Implementation - curvature
    4242 
    4243  ON_SimpleArray<ON_SurfaceCurvature> m_K; // OPTIONAL surface curvatures
    4244  // Either m_K[] has zero count or it has the same
    4245  // count as m_V[], in which case m_K[j] reports
    4246  // the surface curvatures at m_V[j].
    4247 
    4248  /////////////////////////////////////////////////////////////////
    4249  // Implementation - false color
    4250  ON_MappingTag m_Ctag; // OPTIONAL tag for values in m_C[]
    4251  ON_SimpleArray<ON_Color> m_C; // OPTIONAL vertex color
    4252  // Either m_C[] has zero count or it has the same
    4253  // count as m_V[], in which case m_C[j] reports
    4254  // the color assigned to m_V[j].
    4255 
    4256  /////////////////////////////////////////////////////////////////
    4257  // Implementation - runtime vertex visibility - not saved in 3dm files.
    4258  ON_SimpleArray<bool> m_H; // OPTIONAL vertex visibility.
    4259  // If m_H.Count() = m_V.Count(), then
    4260  // m_H[vi] is true if the vertex m_V[vi]
    4261  // is hidden. Otherwise, all vertices are visible.
    4262  int m_hidden_count; // number of vertices that are hidden
    4263  // = number of true values in m_H[] array.
    4264 
    4265  /////////////////////////////////////////////////////////////////
    4266  // Implementation - runtime UI information
    4267  const ON_Object* m_parent; // runtime parent geometry (use ...::Cast() to get it)
    4268 
    4269 protected:
    4270 
    4271  /////////////////////////////////////////////////////////////////
    4272  // Implementation - mesh topology
    4274 
    4275  ON_MeshParameters* m_mesh_parameters; // If mesh was created from a parametric surface,
    4276  // these parameters were used to create the mesh.
    4280 
    4281 private:
    4282  char m_mesh_is_closed; // 0 = unset, 1 = all edges have 2 or more faces, 2 = at least one boundary edge
    4283  char m_mesh_is_manifold; // 0 = unset, 1 = all edges have 1 or 2 faces, 2 = not manifold
    4284  char m_mesh_is_oriented; // 0 = unset, 1 = faces normals agree across all edges that have 2 faces, 2 = not oriented
    4285  char m_mesh_is_solid; // 0 = unset, 1 = solid with outward face normals, 2 = solid with inward face normals, 3 = not solid
    4286 
    4287 private:
    4288  mutable ON_BoundingBox m_vertex_bbox = ON_BoundingBox::UnsetBoundingBox;
    4289 
    4290 protected:
    4291  float m_nbox[2][3]; // 3d bounding box of all referenced unit normals
    4292  // (for estimation of Gauss map bounds)
    4293  float m_tbox[2][2]; // 2d bounding box of all referenced texture coordinates
    4294 
    4295 private:
    4296  // m_vertex_bbox = bounding box of vertex locations
    4297 
    4298  // cache of recently used tight bounding boxes
    4299  mutable ON_BoundingBoxCache m_tight_bbox_cache;
    4300 
    4301 protected:
    4302 
    4303  ON_MeshCurvatureStats* m_kstat[4]; // gaussian,mean,min,max,sectionx,sectiony,sectionz
    4304 
    4305  // sub-mesh information rendering large meshes
    4307 
    4308 
    4309 private:
    4310  bool Write_1( ON_BinaryArchive& ) const; // uncompressed 1.x format
    4311  bool Write_2( int, ON_BinaryArchive& ) const; // compressed 2.x format
    4312  bool Read_1( ON_BinaryArchive& );
    4313  bool Read_2( int, ON_BinaryArchive& );
    4314  bool WriteFaceArray( int, int, ON_BinaryArchive& ) const;
    4315  bool ReadFaceArray( int, int, ON_BinaryArchive& );
    4316  bool SwapEdge_Helper( int, bool );
    4317 };
    4318 
    4319 //////////////////////////////////////////////////////////////////////////
    4320 //
    4321 // ON_MeshCache
    4322 //
    4323 class ON_CLASS ON_MeshCache
    4324 {
    4325 public:
    4326  static const ON_MeshCache Empty;
    4327 
    4328  static const ON_UUID RenderMeshId;
    4329  static const ON_UUID AnalysisMeshId;
    4330  static const ON_UUID PreviewMeshId;
    4331  static const ON_UUID AnyMeshId;
    4332 
    4333  // Cached mesh with the fewest faces
    4334  static const ON_UUID CoarseMeshId;
    4335 
    4336  // Cached mesh with the most faces
    4337  static const ON_UUID FineMeshId;
    4338 
    4339  /*
    4340  Returns:
    4341  The id that corresonds to the obsolete ON::mesh_type enum value.
    4342  Remarks:
    4343  Ids are used to allow custom meshes to be cached.
    4344  */
    4345  static ON_UUID MeshIdFromMeshType(
    4346  ON::mesh_type mesh_type
    4347  );
    4348 
    4349 public:
    4350  ON_MeshCache() = default;
    4351  ~ON_MeshCache();
    4352  ON_MeshCache( const ON_MeshCache& src );
    4353  ON_MeshCache& operator=( const ON_MeshCache& src );
    4354 
    4355 #if defined(ON_HAS_RVALUEREF)
    4356  // rvalue copy constructor
    4357  ON_MeshCache( ON_MeshCache&& ) ON_NOEXCEPT;
    4358 
    4359  ON_MeshCache& operator=( ON_MeshCache&& );
    4360 #endif
    4361 
    4362 public:
    4363 
    4364  /*
    4365  Parameters:
    4366  mesh_id - [in]
    4367  mesh_id cannot be nil or ON_MeshCache::AnyMeshId.
    4368  */
    4369  void SetMesh(
    4370  ON_UUID mesh_id,
    4371  const std::shared_ptr<ON_Mesh>& mesh_sp
    4372  );
    4373  void SetMesh(
    4374  ON::mesh_type mesh_type,
    4375  const std::shared_ptr<ON_Mesh>& mesh_sp
    4376  );
    4377 
    4378  /*
    4379  Parameters:
    4380  mesh_id - [in]
    4381  If mesh_id is ON_MeshCache::AnyMeshId, then every cached mesh
    4382  will be deleted.
    4383  */
    4384  void ClearMesh(
    4385  ON_UUID mesh_id
    4386  );
    4387  void ClearMesh(
    4388  ON::mesh_type mesh_type
    4389  );
    4390 
    4391  void ClearAllMeshes();
    4392 
    4393  /*
    4394  Parameters:
    4395  bDeleteMesh - [in]
    4396  true
    4397  ON_Mesh will be deleted.
    4398  false
    4399  ON_Mesh will not be deleted. This is typically done when the
    4400  mesh was in the process of being created in a separate thread
    4401  and memory pool, both of which were killed and the pointer
    4402  to the mesh is no longer valid.
    4403  */
    4404  void ClearMesh(
    4405  ON_UUID mesh_id,
    4406  bool bDeleteMesh
    4407  );
    4408 
    4409  /*
    4410  Parameters:
    4411  bDeleteMesh - [in]
    4412  true
    4413  ON_Mesh will be deleted.
    4414  false
    4415  ON_Mesh will not be deleted. This is typically done when the
    4416  mesh was in the process of being created in a separate thread
    4417  and memory pool, both of which were killed and the pointer
    4418  to the mesh is no longer valid.
    4419  */
    4420  void ClearMesh(
    4421  ON::mesh_type mesh_type,
    4422  bool bDeleteMesh
    4423  );
    4424 
    4425 
    4426  /*
    4427  Parameters:
    4428  bDeleteMeshes - [in]
    4429  true
    4430  ON_Mesh will be deleted.
    4431  false
    4432  ON_Mesh will not be deleted. This is typically done when the
    4433  mesh was in the process of being created in a separate thread
    4434  and memory pool, both of which were killed and the pointer
    4435  to the mesh is no longer valid.
    4436  */
    4437  void ClearAllMeshes(
    4438  bool bDeleteMeshes
    4439  );
    4440 
    4441  /*
    4442  Parameters:
    4443  mesh_id - [in]
    4444  If mesh_id is ON_MeshCache::AnyMeshId, then the most recently cached mesh is returned.
    4445  */
    4446  const ON_Mesh* Mesh(
    4447  ON_UUID mesh_id
    4448  ) const;
    4449  const ON_Mesh* Mesh(
    4450  ON::mesh_type mesh_type
    4451  ) const;
    4452 
    4453 
    4454  /*
    4455  Parameters:
    4456  mesh_id - [in]
    4457  If mesh_id is ON_MeshCache::AnyMeshId, then the most recently cached mesh is returned.
    4458  */
    4459  std::shared_ptr<ON_Mesh> MeshSharedPtr(
    4460  ON_UUID mesh_id
    4461  ) const;
    4462 
    4463  std::shared_ptr<ON_Mesh> MeshSharedPtr(
    4464  ON::mesh_type mesh_type
    4465  ) const;
    4466 
    4467  unsigned int MeshCount() const;
    4468 
    4469  bool Write(
    4470  ON_BinaryArchive& archive
    4471  ) const;
    4472 
    4473  bool Read(
    4474  ON_BinaryArchive& archive
    4475  );
    4476 
    4477  void Dump(
    4478  ON_TextLog& text_log
    4479  ) const;
    4480 
    4481  bool Transform(
    4482  const ON_Xform& xform
    4483  );
    4484 
    4485 private:
    4486  void Internal_CopyHelper(
    4487  const class ON_MeshCacheItem* src_item_list
    4488  );
    4489 
    4490  class ON_MeshCacheItem* Internal_FindHelper(
    4491  ON_UUID mesh_type
    4492  ) const;
    4493 
    4494  class ON_MeshCacheItem* Internal_CreateItem();
    4495  class ON_MeshCacheItem* Internal_CopyItem(const class ON_MeshCacheItem& src_item);
    4496 
    4497  void Internal_DeleteItem(class ON_MeshCacheItem*,bool bDeleteMesh);
    4498 
    4499  class ON_MeshCacheItem* m_impl = nullptr;
    4500 };
    4501 
    4502 class ON_CLASS ON_MeshNgonIterator
    4503 {
    4504 public:
    4505 
    4507 
    4508  ON_MeshNgonIterator() = default;
    4509  ~ON_MeshNgonIterator() = default;
    4510 
    4512  const ON_MeshNgonIterator& src
    4513  );
    4514 
    4515  ON_MeshNgonIterator& operator=(
    4516  const ON_MeshNgonIterator& src
    4517  );
    4518 
    4519 
    4520  /*
    4521  Parameters:
    4522  mesh - [in]
    4523  If the mesh has explicit ngons, then mesh->NgonMap() must
    4524  return true;
    4525  */
    4527  const class ON_Mesh* mesh
    4528  );
    4529 
    4530  /*
    4531  Parameters:
    4532  mesh - [in]
    4533  If the mesh has explicit ngons,
    4534  meshfdex_to_meshngondex_map - [in]
    4535  It's generally best to pass the value of mesh->NgonMap(true).
    4536  Expert users can specify a custom map if required.
    4537  */
    4538  void SetMesh(
    4539  const class ON_Mesh* mesh,
    4540  const unsigned int* meshfdex_to_meshngondex_map
    4541  );
    4542 
    4543  /*
    4544  Returns:
    4545  The mesh being iterated.
    4546  */
    4547  const ON_Mesh* Mesh() const;
    4548 
    4549  /*
    4550  Description:
    4551  Returns the first ngon.
    4552  Returns:
    4553  The first ngon when iterating through the mesh
    4554  triangles, quads and explicitly defined ngons.
    4555  Remarks:
    4556  If CurrentNgonIsMeshFace() is true after calling FirstNgon().
    4557  the the returned ngon references a triangle or
    4558  quad that is not part of an explicitly defined
    4559  ngon in the mesh. If you need the information
    4560  to persist after any subsequent calls to the iterator
    4561  or after the destruction of the iterator, then
    4562  you must make and manage a copy of the ngon.
    4563  */
    4564  const class ON_MeshNgon* FirstNgon();
    4565 
    4566  /*
    4567  Description:
    4568  Increments the iterator and returns the next ngon.
    4569  Returns:
    4570  The next ngon when iterating through the mesh
    4571  triangles, quads and explicitly defined ngons.
    4572  Remarks:
    4573  If CurrentNgonIsMeshFace() is true after calling NextNgon().
    4574  the the returned ngon references a triangle or
    4575  quad that is not part of an explicitly defined
    4576  ngon in the mesh. If you need the information
    4577  to persist after any subsequent calls to the iterator
    4578  or after the destruction of the iterator, then
    4579  you must make and manage a copy of the ngon.
    4580  */
    4581  const class ON_MeshNgon* NextNgon();
    4582 
    4583  /*
    4584  Description:
    4585  Get the ngon most recently returned by FirstNgon()
    4586  or NextNgon().
    4587  Returns:
    4588  Returns the ngon most recently returned by FirstNgon()
    4589  or NextNgon().
    4590  Remarks:
    4591  If CurrentNgonIsMeshFace() is true after calling CurrentNgon().
    4592  the the returned ngon references a triangle or
    4593  quad that is not part of an explicitly defined
    4594  ngon in the mesh. If you need the information
    4595  to persist after any subsequent calls to the iterator
    4596  or after the destruction of the iterator, then
    4597  you must make and manage a copy of the ngon.
    4598  */
    4599  const class ON_MeshNgon* CurrentNgon();
    4600 
    4601  ON_COMPONENT_INDEX CurrentNgonComponentIndex() const;
    4602  /*
    4603  Returns:
    4604  If the current iterator ngon references an ON_MeshFace
    4605  that is in m_mesh->m_F[] but is not explictly referenced
    4606  by an ON_MeshNgon in ON_Mesh.m_Ngon[], then true is returned.
    4607  In this case, the ngon's m_fi[] array
    4608  has length 1 and contains the face's index, and the ngon's
    4609  m_vi[] array is a copy of the faces's vi[] array.
    4610  Otherwise false is returned.
    4611  */
    4612  bool CurrentNgonIsMeshFace() const;
    4613 
    4614  /*
    4615  Returns:
    4616  If the current iterator ngon references an ON_MeshNgon
    4617  that is in m_mesh->m_Ngon[], then true is returned.
    4618  Otherwise false is returned.
    4619  */
    4620  bool CurrentNgonIsMeshNgon() const;
    4621 
    4622  /*
    4623  Description:
    4624  Sets the state of the iterator to the initial state that
    4625  exists after construction. This is useful if the iterator
    4626  has been used the get one or more elements and then
    4627  the referenced mesh is modified or code wants
    4628  to begin iteration again a used a call to NextNgon()
    4629  to return the first element.
    4630  */
    4631  void Reset();
    4632 
    4633  /*
    4634  Returns:
    4635  Number of ngons that will be iterated over.
    4636  Remarks:
    4637  The count = explicit ngons + faces that are not in an ngon.
    4638  */
    4639  unsigned int Count() const;
    4640 
    4641 private:
    4642  const class ON_Mesh* m_mesh = nullptr;
    4643  const unsigned int* m_facedex_to_ngondex_map = nullptr;
    4644  ON__UINT_PTR m_current_ngon = 0;
    4645  ON_MeshNgonBuffer m_ngon_buffer;
    4646  ON_COMPONENT_INDEX m_current_ngon_ci = ON_COMPONENT_INDEX::UnsetComponentIndex;
    4647  unsigned int m_mesh_face_count = 0;
    4648  unsigned int m_mesh_ngon_count = 0;
    4649  unsigned int m_iterator_index = 0;
    4650 };
    4651 
    4652 class ON_CLASS ON_MeshComponentRef : public ON_Geometry
    4653 {
    4654  ON_OBJECT_DECLARE(ON_MeshComponentRef);
    4655 public:
    4657 
    4660  const class ON_Mesh* mesh,
    4661  ON_COMPONENT_INDEX ci
    4662  );
    4664  ON_MeshComponentRef& operator=(const ON_MeshComponentRef&);
    4665 
    4666 private:
    4667  // referenced mesh
    4668  const class ON_Mesh* m_mesh;
    4669 
    4670  // component
    4671  ON_COMPONENT_INDEX m_mesh_ci;
    4672 
    4673 public:
    4674  void Set(
    4675  const class ON_Mesh* mesh,
    4676  ON_COMPONENT_INDEX ci
    4677  );
    4678 
    4679  /*
    4680  Returns:
    4681  The referenced mesh.
    4682  */
    4683  const class ON_Mesh* Mesh() const;
    4684 
    4685  /*
    4686  Description:
    4687  Override of the virtual ON_Geometry::ComponentIndex().
    4688  Returns:
    4689  A mesh component index for the face. The type is
    4690  ON_COMPONENT_INDEX::mesh_face and the index is the
    4691  index into the ON_Mesh.m_F[] array.
    4692  */
    4693  ON_COMPONENT_INDEX ComponentIndex() const override;
    4694 
    4695  /*
    4696  Returns:
    4697  If the mesh topology exists or the component references
    4698  a mesh topology component, then this returns a pointer
    4699  to the mesh topology.
    4700  Otherwise null is returned.
    4701  */
    4702  const class ON_MeshTopology* MeshTopology() const;
    4703 
    4704  /*
    4705  Returns:
    4706  If the component is a vertex, this returns the vertex index.
    4707  Otherwise ON_UNSET_UINT_INDEX is returned.
    4708  */
    4709  unsigned int VertexIndex() const;
    4710 
    4711  /*
    4712  Returns:
    4713  If the component is a mesh vertex or mesh topology vertex,
    4714  then this returns the vertex location.
    4715  Otherwise ON_3dPoint::UnsetPoint is returned.
    4716  */
    4717  ON_3dPoint VertexPoint() const;
    4718 
    4719  /*
    4720  Parameters:
    4721  point - [out]
    4722  location of the vertex
    4723  Returns:
    4724  If the component is a vertex, this returns the vertex index.
    4725  Otherwise ON_UNSET_UINT_INDEX is returned.
    4726  */
    4727  unsigned int GetVertexPoint(
    4728  class ON_3dPoint& point
    4729  ) const;
    4730 
    4731  /*
    4732  Returns:
    4733  If the component is a vertex and mesh topology exists or
    4734  the component is a mesh topology vertex, then this returns
    4735  a pointer to the mesh topology vertex index.
    4736  Otherwise null is returned.
    4737  */
    4738  const struct ON_MeshTopologyVertex* MeshTopologyVertex() const;
    4739 
    4740  /*
    4741  Returns:
    4742  If the component is a vertex and mesh topology exists or
    4743  the component is a mesh topology vertex, then this returns
    4744  the mesh topology vertex index.
    4745  Otherwise ON_UNSET_UINT_INDEX is returned.
    4746  */
    4747  unsigned int MeshTopologyVertexIndex() const;
    4748 
    4749  /*
    4750  Returns:
    4751  If the component is a vertex and mesh topology exists or
    4752  the component is a mesh topology vertex, then this returns
    4753  the mesh topology vertex index.
    4754  Otherwise ON_UNSET_UINT_INDEX is returned.
    4755  */
    4756  unsigned int GetMeshTopologyVertexPoint(
    4757  class ON_3dPoint& point
    4758  ) const;
    4759 
    4760  /*
    4761  Returns:
    4762  If the component is a vertex and mesh topology exists or
    4763  the component is a mesh topology vertex, then this returns
    4764  the mesh topology vertex index.
    4765  Otherwise ON_UNSET_UINT_INDEX is returned.
    4766  */
    4767  unsigned int GetMeshTopologyVertex(
    4768  const struct ON_MeshTopologyVertex*& topv
    4769  ) const;
    4770 
    4771  /*
    4772  Returns:
    4773  If the component is a vertex and mesh topology exists or
    4774  the component is a mesh topology vertex, then this returns
    4775  the mesh topology vertex index.
    4776  Otherwise ON_UNSET_UINT_INDEX is returned.
    4777  */
    4778  unsigned int GetMeshTopologyVertexAndPoint(
    4779  const struct ON_MeshTopologyVertex*& topv,
    4780  class ON_3dPoint& point
    4781  ) const;
    4782 
    4783  /*
    4784  Returns:
    4785  If the component is a mesh topology edge, this returns
    4786  the mesh topology edge index.
    4787  Otherwise ON_UNSET_UINT_INDEX is returned.
    4788  */
    4789  unsigned int MeshTopologyEdgeIndex() const;
    4790 
    4791  /*
    4792  Returns:
    4793  If the component is an edge, this returns the edge.
    4794  Otherwise null is returned.
    4795  */
    4796  const struct ON_MeshTopologyEdge* MeshTopologyEdge() const;
    4797 
    4798  unsigned int GetMeshTopologyEdge(
    4799  const struct ON_MeshTopologyEdge*& tope
    4800  ) const;
    4801 
    4802  unsigned int GetMeshTopologyEdgeLine(
    4803  class ON_Line& line
    4804  ) const;
    4805 
    4806  /*
    4807  Parameters:
    4808  line - [out]
    4809  If the component is an edge, the 3d line is returned here.
    4810  Returns:
    4811  If the component is an edge, this returns the edge.
    4812  Otherwise null is returned.
    4813  */
    4814  unsigned int GetMeshTopologyEdgeAndLine(
    4815  const struct ON_MeshTopologyEdge*& tope,
    4816  ON_Line& line
    4817  ) const;
    4818 
    4819  /*
    4820  Returns:
    4821  - If the component references to an ON_MeshNgon in the mesh, then a pointer
    4822  to this ngon is returned.
    4823  - If the component references an ON_MeshFace triangle or quad, then
    4824  then a single face ON_MeshNgon is created in the memory in
    4825  ngon_buffer.
    4826  - Otherwise, null is returned.
    4827  */
    4828  const class ON_MeshNgon* MeshNgon(
    4829  class ON_MeshNgonBuffer& ngon_buffer
    4830  ) const;
    4831 
    4832  /*
    4833  Returns:
    4834  If the component is a face or an ngon containing a single face,
    4835  this returns the face index.
    4836  Otherwise ON_UNSET_UINT_INDEX is returned.
    4837  Remarks:
    4838  The best way to write code that works with triangle, quad
    4839  and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).
    4840  */
    4841  unsigned int MeshFaceIndex() const;
    4842 
    4843  /*
    4844  Returns:
    4845  If the component is a face or an ngon made of a single face,
    4846  this returns the face.
    4847  Otherwise null is returned.
    4848  Remarks:
    4849  The best way to write code that works with triangle, quad
    4850  and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).
    4851  */
    4852  const class ON_MeshFace* MeshFace() const;
    4853 
    4854  /*
    4855  Returns:
    4856  If the component is a face or an ngon made of a single face,
    4857  this returns the face.
    4858  Otherwise null is returned.
    4859  Remarks:
    4860  The best way to write code that works with triangle, quad
    4861  and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).
    4862  */
    4863  unsigned int GetMeshFace(
    4864  const class ON_MeshFace*& mesh_face
    4865  ) const;
    4866 
    4867 
    4868  /*
    4869  Returns:
    4870  If the component is an ngon or a face in an ngon,
    4871  this returns the ngon index.
    4872  Otherwise ON_UNSET_UINT_INDEX is returned.
    4873  Remarks:
    4874  The best way to write code that works with triangle, quad
    4875  and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).
    4876  */
    4877  unsigned int MeshNgonIndex() const;
    4878 
    4879 
    4880  /*
    4881  Returns:
    4882  If the component is an ngon or a face in an ngon, this returns the ngon.
    4883  Otherwise null is returned.
    4884  Remarks:
    4885  The best way to write code that works with triangle, quad
    4886  and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).
    4887  */
    4888  const class ON_MeshNgon* MeshNgon() const;
    4889 
    4890 
    4891  // overrides of virtual ON_Object functions
    4892  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    4893  void Dump( ON_TextLog& ) const override;
    4894  unsigned int SizeOf() const override;
    4895  ON::object_type ObjectType() const override;
    4896 
    4897  // overrides of virtual ON_Geometry functions
    4898  int Dimension() const override;
    4899 
    4900  // virtual ON_Geometry GetBBox override
    4901  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    4902 
    4903  bool Transform(
    4904  const ON_Xform& xform
    4905  ) override;
    4906 };
    4907 
    4908 
    4909 /*
    4910 Description:
    4911  Calculate a mesh representation of the NURBS surface's control polygon.
    4912 Parameters:
    4913  nurbs_surface - [in]
    4914  bCleanMesh - [in] If true, then degenerate quads are cleaned
    4915  up to be triangles. Surfaces with singular
    4916  sides are a common source of degenerate qauds.
    4917  input_mesh - [in] If nullptr, then the returned mesh is created
    4918  by a class to new ON_Mesh(). If not null, then this
    4919  mesh will be used to store the conrol polygon.
    4920 Returns:
    4921  If successful, a pointer to a mesh.
    4922 */
    4923 ON_DECL
    4924 ON_Mesh* ON_ControlPolygonMesh(
    4925  const ON_NurbsSurface& nurbs_surface,
    4926  bool bCleanMesh,
    4927  ON_Mesh* input_mesh = nullptr
    4928  );
    4929 
    4930 
    4931 /*
    4932 Description:
    4933  Finds the unit normal to the triangle
    4934 Parameters:
    4935  A - [in] triangle corner
    4936  B - [in] triangle corner
    4937  C - [in] triangle corner
    4938 Returns:
    4939  Unit normal
    4940 */
    4941 ON_DECL
    4942 ON_3dVector ON_TriangleNormal(
    4943  const ON_3dPoint& A,
    4944  const ON_3dPoint& B,
    4945  const ON_3dPoint& C
    4946  );
    4947 
    4948 
    4949 /*
    4950 Description:
    4951  Finds the unit normal to the triangle
    4952 Parameters:
    4953  A - [in] triangle corner
    4954  B - [in] triangle corner
    4955  C - [in] triangle corner
    4956  a - [out] must not be null
    4957  b - [out] must not be null
    4958  c - [out] must not be null
    4959  d - [out] must not be null
    4960  The equation of the plane is a*x + b*y + c*z + d = 0
    4961  ev_tol - [out]
    4962  If ev_tol is not null, then it is the maximum absolute
    4963  value of the plane equation evaluated at A,B,C. Mathematically,
    4964  ev_tol is zero. Since these computations are performed with
    4965  finite precision doubles, ev_tol is generally not zero.
    4966 Returns:
    4967  Unit normal
    4968 */
    4969 ON_DECL
    4970 bool ON_GetTrianglePlaneEquation(
    4971  const ON_3dPoint& A,
    4972  const ON_3dPoint& B,
    4973  const ON_3dPoint& C,
    4974  double* a,
    4975  double* b,
    4976  double* c,
    4977  double* d,
    4978  double* evaluation_tol
    4979  );
    4980 
    4981 
    4982 #endif
    Definition: opennurbs_point.h:2277
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_MESH_INC_)
    18 #define OPENNURBS_MESH_INC_
    19 
    20 ///////////////////////////////////////////////////////////////////////////////
    21 //
    22 // Class ON_Mesh
    23 //
    24 class ON_CLASS ON_MeshParameters
    25 {
    26  // surface meshing perameters
    27 public:
    28 
    29  // The Rhino legacy mesher is the mesher used in Rhino 1, 2, 3, 4, 5, 6.
    30  // {F15F67AA-4AF9-4B25-A3B8-517CEDDAB134}
    32 
    33  // {EB6F6F3F-F975-4546-9D1C-64E9423BEB7F}
    34  static const ON_UUID PangolinMesherId;
    35 
    36  enum class MESH_STYLE : unsigned char
    37  {
    38  // All of these enum values must be in the range 0-255 because
    39  // unsigned chars are use for storage in some locations.
    40  unset_mesh_style = 0,
    41  render_mesh_fast = 1, // Use ON_MeshParameters::FastRenderMesh
    42  render_mesh_quality = 2, // Use ON_MeshParameters::QualityRenderMesh
    43  // 3 - 8 reserved for future predefined render mesh styles
    44  render_mesh_custom = 9,// Use ON_3dmSettings::m_CustomRenderMeshSettings
    45  render_mesh_per_object = 10 // Use ON_Object::GetMeshParameters().
    46  };
    47 
    48  static ON_MeshParameters::MESH_STYLE MeshStyleFromUnsigned(
    49  unsigned int mesh_style_as_unsigned
    50  );
    51 
    52 
    53  //////////////////////////////////////////////////////////////
    54  //
    55  // The MESH_PARAMETER_ID enum values are used to identify
    56  // mesh creation parameters.
    57  //
    58  enum class MESH_PARAMETER_ID : unsigned int
    59  {
    60  unspecified_mesh_parameter_id = 0,
    61 
    62  ////////////////////////////////////////////////////////
    63  // BEGIN Legacy parameters.
    64  //
    65 
    66  bComputeCurvature_parameter_id = 1,
    67  bSimplePlanes_parameter_id = 2,
    68  bRefine_parameter_id = 3,
    69  bJaggedSeams_parameter_id = 4,
    70  bDoublePrecision_parameter_id = 5,
    71  mesher_parameter_id = 6,
    72  texture_range_parameter_id = 7,
    73  tolerance_parameter_id = 8,
    74  relative_tolerance_parameter_id = 9,
    75  min_tolerance_parameter_id = 10,
    76  min_edge_length_parameter_id = 11,
    77  max_edge_length_parameter_id = 12,
    78  grid_aspect_ratio_parameter_id = 13,
    79  grid_min_count_parameter_id = 14,
    80  grid_max_count_parameter_id = 15,
    81  grid_angle_parameter_id = 16,
    82  grid_amplification_parameter_id = 17,
    83  refine_angle_parameter_id = 18,
    84  face_type_parameter_id = 19,
    85  srf_domain_parameter_id = 20,
    86  bClosedObjectPostProcess_id = 21,
    87 
    88  //
    89  // END Legacy parameters.
    90  ////////////////////////////////////////////////////////
    91 
    92  // UUID parameter identifying what mesher code created the mesh.
    93  mesher_id = 22,
    94 
    95  ////////////////////////////////////////////////////////
    96  // BEGIN Pangolin parameters
    97  //
    98 
    99  crv_tess_min_num_segments_parameter_id = 23,
    100  crv_tess_angle_tol_in_degrees_parameter_id = 24,
    101  crv_tess_max_dist_between_points_parameter_id = 25, // Not same as 'max_edge_length_parameter_id' since
    102  // 'curve_tess_max_dist_between_points' is only for
    103  // curves, not surfaces.
    104  crv_tess_min_parametric_ratio_parameter_id = 26,
    105  bEvaluatorBasedTessellation_parameter_id = 27,
    106  srf_tess_chord_height_parameter_id = 28, // Not same as 'tolerance_parameter_id' since
    107  // 'surface_tess_chord_height' is only for
    108  // surfaces, not curves.
    109  srf_tess_angle_tol_in_degrees_parameter_id = 29,
    110  srf_tess_max_edge_length_parameter_id = 30,
    111  srf_tess_min_edge_length_parameter_id = 31,
    112  srf_tess_min_edge_length_ratio_uv_parameter_id = 32,
    113  srf_tess_max_aspect_ratio_parameter_id = 33,
    114  smoothing_passes_parameter_id = 34,
    115 
    116  //
    117  // END Pangolin parameters
    118  ////////////////////////////////////////////////////////
    119 
    120  max_mesh_parameter_id
    121  };
    122 
    123  static ON_MeshParameters::MESH_PARAMETER_ID MeshParameterIdFromUnsigned(
    124  unsigned int mesh_parameter_id_as_unsigned
    125  );
    126 
    127  /*
    128  Description:
    129  Mesh creationg parameters to create the default render mesh.
    130  */
    131  static
    133 
    134  /*
    135  Description:
    136  Mesh creationg parameters to create the a render mesh
    137  when meshing speed is prefered over mesh quality.
    138  */
    139  static
    141 
    142  /*
    143  Description:
    144  Mesh creationg parameters to create the a render mesh
    145  when mesh quality is prefered over meshing speed.
    146  */
    147  static
    149 
    150  /*
    151  Description:
    152  Mesh creationg parameters to create the default analysis mesh.
    153  */
    154  static
    156 
    157  /*
    158  Description:
    159  Get a value to use for tolerance based on the relative_tolerance
    160  and actual size.
    161  Parameters:
    162  relative_tolerance - [in]
    163  See m_relative_tolerance field
    164  actual_size - [in]
    165  Length of object's bounding box diagonal or some similar
    166  measure of the object's 3d size.
    167  Returns:
    168  A value that can be used for m_tolerance if no
    169  user specified value is available.
    170  */
    171  static
    172  double ToleranceFromObjectSize( double relative_tolerance, double actual_size );
    173 
    174  /*
    175  Description:
    176  Get a value to use for minimum edge length base on max_edge_length
    177  and tolerance settings.
    178  Parameters:
    179  max_edge_length - [in]
    180  3d maximum edge length used to create mesh.
    181  tolerance - [in]
    182  3d distance tolerance used to create mesh.
    183  Returns:
    184  A value that can be used for m_min_edge_length if no
    185  user specified value is available.
    186  */
    187  static
    188  double MinimumEdgeLengthFromTolerance( double max_edge_length, double tolerance );
    189 
    190  ON_MeshParameters() = default;
    191  ~ON_MeshParameters() = default;
    192  ON_MeshParameters(const ON_MeshParameters&) = default;
    193  ON_MeshParameters& operator=(const ON_MeshParameters&) = default;
    194 
    195  /*
    196  Description:
    197  Tool for provding a simple slider interface.
    198  Parameters:
    199  density - [in] 0.0 <= density <= 1.0
    200  0 quickly creates coarse meshes.
    201  1 slowly creates dense meshes.
    202  min_edge_length - [in]
    203  > 0.0 custom value
    204  ON_UNSET_VALUE: for default (0.0001)
    205  */
    207  double density,
    208  double min_edge_length = ON_UNSET_VALUE
    209  );
    210 
    211  // C++ default works fine // ON_MeshParameters(const ON_MeshParameters& );
    212  // C++ default works fine // ON_MeshParameters& operator=(const ON_MeshParameters&);
    213 
    214  void Dump( ON_TextLog& test_log ) const;
    215 
    216 
    217  /*
    218  */
    219  static int Compare(
    220  const ON_MeshParameters& a,
    221  const ON_MeshParameters& b
    222  );
    223 
    224  /*
    225  Description:
    226  Compares all meshing parameters that control mesh geometry.
    227  Does not compare m_bCustomSettings, CustomSettingsEnabled(),
    228  m_bComputeCurvature, m_bDoublePrecision, MinimumTolerance(),
    229  m_texture_range, m_srf_domain0 and m_srf_domain1.
    230  */
    231  static int CompareGeometrySettings(
    232  const ON_MeshParameters& a,
    233  const ON_MeshParameters& b
    234  );
    235 
    236  ON_SHA1_Hash ContentHash() const;
    237  ON_SHA1_Hash GeometrySettingsHash() const;
    238 
    239  ON_UUID MesherId() const;
    240  void SetMesherId(
    241  ON_UUID
    242  );
    243 
    244 
    245  /*
    246  Returns:
    247  ON_MeshParameters::render_mesh_fast
    248  ON_MeshParameters::FastRenderMesh and this have the same geometry settings
    249  ON_MeshParameters::render_mesh_quality
    250  ON_MeshParameters::QualityRenderMesh and this have the same geometry settings
    251  ON_MeshParameters::render_mesh_custom
    252  custom_mp is not null and has the same geometry settings
    253  no_match_found_result
    254  otherwise
    255  */
    256  const ON_MeshParameters::MESH_STYLE GeometrySettingsRenderMeshStyle(
    257  const ON_MeshParameters* custom_mp,
    258  ON_MeshParameters::MESH_STYLE no_match_found_result
    259  ) const;
    260 
    261  /*
    262  Returns:
    263  n in the range 0 to 100, inclusive, when
    264  (0 == ON_MeshParameters::CompareGeometrySettings(*this,ON_MeshParameters(n/100.0))
    265  no_match_found_result:
    266  otherwise
    267  */
    268  const int GeometrySettingsDensityPercentage(
    269  int no_match_found_result
    270  ) const;
    271 
    272  bool Write( ON_BinaryArchive& ) const;
    273  bool Read( ON_BinaryArchive& );
    274 
    275  ON__UINT32 DataCRC(ON__UINT32) const;
    276 
    277  //////////////////////////////////////////////////////////////
    278  //
    279  // The CustomSettings() parameter applies when these mesh
    280  // creation parameters specify how an object's mesh should
    281  // be created and these parameters should override the
    282  // the model or application default mesh creation parameters.
    283  //
    284  // When CustomSettings() is true, it indicates these mesh
    285  // creation parameters are explictily set for the object
    286  // and context in question and should override the model
    287  // or application defaults.
    288  //
    289  // When CustomSettings() is false, it indicates these mesh
    290  // creation parameters were inherited from from model or
    291  // application defaults and any mesh created with these
    292  // parameters should be updated when these parameters
    293  // differ from the current model or application defaults.
    294  //
    295  const bool CustomSettings() const;
    296  void SetCustomSettings(
    297  bool bCustomSettings
    298  );
    299 
    300  //////////////////////////////////////////////////////////////
    301  //
    302  // The CustomSettingsEnabled() value applies to mesh creation
    303  // parameters that are on ON_3dmObjectAttributes and have
    304  // CustomSettings() = true. In this situation:
    305  //
    306  // If CustomSettingsEnabled() is true, then the use of
    307  // these mesh creation parameters is enabled.
    308  //
    309  // If CustomSettingsEnabled() is false, then these mesh
    310  // creation parameters should be gnored.
    311  //
    312  const bool CustomSettingsEnabled() const;
    313  void SetCustomSettingsEnabled(
    314  bool bCustomSettingsEnabled
    315  );
    316 
    317 
    318  //////////////////////////////////////////////////////////////
    319  //
    320  // Meshing happens in two stages. The first stage creates a
    321  // rectangular grid. The second stage refines the grid until
    322  // the mesh meets all meshing requirements. The third stage
    323  // combines coincident vertices if the resulting mesh is a composite.
    324  //
    325 
    326 
    327  // false - (default) - ON_Mesh::m_K[] not computed
    328  // true - ON_Mesh::m_K[] computed bool ComputeCurvature() const;
    329  const bool ComputeCurvature() const;
    330  void SetComputeCurvature(
    331  bool bComputeCurvature
    332  );
    333 
    334  // false - (default) planar surfaces are meshed
    335  // using the controls below.
    336  // true - planar surfaces are meshed using
    337  // minimal number of triangles and
    338  // aspect/edge controls are ignored.
    339  const bool SimplePlanes() const;
    340  void SetSimplePlanes(
    341  bool bSimplePlanes
    342  );
    343 
    344 public:
    345  // false - skip stage 2 mesh refinement step
    346  // true - (default) do stage 2 mesh refinement step
    347  const bool Refine() const;
    348  void SetRefine(
    349  bool bRefine
    350  );
    351 
    352 public:
    353  // false - (default) edges of meshes of joined
    354  // b-rep faces match with no gaps or
    355  // "T" joints.
    356  // true - faces in b-reps are meshed independently.
    357  // This is faster but results in gaps and
    358  // "T" joints along seams between faces.
    359  const bool JaggedSeams() const;
    360  void SetJaggedSeams(
    361  bool bJaggedSeams
    362  );
    363 
    364 public:
    365  // false - (default) the mesh vertices will be
    366  // float precision values in the m_V[] array.
    367  // true - The mesh vertices will be double precision
    368  // values in the DoublePrecisionVertices()
    369  // array. Float precision values will also
    370  // be returned in the m_V[] array.
    371  const bool DoublePrecision() const;
    372  void SetDoublePrecision(
    373  bool bDoublePrecision
    374  );
    375 
    376  // 0 = slow mesher, 1 = fast mesher
    377  const unsigned int Mesher() const;
    378  void SetMesher(
    379  unsigned int mesher
    380  );
    381 
    382  // 1: unpacked, unscaled, normalized
    383  // each face has a normalized texture range [0,1]x[0,1].
    384  // The normalized coordinate is calculated using the
    385  // entire surface domain. For meshes of trimmed
    386  // surfaces when the active area is a small subset of
    387  // the entire surface, there will be large regions of
    388  // unsued texture space in [0,1]x[0,1]. When the 3d region
    389  // being meshed is far from being sqaure-ish, there will be
    390  // a substantual amount of distortion mapping [0,1]x[0,1]
    391  // texture space to the 3d mesh.
    392  //
    393  // 2: packed, scaled, normalized (default)
    394  // each face is assigned a texture range that is a
    395  // subrectangle of [0,1]x[0,1]. The subrectangles are
    396  // mutually disjoint and packed into into [0,1]x[0,1]
    397  // in a way that minimizes distortion and maximizes the
    398  // coverage of [0,1]x[0,1].
    399  // When the surface or surfaces being meshed are trimmed,
    400  // this option takes into account only the region of the
    401  // base surface the mesh covers and uses as much of
    402  // [0,1]x[0,1] as possible. unsigned int TextureRange() const;
    403  const unsigned int TextureRange() const;
    404  void SetTextureRange(
    405  unsigned int texture_range
    406  );
    407  const bool TextureRangeIsValid() const;
    408  void SetTextureRangePictureFrameHack();
    409 
    410  // If the object being meshed is closed, m_bClosedObjectPostProcess is true,
    411  // m_bJaggedSeams = false, and the resultig mesh is not closed, then a post meshing process
    412  // is applied to find and close gaps in the mesh. Typically the resulting mesh
    413  // is not closed because the input object has a geometric flaw like loops in
    414  // trimming curves.
    415  const bool ClosedObjectPostProcess() const;
    416  void SetClosedObjectPostProcess(
    417  bool bClosedObjectPostProcess
    418  );
    419 
    420  // These controls are used in both stages
    421 
    422  // approximate maximum distance from center of edge to surface
    423  const double Tolerance() const;
    424  void SetTolerance(
    425  double tolerance
    426  );
    427 
    428  /*
    429  If 0.0 < RelativeTolerance() < 1.0,
    430  then the maximum distance from the
    431  center of an edge to the surface will
    432  be <= T, where T is the larger of
    433  (MinimumTolerance(),d*RelativeTolerance()),
    434  where d is an esimate of the size of the
    435  object being meshed.
    436  */
    437  const double RelativeTolerance() const;
    438  void SetRelativeTolerance(
    439  double relative_tolerance
    440  );
    441 
    442  const double MinimumTolerance() const;
    443  void SetMinimumTolerance(
    444  double minimum_tolerance
    445  );
    446 
    447  // edges shorter than MinimumEdgeLength() will
    448  // not be split even if the do not meet other
    449  // meshing requirements
    450  const double MinimumEdgeLength() const;
    451  void SetMinimumEdgeLength(
    452  double minimum_edge_length
    453  );
    454 
    455  /*
    456  Returns:
    457  SubD display mesh density.
    458  Example:
    459  Use ON_MeshParameters to control the density of a SubD limit mesh.
    460  ON_MeshParameters mp = ...;
    461  ON_Mesh* mesh = subd->GetLimitSurfaceMesh(
    462  ON_SubDDisplayParameters::CreateFromDisplayDensity( mp.SubDDisplayMeshDensity() ),
    463  nullptr
    464  );
    465  */
    466  unsigned int SubDDisplayMeshDensity() const;
    467 
    468 public:
    469  // edges longer than MaximumEdgeLength() will
    470  // be split even when they meet all other
    471  // meshing requirements
    472  const double MaximumEdgeLength() const;
    473  void SetMaximumEdgeLength(
    474  double maximum_edge_length
    475  );
    476 
    477  ////////////////////////////////////////////////////////////////////////////////////
    478  //
    479  // These controls are used during stage 1 to generate the grid
    480  //
    481 
    482 
    483  // desired aspect ratio of quads in grid
    484  // 0.0 = any aspect ratio is acceptable
    485  // values >0 and < sqrt(2) are treated as sqrt(2)
    486  const double GridAspectRatio() const;
    487  void SetGridAspectRatio(
    488  double grid_aspect_ratio
    489  );
    490 
    491  // minimum number of quads in initial grid
    492  const int GridMinCount() const;
    493  void SetGridMinCount(
    494  int grid_min_count
    495  );
    496 
    497  // desired masimum number of quads in initial grid
    498  const int GridMaxCount() const;
    499  void SetGridMaxCount(
    500  int grid_max_count
    501  );
    502 
    503  // maximum angle (radians) between surface
    504  // normal evaluated at adjacent vertices.
    505  // 0.0 is treated as pi.
    506  const double GridAngleRadians() const;
    507  void SetGridAngleRadians(
    508  double grid_angle_radians
    509  );
    510 
    511  // maximum angle (degrees) between surface
    512  // normal evaluated at adjacent vertices.
    513  // 0.0 is treated as 180.0.
    514  const double GridAngleDegrees() const;
    515  void SetGridAngleDegrees(
    516  double grid_angle_degrees
    517  );
    518 
    519  // The parameters above generate a grid.
    520  // If you want fewer quads, set m_grid_amplification
    521  // to a value < 1. If you want more quads,
    522  // set m_grid_amplification to a value > 1.
    523  // default = 1 and values <= 0 are treated as 1.
    524  const double GridAmplification() const;
    525  void SetGridAmplification(
    526  double grid_amplification
    527  );
    528 
    529  ////////////////////////////////////////////////////////////////////////////
    530  //
    531  // These controls are used during stage 2 to refine the grid
    532  //
    533 
    534 
    535  // (in radians) maximum angle in radians between
    536  // surface normal evaluated at adjacent vertices.
    537  const double RefineAngleRadians() const;
    538  void SetRefineAngleRadians(
    539  double refine_angle_radians
    540  );
    541  const double RefineAngleDegrees() const;
    542  void SetRefineAngleDegrees(
    543  double refine_angle_degrees
    544  );
    545 
    546  ////////////////////////////////////////////////////////////////////////////
    547  //
    548  // These controls are used during stage 3
    549  //
    550 
    551  // 0 = mixed triangle and quads
    552  // 1 = all triangles
    553  // 2 = all quads
    554  const unsigned int FaceType() const;
    555  void SetFaceType(
    556  unsigned int face_type
    557  );
    558 
    559 
    560 private:
    561  void Internal_SetBoolHelper(bool b, bool* dest);
    562  void Internal_SetCharHelper(unsigned int u, unsigned char minc, unsigned char maxc, unsigned char*);
    563  void Internal_SetDoubleHelper(double x, double minx, double maxx, double* dest);
    564  void Internal_SetIntHelper(int i, int mini, int maxi, int* dest);
    565 
    566 private:
    567  //////////////////////////////////////////////////////////
    568  //
    569  // BEGIN Rhino Legacy parameters
    570  //
    571  bool m_bCustomSettings = false;
    572  bool m_bCustomSettingsEnabled = true;
    573  bool m_bComputeCurvature = false;
    574  bool m_bSimplePlanes = false;
    575 
    576  bool m_bRefine = true;
    577  bool m_bJaggedSeams = false;
    578  bool m_bDoublePrecision = false;
    579  bool m_bClosedObjectPostProcess = false;
    580 
    581  ON_UUID m_mesher_id = ON_nil_uuid;
    582 
    583  unsigned char m_mesher = 0;
    584  unsigned char m_texture_range = 2;
    585  unsigned char m_face_type = 0;
    586 
    587  unsigned char m_reserved1 = 0;
    588 
    589  int m_grid_min_count = 0;
    590  int m_grid_max_count = 0;
    591  mutable ON_SHA1_Hash m_geometry_settings_hash = ON_SHA1_Hash::ZeroDigest;
    592 
    593  ON__UINT32 m_reserved2 = 0;
    594 
    595  double m_tolerance = 0.0;
    596  double m_relative_tolerance = 0.0;
    597  double m_min_tolerance = 0.0;
    598  double m_min_edge_length = 0.0001;
    599  double m_max_edge_length = 0.0;
    600  double m_grid_aspect_ratio = 6.0;
    601  double m_grid_angle_radians = 20.0*ON_PI/180.0;
    602  double m_grid_amplification = 1.0;
    603  double m_refine_angle_radians = 20.0*ON_PI/180.0;
    604  //
    605  // BEGIN Rhino Legacy parameters
    606  //
    607  //////////////////////////////////////////////////////////
    608 
    609 private:
    610  bool m_reserved3 = false;
    611  bool m_reserved4 = false;
    612 
    613 private:
    614  //////////////////////////////////////////////////////////
    615  //
    616  // BEGIN Pangolin parameters
    617  //
    618 
    619  bool m_bEvaluatorBasedTessellation = false;
    620  int m_curve_tess_min_num_segments = 0;
    621  double m_curve_tess_angle_tol_in_degrees = 20.0;
    622  double m_curve_tess_max_dist_between_points = 0.0;
    623  double m_curve_tess_min_parametric_ratio = 0.00001;
    624  double m_surface_tess_angle_tol_in_degrees = 20.0;
    625  double m_surface_tess_max_edge_length = 0.0;
    626  double m_surface_tess_min_edge_length = 0.0;
    627  double m_surface_tess_min_edge_length_ratio_uv = 0.0001;
    628  double m_surface_tess_max_aspect_ratio = 0.0;
    629  int m_smoothing_passes = 0;
    630 
    631 private:
    632  void Internal_AccumulatePangolinParameters(
    633  const ON_MeshParameters& pangolin_defaults,
    634  class ON_SHA1& sha1
    635  ) const;
    636 
    637  //
    638  // END Pangolin parameters
    639  //
    640  //////////////////////////////////////////////////////////
    641 
    642 private:
    643  ON__UINT_PTR m_reserved5 = 0;
    644 };
    645 
    646 ON_DECL
    647 bool operator!=(const ON_MeshParameters& a, const ON_MeshParameters& b);
    648 
    649 ON_DECL
    650 bool operator==(const ON_MeshParameters& a, const ON_MeshParameters& b);
    651 
    652 class ON_CLASS ON_MeshCurvatureStats
    653 {
    654 public:
    658  ON_MeshCurvatureStats& operator=(const ON_MeshCurvatureStats&);
    659 
    660  void Destroy();
    661  void EmergencyDestroy();
    662 
    663  bool Set( ON::curvature_style,
    664  int, // Kcount,
    665  const ON_SurfaceCurvature*, // K[]
    666  const ON_3fVector*, // N[] surface normals needed for normal sectional curvatures
    667  double = 0.0 // if > 0, value is used for "infinity"
    668  );
    669 
    670  bool Write( ON_BinaryArchive& ) const;
    671  bool Read( ON_BinaryArchive& );
    672 
    673  ON::curvature_style m_style;
    674 
    675  double m_infinity; // curvature values >= this are considered infinite
    676  // and not used to compute the m_average or m_adev
    677  int m_count_infinite; // number of "infinte" values
    678  int m_count; // count of "finite" values
    679  double m_mode; // mode of "finite" values
    680  double m_average; // average of "finite" values
    681  double m_adev; // average deviation of "finite" values
    682 
    684 };
    685 
    686 ///////////////////////////////////////////////////////////////////////////////
    687 //
    688 // Class ON_MeshTopology
    689 //
    690 
    692 {
    693  // m_tope_count = number of topological edges that begin or
    694  // end at this topological vertex.
    696 
    697  // m_topei[] is an array of length m_tope_count with the indices
    698  // of the topological edges that begin or end at this topological
    699  // vertex. Generally, these edges are listed in no particular
    700  // order. If you want the edges listed "radially", then call
    701  // ON_MeshTopology::SortVertexEdges.
    702  const int* m_topei;
    703 
    704  // m_v_count = number of ON_Mesh vertices that correspond to
    705  // this topological vertex.
    707 
    708  // m_vi[] is an array of length m_v_count with the indices of the
    709  // ON_Mesh vertices that correspond to this topological vertex.
    710  const int* m_vi;
    711 };
    712 
    714 {
    715  // m_topvi[] = indices of the topological verteices where the
    716  // edge begins and ends.
    717  int m_topvi[2];
    718 
    719  // m_topf_count = number of topological faces tat share this topological edge
    721 
    722  // m_topfi[] is an array of length m_topf_count with the indices of the
    723  // topological faces that share this topological edge.
    724  const int* m_topfi;
    725 };
    726 
    727 struct ON_CLASS ON_MeshTopologyFace
    728 {
    729  /*
    730  m_topei[] = indices of the topological edges that bound the face.
    731  If m_topei[2] = m_topei[3], then the face is a triangle, otherwise
    732  the face is a quad.
    733 
    734  NOTE WELL:
    735  The topological edge with index m_topei[k] ENDS at the
    736  vertex corresponding to ON_MeshFace.vi[k]. So, ...
    737 
    738  If the face is a quad, (ON_MeshFace.vi[2]!=ON_MeshFace.vi[3]),
    739  the topological edge with index m_topei[0] STARTS at
    740  ON_MeshFace.vi[3] and ENDS at ON_MeshFace.vi[0],
    741  the topological edge with index m_topei[1] STARTS at
    742  ON_MeshFace.vi[0] and ENDS at ON_MeshFace.vi[1],
    743  the topological edge with index m_topei[2] STARTS at
    744  ON_MeshFace.vi[1] and ENDS at ON_MeshFace.vi[2], and
    745  the topological edge with index m_topei[3] STARTS at
    746  ON_MeshFace.vi[2] and ENDS at ON_MeshFace.vi[3],
    747 
    748  If the face is a triangle, (ON_MeshFace.vi[2]==ON_MeshFace.vi[3]),
    749  the topological edge with index m_topei[0] STARTS at
    750  ON_MeshFace.vi[2] and ENDS at ON_MeshFace.vi[0],
    751  the topological edge with index m_topei[1] STARTS at
    752  ON_MeshFace.vi[0] and ENDS at ON_MeshFace.vi[1],
    753  the topological edge with index m_topei[2] STARTS at
    754  ON_MeshFace.vi[1] and ENDS at ON_MeshFace.vi[2].
    755  */
    756  int m_topei[4];
    757 
    758  /*
    759  If m_reve[i] is 0, then the orientation of the edge matches the
    760  orientation of the face. If m_reve[i] is 1, then the orientation
    761  of the edge is opposite that of the face.
    762  */
    763  char m_reve[4];
    764 
    765  /*
    766  Description:
    767  A topological mesh face is a valid triangle if m_topei[0],
    768  m_topei[1], m_topei[2] are distinct edges and
    769  m_topei[3]=m_topei[2].
    770  Returns:
    771  True if face is a triangle.
    772  */
    773  bool IsTriangle() const;
    774 
    775  /*
    776  Description:
    777  A topological mesh face is a valid quad if m_topei[0],
    778  m_topei[1], m_topei[2], and m_topei[3] are distinct edges.
    779  Returns:
    780  True if face is a quad.
    781  */
    782  bool IsQuad() const;
    783 
    784  /*
    785  Description:
    786  A topological mesh face is valid if m_topei[0], m_topei[1],
    787  and m_topei[2] are mutually distinct, and m_topei[3] is
    788  either equal to m_topei[2] or mutually distinct from the
    789  first three indices.
    790  Returns:
    791  True if face is valid.
    792  */
    793  bool IsValid( ) const;
    794 };
    795 
    796 class ON_CLASS ON_MeshFace
    797 {
    798 public:
    799  static const ON_MeshFace UnsetMeshFace; // all vi[] values are -1.
    800 
    801 
    802  int vi[4]; // vertex index - vi[2]==vi[3] for tirangles
    803 
    804  /*
    805  Returns:
    806  True if vi[2] == vi[3];
    807  Remarks:
    808  Assumes the face is valid.
    809  */
    810  bool IsTriangle() const;
    811 
    812  /*
    813  Returns:
    814  True if vi[2] != vi[3];
    815  Remarks:
    816  Assumes the face is valid.
    817  */
    818  bool IsQuad() const;
    819 
    820  /*
    821  Description:
    822  Determine if a face is valid by checking that the vertices
    823  are distinct.
    824  Parameters:
    825  mesh_vertex_count - [in]
    826  number of vertices in the mesh
    827  V - [in]
    828  optional array of mesh_vertex_count vertex locations.
    829  Returns:
    830  true
    831  The face is valid.
    832  false
    833  The face is not valid. It may be possible to repair the
    834  face by calling ON_MeshFace::Repair().
    835  */
    836  bool IsValid(
    837  int mesh_vertex_count
    838  ) const;
    839  bool IsValid(
    840  unsigned int mesh_vertex_count
    841  ) const;
    842  bool IsValid(
    843  int mesh_vertex_count,
    844  const ON_3fPoint* V
    845  ) const;
    846  bool IsValid(
    847  int mesh_vertex_count,
    848  const ON_3dPoint* V
    849  ) const;
    850 
    851  /*
    852  Description:
    853  Reverses the order of the vertices in v[].
    854  vi[0] is not changed.
    855  */
    856  void Flip();
    857 
    858  /*
    859  Description:
    860  If IsValid() returns false, then you can use Repair()
    861  to attempt to create a valid triangle.
    862  Parameters:
    863  mesh_vertex_count - [in]
    864  number of vertices in the mesh
    865  V - [in]
    866  optional array of mesh_vertex_count vertex locations.
    867  Returns:
    868  true
    869  repair was successful and v[0], v[1], vi[2] have distinct valid
    870  values and v[2] == v[3].
    871  false
    872  this face's vi[] values cannot be repaired
    873  */
    874  bool Repair(
    875  int mesh_vertex_count
    876  );
    877  bool Repair(
    878  int mesh_vertex_count,
    879  const ON_3fPoint* V
    880  );
    881  bool Repair(
    882  int mesh_vertex_count,
    883  const ON_3dPoint* V
    884  );
    885 
    886  /*
    887  Description:
    888  Compute the face normal
    889  Parameters:
    890  dV - [in] double precision vertex array for the mesh
    891  fV - [in] float precision vertex array for the mesh
    892  FN - [out] face normal
    893  Returns:
    894  true if FN is valid.
    895  */
    896  bool ComputeFaceNormal( const ON_3dPoint* dV, ON_3dVector& FN ) const;
    897  bool ComputeFaceNormal( const ON_3fPoint* fV, ON_3dVector& FN ) const;
    898  bool ComputeFaceNormal( const class ON_3dPointListRef& vertex_list, ON_3dVector& FN ) const;
    899 
    900  /*
    901  Parameters:
    902  planar_tolerance - [in]
    903  If planar_tolerance >= 0 and
    904  (maximum plane equation value - minimum plane equation value) > planar_tolerance,
    905  then false is returned.
    906  angle_tolerance_radians - [in]
    907  If angle_tolerance_radians >= 0.0 and the angle between opposite
    908  corner normals is > angle_tolerance_radians, then false is returned.
    909  A corner normal is the normal to the triangle formed by two
    910  adjacent edges and the diagonal connecting their endpoints.
    911  A quad has four corner normals.
    912  Passing in ON_PI/2 is a good way will result in false being
    913  returned for non-convex quads
    914  face_plane_equation - [out]
    915  If not null, the equation used to test planarity is returned here.
    916  Returns:
    917  True if the face is planar
    918  */
    919  bool IsPlanar(
    920  double planar_tolerance,
    921  double angle_tolerance_radians,
    922  const class ON_3dPointListRef& vertex_list,
    923  ON_PlaneEquation* face_plane_equation
    924  ) const;
    925 
    926  /*
    927  Description:
    928  Get corner normals.
    929  Parameters:
    930  vertex_list - [in]
    931  corner_normals[4] - [out]
    932  For a triangle, all values are identical.
    933  If a corner normal cannot be calculated, ON_3dVector::UnsetVector
    934  is returned.
    935  Returns:
    936  Number of corner normals that are valid.
    937  */
    938  unsigned int GetCornerNormals(
    939  const class ON_3dPointListRef& vertex_list,
    940  ON_3dVector corner_normals[4]
    941  ) const;
    942 
    943  bool GetPlaneEquation(
    944  const class ON_3dPointListRef& vertex_list,
    945  ON_PlaneEquation& face_plane_equation
    946  ) const;
    947 
    948 };
    949 
    950 
    951 class ON_CLASS ON_MeshTriangle
    952 {
    953 public:
    954  static const ON_MeshTriangle UnsetMeshTriangle; // all vi[] values are ON_UNSET_UINT_INDEX.
    955 
    956  unsigned int m_vi[3]; // vertex index list
    957 
    958  /*
    959  Description:
    960  Determine if a triangle is valid by checking that the vertices
    961  are distinct.
    962  Parameters:
    963  mesh_vertex_count - [in]
    964  number of vertices in the mesh
    965  vertex_list - [in]
    966  optional list of mesh vertex locations.
    967  Returns:
    968  true
    969  The triangle is valid.
    970  false
    971  The triangle is not valid.
    972  */
    973  bool IsValid(
    974  size_t mesh_vertex_count
    975  ) const;
    976 
    977  bool IsValid(
    978  size_t mesh_vertex_count,
    979  const class ON_3fPoint* vertex_list
    980  ) const;
    981 
    982  bool IsValid(
    983  size_t mesh_vertex_count,
    984  const class ON_3dPoint* vertex_list
    985  ) const;
    986 
    987  bool IsValid(
    988  const class ON_3dPointListRef& vertex_list
    989  ) const;
    990 
    991  /*
    992  Description:
    993  Swaps the values of m_vi[1] and m_vi[2]. m_vi[0] is not changed.
    994  */
    995  void Flip();
    996 
    997 
    998  /*
    999  Description:
    1000  Compute the triangle normal
    1001  Parameters:
    1002  dV - [in] double precision vertex array for the mesh
    1003  fV - [in] float precision vertex array for the mesh
    1004  vertex_list - [in] vertex locations
    1005  triangle_normal - [out] triangle normal
    1006  Returns:
    1007  true if triangle_normal is valid.
    1008  */
    1009  bool GetTriangleNormal(
    1010  const class ON_3dPoint* dV,
    1011  class ON_3dVector& triangle_normal
    1012  ) const;
    1013 
    1014  bool GetTriangleNormal(
    1015  const class ON_3fPoint* fV,
    1016  class ON_3dVector& triangle_normal
    1017  ) const;
    1018 
    1019  bool GetTriangleNormal(
    1020  const class ON_3dPointListRef& vertex_list,
    1021  class ON_3dVector& triangle_normal
    1022  ) const;
    1023 
    1024  static bool GetTriangleNormal(
    1025  ON_3dPoint point0,
    1026  ON_3dPoint point1,
    1027  ON_3dPoint point2,
    1028  class ON_3dVector& triangle_normal
    1029  );
    1030 
    1031 };
    1032 
    1033 class ON_CLASS ON_MeshFaceList
    1034 {
    1035 public:
    1037  : m_bQuadFaces(false)
    1038  , m_face_count(0)
    1039  , m_face_stride(0)
    1040  , m_faces(0)
    1041  {}
    1042 
    1044  const ON_Mesh* mesh
    1045  );
    1046 
    1048 
    1049  unsigned int SetFromTriangleList(
    1050  size_t triangle_count,
    1051  size_t triangle_stride,
    1052  const unsigned int* triangles
    1053  );
    1054 
    1055  unsigned int SetFromQuadList(
    1056  size_t quad_count,
    1057  size_t quad_stride,
    1058  const unsigned int* quads
    1059  );
    1060 
    1061  unsigned int SetFromMesh(
    1062  const ON_Mesh* mesh
    1063  );
    1064 
    1065  inline const unsigned int* Fvi(unsigned int face_index) const
    1066  {
    1067  return (face_index < m_face_count) ? (m_faces + (face_index*m_face_stride)) : 0;
    1068  }
    1069 
    1070  inline unsigned int* QuadFvi(unsigned int face_index, unsigned int buffer[4]) const
    1071  {
    1072  if ( face_index < m_face_count )
    1073  {
    1074  const unsigned int* p = m_faces + (face_index*m_face_stride);
    1075  buffer[0] = *p;
    1076  buffer[1] = *(++p);
    1077  buffer[2] = *(++p);
    1078  buffer[3] = m_bQuadFaces ? *(++p) : buffer[2];
    1079  }
    1080  else
    1081  {
    1082  buffer[0] = buffer[1] = buffer[2] = buffer[3] = 0;
    1083  }
    1084  return buffer;
    1085  }
    1086 
    1087 
    1088  inline bool IsQuad(unsigned int face_index) const
    1089  {
    1090  if ( m_bQuadFaces && face_index < m_face_count )
    1091  {
    1092  const unsigned int* p = m_faces + (face_index*m_face_stride);
    1093  return p[2] != p[3];
    1094  }
    1095  return false;
    1096  }
    1097 
    1098  inline unsigned int FaceCount() const
    1099  {
    1100  return m_face_count;
    1101  }
    1102 
    1103  inline unsigned int FaceVertexCount() const
    1104  {
    1105  return m_bQuadFaces?4:3;
    1106  }
    1107 
    1108  size_t FaceStride() const
    1109  {
    1110  return m_face_stride;
    1111  }
    1112 
    1113  /*
    1114  Description:
    1115  Get the minimum and maximum vertex indices referenced by a face in the list.
    1116  Parameters:
    1117  minimum_valid_vertex_index - [in]
    1118  Any face with a vertex index < minimum_valid_vertex_index will be ignored.
    1119  maximum_valid_vertex_index - [in]
    1120  Any face with a vertex index > maximum_valid_vertex_index will be ignored.
    1121  minimum_vertex_index - [out]
    1122  maximum_vertex_index - [out]
    1123  If there are no valid faces, then both output values are 0.
    1124  Returns:
    1125  Number of valid faces.
    1126  */
    1127  unsigned int GetVertexIndexInterval(
    1128  unsigned int minimum_valid_vertex_index,
    1129  unsigned int maximum_valid_vertex_index,
    1130  unsigned int* minimum_vertex_index,
    1131  unsigned int* maximum_vertex_index
    1132  ) const;
    1133 
    1134 private:
    1135  bool m_bQuadFaces;
    1136  unsigned int m_face_count;
    1137  unsigned int m_face_stride;
    1138  const unsigned int* m_faces;
    1139 };
    1140 
    1141 class ON_CLASS ON_MeshVertexFaceMap
    1142 {
    1143 public:
    1144  ON_MeshVertexFaceMap() ON_NOEXCEPT;
    1147  ON_MeshVertexFaceMap& operator=(const ON_MeshVertexFaceMap&);
    1148 
    1149 #if defined(ON_HAS_RVALUEREF)
    1150  // rvalue copy constructor
    1151  ON_MeshVertexFaceMap( ON_MeshVertexFaceMap&& ) ON_NOEXCEPT;
    1152  ON_MeshVertexFaceMap& operator=( ON_MeshVertexFaceMap&& ) ON_NOEXCEPT;
    1153 #endif
    1154 
    1155  bool SetFromMesh(
    1156  const ON_Mesh* mesh,
    1157  bool bMapInvalidFaces
    1158  );
    1159 
    1160  bool SetFromFaceList(
    1161  unsigned int vertex_count,
    1162  const class ON_MeshFaceList& face_list,
    1163  bool bMapInvalidFaces
    1164  );
    1165 
    1166  void Destroy();
    1167 
    1168  /*
    1169  Returns:
    1170  Number a vertices.
    1171  */
    1172  unsigned int VertexCount() const;
    1173 
    1174  /*
    1175  Returns:
    1176  Number a faces.
    1177  */
    1178  unsigned int FaceCount() const;
    1179 
    1180  /*
    1181  Parameters:
    1182  vertex_index - [in]
    1183  Index of a vertex.
    1184  Returns:
    1185  The number of faces that reference the vertex.
    1186  Remarks:
    1187  If vertex_index is out of range, then zero is returned.
    1188  */
    1189  unsigned int VertexFaceCount(
    1190  unsigned int vertex_index
    1191  ) const;
    1192 
    1193  /*
    1194  Parameters:
    1195  vertex_index - [in]
    1196  Index of a vertex.
    1197  Returns:
    1198  An array of indices of faces that reference the vertex.
    1199  The array has length VertexFaceCount(vertex_index).
    1200  When the value of VertexFaceCount(vertex_index) is zero,
    1201  this function returns a null pointer.
    1202  Remarks:
    1203  If vertex_index is out of range, then null is returned.
    1204  */
    1205  const unsigned int* VertexFaceList(
    1206  unsigned int vertex_index
    1207  ) const;
    1208 
    1209  /*
    1210  Description:
    1211  Expert user function for situations where rapid access to the
    1212  vertex face list information is required.
    1213  Returns:
    1214  An array of VertexCount() unsigned int arrays that list the
    1215  indices of faces that reference each vertex.
    1216  VertexFaceMap()[vertex_index] is null if zero faces reference the
    1217  indicated vertex. Otherwise, VertexFaceMap()[vertex_index][0] is
    1218  the number of faces that reference the vertex and
    1219  VertexFaceMap()[vertex_index][1,...,n] are the indices of those faces,
    1220  where "n" is the value of VertexFaceMap()[vertex_index][0].
    1221  */
    1222  const unsigned int *const* VertexFaceMap() const;
    1223 
    1224 private:
    1225  unsigned int m_vertex_count;
    1226  unsigned int m_face_count;
    1227  const unsigned int *const* m_vertex_face_map;
    1228  void* m_p;
    1229  void m_copy(const ON_MeshVertexFaceMap&);
    1230  void* m_alloc(size_t);
    1231 };
    1232 
    1233 
    1234 class ON_CLASS ON_MeshNgonBuffer
    1235 {
    1236  // An ON_MeshNgonBuffer provides memory for
    1237  // creating an ON_MeshNgon that is a triangle or quad.
    1238 public:
    1240  const class ON_MeshNgon* Ngon() const;
    1241 
    1242  const class ON_MeshNgon* CreateFromMeshFaceIndex(
    1243  const class ON_Mesh* mesh,
    1244  unsigned int face_index
    1245  );
    1246 
    1247  const class ON_MeshNgon* CreateFromMeshFace(
    1248  const class ON_MeshFace* mesh_face,
    1249  unsigned int face_index
    1250  );
    1251 
    1252  const class ON_MeshNgon* CreateFromTriangle(
    1253  const unsigned int triangle_vertex_indices[3],
    1254  unsigned int face_index
    1255  );
    1256 
    1257  const class ON_MeshNgon* CreateFromQuad(
    1258  const unsigned int quad_vertex_indices[4],
    1259  unsigned int face_index
    1260  );
    1261 
    1262 public:
    1263  ON__UINT_PTR m_ngon_buffer[10];
    1264 };
    1265 
    1266 class ON_CLASS ON_MeshNgon
    1267 {
    1268 public:
    1269  // Number of N-gon corners (N >= 3)
    1270  unsigned int m_Vcount; // number of vertices and sides (the "n" in n-gon)
    1271  unsigned int m_Fcount; // number of faces
    1272 
    1273  // N-gon vertex indices
    1274  // An array of m_Vcount indices into the mesh's m_V[] vertex array.
    1275  // Unset elements have the value ON_UNSET_UINT_INDEX. If the ngon
    1276  // in managed by an ON_NgonAllocator, then the memory for m_vi[]
    1277  // is also managed by that ON_NgonAllocator.
    1278  unsigned int* m_vi;
    1279 
    1280  // N-gon face indices
    1281  // An array of m_Fcount indices into the mesh's m_F[] face array.
    1282  // Unset elements have the value ON_UNSET_UINT_INDEX. If the ngon
    1283  // in managed by an ON_NgonAllocator, then the memory for m_fi[]
    1284  // is also managed by that ON_NgonAllocator.
    1285  unsigned int* m_fi;
    1286 
    1287  /*
    1288  Returns:
    1289  0: This n-gon is not managed by an ON_MeshNgonAllocator.
    1290  >=0: The maximum capcity (maximum m_Vcount+m_Fcount) for this N-gon
    1291  */
    1292  unsigned int Capacity() const;
    1293 
    1294  static int Compare(
    1295  const ON_MeshNgon* A,
    1296  const ON_MeshNgon* B
    1297  );
    1298 
    1299  /*
    1300  Returns:
    1301  32-bit cyclic redundancy check that can be used as a hash code.
    1302  */
    1303  ON__UINT32 CRC32() const;
    1304 
    1305  /*
    1306  Returns:
    1307  A SHA-1 has of the vertex and face indices.
    1308  */
    1309  ON_SHA1_Hash ContentHash() const;
    1310 
    1311  /*
    1312  Parameters:
    1313  mesh_face_list - [in]
    1314  faces referenced by this n-gon.
    1315  Returns:
    1316  Total number of boundary edges, including interior edges.
    1317  */
    1318  unsigned int BoundaryEdgeCount(
    1319  const ON_MeshFaceList& mesh_face_list
    1320  ) const;
    1321 
    1322  /*
    1323  Parameters:
    1324  mesh - [in]
    1325  mesh referenced by this n-gon.
    1326  Returns:
    1327  Total number of boundary edges, including interior edges.
    1328  */
    1329  unsigned int BoundaryEdgeCount(
    1330  const ON_Mesh* mesh
    1331  ) const;
    1332 
    1333  /*
    1334  Returns:
    1335  Total number of outer boundary edges.
    1336  */
    1337  unsigned int OuterBoundaryEdgeCount() const;
    1338 
    1339  /*
    1340  Pamameters:
    1341  mesh_face_list - [in]
    1342  ON_Mesh face list.
    1343  bPermitHoles - [in]
    1344  true if the ngon is permitted to have interior holes
    1345  false otherwise.
    1346  Description:
    1347  Determine if the ngon's boundary orientation matches that of the set of faces it is made from.
    1348  Returns:
    1349  1: The ngon does not have holes, the ngon's faces are compatibly oriented,
    1350  and the ngon's outer boundary orientation matches the faces' orientation.
    1351  -1: The ngon does not have holes, the ngon's faces are compatibly oriented,
    1352  and the ngon's outer boundary orientation is opposite the faces' orientation.
    1353  0: Otherwise. The ngon may be invalid, have holes, the ngon's faces may not be compatibly oriented,
    1354  the ngons edges may not have a consistent orientation with respect to the faces, or some other issue.
    1355  */
    1356  int Orientation(
    1357  const ON_MeshFaceList& mesh_face_list,
    1358  bool bPermitHoles
    1359  ) const;
    1360 
    1361  /*
    1362  Pamameters:
    1363  mesh_face_list - [in]
    1364  ON_Mesh face list.
    1365  bPermitHoles - [in]
    1366  true if the ngon is permitted to have interior holes
    1367  false otherwise.
    1368  Description:
    1369  Determine if the ngon's boundary orientation matches that of the set of faces it is made from.
    1370  Returns:
    1371  1: The ngon does not have holes, the ngon's faces are compatibly oriented,
    1372  and the ngon's outer boundary orientation matches the faces' orientation.
    1373  -1: The ngon does not have holes, the ngon's faces are compatibly oriented,
    1374  and the ngon's outer boundary orientation is opposite the faces' orientation.
    1375  0: Otherwise. The ngon may be invalid, have holes, the ngon's faces may not be compatibly oriented,
    1376  the ngons edges may not have a consistent orientation with respect to the faces, or some other issue.
    1377  */
    1378  int Orientation(
    1379  const ON_Mesh* mesh,
    1380  bool bPermitHoles
    1381  ) const;
    1382 
    1383  /*
    1384  Description:
    1385  Reverse the order of the m_vi[] array.
    1386  */
    1387  void ReverseOuterBoundary();
    1388 
    1389  /*
    1390  Description:
    1391  Use the ngon m_vi[] array to get a list of 3d points from
    1392  mesh_vertex_list.
    1393  Parameters:
    1394  mesh_vertex_list - [in]
    1395  bAppendStartPoint - [in]
    1396  If true, the initial point in the boundary will be added
    1397  as the first point of ngon_boundary_points[] and then
    1398  added again as the last point of ngon_boundary_points[].
    1399  This is useful when you need a closed polyline.
    1400  ngon_boundary_points - [out]
    1401  An array of ngon->m_Vcount + (bAppendStartPoint ? 1 : 0)
    1402  points.
    1403  Returns:
    1404  Number of points added to ngon_boundary_points[] or 0 if invalid
    1405  input is encountered.
    1406  */
    1407  unsigned int GetOuterBoundaryPoints(
    1408  const class ON_3dPointListRef& mesh_vertex_list,
    1409  bool bAppendStartPoint,
    1410  ON_SimpleArray<ON_3dPoint>& ngon_boundary_points
    1411  ) const;
    1412 
    1413  /*
    1414  Description:
    1415  Use the ngon m_vi[] array to get a list of 3d points from
    1416  mesh_vertex_list.
    1417  Parameters:
    1418  mesh_vertex_list - [in]
    1419  bAppendStartPoint - [in]
    1420  If true, the initial point in the boundary will be added
    1421  as the first point of ngon_boundary_points[] and then
    1422  added again as the last point of ngon_boundary_points[].
    1423  This is useful when you need a closed polyline.
    1424  ngon_boundary_points - [out]
    1425  An array of ngon->m_Vcount + (bAppendStartPoint ? 1 : 0) points
    1426  is returned in ngon_boundary_points[]. The caller must insure
    1427  that ngon_boundary_points[] has room for this many elements.
    1428  Returns:
    1429  Number of points added to ngon_boundary_points[] or 0 if invalid
    1430  input is encountered.
    1431  */
    1432  unsigned int GetOuterBoundaryPoints(
    1433  const class ON_3dPointListRef& mesh_vertex_list,
    1434  bool bAppendStartPoint,
    1435  ON_3dPoint* ngon_boundary_points
    1436  ) const;
    1437 
    1438 
    1439  /*
    1440  Description:
    1441  Use the ngon m_fi[] array to get a list of ngon boundary sides.
    1442  Parameters:
    1443  mesh_face_list - [in]
    1444  ngon_boundary_sides - [out]
    1445  ngon_boundary_sides[i]/8 = ON_MeshNon.m_fi[] array index
    1446  ngon_boundary_sides[i]%4 = side index
    1447  side index 0 identifies the side that runs from the first face
    1448  vertex to the second face vertex.
    1449  ngon_boundary_sides[i]&4 != 0 means the face side is reversed
    1450  when used as an ngon boundary segment.
    1451  Returns:
    1452  Number of elements added to ngon_boundary_sides[] or 0 if invalid
    1453  input is encountered.
    1454  */
    1455  unsigned int GetBoundarySides(
    1456  const class ON_MeshFaceList& mesh_face_list,
    1457  ON_SimpleArray<unsigned int>& ngon_boundary_sides
    1458  ) const;
    1459 
    1460 
    1461  //////////////////////////////////////////////////////////////
    1462  //
    1463  // Tools for finding a making n-gons
    1464  //
    1465  static unsigned int FindPlanarNgons(
    1466  const class ON_3dPointListRef& vertex_list,
    1467  const class ON_MeshFaceList& face_list,
    1468  const unsigned int *const* vertex_face_map,
    1469  double planar_tolerance,
    1470  unsigned int minimum_ngon_vertex_count,
    1471  unsigned int minimum_ngon_face_count,
    1472  bool bAllowHoles,
    1473  class ON_MeshNgonAllocator& NgonAllocator,
    1476  );
    1477 
    1478  /*
    1479  Description:
    1480  Get a list of vertices that form the boundary of a set of faces.
    1481  Parameters:
    1482  mesh_vertex_list - [in]
    1483  mesh_face_list - [in]
    1484  vertex_face_map - [in]
    1485  null or a vertex map made from the information in
    1486  mesh_vertex_list and mesh_face_list.
    1487  ngon_fi_count - [in]
    1488  length of ngon_fi[] array
    1489  ngon_fi - [in]
    1490  An array of length ngon_fi_count that contains the indices
    1491  of the faces that form the ngon.
    1492  ngon_vi - [out]
    1493  An array of vertex indices that make the ngon boundary.
    1494  Returns:
    1495  Number of vertices in the ngon outer boundary or 0 if the input is
    1496  not valid.
    1497  */
    1498  static unsigned int FindNgonOuterBoundary(
    1499  const class ON_3dPointListRef& mesh_vertex_list,
    1500  const class ON_MeshFaceList& mesh_face_list,
    1501  const unsigned int *const* vertex_face_map,
    1502  size_t ngon_fi_count,
    1503  const unsigned int* ngon_fi,
    1505  );
    1506 
    1507  /*
    1508  Description:
    1509  Create an ngon pointer that contains a triangle (3-gon)
    1510  or quad (4-gon) from a mesh face.
    1511  This is handy when your code needs to handle both
    1512  ngons and faces because it lets you convert a face to its
    1513  ngon format and the rest of the code can work exclusively with
    1514  ngons.
    1515  Parameters:
    1516  buffer - [in]
    1517  an array with a capacity for at least 9 ON__UINT_PTR elements.
    1518  The returned ngon information will be stored in this memory.
    1519  mesh_face_index - [in]
    1520  fvi - [in]
    1521  mesh face vertex indices.
    1522  If "f" is an ON_MeshFace, then pass (const unsigned int*)f.vi.
    1523  Returns:
    1524  If the input is valid, the returned ngon pointer is is the
    1525  face's triangle or quad. All returned information is in the
    1526  buffer[].
    1527  null - invalid input.
    1528  See Also:
    1529  ON_Mesh::NgonFromComponentIndex()
    1530  */
    1531  static class ON_MeshNgon* NgonFromMeshFace(
    1532  class ON_MeshNgonBuffer& ngon_buffer,
    1533  unsigned int mesh_face_index,
    1534  const unsigned int* fvi
    1535  );
    1536 
    1537  /*
    1538  Description:
    1539  Create an array of a single ngon pointer that contains
    1540  a triangle (3-gon) or quad (4-gon) from a mesh face.
    1541  This is handy when your code needs to handle both
    1542  ngons and faces because it lets you convert a face to its
    1543  ngon format and the rest of the code can work exclusively with
    1544  ngons.
    1545  Parameters:
    1546  ngon_buffer - [in]
    1547  memory used to create ngon classan array with a capacity for at least 10 ON__UINT_PTR elements.
    1548  mesh_face_index - [in]
    1549  fvi - [in]
    1550  mesh face vertex indices.
    1551  If "f" is an ON_MeshFace, then pass (const unsigned int*)f.vi.
    1552  Returns:
    1553  If the input is valid, the returned pointer is an array of a single ngon
    1554  that is the face's triangle or quad. All returned information is in the
    1555  buffer[].
    1556  null - invalid input.
    1557  */
    1558  static class ON_MeshNgon** NgonListFromMeshFace(
    1559  class ON_MeshNgonBuffer& ngon_buffer,
    1560  unsigned int mesh_face_index,
    1561  const unsigned int* fvi
    1562  );
    1563 
    1564  /*
    1565  Description:
    1566  If a component index identifies a face or ngon, Get an array Create an array of a single ngon pointer that contains
    1567  a triangle (3-gon) or quad (4-gon) from a mesh face.
    1568  This is handy when your code needs to handle both
    1569  ngons and faces because it lets you convert a face to its
    1570  ngon format and the rest of the code can work exclusively with
    1571  ngons.
    1572  Parameters:
    1573  ngon_buffer - [in]
    1574  memory used to create ON_MeshNgon class
    1575  ci - [in]
    1576  mesh - [in]
    1577  ngon_list - [out]
    1578  An array of ngon pointers. Some pointers may be null.
    1579  Returns:
    1580  Number of ngon pointers in ngon_list.
    1581  */
    1582  static unsigned int NgonListFromMeshFaceOrNgonComponent(
    1583  class ON_MeshNgonBuffer& ngon_buffer,
    1584  ON_COMPONENT_INDEX ci,
    1585  const class ON_Mesh* mesh,
    1586  const class ON_MeshNgon* const *& ngon_list
    1587  );
    1588 
    1589  ////////////////////////////////////////////////////////////////////
    1590  //
    1591  // Tools for text output
    1592  //
    1593  ON_String ToString() const;
    1594 
    1595  ON_wString ToWideString() const;
    1596 
    1597  void Dump(
    1598  class ON_TextLog& text_log
    1599  )const;
    1600 
    1601  void AppendToString(
    1602  class ON_String& s
    1603  )const;
    1604 
    1605  void AppendToString(
    1606  class ON_wString& s
    1607  )const;
    1608 
    1609 
    1610  ////////////////////////////////////////////////////////////////////
    1611  //
    1612  // Tools for validation output
    1613  //
    1614 
    1615  /*
    1616  Description:
    1617  Test ngon to see if the vertex and face references are valid and
    1618  pass partial boundary validity checks,
    1619  Parameters:
    1620  ngon - [in]
    1621  ngon to test
    1622  ngon_index - [in]
    1623  This index is used in messages sent to text_log
    1624  text_log - [in]
    1625  nullptr or a place to send information about problems.
    1626  mesh_vertex_count - [in]
    1627  Number of vertices in the mesh
    1628  mesh_face_count - [in]
    1629  Number of face in the mesh
    1630  mesh_F - [in]
    1631  nullptr of mesh faces - required for boundary checks
    1632  workspace_buffer - [in]
    1633  If you are passing in mesh_F and you are testing testing multple
    1634  ngons, then consider providing a workspace_buffer that will be automatically
    1635  reused for successive ngons.
    1636  Returns:
    1637  0: ngon is not valid
    1638  >0: number of boundary edges.
    1639  If this number is > ngon->m_V_count, then the ngon has inner boundaries
    1640  or duplicate vertices.
    1641  */
    1642  static unsigned int IsValid(
    1643  const ON_MeshNgon* ngon,
    1644  unsigned int ngon_index,
    1645  ON_TextLog* text_log,
    1646  unsigned int mesh_vertex_count,
    1647  unsigned int mesh_face_count,
    1648  const ON_MeshFace* mesh_F
    1649  );
    1650 
    1651  static unsigned int IsValid(
    1652  const ON_MeshNgon* ngon,
    1653  unsigned int ngon_index,
    1654  ON_TextLog* text_log,
    1655  unsigned int mesh_vertex_count,
    1656  unsigned int mesh_face_count,
    1657  const ON_MeshFace* mesh_F,
    1658  ON_SimpleArray< unsigned int >& workspace_buffer
    1659  );
    1660 };
    1661 
    1662 class ON_CLASS ON_MeshNgonAllocator
    1663 {
    1664 public:
    1665  ON_MeshNgonAllocator() ON_NOEXCEPT;
    1667 
    1668  /*
    1669  Parameters:
    1670  Vcount - [in] >= 3
    1671  Fcount - [in] >= 0
    1672  */
    1673  ON_MeshNgon* AllocateNgon(
    1674  unsigned int Vcount,
    1675  unsigned int Fcount
    1676  );
    1677 
    1678  /*
    1679  Parameters:
    1680  Vcount - [in] >= 3
    1681  Fcount - [in] >= 0
    1682  */
    1683  ON_MeshNgon* ReallocateNgon(
    1684  ON_MeshNgon* ngon,
    1685  unsigned int Vcount,
    1686  unsigned int Fcount
    1687  );
    1688 
    1689  /*
    1690  Parameters:
    1691  ngon - in]
    1692  An ngon pointer value that was previously returned by
    1693  this allocator's AllocateNgon() or CopyNgon() function.
    1694  */
    1695  bool DeallocateNgon(
    1696  ON_MeshNgon* ngon
    1697  );
    1698 
    1699  /*
    1700  Description:
    1701  Returns a copy of ngon.
    1702  Parameters:
    1703  ngon - [in]
    1704  Returns:
    1705  If
    1706  */
    1707  ON_MeshNgon* CopyNgon(
    1708  const ON_MeshNgon* ngon
    1709  );
    1710 
    1711  /*
    1712  Description:
    1713  Deallocate every n-gon managed by this allocator.
    1714  */
    1715  void DeallocateAllNgons();
    1716 
    1717 #if defined(ON_HAS_RVALUEREF)
    1720 #endif
    1721 
    1722 private:
    1723 
    1724  ON_FixedSizePool m_7; // Vcount+Fcount <= 7
    1725  ON_FixedSizePool m_15; // Vcount+Fcount <= 15
    1726  void* m_31; // available for Vcount+Fcount <= 31
    1727  void* m_63; // available for Vcount+Fcount <= 63
    1728  void* m_active; // active Vcount+Fcount >= 16
    1729 
    1730 private:
    1731  // prohibit copy construction. No implentation.
    1732  ON_MeshNgonAllocator(const ON_MeshNgonAllocator&) = delete;
    1733 
    1734  // prohibit operator=. No implentation.
    1735  ON_MeshNgonAllocator& operator=(const ON_MeshNgonAllocator&) = delete;
    1736 };
    1737 
    1739 {
    1740 public:
    1741  unsigned int m_vi[2]; // vertex indices or ids (equal values indicate unset)
    1742  unsigned int m_fi; // face index or id
    1743  unsigned char m_side; // triangles use 0,1,3, quads use 0,1,2,3
    1744  // m_side 0 connect face vertex 0 to face vertex 1.
    1745  unsigned char m_dir; // 0 = counterclockwise, 1 = clockwise (reversed)
    1746  unsigned short m_value; // Use depends on context.
    1747  unsigned int m_id; // Use depends on context - typically identifies and edge or ngon
    1748 
    1749  static const ON_MeshFaceSide Unset; // all values are zero
    1750 
    1751  /*
    1752  Description:
    1753  Compare a and b in dictionary order comparing the field values in the order
    1754  m_fi
    1755  m_vi[0]
    1756  m_vi[1]
    1757  m_side
    1758  m_dir
    1759  Parameters:
    1760  a - [in]
    1761  b - [in]
    1762  Returns:
    1763  -1: *a < *b
    1764  0: *a < *b
    1765  1: *a > *b
    1766  Remarks:
    1767  The function is thread safe.
    1768  */
    1769  static int CompareFaceIndex(
    1770  const ON_MeshFaceSide* a,
    1771  const ON_MeshFaceSide* b
    1772  );
    1773 
    1774  /*
    1775  Description:
    1776  Compare a and b in dictionary order comparing the field values in the order
    1777  m_vi[0]
    1778  m_vi[1]
    1779  m_fi
    1780  m_side
    1781  m_dir
    1782  Parameters:
    1783  a - [in]
    1784  b - [in]
    1785  Returns:
    1786  -1: *a < *b
    1787  0: *a < *b
    1788  1: *a > *b
    1789  Remarks:
    1790  The function is thread safe.
    1791  */
    1792  static int CompareVertexIndex(
    1793  const ON_MeshFaceSide* a,
    1794  const ON_MeshFaceSide* b
    1795  );
    1796 
    1797  /*
    1798  Description:
    1799  Sort the face_sides[] using the compare function
    1800  ON_MeshFaceSide::CompareVertexIndex().
    1801  Paramters:
    1802  face_sides - [in/out]
    1803  array to sort
    1804  face_sides_count - [in]
    1805  number of elements in the face_sides[] array.
    1806  Remarks:
    1807  The function is thread safe.
    1808  */
    1809  static void SortByVertexIndex(
    1810  ON_MeshFaceSide* face_sides,
    1811  size_t face_sides_count
    1812  );
    1813 
    1814  /*
    1815  Description:
    1816  Sort the face_sides[] using the compare function
    1817  ON_MeshFaceSide::CompareFaceIndex().
    1818  Paramters:
    1819  face_sides - [in/out]
    1820  array to sort
    1821  face_sides_count - [in]
    1822  number of elements in the face_sides[] array.
    1823  Remarks:
    1824  The function is thread safe.
    1825  */
    1826  static void SortByFaceIndex(
    1827  ON_MeshFaceSide* face_sides,
    1828  size_t face_sides_count
    1829  );
    1830 
    1831  /*
    1832  Description:
    1833  Get a list of mesh face sides.
    1834  Parameters:
    1835  mesh_vertex_count - [in]
    1836  Number of vertices in the mesh.
    1837  This value is used to validate vertex index values in mesh_face_list.
    1838  mesh_face_list - [in]
    1839  Mesh faces
    1840  fi_list - [in]
    1841  - If fi_list null, then sides for every face in mesh_face_list will
    1842  be added and the ON_MeshFaceSide.m_fi values will be the
    1843  mesh_face_list[] index.
    1844  - If fi_list is not null, then fi_list[] is an array of mesh_face_list[]
    1845  indices and the ON_MeshFaceSide.m_fi values will be fi_list[] array
    1846  indices. For example, you may pass ON_MeshNon.m_fi as this parameter
    1847  when you want a list of sides of faces in an ngon.
    1848  fi_list_count - [in]
    1849  - If fi_list is not null, then fi_list_count is the number of elements
    1850  in the fi_list[] array.
    1851  - If fi_list is null, then fi_list_count is ignored.
    1852  vertex_id_map - [in] (can be null)
    1853  - If vertex_id_map is null, then the ON_MeshFaceSide::m_vi[] values
    1854  are the vertex index values from mesh_face_list[].
    1855  - If vertex_id_map is not null, then vertex_id_map[] is an array
    1856  with the mesh_vertex_count elements and ON_MeshFaceSide::m_vi[] values
    1857  are vertex_id_map[mesh_face_list[] vertex indices]. A vertex_id_map[]
    1858  is commonly used when coincident vertices need to be treated as
    1859  a single topological entity.
    1860  face_side_list - [out]
    1861  - If the input value of face_side_list is not null, then face_side_list[]
    1862  must be long enough to hold the returned face_side_list list.
    1863  The maximum posssible length is 4*mesh_face_list.FaceCount().
    1864  - If the input falue of face_side_list is null, memory will be allocated
    1865  using onmalloc() and the caller is responsible for calling onfree() at
    1866  an appropriate time.
    1867  The returned is face_side_list[] is dictionary sorted by ON_MeshFaceSide.m_fi
    1868  and then ON_MeshFaceSide.m_si. The vertex ids satisfy
    1869  ON_MeshFaceSide.m_vi[0] < ON_MeshFaceSide.m_vi[1]. ON_MeshFaceSide.m_dir
    1870  is 0 if the face vertex order is the same and 1 if the face vertex order
    1871  is opposite. The static sorting functions on ON_MeshFaceSide can be used
    1872  to change this ordering.
    1873  Returns:
    1874  Number of elements set in face_side_list[].
    1875  Remarks:
    1876  Faces in mesh_face_list with vertex indices that are >= mesh_vertex_count
    1877  are ignored. Degenerate faces are processed, but degenerate sides
    1878  (equal vertex ids) are not added to face_side_list[].
    1879  */
    1880  static unsigned int GetFaceSideList(
    1881  size_t mesh_vertex_count,
    1882  const class ON_MeshFaceList& mesh_face_list,
    1883  const unsigned int* fi_list,
    1884  size_t fi_list_count,
    1885  const unsigned int* vertex_id_map,
    1886  ON_MeshFaceSide*& face_side_list
    1887  );
    1888 };
    1889 
    1890 
    1892 {
    1893  // ON_Mesh faces with indices fi[0] <= i < fi[1] reference
    1894  // vertices with indices vi[0] <= j < vi[1].
    1895  int vi[2]; // subinterval of mesh m_V[] array
    1896  int fi[2]; // subinterval of mesh m_F[] array
    1897  int vertex_count; // = vi[1] - vi[0];
    1898  int triangle_count; // tris + 2*quads >= fi[1] - fi[0]
    1899 };
    1900 
    1901 #if defined(ON_DLL_TEMPLATE)
    1902 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_MeshFace>;
    1903 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_MeshNgon*>;
    1904 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_MeshTopologyVertex>;
    1905 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_MeshTopologyEdge>;
    1906 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_MeshTopologyFace>;
    1907 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<struct ON_MeshPart>;
    1908 #endif
    1909 
    1910 class ON_CLASS ON_MeshTopology
    1911 {
    1912  // A mesh topology class is always associated with an ON_Mesh
    1913  // and can be retrieved by calling ON_Mesh::Topology()
    1914 public:
    1915  ON_MeshTopology();
    1916  ~ON_MeshTopology();
    1917 
    1918  bool IsValid() const;
    1919 
    1920  void Dump( ON_TextLog& ) const;
    1921 
    1922  //////////
    1923  // The parent ON_Mesh geometry used to compute this mesh topology.
    1924  const ON_Mesh* m_mesh;
    1925 
    1926  //////////
    1927  // number of topoligical vertices (<= m_mesh.VertexCount())
    1928  int TopVertexCount() const;
    1929 
    1930  //////////
    1931  // number of topoligical edges
    1932  int TopEdgeCount() const;
    1933 
    1934  //////////
    1935  // number of topoligical faces (same as m_mesh.FaceCount())
    1936  int TopFaceCount() const;
    1937 
    1938  class ON_MeshComponentRef MeshComponentRef(
    1939  ON_COMPONENT_INDEX ci
    1940  ) const;
    1941 
    1942  /*
    1943  Description:
    1944  Get the 3d point location of a vertex.
    1945  Parameters:
    1946  topv_index - [in];
    1947  Returns:
    1948  Location of vertex.
    1949  */
    1950  ON_3dPoint TopVertexPoint(
    1951  int topv_index
    1952  ) const;
    1953 
    1954  /*
    1955  Description:
    1956  Get the 3d line along an edge.
    1957  Parameters:
    1958  tope_index - [in];
    1959  Returns:
    1960  Line along edge. If input is not valid,
    1961  the line.from and to are ON_3dPoint::UnsetPoint
    1962  */
    1963  ON_Line TopEdgeLine(
    1964  int tope_index
    1965  ) const;
    1966 
    1967  ////////
    1968  // returns index of edge that connects topological vertices
    1969  // returns -1 if no edge is found.
    1970  int TopEdge(
    1971  int vtopi0,
    1972  int vtopi1 // ON_MeshTopology vertex topology indices
    1973  ) const;
    1974 
    1975  ////////
    1976  // returns ON_MeshTopology vertex topology index of a face
    1977  // corner. The face is triangle iv TopFaceVertex(2) = TopFaceVertex(3)
    1978  bool GetTopFaceVertices(
    1979  int topfi, // ON_MeshTopology face topology index (= ON_Mesh face index)
    1980  int topvi[4] // ON_MeshTopology vertex indices returned here
    1981  ) const;
    1982 
    1983  /*
    1984  Parameters:
    1985  topvi - [in]
    1986  Topology vertex index
    1987  mesh_facedex_to_ngondex_map - [in]
    1988  If null, Mesh().NgonMap() will be used. In cases where Mesh().NgonMap()
    1989  does not exist and cannot be created, an expert user may pass in
    1990  a local map that converts a face index into an ngon index.
    1991  Returns:
    1992  If the vertex is interior to a single ngon, then the index of the
    1993  ngon is returned. Otherwise ON_UNSET_UINT_INDEX is returned.
    1994  */
    1995  unsigned int NgonIndexFromTopologyVertexIndex(
    1996  unsigned int topvi,
    1997  const unsigned int* mesh_facedex_to_ngondex_map
    1998  ) const;
    1999 
    2000  /*
    2001  Parameters:
    2002  topei - [in]
    2003  Topology edge index
    2004  mesh_facedex_to_ngondex_map - [in]
    2005  If null, Mesh().NgonMap() will be used. In cases where Mesh().NgonMap()
    2006  does not exist and cannot be created, an expert user may pass in
    2007  a local map that converts a face index into an ngon index.
    2008  Returns:
    2009  If the vertex is interior to a single ngon, then the index of the
    2010  ngon is returned. Otherwise ON_UNSET_UINT_INDEX is returned.
    2011  */
    2012  unsigned int NgonIndexFromTopologyEdgeIndex(
    2013  unsigned int topei,
    2014  const unsigned int* mesh_facedex_to_ngondex_map
    2015  ) const;
    2016 
    2017  /*
    2018  Description:
    2019  Sort the m_topei[] list of a mesh topology vertex so that
    2020  the edges are in radial order. The "const" is a white
    2021  lie to make this function easier to call.
    2022  Parameter:
    2023  topvi - [in] index of vertex in m_topv[] array.
    2024  Remarks:
    2025  A nonmanifold edge is treated as a boundary edge with respect
    2026  to sorting. If any boundary or nonmanifold edges end at the
    2027  vertex, then the first edge will be a boundary or nonmanifold
    2028  edge.
    2029  */
    2030  bool SortVertexEdges( int topvi ) const;
    2031 
    2032  /*
    2033  Description:
    2034  Sort the m_topei[] list of every mesh topology vertex so
    2035  that the edges are in radial order. The "const" is a white
    2036  lie to make this function easier to call.
    2037  Remarks:
    2038  Same as
    2039  for ( int topvi = 0; topvi < m_topv.Count(); topvi++ )
    2040  SortVertexEdges(topvi);
    2041  */
    2042  bool SortVertexEdges() const;
    2043 
    2044  /*
    2045  Description:
    2046  Returns true if the topological vertex is hidden.
    2047  Parameters:
    2048  topvi - [in] mesh topology vertex index.
    2049  Returns:
    2050  True if mesh topology vertex is hidden.
    2051  Remarks:
    2052  The mesh topology vertex is hidden if and only if
    2053  all the ON_Mesh vertices it represents is hidden.
    2054  */
    2055  bool TopVertexIsHidden( int topvi ) const;
    2056 
    2057  /*
    2058  Description:
    2059  Returns true if the topological edge is hidden.
    2060  Parameters:
    2061  topei - [in] mesh topology edge index.
    2062  Returns:
    2063  True if mesh topology edge is hidden.
    2064  Remarks:
    2065  The mesh topology edge is hidden if and only if
    2066  either of its mesh topology vertices is hidden.
    2067  */
    2068  bool TopEdgeIsHidden( int topei ) const;
    2069 
    2070  /*
    2071  Description:
    2072  Returns true if the topological face is hidden.
    2073  Parameters:
    2074  topfi - [in] mesh topology face index.
    2075  Returns:
    2076  True if mesh topology face is hidden.
    2077  Remarks:
    2078  The mesh topology face is hidden if and only if
    2079  any of its mesh topology edges are hidden.
    2080  */
    2081  bool TopFaceIsHidden( int topfi ) const;
    2082 
    2083  //////////
    2084  // m_topv_map[] has length m_mesh.VertexCount() and
    2085  // m_topv[m_topv_map[vi]] is the topological mesh vertex that is assocated
    2086  // the with the mesh vertex m_mesh.m_V[vi].
    2088 
    2089  ////////////
    2090  // Array of topological mesh vertices. See the comments in the definition
    2091  // of ON_MeshTopologyVertex for details.
    2093 
    2094  ////////////
    2095  // Array of topological mesh edges. See the comments in the definition
    2096  // of ON_MeshTopologyEdge for details.
    2098 
    2099  ////////////
    2100  // Array of topological mesh faces. The topological face
    2101  // m_topf[fi] corresponds to the mesh face ON_Mesh.m_F[fi].
    2102  // See the comments in the definition of ON_MeshTopologyFace
    2103  // for details. To get the indices of the mesh topology
    2104  // vertices at the face corners use
    2105  // topvi = m_topv_map[m_mesh.m_F[fi].vi[n]]
    2107 
    2108  /*
    2109  Description:
    2110  Expert user function for efficiently getting the
    2111  integer arrays used by the ON_MeshTopologyVertex
    2112  and ON_MeshTopologyEdge classes.
    2113  Parameters:
    2114  count - [in] number of integers in array
    2115  Returns:
    2116  pointer to integer array. The array memory
    2117  will be freed by ~ON_MeshTopology()
    2118  */
    2119  int* GetIntArray(int count);
    2120 
    2121 private:
    2122  friend class ON_Mesh;
    2123 
    2124  bool Create();
    2125  void Destroy();
    2126  void EmergencyDestroy();
    2127 
    2128  // efficient workspaces for
    2129  struct memchunk
    2130  {
    2131  struct memchunk* next;
    2132  } *m_memchunk;
    2133 
    2134  // NOTE: this field is a bool with valid values of 0 and 1.
    2135  volatile int m_b32IsValid; // sizeof(m_bIsValid) must be 4 - it is used in sleep locks.
    2136  // 0: Not Valid
    2137  // 1: Valid
    2138  // -1: Sleep locked - ON_Mesh::Topology() calculation is in progress
    2139  int WaitUntilReady(int sleep_value) const; // waits until m_b32IsValid >= 0
    2140 
    2141 private:
    2142  // no implementation
    2144  ON_MeshTopology& operator=(const ON_MeshTopology&);
    2145 };
    2146 
    2147 
    2148 
    2149 class ON_CLASS ON_MeshPartition
    2150 {
    2151 public:
    2152  ON_MeshPartition();
    2153  ~ON_MeshPartition();
    2154 
    2155  // maximum number of vertices in a partition
    2157  // maximum number of triangles in a partition (quads count as 2 triangles)
    2159 
    2160  // Partition i uses
    2161  // vertices m_V[j] where
    2162  //
    2163  // m_part[i].vi[0] <= j < m_part[i].vi[1]
    2164  //
    2165  // and uses faces m_F[k] where
    2166  //
    2167  // m_part[i].fi[0] <= k < m_part[i].fi[1]
    2169 };
    2170 
    2171 
    2172 
    2173 class ON_CLASS ON_MappingTag
    2174 {
    2175 public:
    2176  ON_MappingTag();
    2177  void Default();
    2178  bool Write(ON_BinaryArchive&) const;
    2179  bool Read(ON_BinaryArchive&);
    2180  void Dump( ON_TextLog& ) const;
    2181  void Transform( const ON_Xform& xform );
    2182  void Set(const ON_TextureMapping& mapping);
    2183 
    2184  /*
    2185  Description:
    2186  Sets the tag to the value the meshes have that
    2187  come out of ON_Brep::CreateMesh().
    2188  */
    2189  void SetDefaultSurfaceParameterMappingTag();
    2190 
    2191  int Compare( const ON_MappingTag& other,
    2192  bool bCompareId = true,
    2193  bool bCompareCRC = true,
    2194  bool bCompareXform = true
    2195  ) const;
    2196 
    2197  /*
    2198  Returns:
    2199  True if the mapping tag is set.
    2200  */
    2201  bool IsSet() const;
    2202 
    2203  /*
    2204  Returns:
    2205  True if the mapping tag is for a mapping with
    2206  type ON_TextureMapping::srfp_mapping with
    2207  m_uvw = identity.
    2208  */
    2209  bool IsDefaultSurfaceParameterMapping() const;
    2210 
    2211  // Identifies the mapping used to create the texture
    2212  // coordinates and records transformations applied
    2213  // to the mesh after the texture coordinates were
    2214  // calculated. If the texture mapping does not
    2215  // change when the mesh is transformed, then set
    2216  // m_mesh_xform to zero so that compares will work right.
    2217  //
    2218  //
    2219  ON_UUID m_mapping_id; // ON_TextureMapping::m_mapping_id
    2220  ON_TextureMapping::TYPE m_mapping_type; // ON_TextureMapping::m_type
    2221  ON__UINT32 m_mapping_crc; // ON_TextureMapping::MappingCRC()
    2223 };
    2224 
    2226 {
    2227 public:
    2229 
    2231  int m_dim; // 1, 2, or 3
    2232  ON_SimpleArray<ON_3fPoint> m_T; // texture coordinates
    2233 };
    2234 
    2235 
    2236 #if defined(ON_DLL_TEMPLATE)
    2237 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_MappingTag>;
    2238 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_TextureCoordinates>;
    2239 #endif
    2240 
    2241 class ON_CLASS ON_Mesh : public ON_Geometry
    2242 {
    2243  ON_OBJECT_DECLARE(ON_Mesh);
    2244 
    2245 public:
    2246  ON_Mesh();
    2247  ON_Mesh(
    2248  int initial_face_array_capacity, // initial face array capacity
    2249  int initial_vertex_array_capacity, // initial vertex array capacity
    2250  bool has_vertex_normals, // true if mesh has vertex normals
    2251  bool has_texture_coordinates // true if mesh has texture coordinates
    2252  );
    2253  ON_Mesh( const ON_Mesh& );
    2254  ON_Mesh& operator=( const ON_Mesh& );
    2255  ~ON_Mesh();
    2256 
    2257 
    2258  // Override of virtual ON_Object::MemoryRelocate
    2259  void MemoryRelocate() override;
    2260 
    2261  // virtual ON_Object::DestroyRuntimeCache override
    2262  void DestroyRuntimeCache( bool bDelete = true ) override;
    2263 
    2264  void Destroy();
    2265  void EmergencyDestroy(); // Call only when memory used by this class's
    2266  // members will soon become invalid for reasons
    2267  // beyond your control. EmergencyDestroy() zeros
    2268  // anything that could possibly cause
    2269  // ~ON_Mesh() to crash. Calling
    2270  // EmergencyDestroy() under normal conditions
    2271  // will result in ~ON_Mesh() leaking
    2272  // memory.
    2273 
    2274 
    2275  void DestroyTree( bool bDeleteTree = true );
    2276 
    2277  /////////////////////////////////////////////////////////////////
    2278  // ON_Object overrides
    2279 
    2280  // virtual ON_Object::SizeOf override
    2281  unsigned int SizeOf() const override;
    2282 
    2283  // virtual ON_Object::DataCRC override
    2284  ON__UINT32 DataCRC(ON__UINT32 current_remainder) const override;
    2285 
    2286  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    2287 
    2288  void Dump( ON_TextLog& ) const override; // for debugging
    2289 
    2290  bool Write( ON_BinaryArchive& ) const override;
    2291 
    2292  bool Read( ON_BinaryArchive& ) override;
    2293 
    2294  ON::object_type ObjectType() const override;
    2295 
    2296  /////////////////////////////////////////////////////////////////
    2297  // ON_Geometry overrides
    2298 
    2299  int Dimension() const override;
    2300 
    2301  // virtual ON_Geometry GetBBox override
    2302  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    2303 
    2304  // virtual ON_Geometry GetTightBoundingBox override
    2305  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    2306 
    2307  bool GetTightBoundingBox(
    2308  ON_BoundingBox& tight_bbox,
    2309  bool bGrowBox ,
    2310  const ON_SimpleArray<ON_PlaneEquation>& clipping_planes,
    2311  const ON_Xform* xform = nullptr
    2312  ) const ;
    2313 
    2314  bool Transform(
    2315  const ON_Xform&
    2316  ) override;
    2317 
    2318  // virtual ON_Geometry::IsDeformable() override
    2319  bool IsDeformable() const override;
    2320 
    2321  // virtual ON_Geometry::MakeDeformable() override
    2322  bool MakeDeformable() override;
    2323 
    2324  bool SwapCoordinates(
    2325  int, int // indices of coords to swap
    2326  ) override;
    2327 
    2328 
    2329  // virtual ON_Geometry override
    2330  bool EvaluatePoint( const class ON_ObjRef& objref, ON_3dPoint& P ) const override;
    2331 
    2332 
    2333  /////////////////////////////////////////////////////////////////
    2334  // Interface
    2335  //
    2336 
    2337  /*
    2338  Returns
    2339  true if there are zero vertices or zero faces.
    2340  */
    2341  bool IsEmpty() const;
    2342 
    2343  // creation
    2344  bool SetVertex(
    2345  int, // vertex index
    2346  const ON_3dPoint& // vertex location
    2347  );
    2348  bool SetVertex(
    2349  int, // vertex index
    2350  const ON_3fPoint& // vertex location
    2351  );
    2352  bool SetVertexNormal(
    2353  int, // vertex index
    2354  const ON_3dVector& // unit normal
    2355  );
    2356  bool SetVertexNormal(
    2357  int, // vertex index
    2358  const ON_3fVector& // unit normal
    2359  );
    2360  bool SetTextureCoord(
    2361  int, // vertex index
    2362  double, double // texture coordinates
    2363  );
    2364  bool SetTriangle(
    2365  int, // face index
    2366  int,int,int // vertex indices
    2367  );
    2368  bool SetQuad(
    2369  int, // face index
    2370  int,int,int,int // vertex indices
    2371  );
    2372 
    2373  /*
    2374  Description:
    2375  Use this function to append a duplicate of an existing vertex.
    2376  Parameters:
    2377  vertex_index - [in]
    2378  index of the existing vertex
    2379  Returns:
    2380  If vertex_index is valid, the index of the duplicate is returned.
    2381  Otherwise, ON_UNSET_UINT_INDEX is returned.
    2382  Remarks:
    2383  This function duplicates all information associated with
    2384  the input vertex and is a good way to insure that
    2385  optional vertex information like color, texture, surface
    2386  parameters, curvatures, vertex normals, and so on get
    2387  duplicated as well.
    2388  */
    2389  unsigned int AppendDuplicateVertex(
    2390  unsigned int vertex_index
    2391  );
    2392 
    2393  /*
    2394  Description:
    2395  Increases the capactiy of arrays used to hold vertex information.
    2396  Parameters:
    2397  new_vertex_capacity - [in]
    2398  desired capacity
    2399  Returns:
    2400  true if successful.
    2401  Remarks:
    2402  This function is useful if you are getting ready to add a known number
    2403  of vertices and want to increase the dynamic array capacities before
    2404  you begin adding vertices.
    2405  */
    2406  bool ReserveVertexCapacity(
    2407  size_t new_vertex_capacity
    2408  );
    2409 
    2410  /*
    2411  Parameters:
    2412  ci - [in]
    2413  component index to test
    2414  Returns:
    2415  True if ci identifies a component (vertex, edge, face, ngon) that exists in this mesh.
    2416  */
    2417  bool IsValidMeshComponentIndex(
    2418  ON_COMPONENT_INDEX ci
    2419  ) const;
    2420 
    2421  class ON_MeshComponentRef MeshComponentRef(
    2422  ON_COMPONENT_INDEX ci
    2423  ) const;
    2424 
    2425  /*
    2426  Parameters:
    2427  ci - [in] a component index with type mesh_vertex, meshtop_vertex,
    2428  meshtop_edge, or mesh_face.
    2429  Returns:
    2430  A pointer to an ON_MeshComponentRef
    2431  The caller must delete the returned object when it is no longer
    2432  needed.
    2433  */
    2434  class ON_MeshComponentRef* MeshComponent(
    2435  ON_COMPONENT_INDEX ci
    2436  ) const;
    2437 
    2438  /*
    2439  Description:
    2440  Delete the portions of the mesh identified in ci_list[].
    2441  Parameters:
    2442  ci_list - [in]
    2443  List of components to delete.
    2444  ci_list_count - [in]
    2445  Number of elements in the ci_list[] array.
    2446  Can be zero if you are using this function to remove
    2447  unused vertices or empty ngons.
    2448  bIgnoreInvalidComponents - [in]
    2449  If true, invalid elements in ci_list[] are ignored.
    2450  If false and ci_list[] contains an invalid element,
    2451  then no changes are made and false is returned.
    2452  bRemoveDegenerateFaces - [in]
    2453  If true, remove degenerate faces.
    2454  bCullUnusedVertices - [in]
    2455  Remove vertices that are not referenced by a face.
    2456  Pass true unless you have a good reason for keeping
    2457  unreferenced vertices.
    2458  bRemoveEmptyNgons - [in]
    2459  Remove ngons that are empty.
    2460  Pass true unless you have a good reason for keeping
    2461  empty ngons.
    2462  Returns:
    2463  True: succesful
    2464  False: failure - no changes.
    2465  */
    2466  bool DeleteComponents(
    2467  const ON_COMPONENT_INDEX* ci_list,
    2468  size_t ci_count,
    2469  bool bIgnoreInvalidComponents,
    2470  bool bRemoveDegenerateFaces,
    2471  bool bRemoveUnusedVertices,
    2472  bool bRemoveEmptyNgons
    2473  );
    2474 
    2475  /*
    2476  Description:
    2477  Calls the detailed version of DeleteComponents() with
    2478  bool bIgnoreInvalidComponents = true;
    2479  bool bRemoveDegenerateFaces = false;
    2480  bool bRemoveUnusedVertices = true;
    2481  bool bRemoveEmptyNgons = true;
    2482  */
    2483  bool DeleteComponents(
    2484  const ON_COMPONENT_INDEX* ci_list,
    2485  size_t ci_count
    2486  ) override;
    2487 
    2488  /*
    2489  Description:
    2490  Calls the detailed version of DeleteComponents() with
    2491  bool bIgnoreInvalidComponents = true;
    2492  bool bRemoveDegenerateFaces = false;
    2493  bool bRemoveUnusedVertices = true;
    2494  bool bRemoveEmptyNgons = true;
    2495  */
    2496  bool DeleteComponents(
    2497  const ON_SimpleArray<ON_COMPONENT_INDEX>& ci_list
    2498  );
    2499 
    2500  /*
    2501  Description:
    2502  Calls the detailed version of DeleteComponents() with
    2503  bool bIgnoreInvalidComponents = true;
    2504  bool bRemoveDegenerateFaces = false;
    2505  bool bRemoveUnusedVertices = true;
    2506  bool bRemoveEmptyNgons = true;
    2507  */
    2508  bool DeleteComponent(
    2509  ON_COMPONENT_INDEX ci
    2510  );
    2511 
    2512  /*
    2513  Description:
    2514  Copy the subset of the mesh idenfied in the component list.
    2515  Parameters:
    2516  ci_list - [in]
    2517  ci_count - [in]
    2518  ci_list[] is an array of ci_count components that identify the
    2519  parts of the mesh to copy. If a face or ngon is specified, then
    2520  any vertices or faces needed for a valid copy are automatically
    2521  copied as well.
    2522  destination_mesh - [in]
    2523  If null, a new mesh is allocated for the copy.
    2524  If not null, the copy is put in this mesh.
    2525  Return:
    2526  null - invalid input - no copy created
    2527  not null - a pointer to the copy.
    2528  */
    2529  ON_Mesh* CopyComponents(
    2530  const ON_COMPONENT_INDEX* ci_list,
    2531  size_t ci_count,
    2532  class ON_Mesh* destination_mesh
    2533  ) const;
    2534 
    2535  /*
    2536  Description:
    2537  Copy the subset of the mesh idenfied in the component list.
    2538  Parameters:
    2539  ci_list - [in]
    2540  ci_list[] is an array of ci_count components that identify the
    2541  parts of the mesh to copy. If a face or ngon is specified, then
    2542  any vertices or faces needed for a valid copy are automatically
    2543  copied as well.
    2544  destination_mesh - [in]
    2545  If null, a new mesh is allocated for the copy.
    2546  If not null, the copy is put in this mesh.
    2547  Return:
    2548  null - invalid input - no copy created
    2549  not null - a pointer to the copy.
    2550  */
    2551  ON_Mesh* CopyComponents(
    2552  const ON_SimpleArray<ON_COMPONENT_INDEX>& ci_list,
    2553  class ON_Mesh* destination_mesh
    2554  ) const;
    2555 
    2556  // query
    2557  int VertexCount() const;
    2558  unsigned int VertexUnsignedCount() const;
    2559  int FaceCount() const;
    2560  unsigned int FaceUnsignedCount() const;
    2561  int QuadCount() const; // number of faces that are quads
    2562  int TriangleCount() const; // number of faces that are triangles
    2563  int InvalidFaceCount() const; // number of face that have invalid m_vi[] values.
    2564  bool HasVertexNormals() const; // normals at vertices
    2565  bool HasFaceNormals() const;
    2566  bool HasTextureCoordinates() const;
    2567  bool HasSurfaceParameters() const;
    2568  bool HasPrincipalCurvatures() const;
    2569  bool HasVertexColors() const;
    2570 
    2571  /*
    2572  Returns:
    2573  True if the mesh has ngons.
    2574  */
    2575  bool HasNgons() const;
    2576 
    2577  /*
    2578  Returns:
    2579  Number of vertices that are hidden.
    2580  */
    2581  int HiddenVertexCount() const;
    2582 
    2583  bool GetCurvatureStats(
    2584  ON::curvature_style,
    2586  ) const;
    2587 
    2588  void InvalidateVertexBoundingBox(); // Call if defining geometry is changed by
    2589  // directly manipulating the m_V[] array.
    2590  void InvalidateVertexNormalBoundingBox(); // Call if defining geometry is changed by
    2591  // directly manipulating the m_N[] array.
    2592  void InvalidateTextureCoordinateBoundingBox(); // Call if defining geometry is changed by
    2593  // directly manipulating the m_T[] array.
    2594  void InvalidateCurvatureStats(); // Call if defining geometry is changed by
    2595  // directly manipulating the m_T[] array.
    2596  void InvalidateBoundingBoxes(); // Invalidates all cached bounding box information.
    2597 
    2598 
    2599  void Flip(); // reverses face orientations and flips vertex and face normals
    2600 
    2601  void FlipVertexNormals(); // reverses vertex normals
    2602  void FlipFaceNormals(); // reverses face normals
    2603  void FlipFaceOrientation(); // reverses face orientation (does nothing to normals)
    2604  void FlipNgonOrientation(); // reverses ngon boundary direction
    2605 
    2606  void SetMeshParameters( const ON_MeshParameters& );
    2607  const ON_MeshParameters* MeshParameters() const;
    2608  void DeleteMeshParameters();
    2609 
    2610 
    2611  bool UnitizeVertexNormals();
    2612  bool UnitizeFaceNormals();
    2613  bool CountQuads();
    2614 
    2615  /*
    2616  Description:
    2617  Splits all quads along the short diagonal.
    2618  */
    2619  bool ConvertQuadsToTriangles();
    2620 
    2621  /*
    2622  Description:
    2623  Splits non-planer quads into two triangles.
    2624 
    2625  Parameters:
    2626  planar_tolerance - [in]
    2627  If planar_tolerance >= 0, then a quad is split if its vertices
    2628  are not coplaner.
    2629 
    2630  If both planar_tolerance = ON_UNSET_VALUE and angle_tolerance_radians >= 0.0,
    2631  then the planarity test is skipped.
    2632 
    2633  If both planar_tolerance = ON_UNSET_VALUE and angle_tolerance_radians = ON_UNSET_VALUE,
    2634  then all quads are split.
    2635 
    2636  angle_tolerance_radians - [in]
    2637  If angle_tolerance_radians >= 0.0, then a quad is split if the
    2638  angle between opposite corner normals is > angle_tolerance_radians.
    2639  The corner normal is the normal to the triangle formed by two
    2640  adjacent edges and the diagonal connecting their endpoints.
    2641  A quad has for corner normals.
    2642 
    2643  If both angle_tolerance_radians = ON_UNSET_VALUE and planar_tolerance >= 0.0,
    2644  then the corner normal angle test is skipped.
    2645 
    2646  If both planar_tolerance = ON_UNSET_VALUE and angle_tolerance_radians = ON_UNSET_VALUE,
    2647  then all quads are split.
    2648 
    2649  split_method - [in]
    2650  0 default
    2651  Currently divides along the short diagonal. This may be
    2652  changed as better methods are found or preferences change.
    2653  By passing zero, you let the developers of this code
    2654  decide what's best for you over time.
    2655  1 divide along the short diagonal
    2656  2 divide along the long diagonal
    2657  3 minimize resulting area
    2658  4 maximize resulting area
    2659  5 minimize angle between triangle normals
    2660  6 maximize angle between triangle normals
    2661 
    2662  bDeleteNgonsContainingSplitQuads - [in]
    2663  If true, ngons that contain a split quad are deleted.
    2664 
    2665  Returns:
    2666  Number of quads that were converted to triangles.
    2667  */
    2668  unsigned int ConvertNonPlanarQuadsToTriangles(
    2669  double planar_tolerance,
    2670  double angle_tolerance_radians,
    2671  unsigned int split_method
    2672  );
    2673 
    2674  unsigned int ConvertNonPlanarQuadsToTriangles(
    2675  double planar_tolerance,
    2676  double angle_tolerance_radians,
    2677  unsigned int split_method,
    2678  bool bDeleteNgonsContainingSplitQuads
    2679  );
    2680 
    2681  /*
    2682  Description:
    2683  Joins adjacent triangles into quads if the resulting quad
    2684  is nice.
    2685  Parameters:
    2686  angle_tol_radians - [in] Used to compare adjacent
    2687  triangles' face normals. For two triangles to be considered,
    2688  the angle between their face normals has to be <= angle_tol_radians.
    2689  When in doubt use ON_PI/90.0 (2 degrees).
    2690  min_diagonal_length_ratio - [in] ( <= 1.0) For two triangles to be
    2691  considered the ratio of the resulting quad's diagonals
    2692  (length of the shortest diagonal)/(length of longest diagonal).
    2693  has to be >= min_diagonal_length_ratio.
    2694  When in doubt us .875.
    2695  */
    2696  bool ConvertTrianglesToQuads(
    2697  double angle_tol_radians,
    2698  double min_diagonal_length_ratio
    2699  );
    2700 
    2701  bool ComputeFaceNormals(); // compute face normals for all faces
    2702  bool ComputeFaceNormal(int); // computes face normal of indexed face
    2703 
    2704  /*
    2705  Description:
    2706  Get a list of pairs of faces that clash.
    2707  Parameters:
    2708  max_pair_count - [in]
    2709  If max_pair_count > 0, then at most this many pairs
    2710  will be appended to the clashing_pairs[] array.
    2711  If max_pair_count <= 0, then all clashing pairs
    2712  will be appended to the clashing_pairs[] array.
    2713  clashing_pairs - [out]
    2714  The faces indices of clashing pairs are appended
    2715  to this array.
    2716  Returns:
    2717  Number of pairs appended to clashing_pairs[].
    2718  */
    2719  int GetClashingFacePairs(
    2720  int max_pair_count,
    2721  ON_SimpleArray< ON_2dex >& clashing_pairs
    2722  ) const;
    2723 
    2724  /*
    2725  Description:
    2726  Cull clashing faces from the mesh.
    2727  Parameters:
    2728  what_to_cull - [in]
    2729  0: when a pair of faces clash, cull both faces
    2730  1: when a pair of faces clash, leave the face with the
    2731  longest edge.
    2732  2: when a pair of faces clash, cull the face with the
    2733  longest edge.
    2734  3: when a pair of faces clash, leave the face with
    2735  the largest area.
    2736  4: when a pair of faces clash, cull the face with
    2737  the largest area.
    2738  Returns:
    2739  Number of faces culled from the mesh.
    2740  Remarks:
    2741  If a large face clashes with many small faces, the large
    2742  face and one small face will be removed. When a degenerate
    2743  face is encountered, it is also culled.
    2744  */
    2745  int CullClashingFaces( int what_to_cull );
    2746 
    2747  unsigned int CullDegenerateFaces(); // returns number of degenerate faces
    2748 
    2749  int CullUnusedVertices(); // returns number of culled vertices
    2750 
    2751  // Description:
    2752  // Removes any unreferenced objects from arrays, reindexes as needed,
    2753  // and shrinks arrays to minimum required size.
    2754  bool Compact();
    2755 
    2756  /*
    2757  Description:
    2758  Removes and unsets all possible cached information and
    2759  then calls Compact().
    2760  Parameters:
    2761  bRemoveNgons - [in]
    2762  If true, all n-gon information is removed.
    2763  bRemoveDegenerateFaces - [in]
    2764  If true, CullDegenerateFaces() is used to remove degenerate faces.
    2765  bCompact - [in]
    2766  If true, Compact() is called after removing cached information.
    2767  */
    2768  void Cleanup(
    2769  bool bRemoveNgons,
    2770  bool bRemoveDegenerateFaces,
    2771  bool bCompact
    2772  );
    2773 
    2774  /*
    2775  Description:
    2776  Calls the latest version of the detailed cleanup command passing the value for bRemoveNgons
    2777  and setting all other parameters to true.
    2778  Parameters:
    2779  bRemoveNgons - [in]
    2780  If true, all n-gon information is removed.
    2781  */
    2782  void Cleanup(
    2783  bool bRemoveNgons
    2784  );
    2785 
    2786  bool ComputeVertexNormals(); // uses face normals to cook up a vertex normal
    2787 
    2788  //////////
    2789  // Scales textures so the texture domains are [0,1] and
    2790  // eliminates any texture rotations.
    2791  bool NormalizeTextureCoordinates();
    2792 
    2793  /////////
    2794  // Description:
    2795  // Transposes the texture coordinates
    2796  // Returns
    2797  // true - success
    2798  bool TransposeTextureCoordinates();
    2799  bool TransposeSurfaceParameters();
    2800 
    2801  /////////
    2802  // Description:
    2803  // Reverse one coordinate direction of the texture coordinates, within texture domain m_tex_domain
    2804  // Parameters:
    2805  // dir -[in] - dir=0 first texture coordinate is reversed
    2806  // dir=1 second texture coordinate is reversed
    2807  // Returns
    2808  // true - success
    2809  bool ReverseTextureCoordinates( int dir );
    2810  bool ReverseSurfaceParameters( int dir );
    2811 
    2812 
    2813 
    2814  /*
    2815  Description:
    2816  Use a texture mapping function to set the m_T[] values.
    2817  Parameters:
    2818  mapping - [in]
    2819  mesh_xform - [in]
    2820  If not nullptr, the mapping calculation is performed as
    2821  if the mesh were transformed by mesh_xform; the
    2822  location of the mesh is not changed.
    2823  bLazy - [in]
    2824  If true and the m_T[] values were set using the same
    2825  mapping parameters, then no calculation is performed.
    2826  Returns:
    2827  True if successful.
    2828  See Also:
    2829  ON_TextureMapping::GetTextureCoordinates
    2830  */
    2831  bool SetTextureCoordinates(
    2832  const class ON_TextureMapping& mapping,
    2833  const class ON_Xform* mesh_xform = 0,
    2834  bool bLazy = true
    2835  );
    2836 
    2837  bool HasCachedTextureCoordinates() const;
    2838 
    2839  const ON_TextureCoordinates* CachedTextureCoordinates(
    2840  const ON_UUID& mapping_id
    2841  ) const;
    2842 
    2843  const ON_TextureCoordinates* SetCachedTextureCoordinates(
    2844  const class ON_TextureMapping& mapping,
    2845  const class ON_Xform* mesh_xform = 0,
    2846  bool bLazy = true
    2847  );
    2848 
    2849  bool EvaluateMeshGeometry( const ON_Surface& ); // evaluate surface at tcoords
    2850  // to set mesh geometry
    2851 
    2852  // finds all coincident vertices and merges them if break angle is small enough
    2853  bool CombineCoincidentVertices(
    2854  ON_3fVector, // coordinate tols for considering vertices
    2855  // to be coincident
    2856  double // cosine normal angle tolerance in radians
    2857  // if vertices are coincident, then they are combined
    2858  // if NormalA o NormalB >= this value
    2859  );
    2860 
    2861  /*
    2862  Description:
    2863  Combines identical vertices.
    2864  Parameters:
    2865  bIgnoreVertexNormals - [in] If true, then vertex normals
    2866  are ignored when comparing vertices.
    2867  bIgnoreTextureCoordinates - [in] If true, then vertex
    2868  texture coordinates, colors, and principal curvatures
    2869  are ignored when comparing vertices.
    2870  Returns:
    2871  True if the mesh is changed, in which case the returned
    2872  mesh will have fewer vertices than the input mesh.
    2873  */
    2874  bool CombineIdenticalVertices(
    2875  bool bIgnoreVertexNormals = false,
    2876  bool bIgnoreTextureCoordinates = false
    2877  );
    2878 
    2879  void Append( const ON_Mesh& ); // appends a copy of mesh to this and updates
    2880  // indices of appended mesh parts
    2881 
    2882  /*
    2883  Description:
    2884  Append a list of meshes. This function is much more efficient
    2885  than making repeated calls to ON_Mesh::Append(const ON_Mesh&)
    2886  when lots of meshes are being joined into a single large mesh.
    2887  Parameters:
    2888  count - [in]
    2889  length of meshes[] array.
    2890  meshes - [in]
    2891  array of meshes to append.
    2892  */
    2893  void Append( int count, const ON_Mesh* const* meshes );
    2894 
    2895  /*
    2896  Description:
    2897  Expert user function to set m_is_closed member.
    2898  Setting this value correctly after a mesh is constructed
    2899  can save time when IsClosed() is called.
    2900  This function sets the private member variable m_is_closed.
    2901  Paramters:
    2902  closed - [in]
    2903  0: The mesh is not closed. There is at least one face with an
    2904  edge that is geometrically distinct (as an unoriented line segment)
    2905  from all other edges.
    2906  1: The mesh is closed. Every geometrically distict edge is used
    2907  by two or more faces.
    2908  */
    2909  void SetClosed(int closed);
    2910 
    2911  /*
    2912  Returns:
    2913  True if every mesh "edge" has two or more faces.
    2914  */
    2915  bool IsClosed() const;
    2916 
    2917  /*
    2918  Returns:
    2919  True if every mesh "edge" has at most two faces.
    2920  */
    2921  bool IsManifold() const;
    2922 
    2923  /*
    2924  Returns:
    2925  True if the mesh is manifold and every pair of faces
    2926  that share an "edge" have compatible orientations.
    2927  */
    2928  bool IsOriented() const;
    2929 
    2930  /*
    2931  Description:
    2932  Determine if the mesh is a manifold.
    2933  Parameters:
    2934  bTopologicalTest - [in]
    2935  If true, the query treats coincident vertices as
    2936  the same.
    2937  pbIsOriented - [out]
    2938  If the input pointer is not nullptr, then the returned
    2939  value of *pbIsOriented will be true if the mesh
    2940  is a manifold and adjacent faces have compatible
    2941  face normals.
    2942  pbHasBoundary - [out]
    2943  If the input pointer is not nullptr, then the returned
    2944  value of *pbHasBoundary will be true if the mesh
    2945  is a manifold and there is at least one "edge"
    2946  with no adjacent faces have compatible
    2947  face normals.
    2948  Returns:
    2949  True if every mesh "edge" has at most two adjacent faces.
    2950  */
    2951  bool IsManifold(
    2952  bool bTopologicalTest,
    2953  bool* pbIsOriented = nullptr,
    2954  bool* pbHasBoundary = nullptr
    2955  ) const;
    2956 
    2957  /*
    2958  Description:
    2959  Expert user function to set m_is_solid member.
    2960  Setting this value correctly after a mesh is constructed
    2961  can save time when IsSolid() is called.
    2962  This function sets the private member variable m_is_solid.
    2963  If solid is nonzero, it will set m_is_closed to 1.
    2964  Paramters:
    2965  solid - [in]
    2966  0: The mesh is not an oriented manifold solid mesh. Either
    2967  the mesh is not closed, not manifold, or the faces are
    2968  not oriented compatibly.
    2969  1: The mesh is an oriented manifold solid whose face normals
    2970  point outwards.
    2971  -1: The mesh is an oriented manifold solid whose face normals
    2972  point inwards.
    2973  */
    2974  void SetSolidOrientation(int solid_orientation);
    2975 
    2976  /*
    2977  Description:
    2978  Determine orientation of a mesh.
    2979  Returns:
    2980  +1 mesh is a solid with outward facing normals
    2981  -1 mesh is a solid with inward facing normals
    2982  0 mesh is not a solid
    2983  See Also:
    2984  ON_Mesh::IsSolid
    2985  */
    2986  int SolidOrientation() const;
    2987 
    2988  /*
    2989  Description:
    2990  Test mesh to see if it is a solid. (A "solid" is
    2991  a closed oriented manifold.)
    2992  Returns:
    2993  true mesh is a solid
    2994  fals mesh is not a solid
    2995  See Also:
    2996  ON_Mesh::SolidOrientation
    2997  ON_Mesh::IsManifold
    2998  */
    2999  bool IsSolid() const;
    3000 
    3001  /*
    3002  Description:
    3003  Determine if a point is inside a solid brep.
    3004  Paramters:
    3005  test_point - [in]
    3006  tolerance - [in] >= 0.0
    3007  3d distance tolerance used for ray-mesh intersection
    3008  and determining strict inclusion.
    3009  bStrictlyInside - [in]
    3010  If bStrictlyInside is true, then test_point must be inside mesh
    3011  by at least tolerance in order for this function to return
    3012  true. If bStrictlyInside is false, then this function will return
    3013  true if test_point is inside or the distance from test_point to
    3014  a mesh face is <= tolerance.
    3015  Returns:
    3016  True if test_point is inside the solid mesh.
    3017  Remarks:
    3018  The caller is responsible for making certing the mesh is
    3019  solid before calling this function. If the mesh is not
    3020  solid, the behavior is unpredictable.
    3021  See Also:
    3022  ON_Mesh::IsSolid()
    3023  */
    3024  bool IsPointInside(
    3025  ON_3dPoint test_point,
    3026  double tolerance,
    3027  bool bStrictlyInside
    3028  ) const;
    3029 
    3030  /*
    3031  Description:
    3032  Appends a list of mesh edges that begin or end at the specified
    3033  vertices to the edges[] array.
    3034  Parameters:
    3035  vcount - [in]
    3036  number of vertices
    3037  vertex_index - [in]
    3038  array of vertex indices
    3039  bNoDuplicates - [in]
    3040  If true, then only one edges[] is added for each edge,
    3041  the first vertex index will alwasy be less than the
    3042  second, and the returned elements are sorted in dictionary
    3043  order.
    3044  If false and an edge is shared by multiple faces, then
    3045  there will be an edges[] element added for each face and the
    3046  order of the vertex indicies will indicate the orientation
    3047  of the edge with respect to the face. No sorting is performed
    3048  in this case.
    3049  edges - [out]
    3050  Edges that begin or end at one of the specified vertices are
    3051  appended to this array. Each ON_2dex records the start and
    3052  end vertex index.
    3053  Returns:
    3054  Number of ON_2dex values appended to the edges[] array.
    3055  */
    3056  int GetVertexEdges(
    3057  int vcount,
    3058  const int* vertex_index,
    3059  bool bNoDuplicates,
    3061  ) const;
    3062 
    3063 
    3064  /*
    3065  Description:
    3066  Appends a list of mesh edges to the edges[] array.
    3067  Parameters:
    3068  edges - [out]
    3069  Each edges[] element is a pair of vertex indices. There
    3070  is at least one face in the mesh with an edge running between
    3071  the indicies.
    3072  Returns:
    3073  Number of ON_2dex values appended to the edges[] array.
    3074  */
    3075  int GetMeshEdges(
    3077  ) const;
    3078 
    3079  /*
    3080  Description:
    3081  Assign a unique id to each vertex location. Coincident vertices
    3082  get the same id.
    3083  Parameters:
    3084  first_vid - [in]
    3085  Initial vertex id. Typically 1 or 0.
    3086  Vid - [out]
    3087  If not null, then Vid[] sould be an array of length VertexCount().
    3088  and the vertex ids will be stored in this array. If null,
    3089  the array will be allocated by calling onmalloc(). The returned
    3090  array Vid[i] is the id of the vertex m_V[i]. If m_V[i] and
    3091  m_V[j] are the same 3d point, then Vid[i] and Vid[j] will have
    3092  the same value.
    3093  Vindex - [out] (can be null)
    3094  If Vindex is not null, then it must have length at least m_V.Count()
    3095  and the returned array will be a permutation of (0,1,...,m_V.Count()-1)
    3096  such (Vid[Vindex[0]], Vid[Vindex[1]], ..., Vid[Vindex[m_V.Count()-1]])
    3097  is an increasing list of value.
    3098  Returns:
    3099  null if the mesh has no vertices.
    3100  An array of length VertexCount(). If vertices m_V[i] and m_V[j]
    3101  are coincident, then Vid[i] = Vid[j]. The id values begin at first_vid.
    3102  The maximum vertex id is Vid[Vindex[m_V.Count()-1]]. The number of
    3103  unique vertex locations is (Vid[Vindex[m_V.Count()-1]] - first_vid + 1).
    3104  */
    3105  unsigned int* GetVertexLocationIds(
    3106  unsigned int first_vid,
    3107  unsigned int* Vid,
    3108  unsigned int* Vindex
    3109  ) const;
    3110 
    3111  /*
    3112  Description:
    3113  Get a list of the sides of every face.
    3114  Parameters:
    3115  Vid - [in] (can be null)
    3116  If Vid is null, then the mesh m_V[] index values are used to set
    3117  the ON_MeshFaceSide::vi[] values.
    3118  If Vid is not null, then it must be an array of length VertexCount().
    3119  The value Vid[mesh m_V[] index] will be used to set the
    3120  ON_MeshFaceSide::vi[] values.
    3121  sides - [out]
    3122  If the input value of sides is not null, then sides[] must be long
    3123  enough to hold the returned side list. The maximum posssible length
    3124  is 4*FaceCount() for a mesh contining FaceCount() nondegenerate quads.
    3125  If the input value of sides is null, memory will be allocated using
    3126  onmalloc() and the caller is responsible for calling onfree() at an
    3127  appropriate time. This function fills in the sides[] array
    3128  with face side information. The returned list is sorted by sides[].fi
    3129  and the sides[].side and each element has vi[0] <= vi[1].
    3130  The function ON_SortMeshFaceSidesByVertexIndex() can be used to sort the
    3131  list by the sides[].vi[] values.
    3132  Returns:
    3133  Number of elements added to sides[].
    3134  Remarks:
    3135  Faces with out of range ON_MeshFace.vi[] values are skipped.
    3136  Degenerate faces are processed, but degenerate sides (equal vertex indices)
    3137  are not added to the list.
    3138  */
    3139  unsigned int GetMeshFaceSideList(
    3140  const unsigned int* Vid,
    3141  class ON_MeshFaceSide*& sides
    3142  ) const;
    3143 
    3144 
    3145  ///////////////////////////////////////////////////////////////////////
    3146  //
    3147  // mesh editing
    3148  //
    3149 
    3150  /*
    3151  Description:
    3152  Replace a mesh edge with a vertex at its center and update
    3153  adjacent faces as needed.
    3154  Parameters:
    3155  topei - [in] index of edge in MeshTopology().m_tope[] array
    3156  Returns:
    3157  true if successful.
    3158  */
    3159  bool CollapseEdge( int topei );
    3160 
    3161  /*
    3162  Description:
    3163  Tests a mesh edge to see if it is valid as input to
    3164  ON_Mesh::SwapMeshEdge.
    3165  Parameters:
    3166  topei - [in] index of edge in MeshTopology().m_tope[] array
    3167  Returns:
    3168  true if edge can be swapped by ON_Mesh::SwapMeshEdge.
    3169  See Also:
    3170  ON_Mesh::SwapEdge
    3171  */
    3172  bool IsSwappableEdge( int topei );
    3173 
    3174 
    3175  /*
    3176  Description:
    3177  If the edge is shared by two triangular face, then
    3178  the edge is "swapped".
    3179  Parameters:
    3180  topei - [in] index of edge in MeshTopology().m_tope[] array
    3181  Returns:
    3182  true if successful
    3183  See Also:
    3184  ON_Mesh::IsSwappableEdge
    3185  */
    3186  bool SwapEdge( int topei );
    3187 
    3188  /*
    3189  Description:
    3190  Removes a face from a mesh and does not alter the
    3191  geometry of the remaining mesh.
    3192  Parameters:
    3193  meshfi - [in] index of face in ON_Mesh.m_F[] array
    3194  Remarks:
    3195  This function calls DestroyTopology() and DestroyPartition().
    3196  The caller is responsible for calling Compact() if that step
    3197  is required.
    3198  Returns:
    3199  true if successful
    3200  */
    3201  bool DeleteFace( int meshfi );
    3202 
    3203  /*
    3204  Description:
    3205  Destroys the m_H[] array and sets m_hidden_count=0.
    3206  */
    3207  void DestroyHiddenVertexArray();
    3208 
    3209  /*
    3210  Returns:
    3211  If the mesh has some hidden vertices, then an array
    3212  of length VertexCount() is returned and the i-th
    3213  element is true if the i-th vertex is hidden.
    3214  If no vertices are hidden, nullptr is returned.
    3215  */
    3216  const bool* HiddenVertexArray() const;
    3217 
    3218  /*
    3219  Description:
    3220  Set the runtime vertex hidden flag.
    3221  Parameters:
    3222  meshvi - [in] mesh vertex index
    3223  bHidden - [in] true to hide vertex
    3224  */
    3225  void SetVertexHiddenFlag( int meshvi, bool bHidden );
    3226 
    3227  /*
    3228  Description:
    3229  Returns true if the mesh vertex is hidden. This is a runtime
    3230  setting that is not saved in 3dm files.
    3231  Parameters:
    3232  meshvi - [in] mesh vertex index.
    3233  Returns:
    3234  True if mesh vertex is hidden.
    3235  */
    3236  bool VertexIsHidden( int meshvi ) const;
    3237 
    3238  /*
    3239  Description:
    3240  Returns true if the mesh face is hidden. This is a runtime
    3241  setting that is not saved in 3dm files.
    3242  Parameters:
    3243  meshfi - [in] mesh face index.
    3244  Returns:
    3245  True if mesh face is hidden.
    3246  Remarks:
    3247  A face is hidden if, and only if, at least one of its
    3248  vertices is hidden.
    3249  */
    3250  bool FaceIsHidden( int meshvi ) const;
    3251 
    3252 
    3253  ///////////////////////////////////////////////////////////////////////
    3254  //
    3255  // mesh topology
    3256  //
    3257  // In order to keep the mesh facet definition simple and make the mesh
    3258  // definition easily used in common rendering application, if two facets
    3259  // share a vertex location but have different normals, curvatures,
    3260  // textures, etc., at that common vertex location, then the vertex is
    3261  // duplicated. When the topology of the mesh needs to be known,
    3262  // use Topology() to get a class that provides complete topological
    3263  // information about the mesh.
    3264  const ON_MeshTopology& Topology() const;
    3265 
    3266  ///////////////////////////////////////////////////////////////////////
    3267  // If you modify the mesh in any way that may change its topology,
    3268  // then call DestroyTopology(). Specifically if you add or remove
    3269  // vertices or face, change vertex locations, or change the face m_vi[]
    3270  // values, then you must call DestroyTopology().
    3271  void DestroyTopology();
    3272 
    3273  /*
    3274  Returns:
    3275  This is an expert user function that returns true if the topology
    3276  information is already calculated and cached. It can be used to
    3277  to avoid calling the Topology() function when the expensive creation
    3278  step will be performed.
    3279  */
    3280  /* obsolete - used HasMeshTopology() */ bool TopologyExists() const;
    3281  bool HasMeshTopology() const;
    3282 
    3283  ///////////////////////////////////////////////////////////////////////
    3284  //
    3285  // mesh partitions
    3286  //
    3287  // In ancient times, some rendering engines were only able to process
    3288  // small batches of triangles and th CreatePartition() function was
    3289  // provided to partition the mesh into subsets of vertices and faces
    3290  // that those renering engines could handle.
    3291  //
    3292  const ON_MeshPartition* CreatePartition(
    3293  int, // maximum number of vertices in a partition
    3294  int // maximum number of triangles in a partition
    3295  );
    3296  const ON_MeshPartition* Partition() const;
    3297  void DestroyPartition();
    3298 
    3299  /*
    3300  Description:
    3301  Extract the portion of this mesh defined by mesh_part.
    3302  Parameters:
    3303  mesh_part - [in]
    3304  defines portion of the mesh to extract.
    3305  mesh - [in] (can be null, cannot be = "this).
    3306  If mesh is no null, the extracted mesh will be put into
    3307  this mesh. If mesh is null, the extracted mesh will
    3308  be created in a mesh allocated on the heap using the
    3309  new operator.
    3310  Returns:
    3311  A pointer to the submesh. If the input mesh parameter is null,
    3312  then the caller must delete this mesh when it is no longer needed.
    3313  If the input is invalid, then null is returned.
    3314  */
    3315  ON_Mesh* MeshPart(
    3316  const ON_MeshPart& mesh_part,
    3317  ON_Mesh* mesh
    3318  ) const;
    3319 
    3320  /*
    3321  Description:
    3322  Create a mesh that is a single face of this mesh.
    3323  Parameters:
    3324  Returns:
    3325  A pointer to the submesh. If the input mesh parameter is null,
    3326  then the caller must delete this mesh when it is no longer needed.
    3327  If the input is invalid, then null is returned.
    3328  */
    3329  ON_Mesh* DuplicateFace(
    3330  int face_index,
    3331  ON_Mesh* mesh
    3332  ) const;
    3333 
    3334  ///////////////////////////////////////////////////////////////////////
    3335  //
    3336  // mesh N-gon lists.
    3337  // ON_Mesh objects support faces that are triangle or quads.
    3338  // When a mesh is created from a format that supports N-gons
    3339  // for N larger than 4, an optional N-gon list can be added
    3340  // that specifies the vertices and faces that make up the N-gon.
    3341  //
    3342 
    3343  /*
    3344  Description:
    3345  If the mesh has an N-gon list, return a pointer to it.
    3346  Returns:
    3347  A pointer to the current N-gon list or nullptr.
    3348  */
    3349  const class ON_V4V5_MeshNgonList* V4V5_NgonList() const;
    3350 
    3351  /*
    3352  Description:
    3353  If an N-gon list exists, it is returned and can be modified.
    3354  If no N-gon list exists, a new empty list is returned and
    3355  it can be modified.
    3356  Returns:
    3357  A pointer to the N-gon list that can be modified.
    3358  */
    3359  class ON_V4V5_MeshNgonList* V4V5_ModifyNgonList();
    3360 
    3361  /*
    3362  Description:
    3363  Destroy any existing N-gon list.
    3364  */
    3365  void V4V5_DestroyNgonList();
    3366 
    3367  ///////////////////////////////////////////////////////////////////////
    3368  //
    3369  // mesh components
    3370  // ON_Mesh objects can consist of sets of faces that are isolated
    3371  // from any other sets of faces. The following 2 functions will
    3372  // dissect a mesh into these sets, called components. Not to be
    3373  // confused with ON_COMPONENT_INDEX.
    3374 
    3375  /*
    3376  Description:
    3377  Calculates the components of a mesh and sets a label for each face in
    3378  the facet_component_labels array.
    3379  Parameters:
    3380  bUseVertexConnections- [in]
    3381  If this parameter is true, then facets that share a common vertex
    3382  are considered connected.
    3383  If this parameter is false, then facets must share an edge to
    3384  be considered connected.
    3385  bUseTopologicalConnections - [in]
    3386  If this parameter is true, then geometric location is used
    3387  to determine if facets are connected.
    3388  If this parameter is false, then facets must share the same vertex
    3389  or vertices to be considered connected.
    3390  facet_component_labels- [out]
    3391  facet_component_labels[] will be an array with the same size
    3392  as ON_Mesh.m_F.Count() and facet_component_labels[i]
    3393  is the component id m_F[i] belongs to. The component id
    3394  will be 1 to the number of compoents.
    3395  Returns:
    3396  Number of components on success, 0 on failure
    3397  */
    3398 
    3399  int GetConnectedComponents( bool bUseVertexConnections,
    3400  bool bTopologicalConnections,
    3401  ON_SimpleArray<int>& facet_component_labels
    3402  ) const;
    3403 
    3404  /*
    3405  Description:
    3406  Calculates the components of a mesh and sets a label for each face in
    3407  the facet_component_labels array.
    3408  Parameters:
    3409  bUseVertexConnections- [in]
    3410  If this parameter is true, then facets that share a common vertex
    3411  are considered connected.
    3412  If this parameter is false, then facets must share an edge to
    3413  be considered connected.
    3414  bUseTopologicalConnections - [in]
    3415  If this parameter is true, then geometric location is used
    3416  to determine if facets are connected.
    3417  If this parameter is false, then facets must share the same vertex
    3418  or vertices to be considered connected.
    3419  components - [out]
    3420  New components are appended to this array
    3421  if this parameter is null, then the components are just counted.
    3422  Returns:
    3423  Number of components on success, 0 on failure
    3424  */
    3425 
    3426  int GetConnectedComponents( bool bUseVertexConnections,
    3427  bool bTopologicalConnections,
    3428  ON_SimpleArray<ON_Mesh*>* components
    3429  ) const;
    3430 
    3431 
    3432  /////////////////////////////////////////////////////////////////
    3433  //
    3434  // Double precision vertex support
    3435  //
    3436 
    3437  /*
    3438  Returns:
    3439  True if the mesh vertex count is > 0, the mesh has single and double
    3440  precision vertices, and the values of the locations are synchronized.
    3441  */
    3442  bool HasSynchronizedDoubleAndSinglePrecisionVertices() const;
    3443 
    3444  /*
    3445  Returns:
    3446  True if the mesh has double precision vertices (m_dV.Count() > 0).
    3447  Remarks:
    3448  Use ON_Mesh::UpdateDoublePrecisionVertices()
    3449  or ON_Mesh::UpdateSinglePrecisionVertices() to synchronize
    3450  values of single and double precision vertices.
    3451  */
    3452  bool HasDoublePrecisionVertices() const;
    3453 
    3454  bool HasSinglePrecisionVertices() const;
    3455 
    3456 
    3457  /*
    3458  Description:
    3459  If you modify the values of double precision vertices,
    3460  then you must call UpdateSinglePrecisonVertices().
    3461  Remarks:
    3462  If double precision vertices are not present, this function
    3463  does nothing.
    3464  */
    3465  void UpdateSinglePrecisionVertices();
    3466 
    3467  /*
    3468  Description:
    3469  If you modify the values of the single precision vertices
    3470  in m_V[], then you must call UpdateDoublePrecisionVertices().
    3471  Remarks:
    3472  If double precision vertices are not present, this function
    3473  does nothing.
    3474  */
    3475  void UpdateDoublePrecisionVertices();
    3476 
    3477  /*
    3478  Description:
    3479  The function removes all double precision vertex information.
    3480  */
    3481  void DestroyDoublePrecisionVertices();
    3482 
    3483 
    3484  /////////////////////////////////////////////////////////////////
    3485  // Implementation - mesh geometry
    3486 
    3487  // Vertex locations
    3488  // In a case where adjacent facets share a vertex
    3489  // location but have distinct normals or texture
    3490  // coordinates at that location, the vertex must
    3491  // be duplicated.
    3492 
    3493  /*
    3494  Description:
    3495  Get double precision vertices. If they do not exist,
    3496  they will be created and match the existing single
    3497  precision vertices.
    3498  Returns:
    3499  Array of double precision vertices. If you modify the
    3500  values in this array, you must make the same modifications
    3501  to the single precision vertices, or call
    3502  UpdateSinglePrecisonVertices().
    3503  Example:
    3504 
    3505  // add a bunch of double precision information
    3506  ON_3dPointArray& dv = mesh.DoublePrecisionVertices();
    3507  for ( i = 0; i < lots; i++ )
    3508  {
    3509  dv[i] = ...
    3510  }
    3511  // This call updates the single precison values
    3512  // in m_V[] and sets all the counts and CRCs that
    3513  // are used in validity checking.
    3514  mesh.UpdateSinglePrecisonVertices();
    3515 
    3516  Remarks:
    3517  Avoid mulitple calls to DoublePrecisionVertices().
    3518  It is most efficient to make one call, save a local
    3519  reference, and use the local reference as needed.
    3520  */
    3521  ON_3dPointArray& DoublePrecisionVertices();
    3522  const ON_3dPointArray& DoublePrecisionVertices() const;
    3523 
    3524  /*
    3525  Description:
    3526  m_dV[] double precision vertices.
    3527  m_V[] single precision vertices.
    3528 
    3529  If m_dV[] is not empty, then m_V and m_dV should have the same length
    3530  and HasSynchronizedDoubleAndSinglePrecisionVertices() should be true.
    3531 
    3532  Otherwise a bug incorrectly modified vertex location information.
    3533 
    3534  If m_dV[] and m_V[] are in use and you modify vertex locations or count,
    3535  then your calculation should insure both are properly updated.
    3536  */
    3539 
    3540  /*
    3541  Returns:
    3542  Location of the vertex. If double precision vertices
    3543  are present, the double precision vertex location is
    3544  returned. If vertex_index is out of range,
    3545  ON_UNSET_VALUE is returned.
    3546  */
    3547  ON_3dPoint Vertex(int vertex_index) const;
    3548 
    3549  // m_F[] facets (triangles or quads)
    3551 
    3552  ////////////////////////////////////////////////////////////////////////
    3553  //
    3554  // N-gon
    3555  //
    3556  // An n-gon is a collection of faces that are grouped together.
    3557  // The outer boundary of the face collection must be a closed
    3558  // polyline.
    3559  //
    3560 
    3561  ////////////////////////////////////////////////////////////////////////
    3562  //
    3563  // N-gon interface
    3564  //
    3565 
    3566  /*
    3567  Number of n-gons in this mesh.
    3568  */
    3569  int NgonCount() const;
    3570 
    3571  /*
    3572  Number of n-gons in this mesh.
    3573  */
    3574  unsigned int NgonUnsignedCount() const;
    3575 
    3576  /*
    3577  Returns:
    3578  null - This mesh does ot have n-gon information.
    3579  not null - a pointer to an array of ON_MeshNgon pointers.
    3580  The array has length ON_Mesh::NgonCount().
    3581  Remarks:
    3582  If ON_Mesh::RemoveNgon has been called, then the array
    3583  can contain null pointers.
    3584  */
    3585  const ON_MeshNgon* const * Ngons() const;
    3586 
    3587  /*
    3588  Parameters:
    3589  ngon_index - [in]
    3590  Index of an ngon.
    3591  Returns:
    3592  A pointetr to the indexed n-gon or null if the
    3593  indexed ngon is null or ngon_index is out of range.
    3594  Remarks:
    3595  If ON_Mesh::RemoveNgon has been called, then a null
    3596  pointer can be returned even when ngon_index >= 0
    3597  and ngon_index < ON_Mesh.NgonCount().
    3598  */
    3599  const ON_MeshNgon* Ngon(
    3600  unsigned int ngon_index
    3601  ) const;
    3602 
    3603  /*
    3604  Parameters:
    3605  ngon_index - [in]
    3606  Index of an ngon.
    3607  Returns:
    3608  Total number of boundary edges, including interior edges
    3609  */
    3610  unsigned int NgonBoundaryEdgeCount(
    3611  unsigned int ngon_index
    3612  ) const;
    3613 
    3614  const ON_MeshNgon* NgonFromComponentIndex(
    3615  class ON_MeshNgonBuffer& ngon_buffer,
    3616  ON_COMPONENT_INDEX ci
    3617  ) const;
    3618 
    3619  /*
    3620  Description:
    3621  Add a new ngon to the mesh.
    3622  Parameters:
    3623  Vcount - number of vertices and number of sides in the n-gon
    3624  ngon_vi[] - in
    3625  An array of N distinct ON_Mesh.m_V[] vertex indices
    3626  Fcount - [in]
    3627  Number of face that make up the ngon.
    3628  ngon_fi[]
    3629  An array of N distinct ON_Mesh.m_F[] face indices
    3630  The outer boundary of this group of faces should
    3631  be the list of vertices passes as ngon_vi[]
    3632  Returns:
    3633  index of the new n-gon.
    3634  -1: If input information is not valid.
    3635  */
    3636  int AddNgon(
    3637  unsigned int Vcount,
    3638  const unsigned int* ngon_vi,
    3639  unsigned int Fcount,
    3640  const unsigned int* ngon_fi
    3641  );
    3642 
    3643  bool ModifyNgon(
    3644  unsigned int ngon_index,
    3645  unsigned int Vcount,
    3646  const unsigned int* ngon_vi,
    3647  unsigned int Fcount,
    3648  const unsigned int* ngon_fi
    3649  );
    3650 
    3651  bool ModifyNgon(
    3652  unsigned int ngon_index,
    3653  const ON_MeshNgon* ngon
    3654  );
    3655 
    3656  /*
    3657  Description:
    3658  Insert an n-gon in the ngon list. This is generally
    3659  slow. Use AddNgon or ModifyNgon.
    3660  */
    3661  bool InsertNgon(
    3662  unsigned int ngon_index,
    3663  const ON_MeshNgon* ngon
    3664  );
    3665 
    3666  /*
    3667  Returns:
    3668  Average of the n-gon vertex locations.
    3669  */
    3670  ON_3dPoint NgonCenter(
    3671  unsigned int ngon_index
    3672  ) const;
    3673 
    3674  /*
    3675  Returns:
    3676  Average of the n-gon vertex locations.
    3677  */
    3678  ON_3dPoint NgonCenter(
    3679  const ON_MeshNgon* ngon
    3680  ) const;
    3681 
    3682  /*
    3683  Returns:
    3684  Bounding box of the n-gon vertex locations.
    3685  */
    3686  ON_BoundingBox NgonBoundaryBoundingBox(
    3687  unsigned int ngon_index
    3688  ) const;
    3689 
    3690  /*
    3691  Returns:
    3692  Bounding box of the n-gon vertex locations.
    3693  */
    3694  ON_BoundingBox NgonBoundaryBoundingBox(
    3695  const ON_MeshNgon* ngon
    3696  ) const;
    3697 
    3698  /*
    3699  Parameters:
    3700  ngon - [in]
    3701  bAppendStartPoint - [in]
    3702  If true, the initial point in the boundary will be added
    3703  as the first point of ngon_boundary_points[] and then
    3704  added again as the last point of ngon_boundary_points[].
    3705  This is useful when you need a closed polyline.
    3706  ngon_boundary_points - [out]
    3707  An array of ngon->m_Vcount + (bAppendStartPoint ? 1 : 0)
    3708  points.
    3709  Returns:
    3710  Number of points added to ngon_boundary_points[] or 0 if invalid
    3711  input is encountered.
    3712  */
    3713  unsigned int GetNgonBoundaryPoints(
    3714  const ON_MeshNgon* ngon,
    3715  bool bAppendStartPoint,
    3716  ON_SimpleArray<ON_3dPoint>& ngon_boundary_points
    3717  ) const;
    3718 
    3719  /*
    3720  Parameters:
    3721  ngon - [in]
    3722  bAppendStartPoint - [in]
    3723  If true, the initial point in the boundary will be added
    3724  as the first point of ngon_boundary_points[] and then
    3725  added again as the last point of ngon_boundary_points[].
    3726  This is useful when you need a closed polyline.
    3727  ngon_boundary_points - [out]
    3728  An array of ngon->m_Vcount + (bAppendStartPoint ? 1 : 0) points
    3729  is returned in ngon_boundary_points[]. The caller must insure
    3730  that ngon_boundary_points[] has room for this many elements.
    3731  Returns:
    3732  Number of points added to ngon_boundary_points[] or 0 if invalid
    3733  input is encountered.
    3734  */
    3735  unsigned int GetNgonBoundaryPoints(
    3736  const ON_MeshNgon* ngon,
    3737  bool bAppendStartPoint,
    3738  ON_3dPoint* ngon_boundary_points
    3739  ) const;
    3740 
    3741  /*
    3742  Description:
    3743  If the mesh has ngons with ON_MeshNgon.Orientation() = -1,
    3744  the reverse the ngon's boundary orientation.
    3745  Parameters:
    3746  bPermitHoles - [in]
    3747  ngons may contain holes.
    3748  Returns:
    3749  True if all non-empty ngons have ON_MeshNgon.Orientation()=1 after the call.
    3750  */
    3751  bool OrientNgons(
    3752  bool bPermitHoles
    3753  );
    3754 
    3755  /*
    3756  Description:
    3757  Remove an n-gon.
    3758  Parameters:
    3759  ngon_index - [in]
    3760  Returns:
    3761  True if ngon_index was valid and the corresponding n-gon was removed.
    3762  Remarks:
    3763  The mesh triangles that make up the n-gon are not deleted.
    3764  */
    3765  bool RemoveNgon(
    3766  unsigned int ngon_index
    3767  );
    3768 
    3769  unsigned int RemoveNgons(
    3770  unsigned int ngon_index_count,
    3771  const unsigned int* ngon_index_list
    3772  );
    3773 
    3774  /*
    3775  Description:
    3776  Remove null and empty entries from the ON_Mesh n-gon list.
    3777  */
    3778  void RemoveEmptyNgons();
    3779 
    3780  /*
    3781  Description:
    3782  Remove all entries from the ON_Mesh n-gon list.
    3783  Remarks:
    3784  Same as SetNgonCount(0)
    3785  */
    3786  void RemoveAllNgons();
    3787 
    3788  /*
    3789  Description:
    3790  Set the n-gon count. Null n-gons are be appended
    3791  when ngon_count > current count. Existing n-gons are
    3792  removed when ngon_count < current count.
    3793  Parameters:
    3794  ngon_count - [in]
    3795  Number of n-gons to have.
    3796  0: removes all ngons.
    3797  Remarks:
    3798  The mesh triangles that make up any removed n-gons are not deleted.
    3799  */
    3800  void SetNgonCount(
    3801  unsigned int ngon_count
    3802  );
    3803 
    3804  /*
    3805  Parameters:
    3806  face_index - [in]
    3807  Mesh face ON_Mesh.m_F[] index.
    3808  Returns:
    3809  ON_UNSET_UINT_INDEX:
    3810  The face is not part of an n-gon.
    3811  Otherwise:
    3812  Index of the n-gon the face is part of.
    3813  */
    3814  unsigned int NgonIndexFromFaceIndex(
    3815  unsigned int face_index
    3816  ) const;
    3817 
    3818  /*
    3819  Returns:
    3820  null:
    3821  The ngonMap does not exist.
    3822  an array of length m_F.Count():
    3823  The value of the i-th element is either the index of the n-gon
    3824  the mesh face m_F[i] belongs to or ON_UNSET_UINT_INDEX when
    3825  m_F[i] does not belong to an n-gon.
    3826  */
    3827  const unsigned int* NgonMap() const;
    3828 
    3829  const unsigned int* NgonMap(
    3830  bool bCreateIfMissing
    3831  );
    3832 
    3833  /*
    3834  Returns:
    3835  true if the n-gon information is valid for adding an n-gon to this mesh.
    3836  Parameters:
    3837  Vcount - [in]
    3838  Number of vertices and sides in the n-gon.
    3839  ngon_vi - [in]
    3840  */
    3841  bool IsValidNewNgonInformation(
    3842  unsigned int Vcount,
    3843  const unsigned int* ngon_vi,
    3844  unsigned int Fcount,
    3845  const unsigned int* ngon_fi
    3846  ) const;
    3847 
    3848  /*
    3849  Description:
    3850  For each set of coplanar connected faces in the mesh that
    3851  qualifies as an n-gon, an new ON_MeshNgon will be appended
    3852  to the Ngons[] array. Faces belonging to existing ngons are
    3853  ignored.
    3854  Parameters:
    3855  vertex_face_map - [in]
    3856  - Pass null if you don't have one.
    3857  - See ON_MeshVertexFaceMap for details about making one.
    3858  The only reason to pass one in is because you
    3859  need it for other reasons or you already have one.
    3860  planar_tolerance - [in]
    3861  For faces to be coplanar, all the points in the
    3862  n-gon must be withing planar_tolerance of the plane
    3863  defined by the first face in the n-gon.
    3864  minimum_ngon_vertex_count - [in]
    3865  n-gons must have at least this many sides in order
    3866  to be added.
    3867  minimum_ngon_face_count - [in]
    3868  n-gons must have at least this many faces in order to
    3869  be added.
    3870  bAllowHoles - [in]
    3871  If true, then the added ngons are permitted to have holes.
    3872  bSeparateNgons - [in]
    3873  If true, any face belonging to a new ngon, will not
    3874  share vertices with a face that does not belong to that
    3875  ngon and the vertex normals for all vertices in an ngon will
    3876  be set to the plane's normal.
    3877  bSetNgonVertexNormals - [in]
    3878  If bSeparateNgons and bSetNgonVertexNormals are both true,
    3879  then all vertex normals vertices in a new ngon will be
    3880  set to the ngon's plane normal.
    3881  bRemoveNgonInteriorPoints - [in]
    3882  If true, the new ngons will not have interior vertices.
    3883  This will result in the ngon being retriangluated
    3884  when connected coplanar faces
    3885  Returns:
    3886  The number of new n-gons appended to m_Ngons[]
    3887  */
    3888  unsigned int AddPlanarNgons(
    3889  const unsigned int *const* vertex_face_map,
    3890  double planar_tolerance,
    3891  unsigned int minimum_ngon_vertex_count,
    3892  unsigned int minimum_ngon_face_count,
    3893  bool bAllowHoles
    3894  );
    3895 
    3896  /*
    3897  Description:
    3898  For each ngon with index in the specified range,
    3899  duplicate vertices as needed so that the ngon
    3900  does not share any vertices with faces that do not
    3901  belong to the ngon.
    3902  Parameters:
    3903  vertex_face_map - [in]
    3904  - Pass null if you don't have one.
    3905  - See ON_MeshVertexFaceMap for details about making one.
    3906  The only reason to pass one in is because you
    3907  need it for other reasons or you already have one.
    3908  - Note that if true is returned, then the information
    3909  in this vertex_face_map will be changed and no
    3910  information will be added for the new vertices.
    3911  ngon_index0 - [in]
    3912  ngon_index1 - [in]
    3913  ngons with indices ni satisfying
    3914  ngon_index0 <= ni < ngon_index1 will be separated.
    3915  To separate every ngon in a mesh, pass
    3916  ngon_index0 = 0 and ngon_index1 = mesh->NgonCount().
    3917  Returns:
    3918  true
    3919  one or more vertices were duplicated to separate an ngon
    3920  from it's neighboring faces. This changes the mesh's
    3921  vertex and face information and invalidates any input
    3922  vertex_face_map.
    3923  false
    3924  The mesh was not modified.
    3925  */
    3926  bool SeparateNgons(
    3927  unsigned int** vertex_face_map,
    3928  unsigned int ngon_index0,
    3929  unsigned int ngon_index1
    3930  );
    3931 
    3932  /*
    3933  Description:
    3934  For each ngon with index in the specified range,
    3935  all vertices in the ngon will have their vertex normal
    3936  set to the normal of the first face in the ngon.
    3937  Parameters:
    3938  ngon_index0 - [in]
    3939  ngon_index1 - [in]
    3940  ngons with indices ni satisfying
    3941  ngon_index0 <= ni < ngon_index1 will be separated.
    3942  To separate every ngon in a mesh, pass
    3943  ngon_index0 = 0 and ngon_index1 = mesh->NgonCount().
    3944  Returns:
    3945  true
    3946  one or more vertices were duplicated to separate an ngon
    3947  from it's neighboring faces. This changes the mesh's
    3948  vertex and face information and invalidates any input
    3949  vertex_face_map.
    3950  false
    3951  The mesh was not modified.
    3952  */
    3953  bool SetNgonVertexNormals(
    3954  unsigned int ngon_index0,
    3955  unsigned int ngon_index1
    3956  );
    3957 
    3958  /*
    3959  Description:
    3960  For each ngon with index in the specified range that has
    3961  interior vertices, remove the interior vertices and
    3962  triangluate the ngon.
    3963  Parameters:
    3964  vertex_face_map - [in]
    3965  - Pass null if you don't have one.
    3966  - See ON_MeshVertexFaceMap for details about making one.
    3967  The only reason to pass one in is because you
    3968  need it for other reasons or you already have one.
    3969  - If true is returned, then the information
    3970  in this vertex_face_map will be invalid because
    3971  vertices will be removed.
    3972  ngon_index0 - [in]
    3973  ngon_index1 - [in]
    3974  ngons with indices ni satisfying
    3975  ngon_index0 <= ni < ngon_index1 will be separated.
    3976  To separate every ngon in a mesh, pass
    3977  ngon_index0 = 0 and ngon_index1 = mesh->NgonCount().
    3978  Returns:
    3979  true
    3980  one or more vertices were removed and one or more ngons
    3981  were triangluated. This changes the mesh's vertex and face
    3982  information and invalidates any input vertex_face_map.
    3983  false
    3984  The mesh was not modified.
    3985  Remarks:
    3986  If true is returned and you are finished modify the mesh, then
    3987  call ON_Mesh::Compact() or ON_Mesh::CullUnusedVertices() to remove
    3988  the unreferenced interior vertices.
    3989  */
    3990  bool RemoveNgonInteriorVertices(
    3991  const unsigned int *const* vertex_face_map,
    3992  unsigned int ngon_index0,
    3993  unsigned int ngon_index1
    3994  );
    3995 
    3996  /*
    3997  Descrption:
    3998  Given a group of connected coplanar faces,
    3999  find the n-gon boundary.
    4000  ngon_fi_count - [in]
    4001  number of indices in ngon_fi[]
    4002  ngon_fi - [in]
    4003  Indices of faces in the ON_Mesh.m_F[] array.
    4004  ngon_vi - [out]
    4005  An ordered list of indices of vertices in the ON_Mesh.m_V[]
    4006  array that for the outer boundary of the n-gon. The natural
    4007  counter-clockwise orientation of the first face with a
    4008  boundary edge determines the order of the ngon_vi[] list.
    4009  */
    4010  unsigned int GetNgonOuterBoundary(
    4011  unsigned int ngon_fi_count,
    4012  const unsigned int* ngon_fi,
    4014  ) const;
    4015 
    4016  /*
    4017  Description:
    4018  An expert user function that allocates an ngon from heap
    4019  memory managed by this ON_Mesh.
    4020  Parameters:
    4021  N - [in] (>= 3)
    4022  Fcount - [in]
    4023  Returns:
    4024  A pointer to an uninitialized ngon.
    4025  Use the ON_Mesh::AddNgon(ngon) to add this ngon to the mesh
    4026  or use DeallocateNgon(ngon) to deallocate the ngon.
    4027  */
    4028  ON_MeshNgon* AllocateNgon(
    4029  unsigned int Vcount,
    4030  unsigned int Fcount
    4031  );
    4032 
    4033  /*
    4034  Description:
    4035  An expert user function that deallocates an ngon
    4036  that was created by AllocateNgon().
    4037  Parameters:
    4038  ngon - [in]
    4039  */
    4040  bool DeallocateNgon(
    4041  ON_MeshNgon* ngon
    4042  );
    4043 
    4044  /*
    4045  Description:
    4046  An expert user function that unconditionally appends the ngon
    4047  pointer to ON_Mesh.m_Ngon[].
    4048  Parameters:
    4049  ngon - [in]
    4050  Returns:
    4051  ON_UNSET_UINT_INDEX: invalid input
    4052  < ON_UNSET_UINT_INDEX: index of the new n-gon.
    4053  */
    4054  unsigned int AddNgon(
    4055  ON_MeshNgon* ngon
    4056  );
    4057 
    4058  /*
    4059  Description:
    4060  Expert user function to update n-gon map after the expert user
    4061  does something to make the current one invalid.
    4062  Returns:
    4063  null:
    4064  The mesh does not have ngon-information.
    4065  an array of length m_F.Count() ngon_map[]
    4066  - If ngon_map[fi] >= 0, then ON_MeshFace.m_F[fi] belongs
    4067  to ON_Mesh.Ngon(ngon_map[fi]).
    4068  - Otherwise, ngon_map[fi] = -1.
    4069  */
    4070  const unsigned int* CreateNgonMap();
    4071 
    4072 
    4073  /*
    4074  Description:
    4075  Expert user function to delete n-gon map information
    4076  but leave n-gon definition information unchanged.
    4077  Description:
    4078  Removes any existing n-gon map.
    4079  Does not remove other n-gon information.
    4080  */
    4081  void RemoveNgonMap();
    4082 
    4083  ////////////////////////////////////////////////////////////////////////
    4084  //
    4085  // N-gon implementation
    4086  //
    4087 
    4088  // If ON_Mesh::HasNgons() is true, then the mesh has n-gons.
    4089  // When a mesh has ngons, m_NgonMap[] is used to determine when
    4090  // a face belongs to an n-gon.
    4091  // If m_NgonMap[fi] >= 0, then it is the index of the ngon m_F[]
    4092  // belongs to. Otherwise, m_Fngon[fi] is -1.
    4093  ON_SimpleArray<unsigned int> m_NgonMap; // invalid if m_NgonMap.Count() != m_F.Count()
    4095  ON_MeshNgonAllocator m_NgonAllocator; // use this to allocate elements added to m_Ngon;
    4096 
    4097  ////////////////////////////////////////////////////////////////////////
    4098  //
    4099  // Vertex and Face normal implementation
    4100  //
    4101 
    4102  // m_N[] OPTIONAL vertex unit normals
    4103  // If m_N[] is empty or m_N.Count() != m_V.Count(),
    4104  // Either m_N[] has zero count or it m_N[j] is the
    4105  // the unit vertex normal at m_V[j].
    4107 
    4108  // m_FN[] OPTIONAL face unit normals
    4109  // If m_FN[] is empty or m_FN.Count() != m_F.Count(),
    4110  // then m_FN is ignored. Otherwise m_FN[j] is the
    4111  // unit normal for the facet m_F[j].
    4113 
    4114  /////////////////////////////////////////////////////////////////
    4115  // Implementation - texture coordinates
    4116  //
    4117  // OPTIONAL texture coordinates for each vertex
    4118 
    4119  // It would be nice if this were an ON_TextureCoordinates,
    4120  // but that breaks lots of checked out code that assumes
    4121  // m_T is an array of ON_2fPoints.
    4122  ON_MappingTag m_Ttag; // OPTIONAL tag for values in m_T[]
    4123  ON_2fPointArray m_T; // OPTIONAL texture coordinates for each vertex
    4124 
    4125  // RUNTIME ONLY
    4126  // This array is used to cache texture coordinates used by
    4127  // rendering applications that require 1d texture coordinates,
    4128  // 3d texture coordinates, or multiple sets of texture
    4129  // coordinates (e.g. blended textures with different mappings).
    4130  // Users are responsible for verifying
    4131  // m_TC[i].m_T.Count() = m_V.Count()
    4133 
    4134  // If m_T.Count() == m_V.Count(), then the mesh has texture coordinates
    4135  // and m_T[j] is the texture coordinate for vertex m_V[j].
    4136  //
    4137  // When opennurbs or Rhino meshes an ON_Surface or ON_Brep, the texture
    4138  // coordinates have a "canonical" linear relationship with the surface
    4139  // parameters that is described in the next section. However, various
    4140  // mappings, spherical, planar, cylindrical, etc., can be applied that
    4141  // change the values of the texture coordinates.
    4142  //
    4143  // If a texture mapping function was used to set the m_T[] values,
    4144  // then the id and serial number of the mapping function is saved
    4145  // in m_mapping_id and m_mapping_sn. The intended use of these fields
    4146  // is to make it easy to avoid unnecessary recalculation.
    4147  // If a mesh is modified, then m_mapping_id should be set to nil
    4148  // and m_mapping_crc should be set to 0.
    4149  //
    4150  /////////////////////////////////////////////////////////////////
    4151 
    4152 
    4153  /////////////////////////////////////////////////////////////////
    4154  // Implementation - surface parameters and packed texture
    4155  // information
    4156  //
    4157  // If m_S.Count() == m_V.Count(), then the mesh is a tesselation
    4158  // of a parameteric surface and m_S[j] is the surface parameter at
    4159  // m_V[j]. Storing values in m_S[] is OPTIONAL.
    4160  //
    4161  // If m_srf_scale[] has positive values, then they report
    4162  // the world coordinate size of a rectangle that would
    4163  // minimize texture distortion if it were mapped to the
    4164  // mesh using normalized surface evaluation parameters.
    4165  // This information is used to calculate high quality
    4166  // packed texture coordinates.
    4168  ON_Interval m_srf_domain[2]; // surface evaluation domain.
    4169  double m_srf_scale[2];
    4170 
    4171 
    4172  // Packed texture information.
    4173  //
    4174  // If either of the m_packed_tex_domain[] intervals is a
    4175  // proper subinterval of (0,1), then a texture packing
    4176  // calculation assigned this subrectangle to this mesh.
    4177 
    4178  ON_Interval m_packed_tex_domain[2];
    4179 
    4180  // The m_packed_tex_rotate setting is valid only when
    4181  // m_S, m_srf_domain, m_packed_scale[] and
    4182  // m_packed_tex_domain[] are all valid and the texture
    4183  // coordinates are based on surface evaluation parameters.
    4184  // In this special situation, this boolean records the
    4185  // correspondence between the the surface parameters, (u,v),
    4186  // and the packed texture coordinates, (s,t),
    4187  //
    4188  // m_packed_tex_rotate = false:
    4189  // a = m_srf_domain[0].NormalizedParameterAt(u);
    4190  // b = m_srf_domain[1].NormalizedParameterAt(v);
    4191  // s = m_packed_tex_domain[0].ParameterAt(a);
    4192  // t = m_packed_tex_domain[1].ParameterAt(b);
    4193  //
    4194  // x = m_packed_tex_domain[0].NormalizedParameterAt(s);
    4195  // y = m_packed_tex_domain[1].NormalizedParameterAt(t);
    4196  // u = m_srf_domain[0].ParameterAt(x);
    4197  // v = m_srf_domain[1].ParameterAt(y);
    4198  //
    4199  // m_packed_tex_rotate = true:
    4200  // a = m_srf_domain[0].NormalizedParameterAt(u);
    4201  // b = m_srf_domain[1].NormalizedParameterAt(v);
    4202  // s = m_packed_tex_domain[0].ParameterAt(a);
    4203  // t = m_packed_tex_domain[1].ParameterAt(1.0-b);
    4204  //
    4205  // x = m_packed_tex_domain[0].NormalizedParameterAt(s);
    4206  // y = m_packed_tex_domain[1].NormalizedParameterAt(t);
    4207  // u = m_srf_domain[0].ParameterAt(y);
    4208  // v = m_srf_domain[1].ParameterAt(1.0 - x);
    4210 
    4211  /*
    4212  Returns:
    4213  True if the m_srf_scale[] values are positive and
    4214  the m_packed_tex_domain[] intervals are set to values
    4215  that describe a proper subrectangle of (0,1)x(0,1).
    4216  True does not necessarily mean the current values in
    4217  m_T[] are packed texture coordinates.
    4218  */
    4219  bool HasPackedTextureRegion() const;
    4220 
    4221  /*
    4222  Description:
    4223  If the mesh does not have surface evaulation parameters,
    4224  has texture coordinates, and the surface parameters can
    4225  be set in a way so the existing texture coordinates can
    4226  be computed from the surface parameters, then this function
    4227  sets the surface parameters. This is useful when meshes
    4228  that have texture coordinates and do not have surface
    4229  parameters want ot set the surface parameters in a way
    4230  so that the texture mapping
    4231  ON_TextureMapping::SurfaceParameterTextureMapping
    4232  will restore the texture coordinates.
    4233  Returns:
    4234  true - successful
    4235  false - failure - no changes made to the mesh.
    4236  */
    4237  bool SetSurfaceParamtersFromTextureCoodinates();
    4238 
    4239 
    4240  /////////////////////////////////////////////////////////////////
    4241  // Implementation - curvature
    4242 
    4243  ON_SimpleArray<ON_SurfaceCurvature> m_K; // OPTIONAL surface curvatures
    4244  // Either m_K[] has zero count or it has the same
    4245  // count as m_V[], in which case m_K[j] reports
    4246  // the surface curvatures at m_V[j].
    4247 
    4248  /////////////////////////////////////////////////////////////////
    4249  // Implementation - false color
    4250  ON_MappingTag m_Ctag; // OPTIONAL tag for values in m_C[]
    4251  ON_SimpleArray<ON_Color> m_C; // OPTIONAL vertex color
    4252  // Either m_C[] has zero count or it has the same
    4253  // count as m_V[], in which case m_C[j] reports
    4254  // the color assigned to m_V[j].
    4255 
    4256  /////////////////////////////////////////////////////////////////
    4257  // Implementation - runtime vertex visibility - not saved in 3dm files.
    4258  ON_SimpleArray<bool> m_H; // OPTIONAL vertex visibility.
    4259  // If m_H.Count() = m_V.Count(), then
    4260  // m_H[vi] is true if the vertex m_V[vi]
    4261  // is hidden. Otherwise, all vertices are visible.
    4262  int m_hidden_count; // number of vertices that are hidden
    4263  // = number of true values in m_H[] array.
    4264 
    4265  /////////////////////////////////////////////////////////////////
    4266  // Implementation - runtime UI information
    4267  const ON_Object* m_parent; // runtime parent geometry (use ...::Cast() to get it)
    4268 
    4269 protected:
    4270 
    4271  /////////////////////////////////////////////////////////////////
    4272  // Implementation - mesh topology
    4274 
    4275  ON_MeshParameters* m_mesh_parameters; // If mesh was created from a parametric surface,
    4276  // these parameters were used to create the mesh.
    4280 
    4281 private:
    4282  char m_mesh_is_closed; // 0 = unset, 1 = all edges have 2 or more faces, 2 = at least one boundary edge
    4283  char m_mesh_is_manifold; // 0 = unset, 1 = all edges have 1 or 2 faces, 2 = not manifold
    4284  char m_mesh_is_oriented; // 0 = unset, 1 = faces normals agree across all edges that have 2 faces, 2 = not oriented
    4285  char m_mesh_is_solid; // 0 = unset, 1 = solid with outward face normals, 2 = solid with inward face normals, 3 = not solid
    4286 
    4287 private:
    4288  mutable ON_BoundingBox m_vertex_bbox = ON_BoundingBox::UnsetBoundingBox;
    4289 
    4290 protected:
    4291  float m_nbox[2][3]; // 3d bounding box of all referenced unit normals
    4292  // (for estimation of Gauss map bounds)
    4293  float m_tbox[2][2]; // 2d bounding box of all referenced texture coordinates
    4294 
    4295 private:
    4296  // m_vertex_bbox = bounding box of vertex locations
    4297 
    4298  // cache of recently used tight bounding boxes
    4299  mutable ON_BoundingBoxCache m_tight_bbox_cache;
    4300 
    4301 protected:
    4302 
    4303  ON_MeshCurvatureStats* m_kstat[4]; // gaussian,mean,min,max,sectionx,sectiony,sectionz
    4304 
    4305  // sub-mesh information rendering large meshes
    4307 
    4308 
    4309 private:
    4310  bool Write_1( ON_BinaryArchive& ) const; // uncompressed 1.x format
    4311  bool Write_2( int, ON_BinaryArchive& ) const; // compressed 2.x format
    4312  bool Read_1( ON_BinaryArchive& );
    4313  bool Read_2( int, ON_BinaryArchive& );
    4314  bool WriteFaceArray( int, int, ON_BinaryArchive& ) const;
    4315  bool ReadFaceArray( int, int, ON_BinaryArchive& );
    4316  bool SwapEdge_Helper( int, bool );
    4317 };
    4318 
    4319 //////////////////////////////////////////////////////////////////////////
    4320 //
    4321 // ON_MeshCache
    4322 //
    4323 class ON_CLASS ON_MeshCache
    4324 {
    4325 public:
    4326  static const ON_MeshCache Empty;
    4327 
    4328  static const ON_UUID RenderMeshId;
    4329  static const ON_UUID AnalysisMeshId;
    4330  static const ON_UUID PreviewMeshId;
    4331  static const ON_UUID AnyMeshId;
    4332 
    4333  // Cached mesh with the fewest faces
    4334  static const ON_UUID CoarseMeshId;
    4335 
    4336  // Cached mesh with the most faces
    4337  static const ON_UUID FineMeshId;
    4338 
    4339  /*
    4340  Returns:
    4341  The id that corresonds to the obsolete ON::mesh_type enum value.
    4342  Remarks:
    4343  Ids are used to allow custom meshes to be cached.
    4344  */
    4345  static ON_UUID MeshIdFromMeshType(
    4346  ON::mesh_type mesh_type
    4347  );
    4348 
    4349 public:
    4350  ON_MeshCache() = default;
    4351  ~ON_MeshCache();
    4352  ON_MeshCache( const ON_MeshCache& src );
    4353  ON_MeshCache& operator=( const ON_MeshCache& src );
    4354 
    4355 #if defined(ON_HAS_RVALUEREF)
    4356  // rvalue copy constructor
    4357  ON_MeshCache( ON_MeshCache&& ) ON_NOEXCEPT;
    4358 
    4359  ON_MeshCache& operator=( ON_MeshCache&& );
    4360 #endif
    4361 
    4362 public:
    4363 
    4364  /*
    4365  Parameters:
    4366  mesh_id - [in]
    4367  mesh_id cannot be nil or ON_MeshCache::AnyMeshId.
    4368  */
    4369  void SetMesh(
    4370  ON_UUID mesh_id,
    4371  const std::shared_ptr<ON_Mesh>& mesh_sp
    4372  );
    4373  void SetMesh(
    4374  ON::mesh_type mesh_type,
    4375  const std::shared_ptr<ON_Mesh>& mesh_sp
    4376  );
    4377 
    4378  /*
    4379  Parameters:
    4380  mesh_id - [in]
    4381  If mesh_id is ON_MeshCache::AnyMeshId, then every cached mesh
    4382  will be deleted.
    4383  */
    4384  void ClearMesh(
    4385  ON_UUID mesh_id
    4386  );
    4387  void ClearMesh(
    4388  ON::mesh_type mesh_type
    4389  );
    4390 
    4391  void ClearAllMeshes();
    4392 
    4393  /*
    4394  Parameters:
    4395  bDeleteMesh - [in]
    4396  true
    4397  ON_Mesh will be deleted.
    4398  false
    4399  ON_Mesh will not be deleted. This is typically done when the
    4400  mesh was in the process of being created in a separate thread
    4401  and memory pool, both of which were killed and the pointer
    4402  to the mesh is no longer valid.
    4403  */
    4404  void ClearMesh(
    4405  ON_UUID mesh_id,
    4406  bool bDeleteMesh
    4407  );
    4408 
    4409  /*
    4410  Parameters:
    4411  bDeleteMesh - [in]
    4412  true
    4413  ON_Mesh will be deleted.
    4414  false
    4415  ON_Mesh will not be deleted. This is typically done when the
    4416  mesh was in the process of being created in a separate thread
    4417  and memory pool, both of which were killed and the pointer
    4418  to the mesh is no longer valid.
    4419  */
    4420  void ClearMesh(
    4421  ON::mesh_type mesh_type,
    4422  bool bDeleteMesh
    4423  );
    4424 
    4425 
    4426  /*
    4427  Parameters:
    4428  bDeleteMeshes - [in]
    4429  true
    4430  ON_Mesh will be deleted.
    4431  false
    4432  ON_Mesh will not be deleted. This is typically done when the
    4433  mesh was in the process of being created in a separate thread
    4434  and memory pool, both of which were killed and the pointer
    4435  to the mesh is no longer valid.
    4436  */
    4437  void ClearAllMeshes(
    4438  bool bDeleteMeshes
    4439  );
    4440 
    4441  /*
    4442  Parameters:
    4443  mesh_id - [in]
    4444  If mesh_id is ON_MeshCache::AnyMeshId, then the most recently cached mesh is returned.
    4445  */
    4446  const ON_Mesh* Mesh(
    4447  ON_UUID mesh_id
    4448  ) const;
    4449  const ON_Mesh* Mesh(
    4450  ON::mesh_type mesh_type
    4451  ) const;
    4452 
    4453 
    4454  /*
    4455  Parameters:
    4456  mesh_id - [in]
    4457  If mesh_id is ON_MeshCache::AnyMeshId, then the most recently cached mesh is returned.
    4458  */
    4459  std::shared_ptr<ON_Mesh> MeshSharedPtr(
    4460  ON_UUID mesh_id
    4461  ) const;
    4462 
    4463  std::shared_ptr<ON_Mesh> MeshSharedPtr(
    4464  ON::mesh_type mesh_type
    4465  ) const;
    4466 
    4467  unsigned int MeshCount() const;
    4468 
    4469  bool Write(
    4470  ON_BinaryArchive& archive
    4471  ) const;
    4472 
    4473  bool Read(
    4474  ON_BinaryArchive& archive
    4475  );
    4476 
    4477  void Dump(
    4478  ON_TextLog& text_log
    4479  ) const;
    4480 
    4481  bool Transform(
    4482  const ON_Xform& xform
    4483  );
    4484 
    4485 private:
    4486  void Internal_CopyHelper(
    4487  const class ON_MeshCacheItem* src_item_list
    4488  );
    4489 
    4490  class ON_MeshCacheItem* Internal_FindHelper(
    4491  ON_UUID mesh_type
    4492  ) const;
    4493 
    4494  class ON_MeshCacheItem* Internal_CreateItem();
    4495  class ON_MeshCacheItem* Internal_CopyItem(const class ON_MeshCacheItem& src_item);
    4496 
    4497  void Internal_DeleteItem(class ON_MeshCacheItem*,bool bDeleteMesh);
    4498 
    4499  class ON_MeshCacheItem* m_impl = nullptr;
    4500 };
    4501 
    4502 class ON_CLASS ON_MeshNgonIterator
    4503 {
    4504 public:
    4505 
    4507 
    4508  ON_MeshNgonIterator() = default;
    4509  ~ON_MeshNgonIterator() = default;
    4510 
    4512  const ON_MeshNgonIterator& src
    4513  );
    4514 
    4515  ON_MeshNgonIterator& operator=(
    4516  const ON_MeshNgonIterator& src
    4517  );
    4518 
    4519 
    4520  /*
    4521  Parameters:
    4522  mesh - [in]
    4523  If the mesh has explicit ngons, then mesh->NgonMap() must
    4524  return true;
    4525  */
    4527  const class ON_Mesh* mesh
    4528  );
    4529 
    4530  /*
    4531  Parameters:
    4532  mesh - [in]
    4533  If the mesh has explicit ngons,
    4534  meshfdex_to_meshngondex_map - [in]
    4535  It's generally best to pass the value of mesh->NgonMap(true).
    4536  Expert users can specify a custom map if required.
    4537  */
    4538  void SetMesh(
    4539  const class ON_Mesh* mesh,
    4540  const unsigned int* meshfdex_to_meshngondex_map
    4541  );
    4542 
    4543  /*
    4544  Returns:
    4545  The mesh being iterated.
    4546  */
    4547  const ON_Mesh* Mesh() const;
    4548 
    4549  /*
    4550  Description:
    4551  Returns the first ngon.
    4552  Returns:
    4553  The first ngon when iterating through the mesh
    4554  triangles, quads and explicitly defined ngons.
    4555  Remarks:
    4556  If CurrentNgonIsMeshFace() is true after calling FirstNgon().
    4557  the the returned ngon references a triangle or
    4558  quad that is not part of an explicitly defined
    4559  ngon in the mesh. If you need the information
    4560  to persist after any subsequent calls to the iterator
    4561  or after the destruction of the iterator, then
    4562  you must make and manage a copy of the ngon.
    4563  */
    4564  const class ON_MeshNgon* FirstNgon();
    4565 
    4566  /*
    4567  Description:
    4568  Increments the iterator and returns the next ngon.
    4569  Returns:
    4570  The next ngon when iterating through the mesh
    4571  triangles, quads and explicitly defined ngons.
    4572  Remarks:
    4573  If CurrentNgonIsMeshFace() is true after calling NextNgon().
    4574  the the returned ngon references a triangle or
    4575  quad that is not part of an explicitly defined
    4576  ngon in the mesh. If you need the information
    4577  to persist after any subsequent calls to the iterator
    4578  or after the destruction of the iterator, then
    4579  you must make and manage a copy of the ngon.
    4580  */
    4581  const class ON_MeshNgon* NextNgon();
    4582 
    4583  /*
    4584  Description:
    4585  Get the ngon most recently returned by FirstNgon()
    4586  or NextNgon().
    4587  Returns:
    4588  Returns the ngon most recently returned by FirstNgon()
    4589  or NextNgon().
    4590  Remarks:
    4591  If CurrentNgonIsMeshFace() is true after calling CurrentNgon().
    4592  the the returned ngon references a triangle or
    4593  quad that is not part of an explicitly defined
    4594  ngon in the mesh. If you need the information
    4595  to persist after any subsequent calls to the iterator
    4596  or after the destruction of the iterator, then
    4597  you must make and manage a copy of the ngon.
    4598  */
    4599  const class ON_MeshNgon* CurrentNgon();
    4600 
    4601  ON_COMPONENT_INDEX CurrentNgonComponentIndex() const;
    4602  /*
    4603  Returns:
    4604  If the current iterator ngon references an ON_MeshFace
    4605  that is in m_mesh->m_F[] but is not explictly referenced
    4606  by an ON_MeshNgon in ON_Mesh.m_Ngon[], then true is returned.
    4607  In this case, the ngon's m_fi[] array
    4608  has length 1 and contains the face's index, and the ngon's
    4609  m_vi[] array is a copy of the faces's vi[] array.
    4610  Otherwise false is returned.
    4611  */
    4612  bool CurrentNgonIsMeshFace() const;
    4613 
    4614  /*
    4615  Returns:
    4616  If the current iterator ngon references an ON_MeshNgon
    4617  that is in m_mesh->m_Ngon[], then true is returned.
    4618  Otherwise false is returned.
    4619  */
    4620  bool CurrentNgonIsMeshNgon() const;
    4621 
    4622  /*
    4623  Description:
    4624  Sets the state of the iterator to the initial state that
    4625  exists after construction. This is useful if the iterator
    4626  has been used the get one or more elements and then
    4627  the referenced mesh is modified or code wants
    4628  to begin iteration again a used a call to NextNgon()
    4629  to return the first element.
    4630  */
    4631  void Reset();
    4632 
    4633  /*
    4634  Returns:
    4635  Number of ngons that will be iterated over.
    4636  Remarks:
    4637  The count = explicit ngons + faces that are not in an ngon.
    4638  */
    4639  unsigned int Count() const;
    4640 
    4641 private:
    4642  const class ON_Mesh* m_mesh = nullptr;
    4643  const unsigned int* m_facedex_to_ngondex_map = nullptr;
    4644  ON__UINT_PTR m_current_ngon = 0;
    4645  ON_MeshNgonBuffer m_ngon_buffer;
    4646  ON_COMPONENT_INDEX m_current_ngon_ci = ON_COMPONENT_INDEX::UnsetComponentIndex;
    4647  unsigned int m_mesh_face_count = 0;
    4648  unsigned int m_mesh_ngon_count = 0;
    4649  unsigned int m_iterator_index = 0;
    4650 };
    4651 
    4652 class ON_CLASS ON_MeshComponentRef : public ON_Geometry
    4653 {
    4654  ON_OBJECT_DECLARE(ON_MeshComponentRef);
    4655 public:
    4657 
    4660  const class ON_Mesh* mesh,
    4661  ON_COMPONENT_INDEX ci
    4662  );
    4664  ON_MeshComponentRef& operator=(const ON_MeshComponentRef&);
    4665 
    4666 private:
    4667  // referenced mesh
    4668  const class ON_Mesh* m_mesh;
    4669 
    4670  // component
    4671  ON_COMPONENT_INDEX m_mesh_ci;
    4672 
    4673 public:
    4674  void Set(
    4675  const class ON_Mesh* mesh,
    4676  ON_COMPONENT_INDEX ci
    4677  );
    4678 
    4679  /*
    4680  Returns:
    4681  The referenced mesh.
    4682  */
    4683  const class ON_Mesh* Mesh() const;
    4684 
    4685  /*
    4686  Description:
    4687  Override of the virtual ON_Geometry::ComponentIndex().
    4688  Returns:
    4689  A mesh component index for the face. The type is
    4690  ON_COMPONENT_INDEX::mesh_face and the index is the
    4691  index into the ON_Mesh.m_F[] array.
    4692  */
    4693  ON_COMPONENT_INDEX ComponentIndex() const override;
    4694 
    4695  /*
    4696  Returns:
    4697  If the mesh topology exists or the component references
    4698  a mesh topology component, then this returns a pointer
    4699  to the mesh topology.
    4700  Otherwise null is returned.
    4701  */
    4702  const class ON_MeshTopology* MeshTopology() const;
    4703 
    4704  /*
    4705  Returns:
    4706  If the component is a vertex, this returns the vertex index.
    4707  Otherwise ON_UNSET_UINT_INDEX is returned.
    4708  */
    4709  unsigned int VertexIndex() const;
    4710 
    4711  /*
    4712  Returns:
    4713  If the component is a mesh vertex or mesh topology vertex,
    4714  then this returns the vertex location.
    4715  Otherwise ON_3dPoint::UnsetPoint is returned.
    4716  */
    4717  ON_3dPoint VertexPoint() const;
    4718 
    4719  /*
    4720  Parameters:
    4721  point - [out]
    4722  location of the vertex
    4723  Returns:
    4724  If the component is a vertex, this returns the vertex index.
    4725  Otherwise ON_UNSET_UINT_INDEX is returned.
    4726  */
    4727  unsigned int GetVertexPoint(
    4728  class ON_3dPoint& point
    4729  ) const;
    4730 
    4731  /*
    4732  Returns:
    4733  If the component is a vertex and mesh topology exists or
    4734  the component is a mesh topology vertex, then this returns
    4735  a pointer to the mesh topology vertex index.
    4736  Otherwise null is returned.
    4737  */
    4738  const struct ON_MeshTopologyVertex* MeshTopologyVertex() const;
    4739 
    4740  /*
    4741  Returns:
    4742  If the component is a vertex and mesh topology exists or
    4743  the component is a mesh topology vertex, then this returns
    4744  the mesh topology vertex index.
    4745  Otherwise ON_UNSET_UINT_INDEX is returned.
    4746  */
    4747  unsigned int MeshTopologyVertexIndex() const;
    4748 
    4749  /*
    4750  Returns:
    4751  If the component is a vertex and mesh topology exists or
    4752  the component is a mesh topology vertex, then this returns
    4753  the mesh topology vertex index.
    4754  Otherwise ON_UNSET_UINT_INDEX is returned.
    4755  */
    4756  unsigned int GetMeshTopologyVertexPoint(
    4757  class ON_3dPoint& point
    4758  ) const;
    4759 
    4760  /*
    4761  Returns:
    4762  If the component is a vertex and mesh topology exists or
    4763  the component is a mesh topology vertex, then this returns
    4764  the mesh topology vertex index.
    4765  Otherwise ON_UNSET_UINT_INDEX is returned.
    4766  */
    4767  unsigned int GetMeshTopologyVertex(
    4768  const struct ON_MeshTopologyVertex*& topv
    4769  ) const;
    4770 
    4771  /*
    4772  Returns:
    4773  If the component is a vertex and mesh topology exists or
    4774  the component is a mesh topology vertex, then this returns
    4775  the mesh topology vertex index.
    4776  Otherwise ON_UNSET_UINT_INDEX is returned.
    4777  */
    4778  unsigned int GetMeshTopologyVertexAndPoint(
    4779  const struct ON_MeshTopologyVertex*& topv,
    4780  class ON_3dPoint& point
    4781  ) const;
    4782 
    4783  /*
    4784  Returns:
    4785  If the component is a mesh topology edge, this returns
    4786  the mesh topology edge index.
    4787  Otherwise ON_UNSET_UINT_INDEX is returned.
    4788  */
    4789  unsigned int MeshTopologyEdgeIndex() const;
    4790 
    4791  /*
    4792  Returns:
    4793  If the component is an edge, this returns the edge.
    4794  Otherwise null is returned.
    4795  */
    4796  const struct ON_MeshTopologyEdge* MeshTopologyEdge() const;
    4797 
    4798  unsigned int GetMeshTopologyEdge(
    4799  const struct ON_MeshTopologyEdge*& tope
    4800  ) const;
    4801 
    4802  unsigned int GetMeshTopologyEdgeLine(
    4803  class ON_Line& line
    4804  ) const;
    4805 
    4806  /*
    4807  Parameters:
    4808  line - [out]
    4809  If the component is an edge, the 3d line is returned here.
    4810  Returns:
    4811  If the component is an edge, this returns the edge.
    4812  Otherwise null is returned.
    4813  */
    4814  unsigned int GetMeshTopologyEdgeAndLine(
    4815  const struct ON_MeshTopologyEdge*& tope,
    4816  ON_Line& line
    4817  ) const;
    4818 
    4819  /*
    4820  Returns:
    4821  - If the component references to an ON_MeshNgon in the mesh, then a pointer
    4822  to this ngon is returned.
    4823  - If the component references an ON_MeshFace triangle or quad, then
    4824  then a single face ON_MeshNgon is created in the memory in
    4825  ngon_buffer.
    4826  - Otherwise, null is returned.
    4827  */
    4828  const class ON_MeshNgon* MeshNgon(
    4829  class ON_MeshNgonBuffer& ngon_buffer
    4830  ) const;
    4831 
    4832  /*
    4833  Returns:
    4834  If the component is a face or an ngon containing a single face,
    4835  this returns the face index.
    4836  Otherwise ON_UNSET_UINT_INDEX is returned.
    4837  Remarks:
    4838  The best way to write code that works with triangle, quad
    4839  and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).
    4840  */
    4841  unsigned int MeshFaceIndex() const;
    4842 
    4843  /*
    4844  Returns:
    4845  If the component is a face or an ngon made of a single face,
    4846  this returns the face.
    4847  Otherwise null is returned.
    4848  Remarks:
    4849  The best way to write code that works with triangle, quad
    4850  and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).
    4851  */
    4852  const class ON_MeshFace* MeshFace() const;
    4853 
    4854  /*
    4855  Returns:
    4856  If the component is a face or an ngon made of a single face,
    4857  this returns the face.
    4858  Otherwise null is returned.
    4859  Remarks:
    4860  The best way to write code that works with triangle, quad
    4861  and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).
    4862  */
    4863  unsigned int GetMeshFace(
    4864  const class ON_MeshFace*& mesh_face
    4865  ) const;
    4866 
    4867 
    4868  /*
    4869  Returns:
    4870  If the component is an ngon or a face in an ngon,
    4871  this returns the ngon index.
    4872  Otherwise ON_UNSET_UINT_INDEX is returned.
    4873  Remarks:
    4874  The best way to write code that works with triangle, quad
    4875  and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).
    4876  */
    4877  unsigned int MeshNgonIndex() const;
    4878 
    4879 
    4880  /*
    4881  Returns:
    4882  If the component is an ngon or a face in an ngon, this returns the ngon.
    4883  Otherwise null is returned.
    4884  Remarks:
    4885  The best way to write code that works with triangle, quad
    4886  and ngons is to use the ON_MeshComponent::MeshNgon(ngon_buffer).
    4887  */
    4888  const class ON_MeshNgon* MeshNgon() const;
    4889 
    4890 
    4891  // overrides of virtual ON_Object functions
    4892  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    4893  void Dump( ON_TextLog& ) const override;
    4894  unsigned int SizeOf() const override;
    4895  ON::object_type ObjectType() const override;
    4896 
    4897  // overrides of virtual ON_Geometry functions
    4898  int Dimension() const override;
    4899 
    4900  // virtual ON_Geometry GetBBox override
    4901  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    4902 
    4903  bool Transform(
    4904  const ON_Xform& xform
    4905  ) override;
    4906 };
    4907 
    4908 
    4909 /*
    4910 Description:
    4911  Calculate a mesh representation of the NURBS surface's control polygon.
    4912 Parameters:
    4913  nurbs_surface - [in]
    4914  bCleanMesh - [in] If true, then degenerate quads are cleaned
    4915  up to be triangles. Surfaces with singular
    4916  sides are a common source of degenerate qauds.
    4917  input_mesh - [in] If nullptr, then the returned mesh is created
    4918  by a class to new ON_Mesh(). If not null, then this
    4919  mesh will be used to store the conrol polygon.
    4920 Returns:
    4921  If successful, a pointer to a mesh.
    4922 */
    4923 ON_DECL
    4924 ON_Mesh* ON_ControlPolygonMesh(
    4925  const ON_NurbsSurface& nurbs_surface,
    4926  bool bCleanMesh,
    4927  ON_Mesh* input_mesh = nullptr
    4928  );
    4929 
    4930 
    4931 /*
    4932 Description:
    4933  Finds the unit normal to the triangle
    4934 Parameters:
    4935  A - [in] triangle corner
    4936  B - [in] triangle corner
    4937  C - [in] triangle corner
    4938 Returns:
    4939  Unit normal
    4940 */
    4941 ON_DECL
    4942 ON_3dVector ON_TriangleNormal(
    4943  const ON_3dPoint& A,
    4944  const ON_3dPoint& B,
    4945  const ON_3dPoint& C
    4946  );
    4947 
    4948 
    4949 /*
    4950 Description:
    4951  Finds the unit normal to the triangle
    4952 Parameters:
    4953  A - [in] triangle corner
    4954  B - [in] triangle corner
    4955  C - [in] triangle corner
    4956  a - [out] must not be null
    4957  b - [out] must not be null
    4958  c - [out] must not be null
    4959  d - [out] must not be null
    4960  The equation of the plane is a*x + b*y + c*z + d = 0
    4961  ev_tol - [out]
    4962  If ev_tol is not null, then it is the maximum absolute
    4963  value of the plane equation evaluated at A,B,C. Mathematically,
    4964  ev_tol is zero. Since these computations are performed with
    4965  finite precision doubles, ev_tol is generally not zero.
    4966 Returns:
    4967  Unit normal
    4968 */
    4969 ON_DECL
    4970 bool ON_GetTrianglePlaneEquation(
    4971  const ON_3dPoint& A,
    4972  const ON_3dPoint& B,
    4973  const ON_3dPoint& C,
    4974  double* a,
    4975  double* b,
    4976  double* c,
    4977  double* d,
    4978  double* evaluation_tol
    4979  );
    4980 
    4981 
    4982 #endif
    Definition: opennurbs_point.h:2277
    ON_MappingTag m_tag
    Definition: opennurbs_mesh.h:2230
    static const ON_MeshFace UnsetMeshFace
    all vi[] values are -1.
    Definition: opennurbs_mesh.h:799
    int m_partition_max_vertex_count
    maximum number of vertices in a partition
    Definition: opennurbs_mesh.h:2156
    @@ -108,7 +106,6 @@ $(function() {
    unsigned char m_side
    Definition: opennurbs_mesh.h:1743
    Definition: opennurbs_mesh.h:1891
    unsigned int * m_vi
    Definition: opennurbs_mesh.h:1278
    -
    int vi[2]
    subinterval of mesh m_V[] array
    Definition: opennurbs_mesh.h:1895
    static const ON_UUID PangolinMesherId
    {EB6F6F3F-F975-4546-9D1C-64E9423BEB7F}
    Definition: opennurbs_mesh.h:34
    Definition: opennurbs_sha1.h:19
    Definition: opennurbs_point.h:2402
    @@ -127,7 +124,6 @@ $(function() {
    ON_ClassArray< ON_TextureCoordinates > m_TC
    Definition: opennurbs_mesh.h:4132
    static const ON_BoundingBox UnsetBoundingBox
    all coordinates are ON_UNSET_VALUE
    Definition: opennurbs_bounding_box.h:29
    ON_SimpleArray< struct ON_MeshPart > m_part
    Definition: opennurbs_mesh.h:2168
    -
    static int CompareVertexIndex(const ON_MeshFaceSide *a, const ON_MeshFaceSide *b)
    ON_3fPointArray m_V
    Definition: opennurbs_mesh.h:3538
    ON_SimpleArray< ON_MeshTopologyFace > m_topf
    Definition: opennurbs_mesh.h:2106
    static unsigned int IsValid(const ON_MeshNgon *ngon, unsigned int ngon_index, ON_TextLog *text_log, unsigned int mesh_vertex_count, unsigned int mesh_face_count, const ON_MeshFace *mesh_F)
    @@ -135,14 +131,12 @@ $(function() {
    ON_Xform m_mesh_xform
    Definition: opennurbs_mesh.h:2222
    Definition: opennurbs_geometry.h:36
    static class ON_MeshNgon ** NgonListFromMeshFace(class ON_MeshNgonBuffer &ngon_buffer, unsigned int mesh_face_index, const unsigned int *fvi)
    -
    int fi[2]
    subinterval of mesh m_F[] array
    Definition: opennurbs_mesh.h:1896
    ON_2dPointArray m_S
    Definition: opennurbs_mesh.h:4167
    unsigned char m_dir
    0 = counterclockwise, 1 = clockwise (reversed)
    Definition: opennurbs_mesh.h:1745
    ON_MeshTopology m_top
    Implementation - mesh topology.
    Definition: opennurbs_mesh.h:4273
    ON_SimpleArray< bool > m_H
    Implementation - runtime vertex visibility - not saved in 3dm files.
    Definition: opennurbs_mesh.h:4258
    Definition: opennurbs_fsp.h:19
    ON_SimpleArray< ON_MeshTopologyVertex > m_topv
    Definition: opennurbs_mesh.h:2092
    -
    int m_topvi[2]
    Definition: opennurbs_mesh.h:717
    ON__UINT32 m_mapping_crc
    ON_TextureMapping::MappingCRC()
    Definition: opennurbs_mesh.h:2221
    Definition: opennurbs_mesh.h:1266
    Definition: opennurbs_mesh.h:713
    @@ -154,7 +148,6 @@ $(function() {
    MESH_PARAMETER_ID
    Definition: opennurbs_mesh.h:58
    ON_TextureMapping::TYPE m_mapping_type
    ON_TextureMapping::m_type.
    Definition: opennurbs_mesh.h:2220
    const ON_Object * m_parent
    Implementation - runtime UI information.
    Definition: opennurbs_mesh.h:4267
    -
    static void SortByVertexIndex(ON_MeshFaceSide *face_sides, size_t face_sides_count)
    ON_SimpleArray< int > m_topv_map
    Definition: opennurbs_mesh.h:2087
    Definition: opennurbs_bounding_box.h:25
    ON_SimpleArray< ON_3fPoint > m_T
    texture coordinates
    Definition: opennurbs_mesh.h:2232
    @@ -177,7 +170,6 @@ $(function() {
    void Dump(class ON_TextLog &text_log) const
    static const ON_MeshParameters FastRenderMesh
    Definition: opennurbs_mesh.h:140
    static const ON_MeshFaceSide Unset
    all values are zero
    Definition: opennurbs_mesh.h:1749
    -
    static unsigned int GetFaceSideList(size_t mesh_vertex_count, const class ON_MeshFaceList &mesh_face_list, const unsigned int *fi_list, size_t fi_list_count, const unsigned int *vertex_id_map, ON_MeshFaceSide *&face_side_list)
    Definition: opennurbs_mesh.h:691
    Definition: opennurbs_mesh.h:2241
    unsigned short m_value
    Use depends on context.
    Definition: opennurbs_mesh.h:1746
    @@ -191,7 +183,6 @@ $(function() {
    int vertex_count
    = vi[1] - vi[0];
    Definition: opennurbs_mesh.h:1897
    static unsigned int NgonListFromMeshFaceOrNgonComponent(class ON_MeshNgonBuffer &ngon_buffer, ON_COMPONENT_INDEX ci, const class ON_Mesh *mesh, const class ON_MeshNgon *const *&ngon_list)
    ON_UUID m_mapping_id
    ON_TextureMapping::m_mapping_id.
    Definition: opennurbs_mesh.h:2219
    -
    static void SortByFaceIndex(ON_MeshFaceSide *face_sides, size_t face_sides_count)
    ON_MeshNgonAllocator m_NgonAllocator
    use this to allocate elements added to m_Ngon;
    Definition: opennurbs_mesh.h:4095
    ON_String ToString() const
    Definition: opennurbs_mesh.h:796
    @@ -222,7 +213,6 @@ $(function() {
    static const ON_UUID CoarseMeshId
    Cached mesh with the fewest faces.
    Definition: opennurbs_mesh.h:4334
    friend class ON_Mesh
    Definition: opennurbs_mesh.h:2122
    int m_dim
    1, 2, or 3
    Definition: opennurbs_mesh.h:2231
    -
    static int CompareFaceIndex(const ON_MeshFaceSide *a, const ON_MeshFaceSide *b)
    Definition: opennurbs_point.h:1465
    static const ON_SHA1_Hash ZeroDigest
    all digest bytes are zero
    Definition: opennurbs_sha1.h:22
    double m_infinity
    Definition: opennurbs_mesh.h:675
    @@ -236,14 +226,13 @@ $(function() {
    unsigned int * QuadFvi(unsigned int face_index, unsigned int buffer[4]) const
    Definition: opennurbs_mesh.h:1070
    Definition: opennurbs_mesh.h:2149
    Definition: opennurbs_point.h:2028
    -
    unsigned int m_vi[2]
    vertex indices or ids (equal values indicate unset)
    Definition: opennurbs_mesh.h:1741
    static const ON_MeshParameters DefaultAnalysisMesh
    Definition: opennurbs_mesh.h:155
    diff --git a/6/db/df8/class_o_n___surface-members.html b/6/db/df8/class_o_n___surface-members.html index 9b6b3899..a990fc70 100644 --- a/6/db/df8/class_o_n___surface-members.html +++ b/6/db/df8/class_o_n___surface-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/db/df9/class_o_n__2f_vector.html b/6/db/df9/class_o_n__2f_vector.html index f745db6c..bd003506 100644 --- a/6/db/df9/class_o_n__2f_vector.html +++ b/6/db/df9/class_o_n__2f_vector.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2fVector Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    ◆ operator<()

    +

    ◆ operator<()

    @@ -1623,7 +1621,7 @@ Static Public Attributes
    -

    ◆ operator<=()

    +

    ◆ operator<=()

    @@ -1855,7 +1853,7 @@ Static Public Attributes
    -

    ◆ operator>()

    +

    ◆ operator>()

    @@ -1873,7 +1871,7 @@ Static Public Attributes
    -

    ◆ operator>=()

    +

    ◆ operator>=()

    @@ -2274,9 +2272,9 @@ Static Public Attributes
    diff --git a/6/db/dfc/opennurbs__hatch_8h_source.html b/6/db/dfc/opennurbs__hatch_8h_source.html index 52d19fef..ef07975e 100644 --- a/6/db/dfc/opennurbs__hatch_8h_source.html +++ b/6/db/dfc/opennurbs__hatch_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_hatch.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_hatch.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    opennurbs_hatch.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #ifndef OPENNURBS_HATCH_H_INCLUDED
    18 #define OPENNURBS_HATCH_H_INCLUDED
    19 
    20 /*
    21  class ON_HatchLoop
    22  /////////////////////////////////////////////////////////////////
    23  Represents a 3d boundary loop curve
    24 */
    25 class ON_CLASS ON_HatchLoop
    26 {
    27 public:
    28 #if defined(OPENNURBS_EXPORTS) || defined(OPENNURBS_IMPORTS)
    29  // When the Microsoft CRT(s) is/are used, this is the best
    30  // way to prevent crashes that happen when a hatch loop is
    31  // allocated with new in one DLL and deallocated with
    32  // delete in another DLL.
    33 
    34  // new/delete
    35  void* operator new(size_t);
    36  void operator delete(void*);
    37 
    38  // array new/delete
    39  void* operator new[] (size_t);
    40  void operator delete[] (void*);
    41 
    42  // in place new/delete
    43  void* operator new(size_t,void*);
    44  void operator delete(void*,void*);
    45 #endif
    46 
    47  enum eLoopType
    48  {
    49  ltOuter = 0,
    50  ltInner = 1,
    51  };
    52 
    53  ON_HatchLoop();
    54  ON_HatchLoop( ON_Curve* pCurve2d, eLoopType type = ltOuter);
    55  ON_HatchLoop( const ON_HatchLoop& src);
    56  ~ON_HatchLoop();
    57 
    58  ON_HatchLoop& operator=( const ON_HatchLoop& src);
    59 
    60  bool IsValid( ON_TextLog* text_log = nullptr ) const;
    61  void Dump( ON_TextLog& ) const; // for debugging
    62  bool Write( ON_BinaryArchive&) const;
    63  bool Read( ON_BinaryArchive&);
    64 
    65  // Interface
    66  /////////////////////////////////////////////////////////////////
    67 
    68  /*
    69  Description:
    70  Get a closed 2d curve boundary loop
    71  Parameters:
    72  Return:
    73  Pointer to loop's 2d curve
    74  */
    75  const ON_Curve* Curve() const;
    76 
    77  /*
    78  Description:
    79  Specify the 2d loop curve in the hatch's plane coordinates
    80  Parameters:
    81  curve - [in] 2d input curve
    82  Return:
    83  true: success, false, curve couldn't be duplicated
    84  Remarks:
    85  The curve is copied
    86  */
    87  bool SetCurve( const ON_Curve& curve);
    88 
    89  /*
    90  Description:
    91  Get the type flag of the loop
    92  Returns:
    93  eLoopType::ltInner or eLoopType::ltOuter
    94  */
    95  eLoopType Type() const;
    96 
    97  /*
    98  Description:
    99  Specify the type flag of the loop
    100  Parameters:
    101  type - [in] ltInner or ltOuter
    102  */
    103  void SetType( eLoopType type);
    104 
    105 protected:
    106  friend class ON_Hatch;
    107  eLoopType m_type; // loop type flag - inner or outer
    108  ON_Curve* m_p2dCurve; // 2d closed curve bounding the hatch
    109  // This is really a 3d curve with z coordinates = 0
    110 };
    111 
    112 
    113 /*
    114  class ON_HatchLine
    115  /////////////////////////////////////////////////////////////////
    116  Represents one line of a hatch pattern
    117  Similar to AutoCAD's .pat file definition
    118  ON_HatchLine's are used by ON_HatchPattern
    119  to specify the dashes and offset patterns of the lines.
    120 
    121  Each line has the following information:
    122  Angle is the direction of the line CCW from the x axis
    123  The first line origin is at base
    124  Each line repetition is offset by offset from the previous line
    125  offset.x is parallel to the line and
    126  offset.y is perpendicular to the line
    127  The base and offset values are rotated by the line's angle to
    128  produce a location in the hatch pattern's coordinate system
    129  There can be gaps and dashes specified for drawing the line
    130 
    131  If there are no dashes, the line is solid
    132  Negative length dashes are gaps
    133  Positive length dashes are drawn as line segments
    134 */
    135 
    136 class ON_CLASS ON_HatchLine
    137 {
    138 public:
    139  // Default constructor creates ON_HatchLine::SolidHorizontal
    140  ON_HatchLine() = default;
    141  ~ON_HatchLine() = default;
    142  ON_HatchLine(const ON_HatchLine&) = default;
    143  ON_HatchLine& operator=(const ON_HatchLine&) = default;
    144 
    145  static const ON_HatchLine Unset; // angle = unset
    146  static const ON_HatchLine SolidHorizontal; // angle = 0
    147  static const ON_HatchLine SolidVertical; // angle = pi/2
    148 
    149  static int Compare(
    150  const ON_HatchLine& a,
    151  const ON_HatchLine& b
    152  );
    153 
    154  ON_HatchLine(
    155  double angle_in_radians,
    156  ON_2dPoint base,
    157  ON_2dVector offset,
    158  const ON_SimpleArray<double>& dashes
    159  );
    160 
    161  // constructs solid line
    162  ON_HatchLine(
    163  double angle_in_radians
    164  );
    165 
    166  bool operator==( const ON_HatchLine&) const;
    167  bool operator!=( const ON_HatchLine&) const;
    168 
    169  bool IsValid( ON_TextLog* text_log = nullptr ) const;
    170  void Dump( ON_TextLog& ) const; // for debugging
    171 
    172 public:
    173  bool Write( ON_BinaryArchive&) const; // serialize definition to binary archive
    174  bool Read( ON_BinaryArchive&); // restore definition from binary archive
    175 
    176 private:
    177  bool WriteV5(ON_BinaryArchive&) const; // serialize definition to binary archive
    178  bool ReadV5(ON_BinaryArchive&); // restore definition from binary archive
    179 
    180 public:
    181  /////////////////////////////////////////////////////////////////
    182  //
    183  // Interface
    184  //
    185 
    186  /*
    187  Description:
    188  Get angle of the hatch line.
    189  CCW from x-axis
    190  Parameters:
    191  Return:
    192  The angle in radians
    193  */
    194  double AngleRadians() const;
    195 
    196  double AngleDegrees() const;
    197 
    198  /*
    199  Description:
    200  Set angle of the hatch line.
    201  CCW from x-axis
    202  Parameters:
    203  angle - [in] angle in radians
    204  Return:
    205  */
    206  void SetAngleRadians(
    207  double angle_in_radians
    208  );
    209 
    210  void SetAngleDegrees(
    211  double angle_in_degrees
    212  );
    213 
    214  /*
    215  Description:
    216  Get this line's 2d basepoint
    217  Parameters:
    218  Return:
    219  the base point
    220  */
    221  ON_2dPoint Base() const;
    222  /*
    223  Description:
    224  Set this line's 2d basepoint
    225  Parameters:
    226  base - [in] the basepoint
    227  Return:
    228  */
    229  void SetBase( const ON_2dPoint& base);
    230 
    231  /*
    232  Description:
    233  Get this line's 2d offset for line repetitions
    234  Offset().x is shift parallel to line
    235  Offset().y is spacing perpendicular to line
    236  Parameters:
    237  Return:
    238  the offset
    239  */
    240  ON_2dVector Offset() const;
    241 
    242  /*
    243  Description:
    244  Get this line's 2d offset for line repetitions
    245  Offset().x is shift parallel to line
    246  Offset().y is spacing perpendicular to line
    247  Parameters:
    248  offset - [in] the shift,spacing for repeated lines
    249  Return:
    250  */
    251  void SetOffset( const ON_2dVector& offset);
    252 
    253  /*
    254  Description:
    255  Get the number of gaps + dashes in the line
    256  Parameters:
    257  Return:
    258  nummber of dashes in the line
    259  */
    260  int DashCount() const;
    261 
    262  /*
    263  Description:
    264  Get the dash length at index
    265  Parameters:
    266  index - [in] the dash to get
    267  Return:
    268  the length of the dash ( gap if negative)
    269  */
    270  double Dash( int) const;
    271 
    272  /*
    273  Description:
    274  Add a dash to the pattern
    275  Parameters:
    276  dash - [in] length to append - < 0 for a gap
    277  */
    278  void AppendDash( double dash);
    279 
    280  /*
    281  Description:
    282  Specify a new dash array
    283  Parameters:
    284  dashes - [in] array of dash lengths
    285  */
    286  void SetDashes( const ON_SimpleArray<double>& dashes);
    287 
    288  const ON_SimpleArray<double>& Dashes() const;
    289 
    290  /*
    291  Description:
    292  Get the line's angle, base, offset and dashes
    293  in one function call
    294  Parameters:
    295  angle_radians - [out] angle in radians CCW from x-axis
    296  base - [out] origin of the master line
    297  offset - [out] offset for line replications
    298  dashes - [out] the dash array for the line
    299  Return:
    300  */
    301  void GetLineData(
    302  double& angle_radians,
    303  ON_2dPoint& base,
    304  ON_2dVector& offset,
    305  ON_SimpleArray<double>& dashes) const;
    306 
    307  /*
    308  Description:
    309  Get the total length of a pattern repeat
    310  Parameters:
    311  Return:
    312  Pattern length
    313  */
    314  double GetPatternLength() const;
    315 
    316 private:
    317  double m_angle_radians = 0.0;
    320  ON_SimpleArray< double> m_dashes;
    321 };
    322 
    323 
    324 
    325 
    326 #if defined(ON_DLL_TEMPLATE)
    327 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_HatchLoop*>;
    328 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_HatchLine>;
    329 #endif
    330 
    331 
    332 /*
    333  class ON_HatchPattern
    334  /////////////////////////////////////////////////////////////////
    335  Fill definition for a hatch
    336 
    337  The hatch will be one of
    338  ON_Hatch::ON_HatchPattern::HatchFillType::Lines - pat file style definition
    339  ON_Hatch::ON_HatchPattern::HatchFillType::Gradient - uses a color function
    340  ON_Hatch::ON_HatchPattern::HatchFillType::Solid - uses entity color
    341 
    342 */
    343 class ON_CLASS ON_HatchPattern : public ON_ModelComponent
    344 {
    345  ON_OBJECT_DECLARE( ON_HatchPattern);
    346 
    347 public:
    348  ON_HatchPattern() ON_NOEXCEPT;
    349  ~ON_HatchPattern() = default;
    351  ON_HatchPattern& operator=(const ON_HatchPattern&) = default;
    352 
    353 public:
    354  static const ON_HatchPattern Unset; // index = ON_UNSET_INT_INDEX, id = nil
    355  static const ON_HatchPattern Solid; // index = -1, id set, unique and persistent
    356  static const ON_HatchPattern Hatch1; // index = -2, id set, unique and persistent
    357  static const ON_HatchPattern Hatch2; // index = -3, id set, unique and persistent
    358  static const ON_HatchPattern Hatch3; // index = -4, id set, unique and persistent
    359  static const ON_HatchPattern HatchDash; // index = -5, id set, unique and persistent
    360  static const ON_HatchPattern Grid; // index = -6, id set, unique and persistent
    361  static const ON_HatchPattern Grid60; // index = -7, id set, unique and persistent
    362  static const ON_HatchPattern Plus; // index = -8, id set, unique and persistent
    363  static const ON_HatchPattern Squares; // index = -9, id set, unique and persistent
    364 
    365  // compare everything except Index() value.
    366  static int Compare(
    367  const ON_HatchPattern& a,
    368  const ON_HatchPattern& b
    369  );
    370 
    371  // Compare all settings (type, lines, ...) that effect the appearance.
    372  // Ignore Index(), Id(), Name()
    373  static int CompareAppearance(
    374  const ON_HatchPattern& a,
    375  const ON_HatchPattern& b
    376  );
    377 
    378 public:
    379  /*
    380  Parameters:
    381  model_component_reference - [in]
    382  none_return_value - [in]
    383  value to return if ON_Layer::Cast(model_component_ref.ModelComponent())
    384  is nullptr
    385  Returns:
    386  If ON_Layer::Cast(model_component_ref.ModelComponent()) is not nullptr,
    387  that pointer is returned. Otherwise, none_return_value is returned.
    388  */
    389  static const ON_HatchPattern* FromModelComponentRef(
    390  const class ON_ModelComponentReference& model_component_reference,
    391  const ON_HatchPattern* none_return_value
    392  );
    393 
    394 public:
    395 
    396  enum class HatchFillType : unsigned int
    397  {
    398  Solid = 0, // uses entity color
    399  Lines = 1, // pat file definition
    400  Gradient = 2, // uses a fill color function
    401  };
    402 
    403  static ON_HatchPattern::HatchFillType HatchFillTypeFromUnsigned(
    404  unsigned hatch_fill_type_as_unsigned
    405  );
    406 
    407 
    408  /////////////////////////////////////////////////////////////////
    409  // ON_Object overrides
    410  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    411  void Dump( ON_TextLog& ) const override; // for debugging
    412  bool Write( ON_BinaryArchive&) const override;
    413  bool Read( ON_BinaryArchive&) override;
    414 private:
    415  bool WriteV5(ON_BinaryArchive&) const;
    416  bool ReadV5(ON_BinaryArchive&);
    417 public:
    418 
    419  //////////////////////////////////////////////////////////////////////
    420  // Interface
    421 
    422  /*
    423  Description:
    424  Return the pattern's fill type
    425  Parameters:
    426  */
    427  ON_HatchPattern::HatchFillType FillType() const;
    428 
    429  /*
    430  Description:
    431  Set the pattern's fill type
    432  Parameters:
    433  type - [in] the new filltype
    434  */
    435  void SetFillType(
    437  );
    438 
    439  /*
    440  Description:
    441  Set the name of the pattern
    442  Parameters:
    443  pDescription - [in] the new description
    444  Returns:
    445  */
    446  void SetDescription(
    447  const wchar_t* pDescription
    448  );
    449 
    450  /*
    451  Description:
    452  Get a short description of the pattern
    453  Parameters:
    454  string - [out] The string is returned here
    455  */
    456  const ON_wString& Description() const;
    457 
    458 
    459  // Interface functions for line hatches
    460  /////////////////////////////////////////////////////////////////
    461  /*
    462  Description:
    463  Get the number of ON_HatchLines in the pattern
    464  Parameters:
    465  Return:
    466  number of lines
    467  */
    468  int HatchLineCount() const;
    469 
    470  /*
    471  Description:
    472  Add an ON_HatchLine to the pattern
    473  Parameters:
    474  line - [in] the line to add
    475  Return:
    476  >= 0 index of the new line
    477  -1 on failure
    478  */
    479  int AddHatchLine(
    480  const ON_HatchLine& line
    481  );
    482 
    483  /*
    484  Description:
    485  Get the ON_HatchLine at index
    486  Parameters:
    487  index - [in] Index of the line to get
    488  Return:
    489  the hatch line
    490  nullptr if index is out of range
    491  */
    492  const ON_HatchLine* HatchLine(
    493  int index
    494  ) const;
    495 
    496  /*
    497  Description:
    498  Remove a hatch line from the pattern
    499  Parameters:
    500  index - [in] Index of the line to remove
    501  Return:
    502  true - success
    503  false - index out of range
    504  */
    505  bool RemoveHatchLine(
    506  int index
    507  );
    508 
    509  /*
    510  Description:
    511  Remove all of the hatch line from the pattern
    512  Parameters:
    513 
    514  Return:
    515  true - success
    516  false - index out of range
    517  */
    518  void RemoveAllHatchLines();
    519 
    520  /*
    521  Description:
    522  Set all of the hatch lines at once.
    523  Existing hatchlines are deleted.
    524  Parameters:
    525  lines - [in] Array of lines to add. Lines are copied
    526  Return:
    527  number of lines added
    528  */
    529  int SetHatchLines(
    530  const ON_ClassArray<ON_HatchLine>& lines
    531  );
    532 
    533  int SetHatchLines(
    534  size_t count,
    535  const ON_HatchLine* lines
    536  );
    537 
    538  const ON_ClassArray<ON_HatchLine>& HatchLines() const;
    539 
    540 private:
    542 
    543  ON_wString m_description = ON_wString::EmptyString; // String description of the pattern
    544 
    545  // Represents a collection of ON_HatchLine's to make a complete pattern
    546  // This is the definition of a hatch pattern.
    547  // Simple solid line hatches with fixed angle and spacing are also
    548  // represented with this type of hatch
    549  ON_ClassArray<ON_HatchLine> m_lines; // used by line hatches
    550 };
    551 
    552 #if defined(ON_DLL_TEMPLATE)
    553 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_HatchPattern*>;
    554 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_HatchPattern*>;
    555 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_HatchPattern>;
    556 #endif
    557 
    558 /*
    559  class ON_Hatch
    560  /////////////////////////////////////////////////////////////////
    561  Represents a hatch in planar boundary loop or loops
    562  This is a 2d entity with a plane defining a local coordinate system
    563  The loops, patterns, angles, etc are all in this local coordinate system
    564 
    565  The ON_Hatch object manages the plane and loop array
    566  Fill definitions are in the ON_HatchPattern or class derived from ON_HatchPattern
    567  ON_Hatch has an index to get the pattern definition from the pattern table
    568 
    569 */
    570 class ON_CLASS ON_Hatch : public ON_Geometry
    571 {
    572  ON_OBJECT_DECLARE( ON_Hatch);
    573 
    574 public:
    575  // Default constructor
    576  ON_Hatch() = default;
    577  ~ON_Hatch();
    578  ON_Hatch( const ON_Hatch&);
    579  ON_Hatch& operator=(const ON_Hatch&);
    580 
    581  static ON_Hatch* HatchFromBrep(
    582  ON_Hatch* use_this_hatch,
    583  const ON_Brep* brep,
    584  int face_index,
    585  int pattern_index,
    586  double pattern_rotation_radians,
    587  double pattern_scale,
    588  ON_3dPoint basepoint);
    589 
    590 private:
    591  void Internal_Destroy();
    592  void Internal_CopyFrom(const ON_Hatch& src);
    593 public:
    594 
    595  virtual ON_Hatch* DuplicateHatch() const;
    596 
    597  // ON_Object overrides
    598  /////////////////////////////////////////////////////////////////
    599  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    600  void Dump( ON_TextLog& ) const override;
    601  bool Write( ON_BinaryArchive&) const override;
    602  bool Read( ON_BinaryArchive&) override;
    603  ON::object_type ObjectType() const override;
    604 
    605  // ON_Geometry overrides
    606  /////////////////////////////////////////////////////////////////
    607  /*
    608  Returns the geometric dimension of the object ( usually 3)
    609  */
    610  int Dimension() const override;
    611 
    612  // virtual ON_Geometry GetBBox override
    613  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    614 
    615  // virtual ON_Geometry GetTightBoundingBox override
    616  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    617 
    618  /*
    619  Description:
    620  Transform the object by a 4x4 xform matrix
    621 
    622  Parameters:
    623  [in] xform - An ON_Xform with the transformation information
    624  Returns:
    625  true = Success
    626  false = Failure
    627  Remarks:
    628  The object has been transformed when the function returns.
    629  */
    630  bool Transform( const ON_Xform&) override;
    631 
    632  /*
    633  Description:
    634  If possible, BrepForm() creates a brep form of the
    635  ON_Geometry.
    636  Parameters:
    637  brep - [in] if not nullptr, brep is used to store the brep
    638  form of the geometry.
    639  Result:
    640  Returns a pointer to on ON_Brep or nullptr. If the brep
    641  parameter is not nullptr, then brep is returned if the
    642  geometry has a brep form and nullptr is returned if the
    643  geometry does not have a brep form.
    644  Remarks:
    645  The caller is responsible for managing the brep memory.
    646  See Also
    647  ON_Geometry::HasBrepForm
    648  */
    649  class ON_Brep* BrepForm(
    650  class ON_Brep* brep = nullptr
    651  ) const override;
    652 
    653 
    654 
    655  // Interface
    656  /////////////////////////////////////////////////////////////////
    657 
    658  /*
    659  Description:
    660  Create a hatch from input geometry and parameters
    661  Parameters:
    662  plane [I] - ON_Plane to make the hatch on
    663  loops [I] - Array of boundary loops with the outer one first
    664  pattern_index [I] - Index into the hatch table
    665  pattern_rotation [I] - ccw in radians about plane origin
    666  pattern_scale [I] - Scale factor for pattern definition
    667  Returns:
    668  true = success, false = failure
    669  */
    670  bool Create( const ON_Plane& plane,
    671  const ON_SimpleArray<const ON_Curve*> loops,
    672  int pattern_index,
    673  double pattern_rotation,
    674  double pattern_scale);
    675 
    676  /*
    677  Description:
    678  Get the plane defining the hatch's coordinate system
    679  Parameters:
    680  Returns:
    681  the plane
    682  */
    683  const ON_Plane& Plane() const;
    684 
    685  /*
    686  Description:
    687  Set the plane defining the hatch's coordinate system
    688  Parameters:
    689  plane - [in] the plane to set
    690  Returns:
    691  */
    692  void SetPlane( const ON_Plane& plane);
    693 
    694  /*
    695  Description:
    696  Gets the rotation applied to the hatch pattern
    697  when it is mapped to the hatch's plane
    698  Returns:
    699  The rotation in radians
    700  Remarks:
    701  The pattern is rotated counter-clockwise around
    702  the hatch's plane origin by this value
    703  */
    704  double PatternRotation() const;
    705 
    706 /*
    707  Description:
    708  Sets the rotation applied to the hatch pattern
    709  when it is mapped to the hatch's plane
    710  Parameters:
    711  rotation - [in] The rotation in radians
    712  Remarks:
    713  The pattern is rotated counter-clockwise around
    714  the hatch's plane origin by this value
    715  */
    716  void SetPatternRotation( double rotation);
    717 
    718  /*
    719  Description:
    720  Gets the scale applied to the hatch pattern
    721  when it is mapped to the hatch's plane
    722  Returns:
    723  The scale
    724  Remarks:
    725  The pattern is scaled around
    726  the hatch's plane origin by this value
    727  */
    728  double PatternScale() const;
    729 
    730 /*
    731  Description:
    732  Sets the scale applied to the hatch pattern
    733  when it is mapped to the hatch's plane
    734  Parameters:
    735  scale - [in] The scale
    736  Remarks:
    737  The pattern is scaled around
    738  the hatch's plane origin by this value
    739  */
    740  void SetPatternScale( double scale);
    741 
    742  /*
    743  Description:
    744  Get the number of loops used by this hatch
    745  Parameters:
    746  Returns:
    747  the number of loops
    748  */
    749  int LoopCount() const;
    750 
    751  /*
    752  Description:
    753  Add a loop to the hatch
    754  Parameters:
    755  loop - [in] the loop to add. Memory management for the loop is managed
    756  by this class.
    757  Returns:
    758  */
    759  void AddLoop( ON_HatchLoop* loop);
    760 
    761  /*
    762  Description:
    763  Insert a loop to the hatch at the specified index
    764  Parameters:
    765  index - [in] zero based index of the position where insert the loop to.
    766  loop - [in] the loop to insert. Memory management for the loop is managed
    767  by this class on success.
    768  Returns:
    769  true if success
    770  false if index is lower than 0 or greater than current loop count.
    771  */
    772  bool InsertLoop( int index,
    773  ON_HatchLoop* loop);
    774 
    775  /*
    776  Description:
    777  Remove a loop in the hatch
    778  Parameters:
    779  loop - [in] zero based index of the loop to remove.
    780  Returns:
    781  true if success
    782  */
    783  bool RemoveLoop( int index);
    784 
    785  /*
    786  Description:
    787  Get the loop at index
    788  Parameters:
    789  index - [in] which loop to get
    790  Returns:
    791  pointer to loop at index
    792  nullptr if index is out of range
    793  */
    794  const ON_HatchLoop* Loop( int index) const;
    795 
    796  /*
    797  Description:
    798  Get the 3d curve corresponding to loop[index]
    799  Parameters:
    800  index - [in] which loop to get
    801  Returns:
    802  pointer to 3d curve of loop at index
    803  nullptr if index is out of range or curve can't be made
    804  Caller deletes the returned curve
    805  */
    806  ON_Curve* LoopCurve3d( int index) const;
    807 
    808  /*
    809  Description:
    810  Get the index of the hatch's pattern
    811  Parameters:
    812  Returns:
    813  index of the pattern
    814  */
    815  int PatternIndex() const;
    816 
    817 /*
    818  Description:
    819  Set the index of the hatch's pattern
    820  Parameters:
    821  index - [in] pattern index to set
    822  Returns:
    823  */
    824  void SetPatternIndex( int index);
    825 
    826  // Basepoint functions added March 23, 2008 -LW
    827  /*
    828  Description:
    829  Set 2d Base point for hatch pattern alignment.
    830  Parameters:
    831  basepoint - 2d point in hatch's ECS
    832  */
    833  void SetBasePoint(ON_2dPoint basepoint);
    834 
    835  /*
    836  Description:
    837  Set 3d Base point for hatch pattern alignment.
    838  Parameters:
    839  point - 3d WCS point
    840  Remarks:
    841  Projects point to hatch's plane and sets 2d point
    842  */
    843  void SetBasePoint(ON_3dPoint point);
    844 
    845  /*
    846  Description:
    847  Return 3d WCS point that lies on hatch's plane used for pattern origin.
    848  */
    849  ON_3dPoint BasePoint() const;
    850 
    851  /*
    852  Description:
    853  Return 2d ECS point used for pattern origin.
    854  */
    855  ON_2dPoint BasePoint2d() const;
    856 
    857  /*
    858  Function added June 12 2008 LW
    859  Description:
    860  Remove all of the loops on the hatch and add the curves in 'loops' as new loops
    861  Parameters:
    862  loops - [in] An array of pointers to 2d or 3d curves
    863  If the curves are 2d, add them to the hatch directly
    864  If they are 3d, project them to the hatch's plane first
    865  Returns:
    866  true - success
    867  false - no loops in input array or an error adding them
    868  */
    869  bool ReplaceLoops(ON_SimpleArray<const ON_Curve*>& loops);
    870 
    871 private:
    872  ON_Plane m_plane;
    873  double m_pattern_scale = 1.0;
    874  double m_pattern_rotation = 0.0;
    875  ON_2dPoint m_basepoint = ON_2dPoint::Origin;
    877  int m_pattern_index = -1;
    878 };
    879 
    880 #endif
    Definition: opennurbs_hatch.h:343
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #ifndef OPENNURBS_HATCH_H_INCLUDED
    18 #define OPENNURBS_HATCH_H_INCLUDED
    19 
    20 /*
    21  class ON_HatchLoop
    22  /////////////////////////////////////////////////////////////////
    23  Represents a 3d boundary loop curve
    24 */
    25 class ON_CLASS ON_HatchLoop
    26 {
    27 public:
    28 #if defined(OPENNURBS_EXPORTS) || defined(OPENNURBS_IMPORTS)
    29  // When the Microsoft CRT(s) is/are used, this is the best
    30  // way to prevent crashes that happen when a hatch loop is
    31  // allocated with new in one DLL and deallocated with
    32  // delete in another DLL.
    33 
    34  // new/delete
    35  void* operator new(size_t);
    36  void operator delete(void*);
    37 
    38  // array new/delete
    39  void* operator new[] (size_t);
    40  void operator delete[] (void*);
    41 
    42  // in place new/delete
    43  void* operator new(size_t,void*);
    44  void operator delete(void*,void*);
    45 #endif
    46 
    47  enum eLoopType
    48  {
    49  ltOuter = 0,
    50  ltInner = 1,
    51  };
    52 
    53  ON_HatchLoop();
    54  ON_HatchLoop( ON_Curve* pCurve2d, eLoopType type = ltOuter);
    55  ON_HatchLoop( const ON_HatchLoop& src);
    56  ~ON_HatchLoop();
    57 
    58  ON_HatchLoop& operator=( const ON_HatchLoop& src);
    59 
    60  bool IsValid( ON_TextLog* text_log = nullptr ) const;
    61  void Dump( ON_TextLog& ) const; // for debugging
    62  bool Write( ON_BinaryArchive&) const;
    63  bool Read( ON_BinaryArchive&);
    64 
    65  // Interface
    66  /////////////////////////////////////////////////////////////////
    67 
    68  /*
    69  Description:
    70  Get a closed 2d curve boundary loop
    71  Parameters:
    72  Return:
    73  Pointer to loop's 2d curve
    74  */
    75  const ON_Curve* Curve() const;
    76 
    77  /*
    78  Description:
    79  Specify the 2d loop curve in the hatch's plane coordinates
    80  Parameters:
    81  curve - [in] 2d input curve
    82  Return:
    83  true: success, false, curve couldn't be duplicated
    84  Remarks:
    85  The curve is copied
    86  */
    87  bool SetCurve( const ON_Curve& curve);
    88 
    89  /*
    90  Description:
    91  Get the type flag of the loop
    92  Returns:
    93  eLoopType::ltInner or eLoopType::ltOuter
    94  */
    95  eLoopType Type() const;
    96 
    97  /*
    98  Description:
    99  Specify the type flag of the loop
    100  Parameters:
    101  type - [in] ltInner or ltOuter
    102  */
    103  void SetType( eLoopType type);
    104 
    105 protected:
    106  friend class ON_Hatch;
    107  eLoopType m_type; // loop type flag - inner or outer
    108  ON_Curve* m_p2dCurve; // 2d closed curve bounding the hatch
    109  // This is really a 3d curve with z coordinates = 0
    110 };
    111 
    112 
    113 /*
    114  class ON_HatchLine
    115  /////////////////////////////////////////////////////////////////
    116  Represents one line of a hatch pattern
    117  Similar to AutoCAD's .pat file definition
    118  ON_HatchLine's are used by ON_HatchPattern
    119  to specify the dashes and offset patterns of the lines.
    120 
    121  Each line has the following information:
    122  Angle is the direction of the line CCW from the x axis
    123  The first line origin is at base
    124  Each line repetition is offset by offset from the previous line
    125  offset.x is parallel to the line and
    126  offset.y is perpendicular to the line
    127  The base and offset values are rotated by the line's angle to
    128  produce a location in the hatch pattern's coordinate system
    129  There can be gaps and dashes specified for drawing the line
    130 
    131  If there are no dashes, the line is solid
    132  Negative length dashes are gaps
    133  Positive length dashes are drawn as line segments
    134 */
    135 
    136 class ON_CLASS ON_HatchLine
    137 {
    138 public:
    139  // Default constructor creates ON_HatchLine::SolidHorizontal
    140  ON_HatchLine() = default;
    141  ~ON_HatchLine() = default;
    142  ON_HatchLine(const ON_HatchLine&) = default;
    143  ON_HatchLine& operator=(const ON_HatchLine&) = default;
    144 
    145  static const ON_HatchLine Unset; // angle = unset
    146  static const ON_HatchLine SolidHorizontal; // angle = 0
    147  static const ON_HatchLine SolidVertical; // angle = pi/2
    148 
    149  static int Compare(
    150  const ON_HatchLine& a,
    151  const ON_HatchLine& b
    152  );
    153 
    154  ON_HatchLine(
    155  double angle_in_radians,
    156  ON_2dPoint base,
    157  ON_2dVector offset,
    158  const ON_SimpleArray<double>& dashes
    159  );
    160 
    161  // constructs solid line
    162  ON_HatchLine(
    163  double angle_in_radians
    164  );
    165 
    166  bool operator==( const ON_HatchLine&) const;
    167  bool operator!=( const ON_HatchLine&) const;
    168 
    169  bool IsValid( ON_TextLog* text_log = nullptr ) const;
    170  void Dump( ON_TextLog& ) const; // for debugging
    171 
    172 public:
    173  bool Write( ON_BinaryArchive&) const; // serialize definition to binary archive
    174  bool Read( ON_BinaryArchive&); // restore definition from binary archive
    175 
    176 private:
    177  bool WriteV5(ON_BinaryArchive&) const; // serialize definition to binary archive
    178  bool ReadV5(ON_BinaryArchive&); // restore definition from binary archive
    179 
    180 public:
    181  /////////////////////////////////////////////////////////////////
    182  //
    183  // Interface
    184  //
    185 
    186  /*
    187  Description:
    188  Get angle of the hatch line.
    189  CCW from x-axis
    190  Parameters:
    191  Return:
    192  The angle in radians
    193  */
    194  double AngleRadians() const;
    195 
    196  double AngleDegrees() const;
    197 
    198  /*
    199  Description:
    200  Set angle of the hatch line.
    201  CCW from x-axis
    202  Parameters:
    203  angle - [in] angle in radians
    204  Return:
    205  */
    206  void SetAngleRadians(
    207  double angle_in_radians
    208  );
    209 
    210  void SetAngleDegrees(
    211  double angle_in_degrees
    212  );
    213 
    214  /*
    215  Description:
    216  Get this line's 2d basepoint
    217  Parameters:
    218  Return:
    219  the base point
    220  */
    221  ON_2dPoint Base() const;
    222  /*
    223  Description:
    224  Set this line's 2d basepoint
    225  Parameters:
    226  base - [in] the basepoint
    227  Return:
    228  */
    229  void SetBase( const ON_2dPoint& base);
    230 
    231  /*
    232  Description:
    233  Get this line's 2d offset for line repetitions
    234  Offset().x is shift parallel to line
    235  Offset().y is spacing perpendicular to line
    236  Parameters:
    237  Return:
    238  the offset
    239  */
    240  ON_2dVector Offset() const;
    241 
    242  /*
    243  Description:
    244  Get this line's 2d offset for line repetitions
    245  Offset().x is shift parallel to line
    246  Offset().y is spacing perpendicular to line
    247  Parameters:
    248  offset - [in] the shift,spacing for repeated lines
    249  Return:
    250  */
    251  void SetOffset( const ON_2dVector& offset);
    252 
    253  /*
    254  Description:
    255  Get the number of gaps + dashes in the line
    256  Parameters:
    257  Return:
    258  nummber of dashes in the line
    259  */
    260  int DashCount() const;
    261 
    262  /*
    263  Description:
    264  Get the dash length at index
    265  Parameters:
    266  index - [in] the dash to get
    267  Return:
    268  the length of the dash ( gap if negative)
    269  */
    270  double Dash( int) const;
    271 
    272  /*
    273  Description:
    274  Add a dash to the pattern
    275  Parameters:
    276  dash - [in] length to append - < 0 for a gap
    277  */
    278  void AppendDash( double dash);
    279 
    280  /*
    281  Description:
    282  Specify a new dash array
    283  Parameters:
    284  dashes - [in] array of dash lengths
    285  */
    286  void SetDashes( const ON_SimpleArray<double>& dashes);
    287 
    288  const ON_SimpleArray<double>& Dashes() const;
    289 
    290  /*
    291  Description:
    292  Get the line's angle, base, offset and dashes
    293  in one function call
    294  Parameters:
    295  angle_radians - [out] angle in radians CCW from x-axis
    296  base - [out] origin of the master line
    297  offset - [out] offset for line replications
    298  dashes - [out] the dash array for the line
    299  Return:
    300  */
    301  void GetLineData(
    302  double& angle_radians,
    303  ON_2dPoint& base,
    304  ON_2dVector& offset,
    305  ON_SimpleArray<double>& dashes) const;
    306 
    307  /*
    308  Description:
    309  Get the total length of a pattern repeat
    310  Parameters:
    311  Return:
    312  Pattern length
    313  */
    314  double GetPatternLength() const;
    315 
    316 private:
    317  double m_angle_radians = 0.0;
    320  ON_SimpleArray< double> m_dashes;
    321 };
    322 
    323 
    324 
    325 
    326 #if defined(ON_DLL_TEMPLATE)
    327 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_HatchLoop*>;
    328 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_HatchLine>;
    329 #endif
    330 
    331 
    332 /*
    333  class ON_HatchPattern
    334  /////////////////////////////////////////////////////////////////
    335  Fill definition for a hatch
    336 
    337  The hatch will be one of
    338  ON_Hatch::ON_HatchPattern::HatchFillType::Lines - pat file style definition
    339  ON_Hatch::ON_HatchPattern::HatchFillType::Gradient - uses a color function
    340  ON_Hatch::ON_HatchPattern::HatchFillType::Solid - uses entity color
    341 
    342 */
    343 class ON_CLASS ON_HatchPattern : public ON_ModelComponent
    344 {
    345  ON_OBJECT_DECLARE( ON_HatchPattern);
    346 
    347 public:
    348  ON_HatchPattern() ON_NOEXCEPT;
    349  ~ON_HatchPattern() = default;
    351  ON_HatchPattern& operator=(const ON_HatchPattern&) = default;
    352 
    353 public:
    354  static const ON_HatchPattern Unset; // index = ON_UNSET_INT_INDEX, id = nil
    355  static const ON_HatchPattern Solid; // index = -1, id set, unique and persistent
    356  static const ON_HatchPattern Hatch1; // index = -2, id set, unique and persistent
    357  static const ON_HatchPattern Hatch2; // index = -3, id set, unique and persistent
    358  static const ON_HatchPattern Hatch3; // index = -4, id set, unique and persistent
    359  static const ON_HatchPattern HatchDash; // index = -5, id set, unique and persistent
    360  static const ON_HatchPattern Grid; // index = -6, id set, unique and persistent
    361  static const ON_HatchPattern Grid60; // index = -7, id set, unique and persistent
    362  static const ON_HatchPattern Plus; // index = -8, id set, unique and persistent
    363  static const ON_HatchPattern Squares; // index = -9, id set, unique and persistent
    364 
    365  // compare everything except Index() value.
    366  static int Compare(
    367  const ON_HatchPattern& a,
    368  const ON_HatchPattern& b
    369  );
    370 
    371  // Compare all settings (type, lines, ...) that effect the appearance.
    372  // Ignore Index(), Id(), Name()
    373  static int CompareAppearance(
    374  const ON_HatchPattern& a,
    375  const ON_HatchPattern& b
    376  );
    377 
    378 public:
    379  /*
    380  Parameters:
    381  model_component_reference - [in]
    382  none_return_value - [in]
    383  value to return if ON_Layer::Cast(model_component_ref.ModelComponent())
    384  is nullptr
    385  Returns:
    386  If ON_Layer::Cast(model_component_ref.ModelComponent()) is not nullptr,
    387  that pointer is returned. Otherwise, none_return_value is returned.
    388  */
    389  static const ON_HatchPattern* FromModelComponentRef(
    390  const class ON_ModelComponentReference& model_component_reference,
    391  const ON_HatchPattern* none_return_value
    392  );
    393 
    394 public:
    395 
    396  enum class HatchFillType : unsigned int
    397  {
    398  Solid = 0, // uses entity color
    399  Lines = 1, // pat file definition
    400  Gradient = 2, // uses a fill color function
    401  };
    402 
    403  static ON_HatchPattern::HatchFillType HatchFillTypeFromUnsigned(
    404  unsigned hatch_fill_type_as_unsigned
    405  );
    406 
    407 
    408  /////////////////////////////////////////////////////////////////
    409  // ON_Object overrides
    410  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    411  void Dump( ON_TextLog& ) const override; // for debugging
    412  bool Write( ON_BinaryArchive&) const override;
    413  bool Read( ON_BinaryArchive&) override;
    414 private:
    415  bool WriteV5(ON_BinaryArchive&) const;
    416  bool ReadV5(ON_BinaryArchive&);
    417 public:
    418 
    419  //////////////////////////////////////////////////////////////////////
    420  // Interface
    421 
    422  /*
    423  Description:
    424  Return the pattern's fill type
    425  Parameters:
    426  */
    427  ON_HatchPattern::HatchFillType FillType() const;
    428 
    429  /*
    430  Description:
    431  Set the pattern's fill type
    432  Parameters:
    433  type - [in] the new filltype
    434  */
    435  void SetFillType(
    437  );
    438 
    439  /*
    440  Description:
    441  Set the name of the pattern
    442  Parameters:
    443  pDescription - [in] the new description
    444  Returns:
    445  */
    446  void SetDescription(
    447  const wchar_t* pDescription
    448  );
    449 
    450  /*
    451  Description:
    452  Get a short description of the pattern
    453  Parameters:
    454  string - [out] The string is returned here
    455  */
    456  const ON_wString& Description() const;
    457 
    458 
    459  // Interface functions for line hatches
    460  /////////////////////////////////////////////////////////////////
    461  /*
    462  Description:
    463  Get the number of ON_HatchLines in the pattern
    464  Parameters:
    465  Return:
    466  number of lines
    467  */
    468  int HatchLineCount() const;
    469 
    470  /*
    471  Description:
    472  Add an ON_HatchLine to the pattern
    473  Parameters:
    474  line - [in] the line to add
    475  Return:
    476  >= 0 index of the new line
    477  -1 on failure
    478  */
    479  int AddHatchLine(
    480  const ON_HatchLine& line
    481  );
    482 
    483  /*
    484  Description:
    485  Get the ON_HatchLine at index
    486  Parameters:
    487  index - [in] Index of the line to get
    488  Return:
    489  the hatch line
    490  nullptr if index is out of range
    491  */
    492  const ON_HatchLine* HatchLine(
    493  int index
    494  ) const;
    495 
    496  /*
    497  Description:
    498  Remove a hatch line from the pattern
    499  Parameters:
    500  index - [in] Index of the line to remove
    501  Return:
    502  true - success
    503  false - index out of range
    504  */
    505  bool RemoveHatchLine(
    506  int index
    507  );
    508 
    509  /*
    510  Description:
    511  Remove all of the hatch line from the pattern
    512  Parameters:
    513 
    514  Return:
    515  true - success
    516  false - index out of range
    517  */
    518  void RemoveAllHatchLines();
    519 
    520  /*
    521  Description:
    522  Set all of the hatch lines at once.
    523  Existing hatchlines are deleted.
    524  Parameters:
    525  lines - [in] Array of lines to add. Lines are copied
    526  Return:
    527  number of lines added
    528  */
    529  int SetHatchLines(
    530  const ON_ClassArray<ON_HatchLine>& lines
    531  );
    532 
    533  int SetHatchLines(
    534  size_t count,
    535  const ON_HatchLine* lines
    536  );
    537 
    538  const ON_ClassArray<ON_HatchLine>& HatchLines() const;
    539 
    540 private:
    542 
    543  ON_wString m_description = ON_wString::EmptyString; // String description of the pattern
    544 
    545  // Represents a collection of ON_HatchLine's to make a complete pattern
    546  // This is the definition of a hatch pattern.
    547  // Simple solid line hatches with fixed angle and spacing are also
    548  // represented with this type of hatch
    549  ON_ClassArray<ON_HatchLine> m_lines; // used by line hatches
    550 };
    551 
    552 #if defined(ON_DLL_TEMPLATE)
    553 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_HatchPattern*>;
    554 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_HatchPattern*>;
    555 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_HatchPattern>;
    556 #endif
    557 
    558 /*
    559  class ON_Hatch
    560  /////////////////////////////////////////////////////////////////
    561  Represents a hatch in planar boundary loop or loops
    562  This is a 2d entity with a plane defining a local coordinate system
    563  The loops, patterns, angles, etc are all in this local coordinate system
    564 
    565  The ON_Hatch object manages the plane and loop array
    566  Fill definitions are in the ON_HatchPattern or class derived from ON_HatchPattern
    567  ON_Hatch has an index to get the pattern definition from the pattern table
    568 
    569 */
    570 class ON_CLASS ON_Hatch : public ON_Geometry
    571 {
    572  ON_OBJECT_DECLARE( ON_Hatch);
    573 
    574 public:
    575  // Default constructor
    576  ON_Hatch() = default;
    577  ~ON_Hatch();
    578  ON_Hatch( const ON_Hatch&);
    579  ON_Hatch& operator=(const ON_Hatch&);
    580 
    581  static ON_Hatch* HatchFromBrep(
    582  ON_Hatch* use_this_hatch,
    583  const ON_Brep* brep,
    584  int face_index,
    585  int pattern_index,
    586  double pattern_rotation_radians,
    587  double pattern_scale,
    588  ON_3dPoint basepoint);
    589 
    590 private:
    591  void Internal_Destroy();
    592  void Internal_CopyFrom(const ON_Hatch& src);
    593 public:
    594 
    595  virtual ON_Hatch* DuplicateHatch() const;
    596 
    597  // ON_Object overrides
    598  /////////////////////////////////////////////////////////////////
    599  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    600  void Dump( ON_TextLog& ) const override;
    601  bool Write( ON_BinaryArchive&) const override;
    602  bool Read( ON_BinaryArchive&) override;
    603  ON::object_type ObjectType() const override;
    604 
    605  // ON_Geometry overrides
    606  /////////////////////////////////////////////////////////////////
    607  /*
    608  Returns the geometric dimension of the object ( usually 3)
    609  */
    610  int Dimension() const override;
    611 
    612  // virtual ON_Geometry GetBBox override
    613  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    614 
    615  // virtual ON_Geometry GetTightBoundingBox override
    616  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    617 
    618  /*
    619  Description:
    620  Transform the object by a 4x4 xform matrix
    621 
    622  Parameters:
    623  [in] xform - An ON_Xform with the transformation information
    624  Returns:
    625  true = Success
    626  false = Failure
    627  Remarks:
    628  The object has been transformed when the function returns.
    629  */
    630  bool Transform( const ON_Xform&) override;
    631 
    632  /*
    633  Description:
    634  If possible, BrepForm() creates a brep form of the
    635  ON_Geometry.
    636  Parameters:
    637  brep - [in] if not nullptr, brep is used to store the brep
    638  form of the geometry.
    639  Result:
    640  Returns a pointer to on ON_Brep or nullptr. If the brep
    641  parameter is not nullptr, then brep is returned if the
    642  geometry has a brep form and nullptr is returned if the
    643  geometry does not have a brep form.
    644  Remarks:
    645  The caller is responsible for managing the brep memory.
    646  See Also
    647  ON_Geometry::HasBrepForm
    648  */
    649  class ON_Brep* BrepForm(
    650  class ON_Brep* brep = nullptr
    651  ) const override;
    652 
    653 
    654 
    655  // Interface
    656  /////////////////////////////////////////////////////////////////
    657 
    658  /*
    659  Description:
    660  Create a hatch from input geometry and parameters
    661  Parameters:
    662  plane [I] - ON_Plane to make the hatch on
    663  loops [I] - Array of boundary loops with the outer one first
    664  pattern_index [I] - Index into the hatch table
    665  pattern_rotation [I] - ccw in radians about plane origin
    666  pattern_scale [I] - Scale factor for pattern definition
    667  Returns:
    668  true = success, false = failure
    669  */
    670  bool Create( const ON_Plane& plane,
    671  const ON_SimpleArray<const ON_Curve*> loops,
    672  int pattern_index,
    673  double pattern_rotation,
    674  double pattern_scale);
    675 
    676  /*
    677  Description:
    678  Get the plane defining the hatch's coordinate system
    679  Parameters:
    680  Returns:
    681  the plane
    682  */
    683  const ON_Plane& Plane() const;
    684 
    685  /*
    686  Description:
    687  Set the plane defining the hatch's coordinate system
    688  Parameters:
    689  plane - [in] the plane to set
    690  Returns:
    691  */
    692  void SetPlane( const ON_Plane& plane);
    693 
    694  /*
    695  Description:
    696  Gets the rotation applied to the hatch pattern
    697  when it is mapped to the hatch's plane
    698  Returns:
    699  The rotation in radians
    700  Remarks:
    701  The pattern is rotated counter-clockwise around
    702  the hatch's plane origin by this value
    703  */
    704  double PatternRotation() const;
    705 
    706 /*
    707  Description:
    708  Sets the rotation applied to the hatch pattern
    709  when it is mapped to the hatch's plane
    710  Parameters:
    711  rotation - [in] The rotation in radians
    712  Remarks:
    713  The pattern is rotated counter-clockwise around
    714  the hatch's plane origin by this value
    715  */
    716  void SetPatternRotation( double rotation);
    717 
    718  /*
    719  Description:
    720  Gets the scale applied to the hatch pattern
    721  when it is mapped to the hatch's plane
    722  Returns:
    723  The scale
    724  Remarks:
    725  The pattern is scaled around
    726  the hatch's plane origin by this value
    727  */
    728  double PatternScale() const;
    729 
    730 /*
    731  Description:
    732  Sets the scale applied to the hatch pattern
    733  when it is mapped to the hatch's plane
    734  Parameters:
    735  scale - [in] The scale
    736  Remarks:
    737  The pattern is scaled around
    738  the hatch's plane origin by this value
    739  */
    740  void SetPatternScale( double scale);
    741 
    742  /*
    743  Description:
    744  Get the number of loops used by this hatch
    745  Parameters:
    746  Returns:
    747  the number of loops
    748  */
    749  int LoopCount() const;
    750 
    751  /*
    752  Description:
    753  Add a loop to the hatch
    754  Parameters:
    755  loop - [in] the loop to add. Memory management for the loop is managed
    756  by this class.
    757  Returns:
    758  */
    759  void AddLoop( ON_HatchLoop* loop);
    760 
    761  /*
    762  Description:
    763  Insert a loop to the hatch at the specified index
    764  Parameters:
    765  index - [in] zero based index of the position where insert the loop to.
    766  loop - [in] the loop to insert. Memory management for the loop is managed
    767  by this class on success.
    768  Returns:
    769  true if success
    770  false if index is lower than 0 or greater than current loop count.
    771  */
    772  bool InsertLoop( int index,
    773  ON_HatchLoop* loop);
    774 
    775  /*
    776  Description:
    777  Remove a loop in the hatch
    778  Parameters:
    779  loop - [in] zero based index of the loop to remove.
    780  Returns:
    781  true if success
    782  */
    783  bool RemoveLoop( int index);
    784 
    785  /*
    786  Description:
    787  Get the loop at index
    788  Parameters:
    789  index - [in] which loop to get
    790  Returns:
    791  pointer to loop at index
    792  nullptr if index is out of range
    793  */
    794  const ON_HatchLoop* Loop( int index) const;
    795 
    796  /*
    797  Description:
    798  Get the 3d curve corresponding to loop[index]
    799  Parameters:
    800  index - [in] which loop to get
    801  Returns:
    802  pointer to 3d curve of loop at index
    803  nullptr if index is out of range or curve can't be made
    804  Caller deletes the returned curve
    805  */
    806  ON_Curve* LoopCurve3d( int index) const;
    807 
    808  /*
    809  Description:
    810  Get the index of the hatch's pattern
    811  Parameters:
    812  Returns:
    813  index of the pattern
    814  */
    815  int PatternIndex() const;
    816 
    817 /*
    818  Description:
    819  Set the index of the hatch's pattern
    820  Parameters:
    821  index - [in] pattern index to set
    822  Returns:
    823  */
    824  void SetPatternIndex( int index);
    825 
    826  // Basepoint functions added March 23, 2008 -LW
    827  /*
    828  Description:
    829  Set 2d Base point for hatch pattern alignment.
    830  Parameters:
    831  basepoint - 2d point in hatch's ECS
    832  */
    833  void SetBasePoint(ON_2dPoint basepoint);
    834 
    835  /*
    836  Description:
    837  Set 3d Base point for hatch pattern alignment.
    838  Parameters:
    839  point - 3d WCS point
    840  Remarks:
    841  Projects point to hatch's plane and sets 2d point
    842  */
    843  void SetBasePoint(ON_3dPoint point);
    844 
    845  /*
    846  Description:
    847  Return 3d WCS point that lies on hatch's plane used for pattern origin.
    848  */
    849  ON_3dPoint BasePoint() const;
    850 
    851  /*
    852  Description:
    853  Return 2d ECS point used for pattern origin.
    854  */
    855  ON_2dPoint BasePoint2d() const;
    856 
    857  /*
    858  Function added June 12 2008 LW
    859  Description:
    860  Remove all of the loops on the hatch and add the curves in 'loops' as new loops
    861  Parameters:
    862  loops - [in] An array of pointers to 2d or 3d curves
    863  If the curves are 2d, add them to the hatch directly
    864  If they are 3d, project them to the hatch's plane first
    865  Returns:
    866  true - success
    867  false - no loops in input array or an error adding them
    868  */
    869  bool ReplaceLoops(ON_SimpleArray<const ON_Curve*>& loops);
    870 
    871 private:
    872  ON_Plane m_plane;
    873  double m_pattern_scale = 1.0;
    874  double m_pattern_rotation = 0.0;
    875  ON_2dPoint m_basepoint = ON_2dPoint::Origin;
    877  int m_pattern_index = -1;
    878 };
    879 
    880 #endif
    Definition: opennurbs_hatch.h:343
    static const ON_HatchPattern HatchDash
    index = -5, id set, unique and persistent
    Definition: opennurbs_hatch.h:359
    static const ON_2dPoint Origin
    (0.0,0.0)
    Definition: opennurbs_point.h:305
    Definition: opennurbs_model_component.h:25
    @@ -114,9 +112,9 @@ $(function() {
    diff --git a/6/dc/d00/class_o_n__3dm_construction_plane_grid_defaults-members.html b/6/dc/d00/class_o_n__3dm_construction_plane_grid_defaults-members.html index 6e96b67c..d75d4815 100644 --- a/6/dc/d00/class_o_n__3dm_construction_plane_grid_defaults-members.html +++ b/6/dc/d00/class_o_n__3dm_construction_plane_grid_defaults-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/dc/d06/class_o_n___text_dot-members.html b/6/dc/d06/class_o_n___text_dot-members.html index a8674520..4ab5b1dc 100644 --- a/6/dc/d06/class_o_n___text_dot-members.html +++ b/6/dc/d06/class_o_n___text_dot-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d07/class_o_n___clipping_plane_info-members.html b/6/dc/d07/class_o_n___clipping_plane_info-members.html index 705d6897..05c74f13 100644 --- a/6/dc/d07/class_o_n___clipping_plane_info-members.html +++ b/6/dc/d07/class_o_n___clipping_plane_info-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d0f/class_o_n___mesh_ngon-members.html b/6/dc/d0f/class_o_n___mesh_ngon-members.html index a51f5870..68e49e60 100644 --- a/6/dc/d0f/class_o_n___mesh_ngon-members.html +++ b/6/dc/d0f/class_o_n___mesh_ngon-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d11/class_o_n___read3dm_buffer_archive.html b/6/dc/d11/class_o_n___read3dm_buffer_archive.html index 5f69f890..a27a8a54 100644 --- a/6/dc/d11/class_o_n___read3dm_buffer_archive.html +++ b/6/dc/d11/class_o_n___read3dm_buffer_archive.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Read3dmBufferArchive Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Construct an ON_BinaryArchive for reading information from a memory buffer. Parameters: sizeof_buffer - [in] size of buffer in bytes (>0) buffer - [in] memory buffer containing binary archive bCopyBuffer - [in] true - copy the input buffer.
    - Useful when the buffer may be destroyed while this class is still in use. false - Do not copy the input buffer.
    - In this case you are responsible for making certain the input buffer is valid while this class is in use. archive_3dm_version - in archive_opennurbs_version - [in]

    +

    Description: Construct an ON_BinaryArchive for reading information from a memory buffer. Parameters: sizeof_buffer - [in] size of buffer in bytes (>0) buffer - [in] memory buffer containing binary archive bCopyBuffer - [in] true - copy the input buffer. Useful when the buffer may be destroyed while this class is still in use. false - Do not copy the input buffer. In this case you are responsible for making certain the input buffer is valid while this class is in use. archive_3dm_version - in archive_opennurbs_version - [in]

    @@ -1372,9 +1368,9 @@ Additional Inherited Members diff --git a/6/dc/d11/class_o_n___text_log_indent-members.html b/6/dc/d11/class_o_n___text_log_indent-members.html index e506f757..f9460ff9 100644 --- a/6/dc/d11/class_o_n___text_log_indent-members.html +++ b/6/dc/d11/class_o_n___text_log_indent-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d12/opennurbs__circle_8h_source.html b/6/dc/d12/opennurbs__circle_8h_source.html index 30cfa892..4be381d3 100644 --- a/6/dc/d12/opennurbs__circle_8h_source.html +++ b/6/dc/d12/opennurbs__circle_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_circle.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_circle.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d18/opennurbs__cylinder_8h_source.html b/6/dc/d18/opennurbs__cylinder_8h_source.html index a558d688..d4dcda2c 100644 --- a/6/dc/d18/opennurbs__cylinder_8h_source.html +++ b/6/dc/d18/opennurbs__cylinder_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_cylinder.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_cylinder.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d1c/class_o_n___sum_surface.html b/6/dc/d1c/class_o_n___sum_surface.html index 5861e61e..9dfb0d8f 100644 --- a/6/dc/d1c/class_o_n___sum_surface.html +++ b/6/dc/d1c/class_o_n___sum_surface.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SumSurface Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    N_iso = 6, iso_count = 7
    - } - pure virtual class for surface objects More...
    + } pure virtual class for surface objects More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -504,8 +502,8 @@ Additional Inherited Members
    -

    Description: Some objects cache bounding box information. If you modify an object, then call ClearBoundingBox() to inform the object that any cached bounding boxes are invalid.
    - Remarks: Generally, ClearBoundingBox() overrides simply invalidate a cached bounding box and then wait for a call to GetBBox() before recomputing the bounding box.

    +

    Description: Some objects cache bounding box information. If you modify an object, then call ClearBoundingBox() to inform the object that any cached bounding boxes are invalid.

    +

    Remarks: Generally, ClearBoundingBox() overrides simply invalidate a cached bounding box and then wait for a call to GetBBox() before recomputing the bounding box.

    The default implementation does nothing.

    Reimplemented from ON_Geometry.

    @@ -951,8 +949,7 @@ Additional Inherited Members
    -

    Description: Where possible, analytically extends surface to include domain. Parameters: dir - [in] 0 new Domain(0) will include domain. (the first surface parameter). 1 new Domain(1) will include domain. (the second surface parameter). domain - [in] if domain is not included in surface domain, surface will be extended so that its domain includes domain.
    - Will not work if surface is closed in direction dir. Original surface is identical to the restriction of the resulting surface to the original surface domain, Returns: true if successful.

    +

    Description: Where possible, analytically extends surface to include domain. Parameters: dir - [in] 0 new Domain(0) will include domain. (the first surface parameter). 1 new Domain(1) will include domain. (the second surface parameter). domain - [in] if domain is not included in surface domain, surface will be extended so that its domain includes domain. Will not work if surface is closed in direction dir. Original surface is identical to the restriction of the resulting surface to the original surface domain, Returns: true if successful.

    Reimplemented from ON_Surface.

    @@ -1079,8 +1076,7 @@ Additional Inherited Members
    -

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search.
    - dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    +

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search. dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    true if a parametric discontinuity was found strictly between t0 and t1. Note well that all curves are parametrically continuous at the ends of their domains.

    Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous):

    true if a locus discontinuity was found strictly between t0 and t1 or at t1 is the at the end of a curve. Note well that all open curves (IsClosed()=false) are locus discontinuous at the ends of their domains. All closed curves (IsClosed()=true) are at least C0_locus_continuous at the ends of their domains.

    @@ -1383,8 +1379,7 @@ Additional Inherited Members
    -

    Description: Is there a NURBS surface representation of this surface. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the surface's 2 success - NURBS point locus matches the surface's and the domain of the NURBS surface is correct.
    - However, This surface's parameterization and the NURBS surface parameterization may not match. This situation happens when getting NURBS representations of surfaces that have a transendental parameterization like spheres, cylinders, and cones. Remarks: This is a low-level virtual function. See Also: ON_Surface::GetNurbForm ON_Surface::NurbsSurface

    +

    Description: Is there a NURBS surface representation of this surface. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the surface's 2 success - NURBS point locus matches the surface's and the domain of the NURBS surface is correct. However, This surface's parameterization and the NURBS surface parameterization may not match. This situation happens when getting NURBS representations of surfaces that have a transendental parameterization like spheres, cylinders, and cones. Remarks: This is a low-level virtual function. See Also: ON_Surface::GetNurbForm ON_Surface::NurbsSurface

    Reimplemented from ON_Surface.

    @@ -2202,17 +2197,16 @@ Additional Inherited Members
    -

    for expert users surface-PointAt(s,t) = m_curve[0]->PointAt(s) + m_curve[1]->PointAt(t) + m_basepoint; m_curve[0] and m_curve[1] are deleted by ~ON_SumSuface.
    - Use a ON_ProxyCurve if this is problem.

    +

    for expert users surface-PointAt(s,t) = m_curve[0]->PointAt(s) + m_curve[1]->PointAt(t) + m_basepoint; m_curve[0] and m_curve[1] are deleted by ~ON_SumSuface. Use a ON_ProxyCurve if this is problem.

    diff --git a/6/dc/d1d/class_o_n___user_string-members.html b/6/dc/d1d/class_o_n___user_string-members.html index 0bf4d542..36b0915c 100644 --- a/6/dc/d1d/class_o_n___user_string-members.html +++ b/6/dc/d1d/class_o_n___user_string-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d27/class_rtf_composer.html b/6/dc/d27/class_rtf_composer.html index f40a70b8..3c6fdec2 100644 --- a/6/dc/d27/class_rtf_composer.html +++ b/6/dc/d27/class_rtf_composer.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: RtfComposer Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d2d/struct_o_n__3_d_m___c_h_u_n_k-members.html b/6/dc/d2d/struct_o_n__3_d_m___c_h_u_n_k-members.html index a72fc6cc..cd312e73 100644 --- a/6/dc/d2d/struct_o_n__3_d_m___c_h_u_n_k-members.html +++ b/6/dc/d2d/struct_o_n__3_d_m___c_h_u_n_k-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d39/class_o_n___length_value.html b/6/dc/d39/class_o_n___length_value.html index 60372f8d..8c75121c 100644 --- a/6/dc/d39/class_o_n___length_value.html +++ b/6/dc/d39/class_o_n___length_value.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_LengthValue Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
      StringFormat::CleanProperFraction = 4, StringFormat::CleanImproperFraction = 5
    - } - Formatting to apply when creating a length value from a double. More...
    + } Formatting to apply when creating a length value from a double. More...
    +   diff --git a/6/dc/d3b/class_o_n___brep_region-members.html b/6/dc/d3b/class_o_n___brep_region-members.html index 1f301a03..23354c42 100644 --- a/6/dc/d3b/class_o_n___brep_region-members.html +++ b/6/dc/d3b/class_o_n___brep_region-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@

    @@ -921,9 +919,9 @@ Static Public Attributes

    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/dc/d3e/class_o_n___r_tree.html b/6/dc/d3e/class_o_n___r_tree.html index d8e54bbd..6459490b 100644 --- a/6/dc/d3e/class_o_n___r_tree.html +++ b/6/dc/d3e/class_o_n___r_tree.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RTree Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d4b/class_o_n___brep_trim_array-members.html b/6/dc/d4b/class_o_n___brep_trim_array-members.html index b9e3d5e9..959fa5c1 100644 --- a/6/dc/d4b/class_o_n___brep_trim_array-members.html +++ b/6/dc/d4b/class_o_n___brep_trim_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d56/opennurbs__annotationbase_8h_source.html b/6/dc/d56/opennurbs__annotationbase_8h_source.html index 36ecd77c..d3198143 100644 --- a/6/dc/d56/opennurbs__annotationbase_8h_source.html +++ b/6/dc/d56/opennurbs__annotationbase_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_annotationbase.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_annotationbase.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d5c/class_o_n___model_component.html b/6/dc/d5c/class_o_n___model_component.html index 81f4c6e2..6e7d3f3b 100644 --- a/6/dc/d5c/class_o_n___model_component.html +++ b/6/dc/d5c/class_o_n___model_component.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ModelComponent Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -521,10 +519,7 @@ Protected Member Functions  

    Detailed Description

    -

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////
    -Description: The ON_ModelComponent class is a base class for all components in a model and manages the index, id and other information common to all components in a model.

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// Description: The ON_ModelComponent class is a base class for all components in a model and manages the index, id and other information common to all components in a model.

    Member Enumeration Documentation

    ◆ Attributes

    @@ -824,8 +819,7 @@ Description: The -

    General attributes interface
    -Description: Writes the attributes identified by the component_filter parameter. Parameters: attributes_filter - [in] A bitfield that determines which attributes will be cleared. Returns: a bitfield indicating which attributes were cleared. (Locked attributes cannot be cleared.)

    +

    General attributes interface Description: Writes the attributes identified by the component_filter parameter. Parameters: attributes_filter - [in] A bitfield that determines which attributes will be cleared. Returns: a bitfield indicating which attributes were cleared. (Locked attributes cannot be cleared.)

    @@ -1191,8 +1185,7 @@ Description: Writes the attributes identified by the component_filter parameter.
    -

    Type interface
    -Returns: Value of the Type attribute. Remarks: If the component is in a model, then the component_type is unique for all components of identical type in the model and is locked.

    +

    Type interface Returns: Value of the Type attribute. Remarks: If the component is in a model, then the component_type is unique for all components of identical type in the model and is locked.

    @@ -1569,8 +1562,7 @@ Returns: Value of the Type attribute. Remarks: If the component is in a model, t

    Id interface

    -

    The component id is intended to be unique in the context of a model.
    -Returns: Value of the Id attribute. Remarks: If the component is in a model, then the id is unique for all components in the model and is locked.

    +

    The component id is intended to be unique in the context of a model. Returns: Value of the Id attribute. Remarks: If the component is in a model, then the id is unique for all components in the model and is locked.

    @@ -1703,8 +1695,7 @@ Returns: Value of the Id attribute. Remarks: If the component is in a model, the

    Index interface

    -

    When a component is managed by a model, the component index is identifies the component within the context of that model.
    -Returns: Value of the runtime model component index attribute. Remarks: If the component is in a model, then the index is unique for all components of identical type in the model and is locked. If the index has not been set, ON_UNSET_INT_INDEX is returned. The
    Index() value can change when saved in an archive (.3dm file). Use the Id() when you need to reference model compoenents in an archive.

    +

    When a component is managed by a model, the component index is identifies the component within the context of that model. Returns: Value of the runtime model component index attribute. Remarks: If the component is in a model, then the index is unique for all components of identical type in the model and is locked. If the index has not been set, ON_UNSET_INT_INDEX is returned. The Index() value can change when saved in an archive (.3dm file). Use the Id() when you need to reference model compoenents in an archive.

    @@ -2002,8 +1993,7 @@ Returns: Value of the runtime model component index attribute. Remarks: If the c
    -

    Returns: True if this model component is a system constant.
    -Remarks: An incomplete list of system constant model compoenents is below:

    +

    Returns: True if this model component is a system constant. Remarks: An incomplete list of system constant model compoenents is below:

    ON_ModelComponent::Unset

    ON_InstanceDefinition::Empty

    ON_Linetype::Unset ON_Linetype::Continuous ON_Linetype::ByLayer ON_Linetype::ByParent

    @@ -2534,8 +2524,7 @@ Remarks: An incomplete list of system constant model compoenents is below:

    -

    Name interface
    -Returns: Value of the Name attribute. Remarks: If the component is in a model, then the name is unique among all components in the model. Names are formatted as reference : parent::leaf. For example in "A.3dm : Z", "A.3dm" is the reference and "Z" is the leaf. For a layer full path "X::Y::Z", "X::Y" is the parent and "Z" is the leaf. For most models, only the leaf is present in the name. The reference portion appears when a model component originates in a reference file (a linked instance definition with reference component names or a worksession reference). Components with a tree hierarchy, like layers, can have a parent and leaf.

    +

    Name interface Returns: Value of the Name attribute. Remarks: If the component is in a model, then the name is unique among all components in the model. Names are formatted as reference : parent::leaf. For example in "A.3dm : Z", "A.3dm" is the reference and "Z" is the leaf. For a layer full path "X::Y::Z", "X::Y" is the parent and "Z" is the leaf. For most models, only the leaf is present in the name. The reference portion appears when a model component originates in a reference file (a linked instance definition with reference component names or a worksession reference). Components with a tree hierarchy, like layers, can have a parent and leaf.

    @@ -2753,8 +2742,7 @@ Returns: Value of the Name attribute. Remarks: If the component is in a model, t
    -

    Parameters: new_name - [in]
    -Returns: If new_name is empty or a valid component name, then name hash this component would have if SetName(new_name) were called. If new_name is not valid, then ON_NameHash::UnsetNameHash is returned. Remarks: This function trims leading and trailing white space, includes the parent id when ON_ModelComponent::UniqueNameIncludesParent(ComponentType()) is true, and uses ON_ModelComponent::IsValidComponentName() to determine if a non-empty name is valid.

    +

    Parameters: new_name - [in] Returns: If new_name is empty or a valid component name, then name hash this component would have if SetName(new_name) were called. If new_name is not valid, then ON_NameHash::UnsetNameHash is returned. Remarks: This function trims leading and trailing white space, includes the parent id when ON_ModelComponent::UniqueNameIncludesParent(ComponentType()) is true, and uses ON_ModelComponent::IsValidComponentName() to determine if a non-empty name is valid.

    @@ -3049,9 +3037,7 @@ Returns: If new_name is empty or a valid component name, then name hash this com
    -

    Returns: The runtime serial number.
    - This value is unique for every instance of an ON_ModelComponent class.
    - This value is never saved in .3dm archives.

    +

    Returns: The runtime serial number. This value is unique for every instance of an ON_ModelComponent class. This value is never saved in .3dm archives.

    @@ -3352,8 +3338,7 @@ Returns: If new_name is empty or a valid component name, then name hash this com

    Model Serial Number interface

    -

    The ModelSerialNumber() identifies the model that manages the component. If the component is from some type of reference model, then one or both of the reference model serial number and InstanceDefinitionModelSerialNumber() identify the source model.
    -Description: Specify the model that is managing this component. Parameters: model_serial_number - [in] In Rhino, this is the document runtime serial number. Returns: true if the model_serial_number value was changed to component_model_serial_number or is already equal to component_model_serial_number. false if the model_serial_number value is locked and component_model_serial_number != locked value.

    +

    The ModelSerialNumber() identifies the model that manages the component. If the component is from some type of reference model, then one or both of the reference model serial number and InstanceDefinitionModelSerialNumber() identify the source model. Description: Specify the model that is managing this component. Parameters: model_serial_number - [in] In Rhino, this is the document runtime serial number. Returns: true if the model_serial_number value was changed to component_model_serial_number or is already equal to component_model_serial_number. false if the model_serial_number value is locked and component_model_serial_number != locked value.

    @@ -3759,9 +3744,9 @@ Description: Specify the model that is managing this component. Parameters: mode diff --git a/6/dc/d60/class_o_n___compress_stream-members.html b/6/dc/d60/class_o_n___compress_stream-members.html index 7cd90ea0..9092ffdf 100644 --- a/6/dc/d60/class_o_n___compress_stream-members.html +++ b/6/dc/d60/class_o_n___compress_stream-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d63/class_o_n__3d_vector_array-members.html b/6/dc/d63/class_o_n__3d_vector_array-members.html index 83efb471..356752bd 100644 --- a/6/dc/d63/class_o_n__3d_vector_array-members.html +++ b/6/dc/d63/class_o_n__3d_vector_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d66/class_o_n__3dm_application-members.html b/6/dc/d66/class_o_n__3dm_application-members.html index 88b545cc..28429c56 100644 --- a/6/dc/d66/class_o_n__3dm_application-members.html +++ b/6/dc/d66/class_o_n__3dm_application-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d67/class_o_n___dim_radial-members.html b/6/dc/d67/class_o_n___dim_radial-members.html index 98fc2b24..5339dfdf 100644 --- a/6/dc/d67/class_o_n___dim_radial-members.html +++ b/6/dc/d67/class_o_n___dim_radial-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d69/class_o_n___offset_surface_value-members.html b/6/dc/d69/class_o_n___offset_surface_value-members.html index 7fe58d66..dee7f72d 100644 --- a/6/dc/d69/class_o_n___offset_surface_value-members.html +++ b/6/dc/d69/class_o_n___offset_surface_value-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d6b/class_o_n__3dm_page_settings.html b/6/dc/d6b/class_o_n__3dm_page_settings.html index 5a0933de..7fffa614 100644 --- a/6/dc/d6b/class_o_n__3dm_page_settings.html +++ b/6/dc/d6b/class_o_n__3dm_page_settings.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmPageSettings Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d70/class_o_n___file_stream-members.html b/6/dc/d70/class_o_n___file_stream-members.html index 5fc6fc48..cbcfdd20 100644 --- a/6/dc/d70/class_o_n___file_stream-members.html +++ b/6/dc/d70/class_o_n___file_stream-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d72/class_o_n___standard_display_mode_id.html b/6/dc/d72/class_o_n___standard_display_mode_id.html index be418326..600c62d9 100644 --- a/6/dc/d72/class_o_n___standard_display_mode_id.html +++ b/6/dc/d72/class_o_n___standard_display_mode_id.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_StandardDisplayModeId Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d7c/class_o_n___obj_ref_evaluation_parameter-members.html b/6/dc/d7c/class_o_n___obj_ref_evaluation_parameter-members.html index 80060745..ca079612 100644 --- a/6/dc/d7c/class_o_n___obj_ref_evaluation_parameter-members.html +++ b/6/dc/d7c/class_o_n___obj_ref_evaluation_parameter-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d81/opennurbs__extensions_8h_source.html b/6/dc/d81/opennurbs__extensions_8h_source.html index 6e7df889..6020ba37 100644 --- a/6/dc/d81/opennurbs__extensions_8h_source.html +++ b/6/dc/d81/opennurbs__extensions_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_extensions.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_extensions.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d83/class_o_n___arc_curve.html b/6/dc/d83/class_o_n___arc_curve.html index 40dfbc51..621c36b2 100644 --- a/6/dc/d83/class_o_n___arc_curve.html +++ b/6/dc/d83/class_o_n___arc_curve.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ArcCurve Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////
    -Description: ON_ArcCurve is used to represent arcs and circles. ON_ArcCurve.IsCircle() returns true if the curve is a complete circle. Remarks:

      +

      / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// Description: ON_ArcCurve is used to represent arcs and circles. ON_ArcCurve.IsCircle() returns true if the curve is a complete circle. Remarks:

      • An ON_ArcCurve is a subcurve of a circle, with a constant speed parameterization. The parameterization is an affine linear reparameterzation of the underlying arc m_arc onto the domain m_t.
      • A valid ON_ArcCurve has Radius()>0 and 0<AngleRadians()<=2*PI and a strictly increasing Domain().
      @@ -937,8 +930,7 @@ Description: ON_Arc
    -

    Description: Test continuity at a curve parameter value. Parameters: c - [in] type of continuity to test for. Read ON::continuity comments for details. t - [in] parameter to test hint - [in] evaluation hint point_tolerance - [in] if the distance between two points is greater than point_tolerance, then the curve is not C0. d1_tolerance - [in] if the difference between two first derivatives is greater than d1_tolerance, then the curve is not C1. d2_tolerance - [in] if the difference between two second derivatives is greater than d2_tolerance, then the curve is not C2. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous.
    - ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if the curve has at least the c type continuity at the parameter t.

    +

    Description: Test continuity at a curve parameter value. Parameters: c - [in] type of continuity to test for. Read ON::continuity comments for details. t - [in] parameter to test hint - [in] evaluation hint point_tolerance - [in] if the distance between two points is greater than point_tolerance, then the curve is not C0. d1_tolerance - [in] if the difference between two first derivatives is greater than d1_tolerance, then the curve is not C1. d2_tolerance - [in] if the difference between two second derivatives is greater than d2_tolerance, then the curve is not C2. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous. ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if the curve has at least the c type continuity at the parameter t.

    Reimplemented from ON_Curve.

    @@ -1925,8 +1916,7 @@ Description: ON_Arc
    -

    Description: Splits (divides) the arc at the specified parameter.
    - The parameter must be in the interior of the arc's domain. The
    ON_Curve pointers passed to ON_ArcCurve::Split must either be nullptr or point to ON_ArcCurve objects. If a pointer is nullptr, then an ON_ArcCurve will be created in Split(). You may pass "this" as left_side or right_side. Parameters: t - [in] parameter to split the curve at in the interval returned by Domain(). left_side - [out] left portion of curve returned here. If not nullptr, left_side must point to an ON_ArcCuve. right_side - [out] right portion of curve returned here If not nullptr, right_side must point to an ON_ArcCuve. Remarks: Overrides virtual ON_Curve::Split.

    +

    Description: Splits (divides) the arc at the specified parameter. The parameter must be in the interior of the arc's domain. The ON_Curve pointers passed to ON_ArcCurve::Split must either be nullptr or point to ON_ArcCurve objects. If a pointer is nullptr, then an ON_ArcCurve will be created in Split(). You may pass "this" as left_side or right_side. Parameters: t - [in] parameter to split the curve at in the interval returned by Domain(). left_side - [out] left portion of curve returned here. If not nullptr, left_side must point to an ON_ArcCuve. right_side - [out] right portion of curve returned here If not nullptr, right_side must point to an ON_ArcCuve. Remarks: Overrides virtual ON_Curve::Split.

    Reimplemented from ON_Curve.

    @@ -2017,8 +2007,8 @@ Description: ON_Arc
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -2079,9 +2069,9 @@ Description: ON_Arc diff --git a/6/dc/d87/opennurbs__public_8h_source.html b/6/dc/d87/opennurbs__public_8h_source.html index a0ad37f6..006f38e4 100644 --- a/6/dc/d87/opennurbs__public_8h_source.html +++ b/6/dc/d87/opennurbs__public_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_public.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_public.h Source File @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archiveopen binary file
    openNURBS SDK Help +  6.0
    - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // Includes all openNURBS toolkit headers required to use the
    20 // openNURBS toolkit library. See readme.txt for details.
    21 //
    22 ////////////////////////////////////////////////////////////////
    23 
    24 #if !defined(OPENNURBS_PUBLIC_INC_)
    25 #define OPENNURBS_PUBLIC_INC_
    26 
    27 #define OPENNURBS_PUBLIC_INC_IN_PROGRESS
    28 
    29 #if defined(ON_COMPILING_OPENNURBS)
    30 #error Do not include opennurbs_public.h in opennurbs library source code.
    31 #endif
    32 
    33 #if defined(OPENNURBS_INC_)
    34 //
    35 // Read the following, think about what you are trying to accomplish,
    36 // and then include exactly one of opennurbs.h or opennurbs_public.h.
    37 //
    38 // If you are building a Rhino plug-in or using the Rhino SDK,
    39 // then include RhinoSDK.h which will eventually include opennurbs.h.
    40 //
    41 // If you are building your own application and linking with an
    42 // opennurbs_public* library, then include opennurbs_public.h.
    43 //
    44 #error Include exactly one of opennurbs.h or opennurbs_public.h
    45 #endif
    46 
    47 
    48 #define OPENNURBS_PUBLIC
    49 #include "opennurbs.h"
    50 
    51 #undef OPENNURBS_PUBLIC_INC_IN_PROGRESS
    52 
    53 #endif
    diff --git a/6/dc/d88/class_o_n___mesh_parameters-members.html b/6/dc/d88/class_o_n___mesh_parameters-members.html index c444935b..515ba926 100644 --- a/6/dc/d88/class_o_n___mesh_parameters-members.html +++ b/6/dc/d88/class_o_n___mesh_parameters-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d8c/class_o_n___dim_linear-members.html b/6/dc/d8c/class_o_n___dim_linear-members.html index e8f7144d..5be61d79 100644 --- a/6/dc/d8c/class_o_n___dim_linear-members.html +++ b/6/dc/d8c/class_o_n___dim_linear-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d9a/class_o_n__3dm_goo-members.html b/6/dc/d9a/class_o_n__3dm_goo-members.html index 6351da7a..c8fc2d93 100644 --- a/6/dc/d9a/class_o_n__3dm_goo-members.html +++ b/6/dc/d9a/class_o_n__3dm_goo-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/d9b/opennurbs__internal___v5__annotation_8h_source.html b/6/dc/d9b/opennurbs__internal___v5__annotation_8h_source.html index b934aaee..4b55bbdc 100644 --- a/6/dc/d9b/opennurbs__internal___v5__annotation_8h_source.html +++ b/6/dc/d9b/opennurbs__internal___v5__annotation_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_internal_V5_annotation.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_internal_V5_annotation.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_internal_V5_annotation.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #ifndef OPENNURBS_INTERNAL_V5_ANNOTATION_H_INC
    18 #define OPENNURBS_INTERNAL_V5_ANNOTATION_H_INC
    19 
    20 #if defined(ON_COMPILING_OPENNURBS)
    21 // V5 annotation classes are internal to opennurbs and are used exclusively
    22 // to support reading and writing V5 3dm archives.
    23 
    24 #if defined(ON_OS_WINDOWS_GDI)
    25 #define ON_OBSOLETE_V5_RECT RECT
    26 #else
    27 typedef struct tagON_RECT
    28 {
    29  int left;
    30  int top;
    31  int right;
    32  int bottom;
    33 } ON_OBSOLETE_V5_RECT;
    34 #endif
    35 
    36 class ON_OBSOLETE_V5_AnnotationText : public ON_wString
    37 {
    38 public:
    39  ON_OBSOLETE_V5_AnnotationText();
    40  ~ON_OBSOLETE_V5_AnnotationText();
    41 
    42 
    43  ON_OBSOLETE_V5_AnnotationText& operator=(const char*);
    44  ON_OBSOLETE_V5_AnnotationText& operator=(const wchar_t*);
    45 
    46  void SetText( const char* s );
    47  void SetText( const wchar_t* s );
    48 
    49  // m_rect is a Windows gdi RECT that bounds text
    50  // ("x" increases to the right and "y" increases downwards).
    51  // If all fields are 0, then m_rect is not set.
    52  // If left < right and top < bottom, then the rect bounds
    53  // the text when it is drawn with its font's
    54  // lfHeight=ON_Font::Constants::AnnotationFontCellHeight and (0,0) left baseline
    55  // point of the leftmost character on the first line
    56  // of text. If (x,y) is a point on the drawn text, then
    57  // left <= x < right and top <= y < bottom.
    58  ON_OBSOLETE_V5_RECT m_rect;
    59 };
    60 
    61 // Extension to ON_OBSOLETE_V2_TextObject added 12/10/2009 for Text background drawing
    62 class ON_OBSOLETE_V5_TextExtra : public ON_UserData
    63 {
    64  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_TextExtra);
    65 public:
    66 
    67  ON_OBSOLETE_V5_TextExtra();
    68  ~ON_OBSOLETE_V5_TextExtra();
    69 
    70  static
    71  ON_OBSOLETE_V5_TextExtra* TextExtension(class ON_OBSOLETE_V5_TextObject* pDim, bool bCreate);
    72  static const
    73  ON_OBSOLETE_V5_TextExtra* TextExtension(const class ON_OBSOLETE_V5_TextObject* pDim, bool bCreate);
    74 
    75  void SetDefaults();
    76 
    77  // override virtual ON_Object::Dump function
    78  void Dump( ON_TextLog& text_log ) const override;
    79 
    80  // override virtual ON_Object::Dump function
    81  unsigned int SizeOf() const override;
    82 
    83  // override virtual ON_Object::Write function
    84  bool Write(ON_BinaryArchive& binary_archive) const override;
    85 
    86  // override virtual ON_Object::Read function
    87  bool Read(ON_BinaryArchive& binary_archive) override;
    88 
    89  // override virtual ON_UserData::GetDescription function
    90  bool GetDescription( ON_wString& description ) override;
    91 
    92  // override virtual ON_UserData::Archive function
    93  bool Archive() const override;
    94 
    95  ON_UUID ParentUUID() const;
    96  void SetParentUUID( ON_UUID parent_uuid);
    97 
    98  bool DrawTextMask() const;
    99  void SetDrawTextMask(bool bDraw);
    100 
    101  int MaskColorSource() const;
    102  void SetMaskColorSource(int source);
    103 
    104  ON_Color MaskColor() const; // Only works right if MaskColorSource returns 2.
    105  // Does not return viewport background color
    106  void SetMaskColor(ON_Color color);
    107 
    108  double MaskOffsetFactor() const;
    109  void SetMaskOffsetFactor(double offset);
    110 
    111  ON_UUID m_parent_uuid; // uuid of the text using this extension
    112 
    113  bool m_bDrawMask; // do or don't draw a mask
    114 
    115  int m_color_source; // 0: Use background color from viewport
    116  // 1: Use specific color from m_mask_color
    117 
    118  ON_Color m_mask_color; // Color to use for mask if m_color_source is 2
    119 
    120  double m_border_offset; // Offset for the border around text to the rectangle used to draw the mask
    121  // This number * HeightOfI for the text is the offset on each side of the
    122  // tight rectangle around the text characters to the mask rectangle.
    123 };
    124 
    125 
    126 class ON_OBSOLETE_V5_DimExtra : public ON_UserData
    127 {
    128  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_DimExtra);
    129 public:
    130 
    131  ON_OBSOLETE_V5_DimExtra();
    132  ~ON_OBSOLETE_V5_DimExtra();
    133 
    134  static
    135  ON_OBSOLETE_V5_DimExtra* DimensionExtension(class ON_OBSOLETE_V5_DimLinear* pDim, bool bCreate);
    136  static const
    137  ON_OBSOLETE_V5_DimExtra* DimensionExtension(const class ON_OBSOLETE_V5_DimLinear* pDim, bool bCreate);
    138  static
    139  ON_OBSOLETE_V5_DimExtra* DimensionExtension(class ON_OBSOLETE_V5_DimRadial* pDim, bool bCreate);
    140  static const
    141  ON_OBSOLETE_V5_DimExtra* DimensionExtension(const class ON_OBSOLETE_V5_DimRadial* pDim, bool bCreate);
    142  static
    143  ON_OBSOLETE_V5_DimExtra* DimensionExtension(class ON_OBSOLETE_V5_DimOrdinate* pDim, bool bCreate);
    144  static const
    145  ON_OBSOLETE_V5_DimExtra* DimensionExtension(const class ON_OBSOLETE_V5_DimOrdinate* pDim, bool bCreate);
    146 
    147  void SetDefaults();
    148 
    149  // override virtual ON_Object::Dump function
    150  void Dump( ON_TextLog& text_log ) const override;
    151 
    152  // override virtual ON_Object::Dump function
    153  unsigned int SizeOf() const override;
    154 
    155  // override virtual ON_Object::Write function
    156  bool Write(ON_BinaryArchive& binary_archive) const override;
    157 
    158  // override virtual ON_Object::Read function
    159  bool Read(ON_BinaryArchive& binary_archive) override;
    160 
    161  // override virtual ON_UserData::GetDescription function
    162  bool GetDescription( ON_wString& description ) override;
    163 
    164  // override virtual ON_UserData::Archive function
    165  bool Archive() const override;
    166 
    167  ON_UUID ParentUUID() const;
    168  void SetParentUUID( ON_UUID parent_uuid);
    169 
    170  // 0: default position
    171  // 1: force inside
    172  // -1: force outside
    173  int ArrowPosition() const;
    174  void SetArrowPosition( int position);
    175 
    176  // For a dimension in page space that measures between points in model space
    177  // of a detail view, this is the ratio of the page distance / model distance.
    178  // When the dimension text is displayed, the distance measured in model space
    179  // is multiplied by this number to get the value to display.
    180  double DistanceScale() const;
    181  void SetDistanceScale(double s);
    182 
    183  // Basepont in modelspace coordinates for ordinate dimensions
    184  void SetModelSpaceBasePoint(ON_3dPoint basepoint);
    185  ON_3dPoint ModelSpaceBasePoint() const;
    186 
    187  // If this dimension measures objects in the model space of a detail view
    188  // this is the detail view, otherwise, nil_uuid
    189  ON_UUID DetailMeasured() const;
    190  void SetDetailMeasured(ON_UUID detail_id);
    191 
    192  //const wchar_t* ToleranceUpperString() const;
    193  //ON_wString& ToleranceUpperString();
    194  //void SetToleranceUpperString( const wchar_t* upper_string);
    195  //void SetToleranceUpperString( ON_wString& upper_string);
    196 
    197  //const wchar_t* ToleranceLowerString() const;
    198  //ON_wString& ToleranceLowerString();
    199  //void SetToleranceLowerString( const wchar_t* lower_string);
    200  //void SetToleranceLowerString( ON_wString& lower_string);
    201 
    202  //const wchar_t* AlternateString() const;
    203  //ON_wString& AlternateString();
    204  //void SetAlternateString( const wchar_t* alt_string);
    205  //void SetAlternateString( ON_wString& alt_string);
    206 
    207  //const wchar_t* AlternateToleranceUpperString() const;
    208  //ON_wString& AlternateToleranceUpperString();
    209  //void SetAlternateToleranceUpperString( const wchar_t* upper_string);
    210  //void SetAlternateToleranceUpperString( ON_wString& upper_string);
    211 
    212  //const wchar_t* AlternateToleranceLowerString() const;
    213  //ON_wString& AlternateToleranceLowerString();
    214  //void SetAlternateToleranceLowerString( const wchar_t* lower_string);
    215  //void SetAlternateToleranceLowerString( ON_wString& lower_string);
    216 
    217  ON_UUID m_partent_uuid; // the dimension using this extension
    218 
    219  int m_arrow_position;
    220 
    221  // This is either nullptr or an array of GDI rects for the substrings
    222  // that make up the dimension string.
    223  // If the dimension text is all on the same line, there is just one
    224  // rectangle needed to bound the text and that is the same as the
    225  // m_rect on the ON_OBSOLETE_V5_AnnotationText.
    226  // If the dimension has tolerances or for some other reason has more
    227  // than one line of text, m_text_rects is an array of 7 rects, one
    228  // each for the substrings that might be needed to display the dimension.
    229  // If some of the rects aren't used, they are empty at 0,0
    230  // The strings that correspond to these rectangles are generated from
    231  // info in the dimstyle
    232  ON_OBSOLETE_V5_RECT* m_text_rects;
    233 
    234  double m_distance_scale;
    235  ON_3dPoint m_modelspace_basepoint;
    236 
    237  // If this dimension measures objects in the model space of a detail view
    238  // this is the detail view
    239  // 27 Aug, 2014, v6
    240  ON_UUID m_detail_measured;
    241 };
    242 
    243 
    244 /*
    245  class ON_OBSOLETE_V5_Annotation
    246 
    247  Description:
    248  Used to serialize definitions of annotation objects (dimensions, text, leaders, etc.).
    249  Virtual base class for annotation objects
    250  Replaces ON_OBSOLETE_V2_Annotation
    251 */
    252 class ON_OBSOLETE_V5_Annotation : public ON_Geometry
    253 {
    254  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_Annotation);
    255 
    256 protected:
    257  ON_OBSOLETE_V5_Annotation();
    258  ON_OBSOLETE_V5_Annotation(const ON_OBSOLETE_V5_Annotation&) = default;
    259  ON_OBSOLETE_V5_Annotation& operator=(const ON_OBSOLETE_V5_Annotation&) = default;
    260 
    261 public:
    262  virtual ~ON_OBSOLETE_V5_Annotation();
    263 
    264 protected:
    265  void Internal_InitializeFromV2Annotation(
    266  const class ON_OBSOLETE_V2_Annotation& V2_annotation,
    267  const class ON_3dmAnnotationContext* annotation_context
    268  );
    269 
    270 public:
    271  static ON_OBSOLETE_V5_Annotation* CreateFromV2Annotation(
    272  const class ON_OBSOLETE_V2_Annotation& V2_annotation,
    273  const class ON_3dmAnnotationContext* annotation_context
    274  );
    275 
    276 public:
    277  static ON_OBSOLETE_V5_Annotation* CreateFromV6Annotation(
    278  const class ON_Annotation& V6_annotation,
    279  const class ON_3dmAnnotationContext* annotation_context
    280  );
    281 
    282 protected:
    283  ////void Internal_SetDimStyleFromV6Annotation(
    284  //// const class ON_Annotation& V6_annotation,
    285  //// const class ON_3dmAnnotationContext* annotation_context
    286  ////);
    287 
    288 public:
    289 
    290  // Description:
    291  // Sets initial defaults
    292  void Create();
    293 
    294  void Destroy();
    295 
    296  void EmergencyDestroy();
    297 
    298  /////////////////////////////////////////////////////////////////
    299  //
    300  // ON_Object overrides
    301  //
    302 
    303  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    304 
    305 
    306  /*
    307  Description: Writes the object to a file
    308 
    309  Returns:
    310  @untitled Table
    311  true Success
    312  false Failure
    313  */
    314  bool Write(
    316  ) const override;
    317 
    318  /*
    319  Description: Reads the object from a file
    320 
    321  Returns:
    322  @untitled Table
    323  true Success
    324  false Failure
    325  */
    326  bool Read(
    328  ) override;
    329 
    330  /*
    331  Returns: The Object Type of this object
    332  */
    333  ON::object_type ObjectType() const override;
    334 
    335  /////////////////////////////////////////////////////////////////
    336  //
    337  // ON_Geometry overrides
    338  //
    339 
    340  /*
    341  Returns the geometric dimension of the object ( usually 3)
    342  */
    343  int Dimension() const override;
    344 
    345  // overrides virtual ON_Geometry::Transform()
    346  bool Transform( const ON_Xform& xform ) override;
    347 
    348  // virtual ON_Geometry override
    349  bool EvaluatePoint( const class ON_ObjRef& objref, ON_3dPoint& P ) const override;
    350 
    351  /////////////////////////////////////////////////////////////////
    352  //
    353  // ON_OBSOLETE_V5_Annotation interface
    354  //
    355 
    356  // Definitions of text justification
    357  // Not implemented on all annotation objects
    358  enum eTextJustification
    359  {
    360  tjUndefined = 0,
    361  tjLeft = 1<<0,
    362  tjCenter = 1<<1,
    363  tjRight = 1<<2,
    364  tjBottom = 1<<16,
    365  tjMiddle = 1<<17,
    366  tjTop = 1<<18,
    367  tjBottomLeft = tjBottom | tjLeft,
    368  tjBottomCenter = tjBottom | tjCenter,
    369  tjBottomRight = tjBottom | tjRight,
    370  tjMiddleLeft = tjMiddle | tjLeft,
    371  tjMiddleCenter = tjMiddle | tjCenter,
    372  tjMiddleRight = tjMiddle | tjRight,
    373  tjTopLeft = tjTop | tjLeft,
    374  tjTopCenter = tjTop | tjCenter,
    375  tjTopRight = tjTop | tjRight,
    376  };
    377 
    378  /*
    379  Description:
    380  Query if the annotation object is a text object
    381  Parameters:
    382  none
    383  Returns:
    384  @untitled table
    385  true It is text
    386  false Its not text
    387  */
    388  bool IsText() const;
    389 
    390  /*
    391  Description:
    392  Query if the annotation object is a leader
    393  Parameters:
    394  none
    395  Returns:
    396  @untitled table
    397  true It is a leader
    398  false Its not a leader
    399  */
    400  bool IsLeader() const;
    401 
    402  /*
    403  Description:
    404  Query if the annotation object is a dimension
    405  Parameters:
    406  none
    407  Returns:
    408  @untitled table
    409  true It is a dimension
    410  false Its not a dimension
    411  */
    412  bool IsDimension() const;
    413 
    414 public:
    415  int V5_3dmArchiveDimStyleIndex() const;
    416 
    417  /*
    418  Description:
    419  If IsText() is false, the dimension style is set.
    420  */
    421  void SetV5_3dmArchiveDimStyleIndex(
    422  int V5_dim_style_index
    423  );
    424 
    425  ////ON_UUID V6_DimStyleId() const;
    426 
    427 
    428 
    429  /////*
    430  ////Description:
    431  //// If IsText() is false, the dimension style is set.
    432  ////*/
    433  ////void SetV6_DimStyleId(
    434  //// ON_UUID dim_style_id,
    435  //// int V5_dim_style_index
    436  //// );
    437 
    438  ////const ON_DimStyle* V6_DimStyleOverride() const;
    439 
    440  /////*
    441  ////Description:
    442  //// If IsText() is false, the dimension style is set.
    443  ////*/
    444  ////void SetV6_DimStyleOverride(
    445  //// const ON_DimStyle* dim_style_override,
    446  //// int V5_dim_style_index
    447  //// );
    448 
    449 public:
    450 
    451  /*
    452  Returns:
    453  Dimension type
    454  Linear dim: distance between arrow tips
    455  Radial dim: radius or diameter depending on m_type value
    456  Angular dim: angle in degrees
    457  Leader: ON_UNSET_VALUE
    458  Text: ON_UNSET_VALUE
    459  */
    460  virtual
    461  double NumericValue() const;
    462 
    463  /*
    464  Description:
    465  Set or Get the height of the text in this annotation
    466  Parameters:
    467  [in] double new text height to set
    468  Returns:
    469  double Height of the text
    470  Remarks:
    471  Height is in model units
    472  */
    473  void SetHeight( double);
    474  double Height() const;
    475 
    476  /*
    477  Description:
    478  Sets or gets the object type member to a specific annotation type:
    479  dtDimLinear, dtDimAligned, dtDimAngular, etc.
    480  Parameters:
    481  [in] ON_INTERNAL_OBSOLETE::V5_eAnnotationType type - dtDimLinear, dtDimAligned, dtDimAngular, etc.
    482  Returns:
    483  ON_INTERNAL_OBSOLETE::V5_eAnnotationType of the object
    484  */
    485  void SetType( ON_INTERNAL_OBSOLETE::V5_eAnnotationType);
    486  ON_INTERNAL_OBSOLETE::V5_eAnnotationType Type() const;
    487 
    488  /*
    489  Description:
    490  Set or get the plane for the object's ECS
    491  Parameters:
    492  [in] ON_Plane& plane in WCS
    493  Returns:
    494  const ON_Plane& - the object's ECS plane in WCS coords
    495  */
    496  void SetPlane( const ON_Plane&);
    497  const ON_Plane& Plane() const;
    498 
    499  /*
    500  Description:
    501  Returns the number of definition points this object has
    502  Parameters:
    503  none
    504  Returns:
    505  @untitled table
    506  int the object's point count
    507  */
    508  int PointCount() const;
    509  void SetPointCount( int count);
    510 
    511  /*
    512  Description:
    513  Set or get the object's whole points array at once
    514  Parameters:
    515  [in] ON_2dPointArray& pts
    516  Returns:
    517  const ON_2dPointArray& - ref to the object's point array
    518  */
    519  void SetPoints( const ON_2dPointArray&);
    520  const ON_2dPointArray& Points() const;
    521 
    522  /*
    523  Description:
    524  Set individual definition points for the annotation
    525  Parameters:
    526  @untitled table
    527  [in] int index index of the point to set in ECS 2d coordinates
    528  [in] const ON_2dPoint& pt the new point value
    529  Returns:
    530  ON_2dPoint the point coordinates in ECS
    531  */
    532  void SetPoint( int, const ON_2dPoint&);
    533  ON_2dPoint Point( int) const;
    534 
    535  /*
    536  Description:
    537 
    538  Set or get the string value of the user text, with no substitution for "<>"
    539  Parameters:
    540  [in] const wchar_t* string the new value for UserText
    541  Returns:
    542  const ON_wString& The object's UserText
    543  Remarks:
    544  UserText is the string that gets printed when the dimensoin is drawn.
    545  If it contains the token "<>", that token is replaced with the measured
    546  value for the dimension, formatted according to the DimStyle settings.
    547  "<>" is the default for linear dimensions.
    548  Other dimensions include "<>" in their default string
    549  */
    550 
    551  ON_DEPRECATED_MSG("use SetTextValue function")
    552  void SetUserText( const wchar_t* text_value );
    553 
    554  ON_DEPRECATED_MSG("use TextValue function")
    555  const ON_wString& UserText() const;
    556 
    557 
    558  /*
    559  Description:
    560  Gets the value of the annotation text.
    561  Returns:
    562  Value of the annotation text.
    563  See Also:
    564  ON_OBSOLETE_V5_AnnotationText::SetTextValue()
    565  ON_OBSOLETE_V5_AnnotationText::SetTextFormula()
    566  ON_OBSOLETE_V5_AnnotationText::TextFormula()
    567  Remarks:
    568  This gets the literal value of the text, there is no
    569  substitution for any "<>" substrings. When a dimension
    570  is drawn, any occurance of "<>" will be replaced
    571  with the measured value for the dimension and formatted
    572  according to the DimStyle settings.
    573 
    574  Annotation text values can be constant or the result
    575  of evaluating text formula containing %<...>%
    576  expressions. The ...TextValue() functions set
    577  and get the text's value. The ...TextFormula()
    578  functions get and set the text's formula.
    579  */
    580  const wchar_t* TextValue() const;
    581 
    582  /*
    583  Description:
    584  Sets the value of the annotation text. No changes
    585  are made to the text_value string.
    586  Parameters:
    587  text_value - [in]
    588  Returns:
    589  Value of the annotation text.
    590  See Also:
    591  ON_OBSOLETE_V5_AnnotationText::SetTextFormula()
    592  ON_OBSOLETE_V5_AnnotationText::TextValue()
    593  ON_OBSOLETE_V5_AnnotationText::TextFormula()
    594  Remarks:
    595  Annotation text values can be constant or the result
    596  of evaluating text formula containing %<...>%
    597  expressions. The ...TextValue() functions set
    598  and get the text's value. The ...TextFormula()
    599  functions get and set the text's formula.
    600  */
    601  void SetTextValue( const wchar_t* text_value );
    602 
    603  /*
    604  Description:
    605  Gets the formula for the annotation text.
    606  Parameters:
    607  text_value - [in]
    608  Returns:
    609  Value of the annotation text.
    610  See Also:
    611  ON_OBSOLETE_V5_AnnotationText::SetTextValue()
    612  ON_OBSOLETE_V5_AnnotationText::TextValue()
    613  ON_OBSOLETE_V5_AnnotationText::TextFormula()
    614  Remarks:
    615  Annotation text values can be constant or the result
    616  of evaluating text formula containing %<...>%
    617  expressions. The ...TextValue() functions set
    618  and get the text's value. The ...TextFormula()
    619  functions get and set the text's formula.
    620  */
    621  const wchar_t* TextFormula() const;
    622 
    623  /*
    624  Description:
    625  Sets the formula for the annotation text.
    626  Parameters:
    627  text_value - [in]
    628  Returns:
    629  Value of the annotation text.
    630  See Also:
    631  ON_OBSOLETE_V5_AnnotationText::SetTextValue()
    632  ON_OBSOLETE_V5_AnnotationText::Value()
    633  ON_OBSOLETE_V5_AnnotationText::Formula()
    634  Remarks:
    635  Annotation text values can be constant or the result
    636  of evaluating text formula containing %<...>%
    637  expressions. The ...TextValue() functions set
    638  and get the text's value. The ...TextFormula()
    639  functions get and set the text's formula.
    640  */
    641  void SetTextFormula( const wchar_t* s );
    642 
    643  /*
    644  Description:
    645  Set or get a flag indication that the dimension text has been moved
    646  from the default location.
    647  Parameters:
    648  bUserPositionedText - [in]
    649  true to indicate that the text has been placed by the user.
    650  false to indicate that it hasn't
    651  Returns:
    652  @untitled table
    653  true The text has been moved
    654  false The text is in the default location
    655  Remarks:
    656  If the text is in the default location, it should be repositioned
    657  automatically when the dimension is adjusted.
    658  If it has been moved, it should not be automatically positioned.
    659  */
    660  void SetUserPositionedText( int bUserPositionedText );
    661  bool UserPositionedText() const;
    662 
    663  /*
    664  Description:
    665  Set or get the text display mode for the annotation
    666  Parameters:
    667  [in] ON::eTextDisplayMode mode - new mode to set
    668  Returns:
    669  ON::eTextDisplayMode - current mode
    670  Remarks:
    671  This is the way the text is oriented with respect to the dimension line or screen:
    672  Above line, In LIne, Horizontal
    673  */
    674  void SetTextDisplayMode( ON_INTERNAL_OBSOLETE::V5_TextDisplayMode);
    675  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode TextDisplayMode() const;
    676 
    677 
    678  /*
    679  Description:
    680  Gets a transform matrix to change from the object's 2d ECS to 3d WCS
    681  Parameters:
    682  [out] xform set to produce the ECS to WCS transform
    683  Returns:
    684  @untitled table
    685  true Success
    686  false Failure
    687  */
    688  bool GetECStoWCSXform( ON_Xform&) const;
    689 
    690  /*
    691  Description:
    692  Gets a transform matrix to change from to 3d WCS to the object's 2d ECS
    693  Parameters:
    694  [out] xform - set to produce the WCS to ECS transform
    695  Returns:
    696  @untitled table
    697  true Success
    698  false Failure
    699  */
    700  bool GetWCStoECSXform( ON_Xform& xform) const;
    701 
    702  /*
    703  Description:
    704  Set the object's point array to a specified length
    705  Parameters:
    706  [in] length - the new size of the array
    707  Returns:
    708  void
    709  */
    710  void ReservePoints( int);
    711 
    712 
    713  /*
    714  Description:
    715  static function to provide the default UserText string for the object
    716  Returns:
    717  const wchar_t* - the default string to use
    718  */
    719  static const wchar_t* DefaultText();
    720 
    721  /*
    722  Description:
    723  Set or Get the text justification
    724  Parameters:
    725  justification [in] See enum eJustification for meanings
    726  Returns:
    727  The justification for the text in this object
    728  Comments:
    729  This is not implemented on all annotation objects.
    730  The default SetJustification() does nothing
    731  The default Justification() always returns 0
    732 
    733  */
    734  virtual
    735  void SetJustification( unsigned int justification);
    736 
    737  virtual unsigned int Justification() const;
    738 
    739  /*
    740  Description:
    741  Get the transformation that maps the annotation's
    742  text to world coordinates.
    743  Added Oct 30, 07 LW
    744  Parameters:
    745  gdi_text_rect - [in]
    746  Windows gdi rect of text when it is drawn with
    747  LOGFONT lfHeight = ON_Font::Constants::AnnotationFontCellHeight.
    748  gdi_height_of_I - [in]
    749  Value returned by ON_Font::HeightOfI().
    750  dimstyle_textheight - [in]
    751  Height of text in world units. If the annotation is
    752  an ON_OBSOLETE_V5_TextObject, this is the m_textheight value.
    753  If the annotation is not an ON_OBSOLETE_V5_TextObject, pass in
    754  the value returned by the dimension style's
    755  ON_DimStyle::TextHeight()
    756  dimstyle_textgap - [in]
    757  The value of the annotation's dimension style's
    758  ON_DimStyle::TextGap().
    759  dimstyle_textalignment - [in]
    760  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode(ON_DimStyle::TextAlignment()).
    761  dimscale - [in]
    762  Global dimension scaling value. If you are using the
    763  Rhino SDK, this value is returned by
    764  CRhinoDoc::Properties().AnnotationSettings().DimScale().
    765  If you are using the OpenNURBS IO toolkit, this value
    766  is on ON_3dmSettings::m_AnnotationSettings.m_dimscale.
    767  cameraX - [in]
    768  zero or the view's unit camera right vector
    769  cameraY - [in]
    770  zero or the view's unit camera up vector
    771  model_xform - [in] transforms the text's parent entity
    772  to world coordinates in case its instance geometry
    773  nullptr == Identity
    774  text_xform - [out]
    775  Returns:
    776  True if text_xform is set.
    777  */
    778  bool GetTextXform(
    779  ON_OBSOLETE_V5_RECT gdi_text_rect,
    780  int gdi_height_of_I,
    781  double dimstyle_textheight,
    782  double dimstyle_textgap,
    783  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode dimstyle_textalignment,
    784  double dimscale,
    785  ON_3dVector cameraX,
    786  ON_3dVector cameraY,
    787  const ON_Xform* model_xform,
    788  ON_Xform& text_xform // output
    789  ) const;
    790 
    791  /*
    792  Description:
    793 
    794  This function has been replaced with a version that
    795  takes a model transform to transform block instance
    796  geometry to world coordinates Oct 30, 07 LW
    797 
    798  Get the transformation that maps the annotation's
    799  text to world coordinates.
    800  Parameters:
    801  gdi_text_rect - [in]
    802  Windows gdi rect of text when it is drawn with
    803  LOGFONT lfHeight = ON_Font::Constants::AnnotationFontCellHeight.
    804  gdi_height_of_I - [in]
    805  Value returned by ON_Font::HeightOfI().
    806  dimstyle_textheight - [in]
    807  Height of text in world units. If the annotation is
    808  an ON_OBSOLETE_V5_TextObject, this is the m_textheight value.
    809  If the annotation is not an ON_OBSOLETE_V5_TextObject, pass in
    810  the value returned by the dimension style's
    811  ON_DimStyle::TextHeight()
    812  dimstyle_textgap - [in]
    813  The value of the annotation's dimension style's
    814  ON_DimStyle::TextGap().
    815  dimstyle_textalignment - [in]
    816  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode(ON_DimStyle::TextAlignment()).
    817  dimscale - [in]
    818  Global dimension scaling value. If you are using the
    819  Rhino SDK, this value is returned by
    820  CRhinoDoc::Properties().AnnotationSettings().DimScale().
    821  If you are using the OpenNURBS IO toolkit, this value
    822  is on ON_3dmSettings::m_AnnotationSettings.m_dimscale.
    823  cameraX - [in]
    824  zero or the view's unit camera right vector
    825  cameraY - [in]
    826  zero or the view's unit camera up vector
    827  xform - [out]
    828  Returns:
    829  True if xform is set.
    830  */
    831  bool GetTextXform(
    832  ON_OBSOLETE_V5_RECT gdi_text_rect,
    833  int gdi_height_of_I,
    834  double dimstyle_textheight,
    835  double dimstyle_textgap,
    836  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode dimstyle_textalignment,
    837  double dimscale,
    838  ON_3dVector cameraX,
    839  ON_3dVector cameraY,
    840  ON_Xform& xform
    841  ) const;
    842 
    843  /*
    844  Description:
    845  Get the transformation that maps the annotation's
    846  text to world coordinates.
    847  Oct 30, 07 LW
    848  Parameters:
    849  gdi_text_rect - [in]
    850  Windows gdi rect of text when it is drawn with
    851  LOGFONT lfHeight = ON_Font::Constants::AnnotationFontCellHeight.
    852  font - [in]
    853  dimstyle - [in]
    854  dimscale - [in]
    855  Global dimension scaling value. If you are using the
    856  Rhino SDK, this value is returned by
    857  CRhinoDoc::Properties().AnnotationSettings().DimScale().
    858  If you are using the OpenNURBS IO toolkit, this value
    859  is on ON_3dmSettings::m_AnnotationSettings.m_dimscale.
    860  vp - [in]
    861  model_xform - [in] transforms the text's parent entity
    862  to world coordinates in case its instance geometry
    863  nullptr == Identity
    864  text_xform - [out]
    865  Returns:
    866  True if text_xform is set.
    867  */
    868  bool GetTextXform(
    869  const ON_OBSOLETE_V5_RECT gdi_text_rect,
    870  const ON_Font& font,
    871  const ON_DimStyle* dimstyle,
    872  double dimscale,
    873  const ON_Viewport* vp,
    874  const ON_Xform* model_xform,
    875  ON_Xform& text_xform // output
    876  ) const;
    877 
    878  /*
    879  Description:
    880  Get the annotation plane coordinates (ECS) of the point
    881  that is used to position the text. The relative position
    882  of the text to this points depends on the type of
    883  annotation, the dimstyle's text alignment flag, and the
    884  view projection.
    885  This point is not the same as the base point of the text.
    886  Parameters:
    887  text_point - [out];
    888  Returns:
    889  True if text_point is set.
    890  */
    891  bool GetTextPoint( ON_2dPoint& text_2d_point ) const;
    892 
    893  // enum for tyoe of annotation DimLinear, DimRadius, etc.
    894  ON_INTERNAL_OBSOLETE::V5_eAnnotationType m_type;
    895 
    896  // m_textdisplaymode controls the orientation
    897  // of the text.
    898  // If m_textdisplaymode = dtHorizontal, then
    899  // the text is always horizontal and in the
    900  // view plane. Otherwise it lies in m_plane.
    901  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode m_textdisplaymode;
    902 
    903  // m_plane is the plane containing the annotation.
    904  // All parts of the annotation that are not
    905  // text lie in this plane. If
    906  // m_textdisplaymode != dtHorizontal, then
    907  // the text lies in the plane too.
    908  // (ECS reference plane in WCS coordinates.)
    909  ON_Plane m_plane;
    910 
    911  // Definition points for the dimension.
    912  // These are 2d coordinates in m_plane.
    913  // The location of these points depends on the
    914  // type of annotation class. There is a comment
    915  // at the start of the definions for
    916  // ON_OBSOLETE_V5_DimLinear, ON_OBSOLETE_V5_DimRadial,
    917  // ON_OBSOLETE_V5_DimAngular, ON_OBSOLETE_V5_TextObject, and
    918  // ON_OBSOLETE_V5_Leader that explains how the points are used.
    919  ON_2dPointArray m_points;
    920 
    921  // With the addition of tolerances and therefore multi-line
    922  // text, the ON_wString in m_usertext will hold multiple
    923  // strings with NULLs between them.
    924  // The strings will be in this order:
    925  // Result of expanding "<>", or user override
    926  // Alternate dimension
    927  // Tolerance upper
    928  // Tolerance lower
    929  // Alt tolerance upper
    930  // Alt tolerance lower
    931  // Prefix
    932  // Suffix
    933  // Alt prefix
    934  // Alt suffix
    935  //
    936  ON_OBSOLETE_V5_AnnotationText m_usertext;
    937 
    938  // true: User has positioned text
    939  // false: use default location
    940  bool m_userpositionedtext;
    941  // Added 13 Aug, 2010 - Lowell
    942  // This determines whether the object will be scaled according to detail
    943  // scale factor or by 1.0 in paperspace rather than by
    944  // dimscale or text scale.
    945  // For the first try this will only be used on text and its
    946  // here on the base class because it would fit and in case
    947  // its needed later on dimensions.
    948  bool m_annotative_scale;
    949 private:
    950  bool m_reserved_b1;
    951  bool m_reserved_b2;
    952 public:
    953 
    954 private:
    955  // At this point, the ON_OBSOLETE_V5_Annotation and derived classes
    956  // exists for a single purpose - to support reading and writing
    957  // V5 (4,3,2) 3dm archives.
    958  // In V5 archives all dimension styles, including per opbject overrrides
    959  // were in the archive dimstyle table. In V6 and later, override dimstyles
    960  // are managed by the object that uses them.
    961  //
    962  // This class used to have a single dimstyle table index.
    963  // That index has been removed and replaced with the following
    964  // information that is parallel to the information on ON_Annotation.
    965 
    966  // Dimstyle index to use when writing a V5 archive.
    967  int m_v5_3dm_archive_dimstyle_index = ON_UNSET_INT_INDEX;
    968 
    969 public:
    970  // Text height in model units
    971  // This is used by text, but not by dimensions
    972  // Dimensions get their height from dimension styles
    973  double m_textheight;
    974 
    975  // Left, Center, Right / Bottom, Middle, Top text justification
    976  // See eTextJustification above
    977  unsigned int m_justification;
    978 };
    979 
    980 
    981 // Subclass of ON_OBSOLETE_V5_Annotation to provide linear dimensions
    982 class ON_OBSOLETE_V5_DimLinear : public ON_OBSOLETE_V5_Annotation
    983 {
    984  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_DimLinear);
    985 
    986 public:
    987 
    988  /*
    989  The annotation's dimstyle controls the position of TEXT,
    990  the size of the arrowheads, and the amount the ends of
    991  linear dimension's extension lines extend beyond the
    992  dimension lines.
    993 
    994  In the picture below, [n] means ON_OBSOLETE_V5_Annotation::m_points[n].
    995 
    996  [2]
    997  |
    998  | |
    999  [1]-------------------------------------------[3]
    1000  | |
    1001  | TEXT
    1002  | [4]
    1003  [0]
    1004 
    1005  The "x" and "y" coordinates of [0] must be (0.0, 0.0).
    1006 
    1007  The "x" coordinate of [1] = "x" of [0]
    1008  The "y" coordinate of [1] can be any value.
    1009 
    1010  The "x" and "y" coordinates of [2] can be any value.
    1011 
    1012  The "x" coordinate of [3] = "x" coordinate of [2].
    1013  The "y" coordinate of [3] = "y" coordinate of [1].
    1014  */
    1015 
    1016  enum POINT_INDEX
    1017  {
    1018  // Do not change these enum values. They are saved in files as the
    1019  // ON_COMPONENT_INDEX.m_index value.
    1020  //
    1021  // Indices of linear dimension definition points in
    1022  // the m_points[] array
    1023  ext0_pt_index = 0, // end of first extension line
    1024  arrow0_pt_index = 1, // arrowhead tip on first extension line
    1025  ext1_pt_index = 2, // end of second extension line
    1026  arrow1_pt_index = 3, // arrowhead tip on second extension line
    1027  userpositionedtext_pt_index = 4,
    1028  dim_pt_count = 5, // number of m_points[] in an angular dim
    1029 
    1030  // Points calculated from values in m_points[]
    1031  text_pivot_pt = 10000, // center of dimension text
    1032  dim_mid_pt = 10001 // midpoint of dimension line
    1033  };
    1034 
    1035 public:
    1036  ON_OBSOLETE_V5_DimLinear();
    1037  ~ON_OBSOLETE_V5_DimLinear();
    1038  ON_OBSOLETE_V5_DimLinear( const ON_OBSOLETE_V5_DimLinear& ) = default;
    1039  ON_OBSOLETE_V5_DimLinear& operator=(const ON_OBSOLETE_V5_DimLinear&) = default;
    1040 
    1041  /*
    1042  Description:
    1043  Create a V5 linear dimension from a V6 linear dimension.
    1044  The function is used when writing V5 files.
    1045  Parameters:
    1046  V6_dim_linear -[in]
    1047  annotation_context - [in]
    1048  Dimstyle and other informtion referenced by V6_dim_linear or nullptr if not available.
    1049  destination - [in]
    1050  If destination is not nullptr, then the V5 linear dimension is constructed
    1051  in destination. If destination is nullptr, then the new V5 linear dimension
    1052  is allocated with a call to new ON_OBSOLETE_V5_DimLinear().
    1053  */
    1054  static ON_OBSOLETE_V5_DimLinear* CreateFromV6DimLinear(
    1055  const class ON_DimLinear& V6_dim_linear,
    1056  const class ON_3dmAnnotationContext* annotation_context,
    1057  ON_OBSOLETE_V5_DimLinear* destination
    1058  );
    1059 
    1060  static ON_OBSOLETE_V5_DimLinear* CreateFromV2LinearDimension(
    1061  const class ON_OBSOLETE_V2_DimLinear& V2_linear_dimension,
    1062  const class ON_3dmAnnotationContext* annotation_context,
    1063  ON_OBSOLETE_V5_DimLinear* destination
    1064  );
    1065 
    1066  // overrides virtual ON_Geometry::Transform()
    1067  bool Transform( const ON_Xform& xform ) override;
    1068 
    1069  /*
    1070  Description:
    1071  Checks the linear dimension and repairs any point locations or flags
    1072  that are not set correctly.
    1073  Returns:
    1074  0: linear dimension is damaged beyond repair
    1075  1: linear dimension was perfect and nothing needed to be repaired.
    1076  2: linear dimension had flaws that were repaired.
    1077  */
    1078  int Repair();
    1079 
    1080  /*
    1081  Description:
    1082  Get the m_plane coordinates of the dimension point.
    1083  Parameters:
    1084  point_index - [in] One of the POINT_INDEX enum values
    1085  Returns:
    1086  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1087  array is not valid.
    1088  */
    1089  ON_2dPoint Dim2dPoint(
    1090  int point_index
    1091  ) const;
    1092 
    1093  /*
    1094  Description:
    1095  Get the m_plane coordinates of the dimension point.
    1096  Parameters:
    1097  point_index - [in] One of the POINT_INDEX enum values
    1098  Returns:
    1099  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1100  array is not valid.
    1101  */
    1102  ON_3dPoint Dim3dPoint(
    1103  int point_index
    1104  ) const;
    1105 
    1106  // overrides virual ON_Object::IsValid
    1107  bool IsValid( ON_TextLog* text_log = nullptr ) const override;
    1108 
    1109  // overrides virual ON_Object::Write
    1110  bool Write(ON_BinaryArchive&) const override;
    1111 
    1112  // overrides virual ON_Object::Read
    1113  bool Read(ON_BinaryArchive&) override;
    1114 
    1115  // virtual ON_Geometry GetBBox override
    1116  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1117 
    1118  // virtual ON_Geometry GetTightBoundingBox override
    1119  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    1120 
    1121  /*
    1122  Description:
    1123  Overrides virtual ON_OBSOLETE_V5_Annotation::NumericValue();
    1124  Returns:
    1125  distance between arrow tips
    1126  */
    1127  double NumericValue() const override;
    1128 
    1129  /*
    1130  Description:
    1131  Get or set the DimStyle index in the dimstyle table for the dimension
    1132  Parameters:
    1133  [in] int the new index (Set)
    1134  Returns:
    1135  int - The current index (Get)
    1136  */
    1137  int StyleIndex() const;
    1138  void SetStyleIndex( int);
    1139 
    1140  /*
    1141  Description:
    1142  static function to provide the default UserText string for the object
    1143  Returns:
    1144  const wchar_t* - the default string to use
    1145  */
    1146  static const wchar_t* DefaultText();
    1147 
    1148 
    1149  /*
    1150  Description:
    1151  Get the annotation plane x coordinates of the dimension
    1152  line. The y coordinate of the dimension line is m_ponts[1].y.
    1153  Parameters:
    1154  gdi_text_rect - [in]
    1155  Windows rect (left < right, top < bottom) that bounds text.
    1156  The baseline of the text should be at y=0 in the rect coordinates.
    1157  gdi_height_of_I - [in]
    1158  Height of an I in the text in the same.
    1159  gdi_to_world - [in]
    1160  transform returned by ON_OBSOLETE_V5_Annotation::GetTextXform().
    1161  dimstyle - [in]
    1162  dimscale - [in]
    1163  vp - [in]
    1164  x - [out] plane x coordinates of the dimension line.
    1165  The y coordinate = m_points[arrow0_pt_index].y
    1166  bInside - [out] true if arrowheads go inside extension lines,
    1167  false if they go outside
    1168  Returns:
    1169  0: the input or class is not valid
    1170  1: A single line from x[0] to x[1] with arrow heads at both ends.
    1171  Arrowtips at x[4] & x[5]
    1172  2: Two lines from x[0] to x[1] and from x[1] to x[2]. The
    1173  Arrowtips at x[4] & x[5]
    1174 
    1175  */
    1176  int GetDimensionLineSegments(
    1177  ON_OBSOLETE_V5_RECT gdi_text_rect,
    1178  int gdi_height_of_I,
    1179  ON_Xform gdi_to_world,
    1180  const ON_DimStyle& dimstyle,
    1181  double dimscale,
    1182  const ON_Viewport* vp,
    1183  double a[6],
    1184  bool& bInside
    1185  ) const;
    1186 
    1187 
    1188  // Added for V5. 4/24/07 LW
    1189  // Get the userdata extension for this dimension
    1190  ON_OBSOLETE_V5_DimExtra* DimensionExtension();
    1191  const ON_OBSOLETE_V5_DimExtra* DimensionExtension() const;
    1192 };
    1193 
    1194 //////////
    1195 // class ON_OBSOLETE_V5_DimRadial
    1196 class ON_OBSOLETE_V5_DimRadial : public ON_OBSOLETE_V5_Annotation
    1197 {
    1198  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_DimRadial);
    1199 
    1200 public:
    1201 
    1202  /*
    1203  The annotation's dimstyle controls the position of TEXT,
    1204  and the size of the arrowheads.
    1205 
    1206  In the picture below, [n] means ON_OBSOLETE_V5_Annotation::m_points[n].
    1207 
    1208  Radial dimensions do not permit user positioned text
    1209 
    1210 
    1211  knee
    1212  [3]--------[2] TEXT
    1213  / (tail)
    1214  /
    1215  /
    1216  [1] (arrow head here)
    1217 
    1218 
    1219  + [0] = (usually at (0,0) = center of circle)
    1220  */
    1221 
    1222  enum POINT_INDEX
    1223  {
    1224  // Do not change these enum values. They are saved in files as the
    1225  // ON_COMPONENT_INDEX.m_index value.
    1226  //
    1227  // Indices of radial dimension definition points in
    1228  // the m_points[] array
    1229  center_pt_index = 0, // location of + (usually at center of circle)
    1230  arrow_pt_index = 1, // arrow tip
    1231  tail_pt_index = 2, // end of radial dimension
    1232  knee_pt_index = 3, // number of m_points[] in a radial dim
    1233  dim_pt_count = 4, // number of m_points[] in a radial dim
    1234 
    1235  // Points calculated from values in m_points[]
    1236  text_pivot_pt = 10000, // start/end of dimension text at tail
    1237  };
    1238 
    1239  ON_OBSOLETE_V5_DimRadial();
    1240  ~ON_OBSOLETE_V5_DimRadial() = default;
    1241  ON_OBSOLETE_V5_DimRadial(const ON_OBSOLETE_V5_DimRadial&) = default;
    1242  ON_OBSOLETE_V5_DimRadial& operator=(const ON_OBSOLETE_V5_DimRadial&) = default;
    1243 
    1244 
    1245  static ON_OBSOLETE_V5_DimRadial* CreateFromV6DimRadial(
    1246  const class ON_DimRadial& V6_dim_radial,
    1247  const class ON_3dmAnnotationContext* annotation_context,
    1248  ON_OBSOLETE_V5_DimRadial* destination
    1249  );
    1250 
    1251  static ON_OBSOLETE_V5_DimRadial* CreateFromV2RadialDimension(
    1252  const class ON_OBSOLETE_V2_DimRadial& V2_radial_dimension,
    1253  const class ON_3dmAnnotationContext* annotation_context,
    1254  ON_OBSOLETE_V5_DimRadial* destination
    1255  );
    1256 
    1257  // overrides virtual ON_Geometry::Transform()
    1258  bool Transform( const ON_Xform& xform ) override;
    1259 
    1260  /*
    1261  Description:
    1262  Get the m_plane coordinates of the dimension point.
    1263  Parameters:
    1264  point_index - [in] One of the POINT_INDEX enum values
    1265  Returns:
    1266  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1267  array is not valid.
    1268  */
    1269  ON_2dPoint Dim2dPoint(
    1270  int point_index
    1271  ) const;
    1272 
    1273  /*
    1274  Description:
    1275  Get the m_plane coordinates of the dimension point.
    1276  Parameters:
    1277  point_index - [in] One of the POINT_INDEX enum values
    1278  Returns:
    1279  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1280  array is not valid.
    1281  */
    1282  ON_3dPoint Dim3dPoint(
    1283  int point_index
    1284  ) const;
    1285 
    1286 
    1287  // overrides virual ON_Object::IsValid
    1288  bool IsValid( ON_TextLog* text_log = nullptr ) const override;
    1289 
    1290  // overrides virual ON_Object::Write
    1291  bool Write(ON_BinaryArchive&) const override;
    1292 
    1293  // overrides virual ON_Object::Read
    1294  bool Read(ON_BinaryArchive&) override;
    1295 
    1296  // virtual ON_Geometry GetBBox override
    1297  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1298 
    1299  // virtual ON_Geometry GetTightBoundingBox override
    1300  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    1301 
    1302  /*
    1303  Description:
    1304  Set the plane and definition points from WCS 3d input
    1305  Parameters:
    1306  center - [in] center of circle
    1307  arrowtip - [in] 3d point on the circle at the dimension arrow tip
    1308  xaxis - [in] x axis of the dimension's plane
    1309  normal - [in] normal to the dimension's plane
    1310  offset_distance - [in] distance from arrow tip to knee point
    1311  Returns:
    1312  @untitled table
    1313  true Success
    1314  false Failure
    1315  */
    1316  bool CreateFromPoints(
    1317  ON_3dPoint center,
    1318  ON_3dPoint arrowtip,
    1319  ON_3dVector xaxis,
    1320  ON_3dVector normal,
    1321  double offset_distance
    1322  );
    1323 
    1324  /*
    1325  Description:
    1326  Overrides virtual ON_OBSOLETE_V5_Annotation::NumericValue();
    1327  Returns:
    1328  If m_type is ON_INTERNAL_OBSOLETE::V5_eAnnotationType::dtDimDiameter, then the diameter
    1329  is returned, othewise the radius is returned.
    1330  */
    1331  double NumericValue() const override;
    1332 
    1333  /*
    1334  Description:
    1335  Get or set the DimStyle index in the dimstyle table for the dimension
    1336  Parameters:
    1337  [in] int the new index (Set)
    1338  Returns:
    1339  int - The current index (Get)
    1340  */
    1341  int StyleIndex() const;
    1342  void SetStyleIndex( int);
    1343 
    1344  /*
    1345  Description:
    1346  static function to provide the default UserText string for the object
    1347  Returns:
    1348  const wchar_t* - the default string to use
    1349  */
    1350  static const wchar_t* DefaultDiameterText();
    1351  static const wchar_t* DefaultRadiusText();
    1352 
    1353  bool CreateFromV2(
    1354  const class ON_OBSOLETE_V2_Annotation& v2_ann,
    1355  const class ON_3dmAnnotationSettings& settings,
    1356  int dimstyle_index
    1357  );
    1358 
    1359  bool GetArrowHeadDirection( ON_2dVector& arrowhead_dir ) const;
    1360  bool GetArrowHeadTip( ON_2dPoint& arrowhead_tip ) const;
    1361 };
    1362 
    1363 
    1364 //////////
    1365 // class ON_OBSOLETE_V5_DimAngular
    1366 class ON_OBSOLETE_V5_DimAngular : public ON_OBSOLETE_V5_Annotation
    1367 {
    1368  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_DimAngular);
    1369 
    1370 public:
    1371 
    1372  /*
    1373  The annotation's dimstyle controls the position of TEXT,
    1374  the size of the arrowheads, and the amount the ends of
    1375  linear dimension's extension lines extend beyond the
    1376  dimension lines.
    1377 
    1378  In the picture below, [n] means ON_OBSOLETE_V5_Annotation::m_points[n].
    1379 
    1380  [0] = if m_userpositionedtext=true, this is the center of text.
    1381  If m_userpositionedtext=false, this point is not used and
    1382  the center of the text is at the arc's midpoint.
    1383 
    1384  Always counter clockwise arc in m_plane with center = (0,0)
    1385  [1] = a point somewhere on the line from the center through the start point.
    1386  The distance from center to [1] can be any value.
    1387  [2] = a point somewhere on the line from the center through the end point.
    1388  The distance from center to [2] can be any value.
    1389  [3] = a point on the interior of the arc. The distance
    1390  from (0,0) to [3] is the radius of the arc.
    1391 
    1392 
    1393  /
    1394  [2]
    1395  /
    1396  / [0]TEXT
    1397  /
    1398  / [3]
    1399  -----(0,0)----------[1]---
    1400  /
    1401  /
    1402  /
    1403 
    1404  */
    1405 
    1406  enum POINT_INDEX
    1407  {
    1408  // Do not change these enum values. They are saved in files as the
    1409  // ON_COMPONENT_INDEX.m_index value.
    1410  //
    1411  // Indices of angular dimension definition points in
    1412  // the m_points[] array
    1413  userpositionedtext_pt_index = 0, //
    1414  start_pt_index = 1, // point on the start ray (not necessarily on arc)
    1415  end_pt_index = 2, // point on the end ray (not necessarily on arc)
    1416  arc_pt_index = 3, // point on the interior of dimension arc
    1417  dim_pt_count = 4, // number of m_points[] in an angular dim
    1418 
    1419  // Points calculated from values in m_points[]
    1420  text_pivot_pt = 10000, // center of dimension text
    1421  arcstart_pt = 10001,
    1422  arcend_pt = 10002,
    1423  arcmid_pt = 10003,
    1424  arccenter_pt = 10004, // center of circle arc lies on
    1425  extension0_pt = 10005, // point where first extension line starts
    1426  extension1_pt = 10006 // point where second extension line starts
    1427  };
    1428 
    1429 public:
    1430  ON_OBSOLETE_V5_DimAngular();
    1431  ~ON_OBSOLETE_V5_DimAngular() = default;
    1432  ON_OBSOLETE_V5_DimAngular(const ON_OBSOLETE_V5_DimAngular&) = default;
    1433  ON_OBSOLETE_V5_DimAngular& operator=(const ON_OBSOLETE_V5_DimAngular&) = default;
    1434 
    1435  static ON_OBSOLETE_V5_DimAngular* CreateFromV6DimAngular(
    1436  const class ON_DimAngular& V6_dim_angular,
    1437  const class ON_3dmAnnotationContext* annotation_context,
    1438  ON_OBSOLETE_V5_DimAngular* destination
    1439  );
    1440 
    1441  static ON_OBSOLETE_V5_DimAngular* CreateFromV2AngularDimension(
    1442  const class ON_OBSOLETE_V2_DimAngular& V2_angular_dimension,
    1443  const class ON_3dmAnnotationContext* annotation_context,
    1444  ON_OBSOLETE_V5_DimAngular* destination
    1445  );
    1446 
    1447 
    1448  // overrides virtual ON_Geometry::Transform()
    1449  bool Transform( const ON_Xform& xform ) override;
    1450 
    1451  /*
    1452  Description:
    1453  Get the m_plane coordinates of the dimension point.
    1454  Parameters:
    1455  point_index - [in] One of the POINT_INDEX enum values
    1456  Returns:
    1457  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1458  array is not valid.
    1459  */
    1460  ON_2dPoint Dim2dPoint(
    1461  int point_index
    1462  ) const;
    1463 
    1464  /*
    1465  Description:
    1466  Get the m_plane coordinates of the dimension point.
    1467  Parameters:
    1468  point_index - [in] One of the POINT_INDEX enum values
    1469  Returns:
    1470  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1471  array is not valid.
    1472  */
    1473  ON_3dPoint Dim3dPoint(
    1474  int point_index
    1475  ) const;
    1476 
    1477 
    1478  // overrides virual ON_Object::IsValid
    1479  bool IsValid( ON_TextLog* text_log = nullptr ) const override;
    1480 
    1481  // virtual ON_Geometry GetBBox override
    1482  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1483 
    1484  // virtual ON_Geometry GetTightBoundingBox override
    1485  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    1486 
    1487  /*
    1488  Description:
    1489  Read from or write to a file
    1490  Returns:
    1491  @untitled Table
    1492  true Success
    1493  false Failure
    1494  */
    1495  bool Write( ON_BinaryArchive& file ) const override;
    1496  bool Read( ON_BinaryArchive& file ) override;
    1497 
    1498  /*
    1499  Description:
    1500  Set the plane and definition points from 3d points
    1501  in world coordinates.
    1502  Parameters:
    1503  apex - [in] 3d apex of the dimension
    1504  (center of arc)
    1505  p0 - [in] 3d point on first line
    1506  p1 - [in] 3d point on second line
    1507  arcpt - [in] 3d point on dimension arc
    1508  (determines radius of arc)
    1509  Normal - [in] normal of the plane on which to make the dimension
    1510  (must be perpendicular to p0-apex and p1-apex)
    1511  Returns:
    1512  @untitled table
    1513  true Success
    1514  false Failure
    1515  */
    1516  bool CreateFromPoints(
    1517  const ON_3dPoint& apex,
    1518  const ON_3dPoint& p0,
    1519  const ON_3dPoint& p1,
    1520  ON_3dPoint& arcpt,
    1521  ON_3dVector& Normal
    1522  );
    1523 
    1524  /*
    1525  Description:
    1526  Set the plane and definition points from a 3d arc.
    1527  Parameters:
    1528  arc - [in]
    1529  Returns:
    1530  @untitled table
    1531  true Success
    1532  false Failure
    1533  */
    1534  bool CreateFromArc(
    1535  const ON_Arc& arc
    1536  );
    1537 
    1538  bool GetArc( ON_Arc& arc ) const;
    1539 
    1540  bool GetExtensionLines(ON_Line extensions[2]) const;
    1541 
    1542  // Set or get the measured angle in radians
    1543  void SetAngle( double angle);
    1544  double Angle() const;
    1545  void SetRadius( double radius);
    1546  double Radius() const;
    1547 
    1548  /*
    1549  Description:
    1550  Overrides virtual ON_OBSOLETE_V5_Annotation::NumericValue();
    1551  Returns:
    1552  Angle in degrees
    1553  */
    1554  double NumericValue() const override;
    1555 
    1556  /*
    1557  Description:
    1558  Get or set the DimStyle index in the dimstyle table for the dimension
    1559  Parameters:
    1560  [in] int the new index (Set)
    1561  Returns:
    1562  int - The current index (Get)
    1563  */
    1564  int StyleIndex() const;
    1565  void SetStyleIndex( int);
    1566 
    1567  /*
    1568  Description:
    1569  static function to provide the default UserText string for the object
    1570  Returns:
    1571  const wchar_t* - the default string to use
    1572  */
    1573  static const wchar_t* DefaultText();
    1574 
    1575  double m_angle = 0.0; // angle being dimensioned
    1576  double m_radius = 1.0; // radius for dimension arc
    1577 
    1578  /*
    1579  Description:
    1580  Get the annotation plane angles of the dimension arc.
    1581  Parameters:
    1582  gdi_text_rect - [in] Windows rect (left < right, top < bottom)
    1583  that bounds text.
    1584  gdi_height_of_I - [in]
    1585  Height of an I in the text.
    1586  gdi_to_world - [in]
    1587  transform returned by ON_OBSOLETE_V5_Annotation::GetTextXform().
    1588  dimstyle - [in]
    1589  dimscale - [in]
    1590  vp - [in]
    1591  a - [out]
    1592  angles at the ends of the arc segment(s) and the arrow tips
    1593  bInside - [out] true if arrowheads go inside, false if they go outside
    1594  Returns:
    1595  number of arc segments to draw
    1596  0: the input or class is not valid
    1597  1: A single arc from a[0] to a[1] with arrow heads at a[4] & a[5].
    1598  2: Two arcs from a[0] to a[1] & from a[2] to a[3].
    1599  Arrowheads are at a[4] & a[5].
    1600  */
    1601  int GetDimensionArcSegments(
    1602  ON_OBSOLETE_V5_RECT gdi_text_rect,
    1603  int gdi_height_of_I,
    1604  ON_Xform gdi_to_world,
    1605  const ON_DimStyle& dimstyle,
    1606  double dimscale,
    1607  const ON_Viewport* vp,
    1608  double a[6],
    1609  bool& bInside
    1610  ) const;
    1611 
    1612 
    1613  /*
    1614  Description:
    1615  Get distance from dimension apex to extension line offset points
    1616  Parameters:
    1617  index - [in] which distance to get
    1618  Returns:
    1619  Distance to offset point [index]
    1620  */
    1621  double DimpointOffset(
    1622  int index) const;
    1623 
    1624  /*
    1625  Description:
    1626  Set distance from dimension apex to extension line offset points
    1627  Parameters:
    1628  index - [in] which distance to set
    1629  offset - [in] Value to set
    1630  */
    1631  void SetDimpointOffset(
    1632  int index,
    1633  double offset);
    1634 };
    1635 
    1636 
    1637 /*
    1638  class ON_OBSOLETE_V5_DimLinear
    1639 
    1640  Description:
    1641  Override od ON_OBSOLETE_V5_Annotation to provide linear dimensions
    1642 */
    1643 class ON_OBSOLETE_V5_DimOrdinate : public ON_OBSOLETE_V5_Annotation
    1644 {
    1645  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_DimOrdinate);
    1646 
    1647 public:
    1648 
    1649  /*
    1650  In the picture below, [n] means ON_OBSOLETE_V5_Annotation::m_points[n].
    1651 
    1652  Measures in X direction
    1653 
    1654  [1]
    1655  |
    1656  |
    1657  |
    1658  |
    1659  |
    1660  [0]
    1661  +
    1662  [plane origin] [plane origin]
    1663  +
    1664 
    1665  or - Measures in Y direction *---[1]
    1666  /
    1667  /
    1668  [0]--------------------[1] [0]---------------*
    1669 
    1670 
    1671  * = calculated, not stored
    1672 
    1673 
    1674  +
    1675  [plane origin]
    1676 
    1677 
    1678  The reference point of for the dimension is at the entity plane origin
    1679  The "x" and "y" coordinates of [1] can be any value.
    1680  The "x" and "y" coordinates of [2] can be any value.
    1681  If Direction is "x", the dimension measures along the "x" axis
    1682  If Direction is "y", the dimension measures along the "y" axis
    1683  If Direction is "x" and [1][x] <> [0][x], an offset segment is drawn
    1684  If Direction is "y" and [1][y] <> [0][y], an offset segment is drawn
    1685  The dimension lines are always drawn in the X or Y directions of the entity plane
    1686  The distance represented by the dimension is measured from the
    1687  plane origin to point [0], parallel to the appropriate axis.
    1688  The points of the offset segment are calculated rather than stored
    1689  */
    1690 
    1691  enum POINT_INDEX
    1692  {
    1693  // Do not change these enum values. They are saved in files as the
    1694  // ON_COMPONENT_INDEX.m_index value.
    1695  //
    1696  // Indices of linear dimension definition points in
    1697  // the m_points[] array
    1698  definition_pt_index = 0, // First end of the dimension line
    1699  leader_end_pt_index = 1, // Other end of the leader (near the text)
    1700  dim_pt_count = 2, // Number of m_points[] in an ordinate dim
    1701 
    1702  // Points calculated from values in m_points[]
    1703  text_pivot_pt = 10000, // Center of dimension text
    1704  offset_pt_0 = 10001, // First offset point (nearest text)
    1705  offset_pt_1 = 10002 // Second offset point
    1706  };
    1707 
    1708  enum DIRECTION
    1709  {
    1710  x = 0, // measures horizontally
    1711  y = 1, // measures vertically
    1712  };
    1713 
    1714  ON_OBSOLETE_V5_DimOrdinate();
    1715  ~ON_OBSOLETE_V5_DimOrdinate();
    1716 
    1717  static ON_OBSOLETE_V5_DimOrdinate* CreateFromV6DimOrdinate(
    1718  const class ON_DimOrdinate& V6_dim_ordinate,
    1719  const class ON_3dmAnnotationContext* annotation_context,
    1720  ON_OBSOLETE_V5_DimOrdinate* destination
    1721  );
    1722 
    1723 
    1724  // overrides virtual ON_Geometry::Transform()
    1725  bool Transform( const ON_Xform& xform ) override;
    1726 
    1727  /*
    1728  Description:
    1729  Get the m_plane coordinates of the dimension point.
    1730  Parameters:
    1731  point_index - [in] One of the POINT_INDEX enum values
    1732  default_offset [in] - kink offset to use if m_kink_offset_0
    1733  or m_kink_offset_1 are ON_UNSET_VALUE
    1734  Returns:
    1735  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1736  array is not valid.
    1737  */
    1738  ON_2dPoint Dim2dPoint(
    1739  int point_index,
    1740  double default_offset = 1.0
    1741  ) const;
    1742 
    1743  /*
    1744  Description:
    1745  Get the m_plane coordinates of the dimension point.
    1746  Parameters:
    1747  point_index - [in] One of the POINT_INDEX enum values
    1748  default_offset [in] - kink offset to use if m_kink_offset_0
    1749  or m_kink_offset_1 are ON_UNSET_VALUE
    1750  Returns:
    1751  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1752  array is not valid.
    1753  */
    1754  ON_3dPoint Dim3dPoint(
    1755  int point_index,
    1756  double default_offset = 1.0
    1757  ) const;
    1758 
    1759  // overrides virual ON_Object::IsValid
    1760  bool IsValid( ON_TextLog* text_log = nullptr ) const override;
    1761 
    1762  // virtual ON_Geometry GetBBox override
    1763  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1764 
    1765  // virtual ON_Geometry GetTightBoundingBox override
    1766  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    1767 
    1768  /*
    1769  Description:
    1770  Read from or write to a file
    1771  Returns:
    1772  @untitled Table
    1773  true Success
    1774  false Failure
    1775  */
    1776  bool Write( ON_BinaryArchive& file ) const override;
    1777  bool Read( ON_BinaryArchive& file ) override;
    1778 
    1779  /*
    1780  Description:
    1781  Overrides virtual ON_OBSOLETE_V5_Annotation::NumericValue();
    1782  Returns:
    1783  If Direction is 'X', x coordinate of point[1]
    1784  If Direction is 'Y', y coordinate of point[1]
    1785  */
    1786  double NumericValue() const override;
    1787 
    1788  /*
    1789  Description:
    1790  Get or set the DimStyle index in the dimstyle table for the dimension
    1791  Parameters:
    1792  [in] int the new index (Set)
    1793  Returns:
    1794  int - The current index (Get)
    1795  */
    1796  int StyleIndex() const;
    1797  void SetStyleIndex( int);
    1798 
    1799  /*
    1800  Description:
    1801  Gets the direction ( X or Y) that the ordinate dimension measures
    1802  based on the relative location of the defining point and leader endpoint
    1803  Returns:
    1804  0: measures parallel to the entity plane x axis
    1805  1: measures parallel to the entity plane y axis
    1806  Remarks:
    1807  This does not consider the dimension's explicit Direction setting
    1808  */
    1809  int ImpliedDirection() const;
    1810 
    1811  /*
    1812  Description:
    1813  Gets or sets the direction ( X or Y) that the ordinate dimension measures
    1814  Returns:
    1815  -1: direction determined by dim point and leader point
    1816  0: measures parallel to the entity plane x axis
    1817  1: measures parallel to the entity plane y axis
    1818  */
    1819  int Direction() const;
    1820  void SetDirection( int direction);
    1821 
    1822  /*
    1823  Description:
    1824  Get the height of the text in this dimension
    1825  by asking the dimension's dimstyle
    1826  Returns:
    1827  double Height of the text
    1828  Remarks:
    1829  Height is in model units
    1830  double Height() const;
    1831  */
    1832 
    1833  /*
    1834  Description:
    1835  static function to provide the default UserText string for the object
    1836  Returns:
    1837  const wchar_t* - the default string to use
    1838  */
    1839  static const wchar_t* DefaultText();
    1840 
    1841  /*
    1842  Description:
    1843  Returns or sets the offset distance parallel to the dimension
    1844  line direction of from the text end of the dimension line to
    1845  the offset point
    1846  If the offset point hasn't been explicitly defined, returns
    1847  ON_UNSET_VALUE and a default should be used to find the point.
    1848  Parameters:
    1849  index [in] - which offset distance to return
    1850  (0 is closer to the text)
    1851  offset [in] - the offset distance to set
    1852  */
    1853  double KinkOffset( int index) const;
    1854  void SetKinkOffset( int index, double offset);
    1855 
    1856 
    1857  int m_direction; // -1 == underermined
    1858  // 0 == x direction
    1859  // 1 == y direction
    1860 
    1861  // kink offsets added 2-4-06 - LW
    1862  double m_kink_offset_0; // from leader_end_point to first break point
    1863  double m_kink_offset_1; // from first break point to second break point
    1864 
    1865  /*
    1866  Description:
    1867  Calculates the 2d point locations of the dimension line kinks
    1868 
    1869  Parameters:
    1870  p0, p1 [in] - End points of the dimension line
    1871  direction [in] - orientation of the dimension
    1872  default_offset [in] - Use this if offsets are ON_UNSET_VALUE
    1873  k0, k1 [out] - The kink points
    1874  Remarks:
    1875  The offsets must be set to the right values before calling this, or
    1876  If they are ON_UNSET_VALUE, they will be set to the defaults
    1877  */
    1878  void CalcKinkPoints( ON_2dPoint p0, ON_2dPoint p1,
    1879  int direction, double default_offset,
    1880  ON_2dPoint& k0, ON_2dPoint& k1) const;
    1881 
    1882 };
    1883 
    1884 
    1885 //////////
    1886 // class ON_OBSOLETE_V5_TextObject
    1887 class ON_OBSOLETE_V5_TextObject : public ON_OBSOLETE_V5_Annotation
    1888 {
    1889  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_TextObject);
    1890 
    1891 public:
    1892  ON_OBSOLETE_V5_TextObject();
    1893  ~ON_OBSOLETE_V5_TextObject();
    1894 
    1895  /*
    1896  Description:
    1897  Create a V6 text object from a V5 text object.
    1898  The function is used when writing V5 files.
    1899  Parameters:
    1900  v6_text_object -[in]
    1901  dimstyle - [in]
    1902  Dimstyle referenced by v6_text_object or nullptr if not available.
    1903  destination - [in]
    1904  If destination is not nullptr, then the V5 text object is constructed
    1905  in destination. If destination is nullptr, then the new V5 text object
    1906  is allocated with a call to new ON_OBSOLETE_V5_TextObject().
    1907  */
    1908  static ON_OBSOLETE_V5_TextObject* CreateFromV6TextObject(
    1909  const class ON_Text& V6_text_object,
    1910  const class ON_3dmAnnotationContext* annotation_context,
    1911  ON_OBSOLETE_V5_TextObject* destination
    1912  );
    1913 
    1914  static ON_OBSOLETE_V5_TextObject* CreateFromV2TextObject(
    1915  const class ON_OBSOLETE_V2_TextObject& V2_text_object,
    1916  const class ON_3dmAnnotationContext* annotation_context,
    1917  ON_OBSOLETE_V5_TextObject* destination
    1918  );
    1919 
    1920  // overrides virual ON_Object::IsValid
    1921  // Text entities with strings that contain no "printable" characters
    1922  // are considered to be NOT valid.
    1923  bool IsValid( ON_TextLog* text_log = nullptr ) const override;
    1924 
    1925  // overrides virual ON_Object::Write
    1926  bool Write(ON_BinaryArchive&) const override;
    1927 
    1928  // overrides virual ON_Object::Read
    1929  bool Read(ON_BinaryArchive&) override;
    1930 
    1931  // overrides virtual ON_Geometry::Transform()
    1932  bool Transform( const ON_Xform& xform ) override;
    1933 
    1934  // virtual ON_Geometry GetBBox override
    1935  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1936 
    1937  // virtual ON_Geometry GetTightBoundingBox override
    1938  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    1939 
    1940  void SetJustification( unsigned int justification) override;
    1941 
    1942  unsigned int Justification() const override;
    1943 
    1944  // Determines whether or not to draw a Text Mask
    1945  bool DrawTextMask() const;
    1946  void SetDrawTextMask(bool bDraw);
    1947 
    1948  // Determines where to get the color to draw a Text Mask
    1949  // 0: Use background color of the viewport. Initially, gradient backgrounds will not be supported
    1950  // 1: Use the ON_Color returned by MaskColor()
    1951  int MaskColorSource() const;
    1952  void SetMaskColorSource(int source);
    1953 
    1954  ON_Color MaskColor() const; // Only works right if MaskColorSource returns 1.
    1955  // Does not return viewport background color
    1956  void SetMaskColor(ON_Color color);
    1957 
    1958  // Offset for the border around text to the rectangle used to draw the mask
    1959  // This number * CRhinoAnnotation::TextHeight() for the text is the offset
    1960  // on each side of the tight rectangle around the text characters to the mask rectangle.
    1961  double MaskOffsetFactor() const;
    1962  void SetMaskOffsetFactor(double offset);
    1963 
    1964  // Scale annotation according to detail scale factor in paperspace
    1965  // or by 1.0 in paperspace and not in a detail
    1966  // Otherwise, dimscale or text scale is used
    1967  bool AnnotativeScaling() const;
    1968  void SetAnnotativeScaling(bool b);
    1969 };
    1970 
    1971 //////////
    1972 // class ON_OBSOLETE_V5_Leader
    1973 class ON_OBSOLETE_V5_Leader : public ON_OBSOLETE_V5_Annotation
    1974 {
    1975  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_Leader);
    1976 
    1977 public:
    1978 
    1979  /*
    1980  The annotation's dimstyle controls the position of TEXT,
    1981  the size of the arrowheads, and the amount the ends of
    1982  linear dimension's extension lines extend beyond the
    1983  dimension lines.
    1984 
    1985  Leaders:
    1986 
    1987  Polyline with N=m_points.Count() points (N >= 2).
    1988 
    1989  [N-2] ----- [N-1] TEXT
    1990  / (tail)
    1991  /
    1992  /
    1993  [1]------[2]
    1994  /
    1995  /
    1996  /
    1997  [0] (arrow)
    1998 
    1999  Leaders ignore the m_userpositionedtext setting. If the
    2000  default leader text handling is not adequate, then use
    2001  a leader with no text and an ON_OBSOLETE_V5_TextObject.
    2002  */
    2003 
    2004  enum POINT_INDEX
    2005  {
    2006  // Do not change these enum values. They are saved in files as the
    2007  // ON_COMPONENT_INDEX.m_index value.
    2008  //
    2009  // Indices of leader definition points in
    2010  // the m_points[] array
    2011  arrow_pt_index = 0, // arrow tip
    2012 
    2013  // Points calculated from values in m_points[]
    2014  text_pivot_pt = 10000, // start/end of dimension text at tail
    2015  tail_pt = 10001
    2016  };
    2017 
    2018  // Constructors
    2019  ON_OBSOLETE_V5_Leader();
    2020  ~ON_OBSOLETE_V5_Leader();
    2021  // C++ automatically provides the correct copy constructor and operator= .
    2022  //ON_OBSOLETE_V5_Leader(const ON_OBSOLETE_V5_Leader&);
    2023  //ON_OBSOLETE_V5_Leader& operator=(const ON_OBSOLETE_V5_Leader&);
    2024 
    2025  /*
    2026  Description:
    2027  Create a V5 leader from a V6 leader.
    2028  The function is used when writing V5 files.
    2029  Parameters:
    2030  v6_leader -[in]
    2031  dimstyle - [in]
    2032  Dimstyle referenced by v6_leader or nullptr if not available.
    2033  destination - [in]
    2034  If destination is not nullptr, then the V5 leader is constructed
    2035  in destination. If destination is nullptr, then the new V5 leader
    2036  is allocated with a call to new ON_V5_Leader().
    2037  */
    2038  static ON_OBSOLETE_V5_Leader* CreateFromV6Leader(
    2039  const class ON_Leader& V6_leader,
    2040  const class ON_3dmAnnotationContext* annotation_context,
    2041  ON_OBSOLETE_V5_Leader* destination
    2042  );
    2043 
    2044 
    2045  static ON_OBSOLETE_V5_Leader* CreateFromV2Leader(
    2046  const class ON_OBSOLETE_V2_Leader& V2_leader,
    2047  const class ON_3dmAnnotationContext* annotation_context,
    2048  ON_OBSOLETE_V5_Leader* destination
    2049  );
    2050 
    2051  // overrides virtual ON_Geometry::Transform()
    2052  bool Transform( const ON_Xform& xform ) override;
    2053 
    2054  /*
    2055  Description:
    2056  Get the m_plane coordinates of the dimension point.
    2057  Parameters:
    2058  point_index - [in] One of the POINT_INDEX enum values
    2059  Returns:
    2060  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    2061  array is not valid.
    2062  */
    2063  ON_2dPoint Dim2dPoint(
    2064  int point_index
    2065  ) const;
    2066 
    2067  /*
    2068  Description:
    2069  Get the m_plane coordinates of the dimension point.
    2070  Parameters:
    2071  point_index - [in] One of the POINT_INDEX enum values
    2072  Returns:
    2073  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    2074  array is not valid.
    2075  */
    2076  ON_3dPoint Dim3dPoint(
    2077  int point_index
    2078  ) const;
    2079 
    2080  // overrides virual ON_Object::IsValid
    2081  bool IsValid( ON_TextLog* text_log = nullptr ) const override;
    2082 
    2083  // overrides virual ON_Object::Write
    2084  bool Write(ON_BinaryArchive&) const override;
    2085 
    2086  // overrides virual ON_Object::Read
    2087  bool Read(ON_BinaryArchive&) override;
    2088 
    2089  // virtual ON_Geometry GetBBox override
    2090  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    2091 
    2092  // virtual ON_Geometry GetTightBoundingBox override
    2093  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    2094 
    2095  /*
    2096  Description:
    2097  Add or delete points to the leader
    2098  Parameters:
    2099  index [in] the point to delete
    2100  point [in] The point to add
    2101  Returns:
    2102  @untitled table
    2103  true Success
    2104  False Failure
    2105  */
    2106  void AddPoint( const ON_2dPoint& point);
    2107  bool RemovePoint( int index = -1);
    2108 
    2109 // April 22, 2010 Lowell - Added to support right justified text on left pointing leader tails rr64292
    2110  bool GetTextDirection( ON_2dVector& text_dir ) const;
    2111  bool GetArrowHeadDirection( ON_2dVector& arrowhead_dir ) const;
    2112  bool GetArrowHeadTip( ON_2dPoint& arrowhead_tip ) const;
    2113 };
    2114 
    2115 #endif
    2116 
    2117 #endif
    unsigned int SizeOf() const override
    -
    Definition: opennurbs_annotationbase.h:23
    -
    virtual bool Transform(const ON_Xform &xform)
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #ifndef OPENNURBS_INTERNAL_V5_ANNOTATION_H_INC
    18 #define OPENNURBS_INTERNAL_V5_ANNOTATION_H_INC
    19 
    20 #if defined(ON_COMPILING_OPENNURBS)
    21 // V5 annotation classes are internal to opennurbs and are used exclusively
    22 // to support reading and writing V5 3dm archives.
    23 
    24 #if defined(ON_OS_WINDOWS_GDI)
    25 #define ON_OBSOLETE_V5_RECT RECT
    26 #else
    27 typedef struct tagON_RECT
    28 {
    29  int left;
    30  int top;
    31  int right;
    32  int bottom;
    33 } ON_OBSOLETE_V5_RECT;
    34 #endif
    35 
    36 class ON_OBSOLETE_V5_AnnotationText : public ON_wString
    37 {
    38 public:
    39  ON_OBSOLETE_V5_AnnotationText();
    40  ~ON_OBSOLETE_V5_AnnotationText();
    41 
    42 
    43  ON_OBSOLETE_V5_AnnotationText& operator=(const char*);
    44  ON_OBSOLETE_V5_AnnotationText& operator=(const wchar_t*);
    45 
    46  void SetText( const char* s );
    47  void SetText( const wchar_t* s );
    48 
    49  // m_rect is a Windows gdi RECT that bounds text
    50  // ("x" increases to the right and "y" increases downwards).
    51  // If all fields are 0, then m_rect is not set.
    52  // If left < right and top < bottom, then the rect bounds
    53  // the text when it is drawn with its font's
    54  // lfHeight=ON_Font::Constants::AnnotationFontCellHeight and (0,0) left baseline
    55  // point of the leftmost character on the first line
    56  // of text. If (x,y) is a point on the drawn text, then
    57  // left <= x < right and top <= y < bottom.
    58  ON_OBSOLETE_V5_RECT m_rect;
    59 };
    60 
    61 // Extension to ON_OBSOLETE_V2_TextObject added 12/10/2009 for Text background drawing
    62 class ON_OBSOLETE_V5_TextExtra : public ON_UserData
    63 {
    64  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_TextExtra);
    65 public:
    66 
    67  ON_OBSOLETE_V5_TextExtra();
    68  ~ON_OBSOLETE_V5_TextExtra();
    69 
    70  static
    71  ON_OBSOLETE_V5_TextExtra* TextExtension(class ON_OBSOLETE_V5_TextObject* pDim, bool bCreate);
    72  static const
    73  ON_OBSOLETE_V5_TextExtra* TextExtension(const class ON_OBSOLETE_V5_TextObject* pDim, bool bCreate);
    74 
    75  void SetDefaults();
    76 
    77  // override virtual ON_Object::Dump function
    78  void Dump( ON_TextLog& text_log ) const override;
    79 
    80  // override virtual ON_Object::Dump function
    81  unsigned int SizeOf() const override;
    82 
    83  // override virtual ON_Object::Write function
    84  bool Write(ON_BinaryArchive& binary_archive) const override;
    85 
    86  // override virtual ON_Object::Read function
    87  bool Read(ON_BinaryArchive& binary_archive) override;
    88 
    89  // override virtual ON_UserData::GetDescription function
    90  bool GetDescription( ON_wString& description ) override;
    91 
    92  // override virtual ON_UserData::Archive function
    93  bool Archive() const override;
    94 
    95  ON_UUID ParentUUID() const;
    96  void SetParentUUID( ON_UUID parent_uuid);
    97 
    98  bool DrawTextMask() const;
    99  void SetDrawTextMask(bool bDraw);
    100 
    101  int MaskColorSource() const;
    102  void SetMaskColorSource(int source);
    103 
    104  ON_Color MaskColor() const; // Only works right if MaskColorSource returns 2.
    105  // Does not return viewport background color
    106  void SetMaskColor(ON_Color color);
    107 
    108  double MaskOffsetFactor() const;
    109  void SetMaskOffsetFactor(double offset);
    110 
    111  ON_UUID m_parent_uuid; // uuid of the text using this extension
    112 
    113  bool m_bDrawMask; // do or don't draw a mask
    114 
    115  int m_color_source; // 0: Use background color from viewport
    116  // 1: Use specific color from m_mask_color
    117 
    118  ON_Color m_mask_color; // Color to use for mask if m_color_source is 2
    119 
    120  double m_border_offset; // Offset for the border around text to the rectangle used to draw the mask
    121  // This number * HeightOfI for the text is the offset on each side of the
    122  // tight rectangle around the text characters to the mask rectangle.
    123 };
    124 
    125 
    126 class ON_OBSOLETE_V5_DimExtra : public ON_UserData
    127 {
    128  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_DimExtra);
    129 public:
    130 
    131  ON_OBSOLETE_V5_DimExtra();
    132  ~ON_OBSOLETE_V5_DimExtra();
    133 
    134  static
    135  ON_OBSOLETE_V5_DimExtra* DimensionExtension(class ON_OBSOLETE_V5_DimLinear* pDim, bool bCreate);
    136  static const
    137  ON_OBSOLETE_V5_DimExtra* DimensionExtension(const class ON_OBSOLETE_V5_DimLinear* pDim, bool bCreate);
    138  static
    139  ON_OBSOLETE_V5_DimExtra* DimensionExtension(class ON_OBSOLETE_V5_DimRadial* pDim, bool bCreate);
    140  static const
    141  ON_OBSOLETE_V5_DimExtra* DimensionExtension(const class ON_OBSOLETE_V5_DimRadial* pDim, bool bCreate);
    142  static
    143  ON_OBSOLETE_V5_DimExtra* DimensionExtension(class ON_OBSOLETE_V5_DimOrdinate* pDim, bool bCreate);
    144  static const
    145  ON_OBSOLETE_V5_DimExtra* DimensionExtension(const class ON_OBSOLETE_V5_DimOrdinate* pDim, bool bCreate);
    146 
    147  void SetDefaults();
    148 
    149  // override virtual ON_Object::Dump function
    150  void Dump( ON_TextLog& text_log ) const override;
    151 
    152  // override virtual ON_Object::Dump function
    153  unsigned int SizeOf() const override;
    154 
    155  // override virtual ON_Object::Write function
    156  bool Write(ON_BinaryArchive& binary_archive) const override;
    157 
    158  // override virtual ON_Object::Read function
    159  bool Read(ON_BinaryArchive& binary_archive) override;
    160 
    161  // override virtual ON_UserData::GetDescription function
    162  bool GetDescription( ON_wString& description ) override;
    163 
    164  // override virtual ON_UserData::Archive function
    165  bool Archive() const override;
    166 
    167  ON_UUID ParentUUID() const;
    168  void SetParentUUID( ON_UUID parent_uuid);
    169 
    170  // 0: default position
    171  // 1: force inside
    172  // -1: force outside
    173  int ArrowPosition() const;
    174  void SetArrowPosition( int position);
    175 
    176  // For a dimension in page space that measures between points in model space
    177  // of a detail view, this is the ratio of the page distance / model distance.
    178  // When the dimension text is displayed, the distance measured in model space
    179  // is multiplied by this number to get the value to display.
    180  double DistanceScale() const;
    181  void SetDistanceScale(double s);
    182 
    183  // Basepont in modelspace coordinates for ordinate dimensions
    184  void SetModelSpaceBasePoint(ON_3dPoint basepoint);
    185  ON_3dPoint ModelSpaceBasePoint() const;
    186 
    187  // If this dimension measures objects in the model space of a detail view
    188  // this is the detail view, otherwise, nil_uuid
    189  ON_UUID DetailMeasured() const;
    190  void SetDetailMeasured(ON_UUID detail_id);
    191 
    192  //const wchar_t* ToleranceUpperString() const;
    193  //ON_wString& ToleranceUpperString();
    194  //void SetToleranceUpperString( const wchar_t* upper_string);
    195  //void SetToleranceUpperString( ON_wString& upper_string);
    196 
    197  //const wchar_t* ToleranceLowerString() const;
    198  //ON_wString& ToleranceLowerString();
    199  //void SetToleranceLowerString( const wchar_t* lower_string);
    200  //void SetToleranceLowerString( ON_wString& lower_string);
    201 
    202  //const wchar_t* AlternateString() const;
    203  //ON_wString& AlternateString();
    204  //void SetAlternateString( const wchar_t* alt_string);
    205  //void SetAlternateString( ON_wString& alt_string);
    206 
    207  //const wchar_t* AlternateToleranceUpperString() const;
    208  //ON_wString& AlternateToleranceUpperString();
    209  //void SetAlternateToleranceUpperString( const wchar_t* upper_string);
    210  //void SetAlternateToleranceUpperString( ON_wString& upper_string);
    211 
    212  //const wchar_t* AlternateToleranceLowerString() const;
    213  //ON_wString& AlternateToleranceLowerString();
    214  //void SetAlternateToleranceLowerString( const wchar_t* lower_string);
    215  //void SetAlternateToleranceLowerString( ON_wString& lower_string);
    216 
    217  ON_UUID m_partent_uuid; // the dimension using this extension
    218 
    219  int m_arrow_position;
    220 
    221  // This is either nullptr or an array of GDI rects for the substrings
    222  // that make up the dimension string.
    223  // If the dimension text is all on the same line, there is just one
    224  // rectangle needed to bound the text and that is the same as the
    225  // m_rect on the ON_OBSOLETE_V5_AnnotationText.
    226  // If the dimension has tolerances or for some other reason has more
    227  // than one line of text, m_text_rects is an array of 7 rects, one
    228  // each for the substrings that might be needed to display the dimension.
    229  // If some of the rects aren't used, they are empty at 0,0
    230  // The strings that correspond to these rectangles are generated from
    231  // info in the dimstyle
    232  ON_OBSOLETE_V5_RECT* m_text_rects;
    233 
    234  double m_distance_scale;
    235  ON_3dPoint m_modelspace_basepoint;
    236 
    237  // If this dimension measures objects in the model space of a detail view
    238  // this is the detail view
    239  // 27 Aug, 2014, v6
    240  ON_UUID m_detail_measured;
    241 };
    242 
    243 
    244 /*
    245  class ON_OBSOLETE_V5_Annotation
    246 
    247  Description:
    248  Used to serialize definitions of annotation objects (dimensions, text, leaders, etc.).
    249  Virtual base class for annotation objects
    250  Replaces ON_OBSOLETE_V2_Annotation
    251 */
    252 class ON_OBSOLETE_V5_Annotation : public ON_Geometry
    253 {
    254  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_Annotation);
    255 
    256 protected:
    257  ON_OBSOLETE_V5_Annotation();
    258  ON_OBSOLETE_V5_Annotation(const ON_OBSOLETE_V5_Annotation&) = default;
    259  ON_OBSOLETE_V5_Annotation& operator=(const ON_OBSOLETE_V5_Annotation&) = default;
    260 
    261 public:
    262  virtual ~ON_OBSOLETE_V5_Annotation();
    263 
    264 protected:
    265  void Internal_InitializeFromV2Annotation(
    266  const class ON_OBSOLETE_V2_Annotation& V2_annotation,
    267  const class ON_3dmAnnotationContext* annotation_context
    268  );
    269 
    270 public:
    271  static ON_OBSOLETE_V5_Annotation* CreateFromV2Annotation(
    272  const class ON_OBSOLETE_V2_Annotation& V2_annotation,
    273  const class ON_3dmAnnotationContext* annotation_context
    274  );
    275 
    276 public:
    277  static ON_OBSOLETE_V5_Annotation* CreateFromV6Annotation(
    278  const class ON_Annotation& V6_annotation,
    279  const class ON_3dmAnnotationContext* annotation_context
    280  );
    281 
    282 protected:
    283  ////void Internal_SetDimStyleFromV6Annotation(
    284  //// const class ON_Annotation& V6_annotation,
    285  //// const class ON_3dmAnnotationContext* annotation_context
    286  ////);
    287 
    288 public:
    289 
    290  // Description:
    291  // Sets initial defaults
    292  void Create();
    293 
    294  void Destroy();
    295 
    296  void EmergencyDestroy();
    297 
    298  /////////////////////////////////////////////////////////////////
    299  //
    300  // ON_Object overrides
    301  //
    302 
    303  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    304 
    305 
    306  /*
    307  Description: Writes the object to a file
    308 
    309  Returns:
    310  @untitled Table
    311  true Success
    312  false Failure
    313  */
    314  bool Write(
    316  ) const override;
    317 
    318  /*
    319  Description: Reads the object from a file
    320 
    321  Returns:
    322  @untitled Table
    323  true Success
    324  false Failure
    325  */
    326  bool Read(
    328  ) override;
    329 
    330  /*
    331  Returns: The Object Type of this object
    332  */
    333  ON::object_type ObjectType() const override;
    334 
    335  /////////////////////////////////////////////////////////////////
    336  //
    337  // ON_Geometry overrides
    338  //
    339 
    340  /*
    341  Returns the geometric dimension of the object ( usually 3)
    342  */
    343  int Dimension() const override;
    344 
    345  // overrides virtual ON_Geometry::Transform()
    346  bool Transform( const ON_Xform& xform ) override;
    347 
    348  // virtual ON_Geometry override
    349  bool EvaluatePoint( const class ON_ObjRef& objref, ON_3dPoint& P ) const override;
    350 
    351  /////////////////////////////////////////////////////////////////
    352  //
    353  // ON_OBSOLETE_V5_Annotation interface
    354  //
    355 
    356  // Definitions of text justification
    357  // Not implemented on all annotation objects
    358  enum eTextJustification
    359  {
    360  tjUndefined = 0,
    361  tjLeft = 1<<0,
    362  tjCenter = 1<<1,
    363  tjRight = 1<<2,
    364  tjBottom = 1<<16,
    365  tjMiddle = 1<<17,
    366  tjTop = 1<<18,
    367  tjBottomLeft = tjBottom | tjLeft,
    368  tjBottomCenter = tjBottom | tjCenter,
    369  tjBottomRight = tjBottom | tjRight,
    370  tjMiddleLeft = tjMiddle | tjLeft,
    371  tjMiddleCenter = tjMiddle | tjCenter,
    372  tjMiddleRight = tjMiddle | tjRight,
    373  tjTopLeft = tjTop | tjLeft,
    374  tjTopCenter = tjTop | tjCenter,
    375  tjTopRight = tjTop | tjRight,
    376  };
    377 
    378  /*
    379  Description:
    380  Query if the annotation object is a text object
    381  Parameters:
    382  none
    383  Returns:
    384  @untitled table
    385  true It is text
    386  false Its not text
    387  */
    388  bool IsText() const;
    389 
    390  /*
    391  Description:
    392  Query if the annotation object is a leader
    393  Parameters:
    394  none
    395  Returns:
    396  @untitled table
    397  true It is a leader
    398  false Its not a leader
    399  */
    400  bool IsLeader() const;
    401 
    402  /*
    403  Description:
    404  Query if the annotation object is a dimension
    405  Parameters:
    406  none
    407  Returns:
    408  @untitled table
    409  true It is a dimension
    410  false Its not a dimension
    411  */
    412  bool IsDimension() const;
    413 
    414 public:
    415  int V5_3dmArchiveDimStyleIndex() const;
    416 
    417  /*
    418  Description:
    419  If IsText() is false, the dimension style is set.
    420  */
    421  void SetV5_3dmArchiveDimStyleIndex(
    422  int V5_dim_style_index
    423  );
    424 
    425  ////ON_UUID V6_DimStyleId() const;
    426 
    427 
    428 
    429  /////*
    430  ////Description:
    431  //// If IsText() is false, the dimension style is set.
    432  ////*/
    433  ////void SetV6_DimStyleId(
    434  //// ON_UUID dim_style_id,
    435  //// int V5_dim_style_index
    436  //// );
    437 
    438  ////const ON_DimStyle* V6_DimStyleOverride() const;
    439 
    440  /////*
    441  ////Description:
    442  //// If IsText() is false, the dimension style is set.
    443  ////*/
    444  ////void SetV6_DimStyleOverride(
    445  //// const ON_DimStyle* dim_style_override,
    446  //// int V5_dim_style_index
    447  //// );
    448 
    449 public:
    450 
    451  /*
    452  Returns:
    453  Dimension type
    454  Linear dim: distance between arrow tips
    455  Radial dim: radius or diameter depending on m_type value
    456  Angular dim: angle in degrees
    457  Leader: ON_UNSET_VALUE
    458  Text: ON_UNSET_VALUE
    459  */
    460  virtual
    461  double NumericValue() const;
    462 
    463  /*
    464  Description:
    465  Set or Get the height of the text in this annotation
    466  Parameters:
    467  [in] double new text height to set
    468  Returns:
    469  double Height of the text
    470  Remarks:
    471  Height is in model units
    472  */
    473  void SetHeight( double);
    474  double Height() const;
    475 
    476  /*
    477  Description:
    478  Sets or gets the object type member to a specific annotation type:
    479  dtDimLinear, dtDimAligned, dtDimAngular, etc.
    480  Parameters:
    481  [in] ON_INTERNAL_OBSOLETE::V5_eAnnotationType type - dtDimLinear, dtDimAligned, dtDimAngular, etc.
    482  Returns:
    483  ON_INTERNAL_OBSOLETE::V5_eAnnotationType of the object
    484  */
    485  void SetType( ON_INTERNAL_OBSOLETE::V5_eAnnotationType);
    486  ON_INTERNAL_OBSOLETE::V5_eAnnotationType Type() const;
    487 
    488  /*
    489  Description:
    490  Set or get the plane for the object's ECS
    491  Parameters:
    492  [in] ON_Plane& plane in WCS
    493  Returns:
    494  const ON_Plane& - the object's ECS plane in WCS coords
    495  */
    496  void SetPlane( const ON_Plane&);
    497  const ON_Plane& Plane() const;
    498 
    499  /*
    500  Description:
    501  Returns the number of definition points this object has
    502  Parameters:
    503  none
    504  Returns:
    505  @untitled table
    506  int the object's point count
    507  */
    508  int PointCount() const;
    509  void SetPointCount( int count);
    510 
    511  /*
    512  Description:
    513  Set or get the object's whole points array at once
    514  Parameters:
    515  [in] ON_2dPointArray& pts
    516  Returns:
    517  const ON_2dPointArray& - ref to the object's point array
    518  */
    519  void SetPoints( const ON_2dPointArray&);
    520  const ON_2dPointArray& Points() const;
    521 
    522  /*
    523  Description:
    524  Set individual definition points for the annotation
    525  Parameters:
    526  @untitled table
    527  [in] int index index of the point to set in ECS 2d coordinates
    528  [in] const ON_2dPoint& pt the new point value
    529  Returns:
    530  ON_2dPoint the point coordinates in ECS
    531  */
    532  void SetPoint( int, const ON_2dPoint&);
    533  ON_2dPoint Point( int) const;
    534 
    535  /*
    536  Description:
    537 
    538  Set or get the string value of the user text, with no substitution for "<>"
    539  Parameters:
    540  [in] const wchar_t* string the new value for UserText
    541  Returns:
    542  const ON_wString& The object's UserText
    543  Remarks:
    544  UserText is the string that gets printed when the dimensoin is drawn.
    545  If it contains the token "<>", that token is replaced with the measured
    546  value for the dimension, formatted according to the DimStyle settings.
    547  "<>" is the default for linear dimensions.
    548  Other dimensions include "<>" in their default string
    549  */
    550 
    551  ON_DEPRECATED_MSG("use SetTextValue function")
    552  void SetUserText( const wchar_t* text_value );
    553 
    554  ON_DEPRECATED_MSG("use TextValue function")
    555  const ON_wString& UserText() const;
    556 
    557 
    558  /*
    559  Description:
    560  Gets the value of the annotation text.
    561  Returns:
    562  Value of the annotation text.
    563  See Also:
    564  ON_OBSOLETE_V5_AnnotationText::SetTextValue()
    565  ON_OBSOLETE_V5_AnnotationText::SetTextFormula()
    566  ON_OBSOLETE_V5_AnnotationText::TextFormula()
    567  Remarks:
    568  This gets the literal value of the text, there is no
    569  substitution for any "<>" substrings. When a dimension
    570  is drawn, any occurance of "<>" will be replaced
    571  with the measured value for the dimension and formatted
    572  according to the DimStyle settings.
    573 
    574  Annotation text values can be constant or the result
    575  of evaluating text formula containing %<...>%
    576  expressions. The ...TextValue() functions set
    577  and get the text's value. The ...TextFormula()
    578  functions get and set the text's formula.
    579  */
    580  const wchar_t* TextValue() const;
    581 
    582  /*
    583  Description:
    584  Sets the value of the annotation text. No changes
    585  are made to the text_value string.
    586  Parameters:
    587  text_value - [in]
    588  Returns:
    589  Value of the annotation text.
    590  See Also:
    591  ON_OBSOLETE_V5_AnnotationText::SetTextFormula()
    592  ON_OBSOLETE_V5_AnnotationText::TextValue()
    593  ON_OBSOLETE_V5_AnnotationText::TextFormula()
    594  Remarks:
    595  Annotation text values can be constant or the result
    596  of evaluating text formula containing %<...>%
    597  expressions. The ...TextValue() functions set
    598  and get the text's value. The ...TextFormula()
    599  functions get and set the text's formula.
    600  */
    601  void SetTextValue( const wchar_t* text_value );
    602 
    603  /*
    604  Description:
    605  Gets the formula for the annotation text.
    606  Parameters:
    607  text_value - [in]
    608  Returns:
    609  Value of the annotation text.
    610  See Also:
    611  ON_OBSOLETE_V5_AnnotationText::SetTextValue()
    612  ON_OBSOLETE_V5_AnnotationText::TextValue()
    613  ON_OBSOLETE_V5_AnnotationText::TextFormula()
    614  Remarks:
    615  Annotation text values can be constant or the result
    616  of evaluating text formula containing %<...>%
    617  expressions. The ...TextValue() functions set
    618  and get the text's value. The ...TextFormula()
    619  functions get and set the text's formula.
    620  */
    621  const wchar_t* TextFormula() const;
    622 
    623  /*
    624  Description:
    625  Sets the formula for the annotation text.
    626  Parameters:
    627  text_value - [in]
    628  Returns:
    629  Value of the annotation text.
    630  See Also:
    631  ON_OBSOLETE_V5_AnnotationText::SetTextValue()
    632  ON_OBSOLETE_V5_AnnotationText::Value()
    633  ON_OBSOLETE_V5_AnnotationText::Formula()
    634  Remarks:
    635  Annotation text values can be constant or the result
    636  of evaluating text formula containing %<...>%
    637  expressions. The ...TextValue() functions set
    638  and get the text's value. The ...TextFormula()
    639  functions get and set the text's formula.
    640  */
    641  void SetTextFormula( const wchar_t* s );
    642 
    643  /*
    644  Description:
    645  Set or get a flag indication that the dimension text has been moved
    646  from the default location.
    647  Parameters:
    648  bUserPositionedText - [in]
    649  true to indicate that the text has been placed by the user.
    650  false to indicate that it hasn't
    651  Returns:
    652  @untitled table
    653  true The text has been moved
    654  false The text is in the default location
    655  Remarks:
    656  If the text is in the default location, it should be repositioned
    657  automatically when the dimension is adjusted.
    658  If it has been moved, it should not be automatically positioned.
    659  */
    660  void SetUserPositionedText( int bUserPositionedText );
    661  bool UserPositionedText() const;
    662 
    663  /*
    664  Description:
    665  Set or get the text display mode for the annotation
    666  Parameters:
    667  [in] ON::eTextDisplayMode mode - new mode to set
    668  Returns:
    669  ON::eTextDisplayMode - current mode
    670  Remarks:
    671  This is the way the text is oriented with respect to the dimension line or screen:
    672  Above line, In LIne, Horizontal
    673  */
    674  void SetTextDisplayMode( ON_INTERNAL_OBSOLETE::V5_TextDisplayMode);
    675  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode TextDisplayMode() const;
    676 
    677 
    678  /*
    679  Description:
    680  Gets a transform matrix to change from the object's 2d ECS to 3d WCS
    681  Parameters:
    682  [out] xform set to produce the ECS to WCS transform
    683  Returns:
    684  @untitled table
    685  true Success
    686  false Failure
    687  */
    688  bool GetECStoWCSXform( ON_Xform&) const;
    689 
    690  /*
    691  Description:
    692  Gets a transform matrix to change from to 3d WCS to the object's 2d ECS
    693  Parameters:
    694  [out] xform - set to produce the WCS to ECS transform
    695  Returns:
    696  @untitled table
    697  true Success
    698  false Failure
    699  */
    700  bool GetWCStoECSXform( ON_Xform& xform) const;
    701 
    702  /*
    703  Description:
    704  Set the object's point array to a specified length
    705  Parameters:
    706  [in] length - the new size of the array
    707  Returns:
    708  void
    709  */
    710  void ReservePoints( int);
    711 
    712 
    713  /*
    714  Description:
    715  static function to provide the default UserText string for the object
    716  Returns:
    717  const wchar_t* - the default string to use
    718  */
    719  static const wchar_t* DefaultText();
    720 
    721  /*
    722  Description:
    723  Set or Get the text justification
    724  Parameters:
    725  justification [in] See enum eJustification for meanings
    726  Returns:
    727  The justification for the text in this object
    728  Comments:
    729  This is not implemented on all annotation objects.
    730  The default SetJustification() does nothing
    731  The default Justification() always returns 0
    732 
    733  */
    734  virtual
    735  void SetJustification( unsigned int justification);
    736 
    737  virtual unsigned int Justification() const;
    738 
    739  /*
    740  Description:
    741  Get the transformation that maps the annotation's
    742  text to world coordinates.
    743  Added Oct 30, 07 LW
    744  Parameters:
    745  gdi_text_rect - [in]
    746  Windows gdi rect of text when it is drawn with
    747  LOGFONT lfHeight = ON_Font::Constants::AnnotationFontCellHeight.
    748  gdi_height_of_I - [in]
    749  Value returned by ON_Font::HeightOfI().
    750  dimstyle_textheight - [in]
    751  Height of text in world units. If the annotation is
    752  an ON_OBSOLETE_V5_TextObject, this is the m_textheight value.
    753  If the annotation is not an ON_OBSOLETE_V5_TextObject, pass in
    754  the value returned by the dimension style's
    755  ON_DimStyle::TextHeight()
    756  dimstyle_textgap - [in]
    757  The value of the annotation's dimension style's
    758  ON_DimStyle::TextGap().
    759  dimstyle_textalignment - [in]
    760  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode(ON_DimStyle::TextAlignment()).
    761  dimscale - [in]
    762  Global dimension scaling value. If you are using the
    763  Rhino SDK, this value is returned by
    764  CRhinoDoc::Properties().AnnotationSettings().DimScale().
    765  If you are using the OpenNURBS IO toolkit, this value
    766  is on ON_3dmSettings::m_AnnotationSettings.m_dimscale.
    767  cameraX - [in]
    768  zero or the view's unit camera right vector
    769  cameraY - [in]
    770  zero or the view's unit camera up vector
    771  model_xform - [in] transforms the text's parent entity
    772  to world coordinates in case its instance geometry
    773  nullptr == Identity
    774  text_xform - [out]
    775  Returns:
    776  True if text_xform is set.
    777  */
    778  bool GetTextXform(
    779  ON_OBSOLETE_V5_RECT gdi_text_rect,
    780  int gdi_height_of_I,
    781  double dimstyle_textheight,
    782  double dimstyle_textgap,
    783  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode dimstyle_textalignment,
    784  double dimscale,
    785  ON_3dVector cameraX,
    786  ON_3dVector cameraY,
    787  const ON_Xform* model_xform,
    788  ON_Xform& text_xform // output
    789  ) const;
    790 
    791  /*
    792  Description:
    793 
    794  This function has been replaced with a version that
    795  takes a model transform to transform block instance
    796  geometry to world coordinates Oct 30, 07 LW
    797 
    798  Get the transformation that maps the annotation's
    799  text to world coordinates.
    800  Parameters:
    801  gdi_text_rect - [in]
    802  Windows gdi rect of text when it is drawn with
    803  LOGFONT lfHeight = ON_Font::Constants::AnnotationFontCellHeight.
    804  gdi_height_of_I - [in]
    805  Value returned by ON_Font::HeightOfI().
    806  dimstyle_textheight - [in]
    807  Height of text in world units. If the annotation is
    808  an ON_OBSOLETE_V5_TextObject, this is the m_textheight value.
    809  If the annotation is not an ON_OBSOLETE_V5_TextObject, pass in
    810  the value returned by the dimension style's
    811  ON_DimStyle::TextHeight()
    812  dimstyle_textgap - [in]
    813  The value of the annotation's dimension style's
    814  ON_DimStyle::TextGap().
    815  dimstyle_textalignment - [in]
    816  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode(ON_DimStyle::TextAlignment()).
    817  dimscale - [in]
    818  Global dimension scaling value. If you are using the
    819  Rhino SDK, this value is returned by
    820  CRhinoDoc::Properties().AnnotationSettings().DimScale().
    821  If you are using the OpenNURBS IO toolkit, this value
    822  is on ON_3dmSettings::m_AnnotationSettings.m_dimscale.
    823  cameraX - [in]
    824  zero or the view's unit camera right vector
    825  cameraY - [in]
    826  zero or the view's unit camera up vector
    827  xform - [out]
    828  Returns:
    829  True if xform is set.
    830  */
    831  bool GetTextXform(
    832  ON_OBSOLETE_V5_RECT gdi_text_rect,
    833  int gdi_height_of_I,
    834  double dimstyle_textheight,
    835  double dimstyle_textgap,
    836  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode dimstyle_textalignment,
    837  double dimscale,
    838  ON_3dVector cameraX,
    839  ON_3dVector cameraY,
    840  ON_Xform& xform
    841  ) const;
    842 
    843  /*
    844  Description:
    845  Get the transformation that maps the annotation's
    846  text to world coordinates.
    847  Oct 30, 07 LW
    848  Parameters:
    849  gdi_text_rect - [in]
    850  Windows gdi rect of text when it is drawn with
    851  LOGFONT lfHeight = ON_Font::Constants::AnnotationFontCellHeight.
    852  font - [in]
    853  dimstyle - [in]
    854  dimscale - [in]
    855  Global dimension scaling value. If you are using the
    856  Rhino SDK, this value is returned by
    857  CRhinoDoc::Properties().AnnotationSettings().DimScale().
    858  If you are using the OpenNURBS IO toolkit, this value
    859  is on ON_3dmSettings::m_AnnotationSettings.m_dimscale.
    860  vp - [in]
    861  model_xform - [in] transforms the text's parent entity
    862  to world coordinates in case its instance geometry
    863  nullptr == Identity
    864  text_xform - [out]
    865  Returns:
    866  True if text_xform is set.
    867  */
    868  bool GetTextXform(
    869  const ON_OBSOLETE_V5_RECT gdi_text_rect,
    870  const ON_Font& font,
    871  const ON_DimStyle* dimstyle,
    872  double dimscale,
    873  const ON_Viewport* vp,
    874  const ON_Xform* model_xform,
    875  ON_Xform& text_xform // output
    876  ) const;
    877 
    878  /*
    879  Description:
    880  Get the annotation plane coordinates (ECS) of the point
    881  that is used to position the text. The relative position
    882  of the text to this points depends on the type of
    883  annotation, the dimstyle's text alignment flag, and the
    884  view projection.
    885  This point is not the same as the base point of the text.
    886  Parameters:
    887  text_point - [out];
    888  Returns:
    889  True if text_point is set.
    890  */
    891  bool GetTextPoint( ON_2dPoint& text_2d_point ) const;
    892 
    893  // enum for tyoe of annotation DimLinear, DimRadius, etc.
    894  ON_INTERNAL_OBSOLETE::V5_eAnnotationType m_type;
    895 
    896  // m_textdisplaymode controls the orientation
    897  // of the text.
    898  // If m_textdisplaymode = dtHorizontal, then
    899  // the text is always horizontal and in the
    900  // view plane. Otherwise it lies in m_plane.
    901  ON_INTERNAL_OBSOLETE::V5_TextDisplayMode m_textdisplaymode;
    902 
    903  // m_plane is the plane containing the annotation.
    904  // All parts of the annotation that are not
    905  // text lie in this plane. If
    906  // m_textdisplaymode != dtHorizontal, then
    907  // the text lies in the plane too.
    908  // (ECS reference plane in WCS coordinates.)
    909  ON_Plane m_plane;
    910 
    911  // Definition points for the dimension.
    912  // These are 2d coordinates in m_plane.
    913  // The location of these points depends on the
    914  // type of annotation class. There is a comment
    915  // at the start of the definions for
    916  // ON_OBSOLETE_V5_DimLinear, ON_OBSOLETE_V5_DimRadial,
    917  // ON_OBSOLETE_V5_DimAngular, ON_OBSOLETE_V5_TextObject, and
    918  // ON_OBSOLETE_V5_Leader that explains how the points are used.
    919  ON_2dPointArray m_points;
    920 
    921  // With the addition of tolerances and therefore multi-line
    922  // text, the ON_wString in m_usertext will hold multiple
    923  // strings with NULLs between them.
    924  // The strings will be in this order:
    925  // Result of expanding "<>", or user override
    926  // Alternate dimension
    927  // Tolerance upper
    928  // Tolerance lower
    929  // Alt tolerance upper
    930  // Alt tolerance lower
    931  // Prefix
    932  // Suffix
    933  // Alt prefix
    934  // Alt suffix
    935  //
    936  ON_OBSOLETE_V5_AnnotationText m_usertext;
    937 
    938  // true: User has positioned text
    939  // false: use default location
    940  bool m_userpositionedtext;
    941  // Added 13 Aug, 2010 - Lowell
    942  // This determines whether the object will be scaled according to detail
    943  // scale factor or by 1.0 in paperspace rather than by
    944  // dimscale or text scale.
    945  // For the first try this will only be used on text and its
    946  // here on the base class because it would fit and in case
    947  // its needed later on dimensions.
    948  bool m_annotative_scale;
    949 private:
    950  bool m_reserved_b1;
    951  bool m_reserved_b2;
    952 public:
    953 
    954 private:
    955  // At this point, the ON_OBSOLETE_V5_Annotation and derived classes
    956  // exists for a single purpose - to support reading and writing
    957  // V5 (4,3,2) 3dm archives.
    958  // In V5 archives all dimension styles, including per opbject overrrides
    959  // were in the archive dimstyle table. In V6 and later, override dimstyles
    960  // are managed by the object that uses them.
    961  //
    962  // This class used to have a single dimstyle table index.
    963  // That index has been removed and replaced with the following
    964  // information that is parallel to the information on ON_Annotation.
    965 
    966  // Dimstyle index to use when writing a V5 archive.
    967  int m_v5_3dm_archive_dimstyle_index = ON_UNSET_INT_INDEX;
    968 
    969 public:
    970  // Text height in model units
    971  // This is used by text, but not by dimensions
    972  // Dimensions get their height from dimension styles
    973  double m_textheight;
    974 
    975  // Left, Center, Right / Bottom, Middle, Top text justification
    976  // See eTextJustification above
    977  unsigned int m_justification;
    978 };
    979 
    980 
    981 // Subclass of ON_OBSOLETE_V5_Annotation to provide linear dimensions
    982 class ON_OBSOLETE_V5_DimLinear : public ON_OBSOLETE_V5_Annotation
    983 {
    984  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_DimLinear);
    985 
    986 public:
    987 
    988  /*
    989  The annotation's dimstyle controls the position of TEXT,
    990  the size of the arrowheads, and the amount the ends of
    991  linear dimension's extension lines extend beyond the
    992  dimension lines.
    993 
    994  In the picture below, [n] means ON_OBSOLETE_V5_Annotation::m_points[n].
    995 
    996  [2]
    997  |
    998  | |
    999  [1]-------------------------------------------[3]
    1000  | |
    1001  | TEXT
    1002  | [4]
    1003  [0]
    1004 
    1005  The "x" and "y" coordinates of [0] must be (0.0, 0.0).
    1006 
    1007  The "x" coordinate of [1] = "x" of [0]
    1008  The "y" coordinate of [1] can be any value.
    1009 
    1010  The "x" and "y" coordinates of [2] can be any value.
    1011 
    1012  The "x" coordinate of [3] = "x" coordinate of [2].
    1013  The "y" coordinate of [3] = "y" coordinate of [1].
    1014  */
    1015 
    1016  enum POINT_INDEX
    1017  {
    1018  // Do not change these enum values. They are saved in files as the
    1019  // ON_COMPONENT_INDEX.m_index value.
    1020  //
    1021  // Indices of linear dimension definition points in
    1022  // the m_points[] array
    1023  ext0_pt_index = 0, // end of first extension line
    1024  arrow0_pt_index = 1, // arrowhead tip on first extension line
    1025  ext1_pt_index = 2, // end of second extension line
    1026  arrow1_pt_index = 3, // arrowhead tip on second extension line
    1027  userpositionedtext_pt_index = 4,
    1028  dim_pt_count = 5, // number of m_points[] in an angular dim
    1029 
    1030  // Points calculated from values in m_points[]
    1031  text_pivot_pt = 10000, // center of dimension text
    1032  dim_mid_pt = 10001 // midpoint of dimension line
    1033  };
    1034 
    1035 public:
    1036  ON_OBSOLETE_V5_DimLinear();
    1037  ~ON_OBSOLETE_V5_DimLinear();
    1038  ON_OBSOLETE_V5_DimLinear( const ON_OBSOLETE_V5_DimLinear& ) = default;
    1039  ON_OBSOLETE_V5_DimLinear& operator=(const ON_OBSOLETE_V5_DimLinear&) = default;
    1040 
    1041  /*
    1042  Description:
    1043  Create a V5 linear dimension from a V6 linear dimension.
    1044  The function is used when writing V5 files.
    1045  Parameters:
    1046  V6_dim_linear -[in]
    1047  annotation_context - [in]
    1048  Dimstyle and other informtion referenced by V6_dim_linear or nullptr if not available.
    1049  destination - [in]
    1050  If destination is not nullptr, then the V5 linear dimension is constructed
    1051  in destination. If destination is nullptr, then the new V5 linear dimension
    1052  is allocated with a call to new ON_OBSOLETE_V5_DimLinear().
    1053  */
    1054  static ON_OBSOLETE_V5_DimLinear* CreateFromV6DimLinear(
    1055  const class ON_DimLinear& V6_dim_linear,
    1056  const class ON_3dmAnnotationContext* annotation_context,
    1057  ON_OBSOLETE_V5_DimLinear* destination
    1058  );
    1059 
    1060  static ON_OBSOLETE_V5_DimLinear* CreateFromV2LinearDimension(
    1061  const class ON_OBSOLETE_V2_DimLinear& V2_linear_dimension,
    1062  const class ON_3dmAnnotationContext* annotation_context,
    1063  ON_OBSOLETE_V5_DimLinear* destination
    1064  );
    1065 
    1066  // overrides virtual ON_Geometry::Transform()
    1067  bool Transform( const ON_Xform& xform ) override;
    1068 
    1069  /*
    1070  Description:
    1071  Checks the linear dimension and repairs any point locations or flags
    1072  that are not set correctly.
    1073  Returns:
    1074  0: linear dimension is damaged beyond repair
    1075  1: linear dimension was perfect and nothing needed to be repaired.
    1076  2: linear dimension had flaws that were repaired.
    1077  */
    1078  int Repair();
    1079 
    1080  /*
    1081  Description:
    1082  Get the m_plane coordinates of the dimension point.
    1083  Parameters:
    1084  point_index - [in] One of the POINT_INDEX enum values
    1085  Returns:
    1086  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1087  array is not valid.
    1088  */
    1089  ON_2dPoint Dim2dPoint(
    1090  int point_index
    1091  ) const;
    1092 
    1093  /*
    1094  Description:
    1095  Get the m_plane coordinates of the dimension point.
    1096  Parameters:
    1097  point_index - [in] One of the POINT_INDEX enum values
    1098  Returns:
    1099  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1100  array is not valid.
    1101  */
    1102  ON_3dPoint Dim3dPoint(
    1103  int point_index
    1104  ) const;
    1105 
    1106  // overrides virual ON_Object::IsValid
    1107  bool IsValid( ON_TextLog* text_log = nullptr ) const override;
    1108 
    1109  // overrides virual ON_Object::Write
    1110  bool Write(ON_BinaryArchive&) const override;
    1111 
    1112  // overrides virual ON_Object::Read
    1113  bool Read(ON_BinaryArchive&) override;
    1114 
    1115  // virtual ON_Geometry GetBBox override
    1116  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1117 
    1118  // virtual ON_Geometry GetTightBoundingBox override
    1119  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    1120 
    1121  /*
    1122  Description:
    1123  Overrides virtual ON_OBSOLETE_V5_Annotation::NumericValue();
    1124  Returns:
    1125  distance between arrow tips
    1126  */
    1127  double NumericValue() const override;
    1128 
    1129  /*
    1130  Description:
    1131  Get or set the DimStyle index in the dimstyle table for the dimension
    1132  Parameters:
    1133  [in] int the new index (Set)
    1134  Returns:
    1135  int - The current index (Get)
    1136  */
    1137  int StyleIndex() const;
    1138  void SetStyleIndex( int);
    1139 
    1140  /*
    1141  Description:
    1142  static function to provide the default UserText string for the object
    1143  Returns:
    1144  const wchar_t* - the default string to use
    1145  */
    1146  static const wchar_t* DefaultText();
    1147 
    1148 
    1149  /*
    1150  Description:
    1151  Get the annotation plane x coordinates of the dimension
    1152  line. The y coordinate of the dimension line is m_ponts[1].y.
    1153  Parameters:
    1154  gdi_text_rect - [in]
    1155  Windows rect (left < right, top < bottom) that bounds text.
    1156  The baseline of the text should be at y=0 in the rect coordinates.
    1157  gdi_height_of_I - [in]
    1158  Height of an I in the text in the same.
    1159  gdi_to_world - [in]
    1160  transform returned by ON_OBSOLETE_V5_Annotation::GetTextXform().
    1161  dimstyle - [in]
    1162  dimscale - [in]
    1163  vp - [in]
    1164  x - [out] plane x coordinates of the dimension line.
    1165  The y coordinate = m_points[arrow0_pt_index].y
    1166  bInside - [out] true if arrowheads go inside extension lines,
    1167  false if they go outside
    1168  Returns:
    1169  0: the input or class is not valid
    1170  1: A single line from x[0] to x[1] with arrow heads at both ends.
    1171  Arrowtips at x[4] & x[5]
    1172  2: Two lines from x[0] to x[1] and from x[1] to x[2]. The
    1173  Arrowtips at x[4] & x[5]
    1174 
    1175  */
    1176  int GetDimensionLineSegments(
    1177  ON_OBSOLETE_V5_RECT gdi_text_rect,
    1178  int gdi_height_of_I,
    1179  ON_Xform gdi_to_world,
    1180  const ON_DimStyle& dimstyle,
    1181  double dimscale,
    1182  const ON_Viewport* vp,
    1183  double a[6],
    1184  bool& bInside
    1185  ) const;
    1186 
    1187 
    1188  // Added for V5. 4/24/07 LW
    1189  // Get the userdata extension for this dimension
    1190  ON_OBSOLETE_V5_DimExtra* DimensionExtension();
    1191  const ON_OBSOLETE_V5_DimExtra* DimensionExtension() const;
    1192 };
    1193 
    1194 //////////
    1195 // class ON_OBSOLETE_V5_DimRadial
    1196 class ON_OBSOLETE_V5_DimRadial : public ON_OBSOLETE_V5_Annotation
    1197 {
    1198  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_DimRadial);
    1199 
    1200 public:
    1201 
    1202  /*
    1203  The annotation's dimstyle controls the position of TEXT,
    1204  and the size of the arrowheads.
    1205 
    1206  In the picture below, [n] means ON_OBSOLETE_V5_Annotation::m_points[n].
    1207 
    1208  Radial dimensions do not permit user positioned text
    1209 
    1210 
    1211  knee
    1212  [3]--------[2] TEXT
    1213  / (tail)
    1214  /
    1215  /
    1216  [1] (arrow head here)
    1217 
    1218 
    1219  + [0] = (usually at (0,0) = center of circle)
    1220  */
    1221 
    1222  enum POINT_INDEX
    1223  {
    1224  // Do not change these enum values. They are saved in files as the
    1225  // ON_COMPONENT_INDEX.m_index value.
    1226  //
    1227  // Indices of radial dimension definition points in
    1228  // the m_points[] array
    1229  center_pt_index = 0, // location of + (usually at center of circle)
    1230  arrow_pt_index = 1, // arrow tip
    1231  tail_pt_index = 2, // end of radial dimension
    1232  knee_pt_index = 3, // number of m_points[] in a radial dim
    1233  dim_pt_count = 4, // number of m_points[] in a radial dim
    1234 
    1235  // Points calculated from values in m_points[]
    1236  text_pivot_pt = 10000, // start/end of dimension text at tail
    1237  };
    1238 
    1239  ON_OBSOLETE_V5_DimRadial();
    1240  ~ON_OBSOLETE_V5_DimRadial() = default;
    1241  ON_OBSOLETE_V5_DimRadial(const ON_OBSOLETE_V5_DimRadial&) = default;
    1242  ON_OBSOLETE_V5_DimRadial& operator=(const ON_OBSOLETE_V5_DimRadial&) = default;
    1243 
    1244 
    1245  static ON_OBSOLETE_V5_DimRadial* CreateFromV6DimRadial(
    1246  const class ON_DimRadial& V6_dim_radial,
    1247  const class ON_3dmAnnotationContext* annotation_context,
    1248  ON_OBSOLETE_V5_DimRadial* destination
    1249  );
    1250 
    1251  static ON_OBSOLETE_V5_DimRadial* CreateFromV2RadialDimension(
    1252  const class ON_OBSOLETE_V2_DimRadial& V2_radial_dimension,
    1253  const class ON_3dmAnnotationContext* annotation_context,
    1254  ON_OBSOLETE_V5_DimRadial* destination
    1255  );
    1256 
    1257  // overrides virtual ON_Geometry::Transform()
    1258  bool Transform( const ON_Xform& xform ) override;
    1259 
    1260  /*
    1261  Description:
    1262  Get the m_plane coordinates of the dimension point.
    1263  Parameters:
    1264  point_index - [in] One of the POINT_INDEX enum values
    1265  Returns:
    1266  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1267  array is not valid.
    1268  */
    1269  ON_2dPoint Dim2dPoint(
    1270  int point_index
    1271  ) const;
    1272 
    1273  /*
    1274  Description:
    1275  Get the m_plane coordinates of the dimension point.
    1276  Parameters:
    1277  point_index - [in] One of the POINT_INDEX enum values
    1278  Returns:
    1279  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1280  array is not valid.
    1281  */
    1282  ON_3dPoint Dim3dPoint(
    1283  int point_index
    1284  ) const;
    1285 
    1286 
    1287  // overrides virual ON_Object::IsValid
    1288  bool IsValid( ON_TextLog* text_log = nullptr ) const override;
    1289 
    1290  // overrides virual ON_Object::Write
    1291  bool Write(ON_BinaryArchive&) const override;
    1292 
    1293  // overrides virual ON_Object::Read
    1294  bool Read(ON_BinaryArchive&) override;
    1295 
    1296  // virtual ON_Geometry GetBBox override
    1297  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1298 
    1299  // virtual ON_Geometry GetTightBoundingBox override
    1300  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    1301 
    1302  /*
    1303  Description:
    1304  Set the plane and definition points from WCS 3d input
    1305  Parameters:
    1306  center - [in] center of circle
    1307  arrowtip - [in] 3d point on the circle at the dimension arrow tip
    1308  xaxis - [in] x axis of the dimension's plane
    1309  normal - [in] normal to the dimension's plane
    1310  offset_distance - [in] distance from arrow tip to knee point
    1311  Returns:
    1312  @untitled table
    1313  true Success
    1314  false Failure
    1315  */
    1316  bool CreateFromPoints(
    1317  ON_3dPoint center,
    1318  ON_3dPoint arrowtip,
    1319  ON_3dVector xaxis,
    1320  ON_3dVector normal,
    1321  double offset_distance
    1322  );
    1323 
    1324  /*
    1325  Description:
    1326  Overrides virtual ON_OBSOLETE_V5_Annotation::NumericValue();
    1327  Returns:
    1328  If m_type is ON_INTERNAL_OBSOLETE::V5_eAnnotationType::dtDimDiameter, then the diameter
    1329  is returned, othewise the radius is returned.
    1330  */
    1331  double NumericValue() const override;
    1332 
    1333  /*
    1334  Description:
    1335  Get or set the DimStyle index in the dimstyle table for the dimension
    1336  Parameters:
    1337  [in] int the new index (Set)
    1338  Returns:
    1339  int - The current index (Get)
    1340  */
    1341  int StyleIndex() const;
    1342  void SetStyleIndex( int);
    1343 
    1344  /*
    1345  Description:
    1346  static function to provide the default UserText string for the object
    1347  Returns:
    1348  const wchar_t* - the default string to use
    1349  */
    1350  static const wchar_t* DefaultDiameterText();
    1351  static const wchar_t* DefaultRadiusText();
    1352 
    1353  bool CreateFromV2(
    1354  const class ON_OBSOLETE_V2_Annotation& v2_ann,
    1355  const class ON_3dmAnnotationSettings& settings,
    1356  int dimstyle_index
    1357  );
    1358 
    1359  bool GetArrowHeadDirection( ON_2dVector& arrowhead_dir ) const;
    1360  bool GetArrowHeadTip( ON_2dPoint& arrowhead_tip ) const;
    1361 };
    1362 
    1363 
    1364 //////////
    1365 // class ON_OBSOLETE_V5_DimAngular
    1366 class ON_OBSOLETE_V5_DimAngular : public ON_OBSOLETE_V5_Annotation
    1367 {
    1368  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_DimAngular);
    1369 
    1370 public:
    1371 
    1372  /*
    1373  The annotation's dimstyle controls the position of TEXT,
    1374  the size of the arrowheads, and the amount the ends of
    1375  linear dimension's extension lines extend beyond the
    1376  dimension lines.
    1377 
    1378  In the picture below, [n] means ON_OBSOLETE_V5_Annotation::m_points[n].
    1379 
    1380  [0] = if m_userpositionedtext=true, this is the center of text.
    1381  If m_userpositionedtext=false, this point is not used and
    1382  the center of the text is at the arc's midpoint.
    1383 
    1384  Always counter clockwise arc in m_plane with center = (0,0)
    1385  [1] = a point somewhere on the line from the center through the start point.
    1386  The distance from center to [1] can be any value.
    1387  [2] = a point somewhere on the line from the center through the end point.
    1388  The distance from center to [2] can be any value.
    1389  [3] = a point on the interior of the arc. The distance
    1390  from (0,0) to [3] is the radius of the arc.
    1391 
    1392 
    1393  /
    1394  [2]
    1395  /
    1396  / [0]TEXT
    1397  /
    1398  / [3]
    1399  -----(0,0)----------[1]---
    1400  /
    1401  /
    1402  /
    1403 
    1404  */
    1405 
    1406  enum POINT_INDEX
    1407  {
    1408  // Do not change these enum values. They are saved in files as the
    1409  // ON_COMPONENT_INDEX.m_index value.
    1410  //
    1411  // Indices of angular dimension definition points in
    1412  // the m_points[] array
    1413  userpositionedtext_pt_index = 0, //
    1414  start_pt_index = 1, // point on the start ray (not necessarily on arc)
    1415  end_pt_index = 2, // point on the end ray (not necessarily on arc)
    1416  arc_pt_index = 3, // point on the interior of dimension arc
    1417  dim_pt_count = 4, // number of m_points[] in an angular dim
    1418 
    1419  // Points calculated from values in m_points[]
    1420  text_pivot_pt = 10000, // center of dimension text
    1421  arcstart_pt = 10001,
    1422  arcend_pt = 10002,
    1423  arcmid_pt = 10003,
    1424  arccenter_pt = 10004, // center of circle arc lies on
    1425  extension0_pt = 10005, // point where first extension line starts
    1426  extension1_pt = 10006 // point where second extension line starts
    1427  };
    1428 
    1429 public:
    1430  ON_OBSOLETE_V5_DimAngular();
    1431  ~ON_OBSOLETE_V5_DimAngular() = default;
    1432  ON_OBSOLETE_V5_DimAngular(const ON_OBSOLETE_V5_DimAngular&) = default;
    1433  ON_OBSOLETE_V5_DimAngular& operator=(const ON_OBSOLETE_V5_DimAngular&) = default;
    1434 
    1435  static ON_OBSOLETE_V5_DimAngular* CreateFromV6DimAngular(
    1436  const class ON_DimAngular& V6_dim_angular,
    1437  const class ON_3dmAnnotationContext* annotation_context,
    1438  ON_OBSOLETE_V5_DimAngular* destination
    1439  );
    1440 
    1441  static ON_OBSOLETE_V5_DimAngular* CreateFromV2AngularDimension(
    1442  const class ON_OBSOLETE_V2_DimAngular& V2_angular_dimension,
    1443  const class ON_3dmAnnotationContext* annotation_context,
    1444  ON_OBSOLETE_V5_DimAngular* destination
    1445  );
    1446 
    1447 
    1448  // overrides virtual ON_Geometry::Transform()
    1449  bool Transform( const ON_Xform& xform ) override;
    1450 
    1451  /*
    1452  Description:
    1453  Get the m_plane coordinates of the dimension point.
    1454  Parameters:
    1455  point_index - [in] One of the POINT_INDEX enum values
    1456  Returns:
    1457  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1458  array is not valid.
    1459  */
    1460  ON_2dPoint Dim2dPoint(
    1461  int point_index
    1462  ) const;
    1463 
    1464  /*
    1465  Description:
    1466  Get the m_plane coordinates of the dimension point.
    1467  Parameters:
    1468  point_index - [in] One of the POINT_INDEX enum values
    1469  Returns:
    1470  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1471  array is not valid.
    1472  */
    1473  ON_3dPoint Dim3dPoint(
    1474  int point_index
    1475  ) const;
    1476 
    1477 
    1478  // overrides virual ON_Object::IsValid
    1479  bool IsValid( ON_TextLog* text_log = nullptr ) const override;
    1480 
    1481  // virtual ON_Geometry GetBBox override
    1482  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1483 
    1484  // virtual ON_Geometry GetTightBoundingBox override
    1485  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    1486 
    1487  /*
    1488  Description:
    1489  Read from or write to a file
    1490  Returns:
    1491  @untitled Table
    1492  true Success
    1493  false Failure
    1494  */
    1495  bool Write( ON_BinaryArchive& file ) const override;
    1496  bool Read( ON_BinaryArchive& file ) override;
    1497 
    1498  /*
    1499  Description:
    1500  Set the plane and definition points from 3d points
    1501  in world coordinates.
    1502  Parameters:
    1503  apex - [in] 3d apex of the dimension
    1504  (center of arc)
    1505  p0 - [in] 3d point on first line
    1506  p1 - [in] 3d point on second line
    1507  arcpt - [in] 3d point on dimension arc
    1508  (determines radius of arc)
    1509  Normal - [in] normal of the plane on which to make the dimension
    1510  (must be perpendicular to p0-apex and p1-apex)
    1511  Returns:
    1512  @untitled table
    1513  true Success
    1514  false Failure
    1515  */
    1516  bool CreateFromPoints(
    1517  const ON_3dPoint& apex,
    1518  const ON_3dPoint& p0,
    1519  const ON_3dPoint& p1,
    1520  ON_3dPoint& arcpt,
    1521  ON_3dVector& Normal
    1522  );
    1523 
    1524  /*
    1525  Description:
    1526  Set the plane and definition points from a 3d arc.
    1527  Parameters:
    1528  arc - [in]
    1529  Returns:
    1530  @untitled table
    1531  true Success
    1532  false Failure
    1533  */
    1534  bool CreateFromArc(
    1535  const ON_Arc& arc
    1536  );
    1537 
    1538  bool GetArc( ON_Arc& arc ) const;
    1539 
    1540  bool GetExtensionLines(ON_Line extensions[2]) const;
    1541 
    1542  // Set or get the measured angle in radians
    1543  void SetAngle( double angle);
    1544  double Angle() const;
    1545  void SetRadius( double radius);
    1546  double Radius() const;
    1547 
    1548  /*
    1549  Description:
    1550  Overrides virtual ON_OBSOLETE_V5_Annotation::NumericValue();
    1551  Returns:
    1552  Angle in degrees
    1553  */
    1554  double NumericValue() const override;
    1555 
    1556  /*
    1557  Description:
    1558  Get or set the DimStyle index in the dimstyle table for the dimension
    1559  Parameters:
    1560  [in] int the new index (Set)
    1561  Returns:
    1562  int - The current index (Get)
    1563  */
    1564  int StyleIndex() const;
    1565  void SetStyleIndex( int);
    1566 
    1567  /*
    1568  Description:
    1569  static function to provide the default UserText string for the object
    1570  Returns:
    1571  const wchar_t* - the default string to use
    1572  */
    1573  static const wchar_t* DefaultText();
    1574 
    1575  double m_angle = 0.0; // angle being dimensioned
    1576  double m_radius = 1.0; // radius for dimension arc
    1577 
    1578  /*
    1579  Description:
    1580  Get the annotation plane angles of the dimension arc.
    1581  Parameters:
    1582  gdi_text_rect - [in] Windows rect (left < right, top < bottom)
    1583  that bounds text.
    1584  gdi_height_of_I - [in]
    1585  Height of an I in the text.
    1586  gdi_to_world - [in]
    1587  transform returned by ON_OBSOLETE_V5_Annotation::GetTextXform().
    1588  dimstyle - [in]
    1589  dimscale - [in]
    1590  vp - [in]
    1591  a - [out]
    1592  angles at the ends of the arc segment(s) and the arrow tips
    1593  bInside - [out] true if arrowheads go inside, false if they go outside
    1594  Returns:
    1595  number of arc segments to draw
    1596  0: the input or class is not valid
    1597  1: A single arc from a[0] to a[1] with arrow heads at a[4] & a[5].
    1598  2: Two arcs from a[0] to a[1] & from a[2] to a[3].
    1599  Arrowheads are at a[4] & a[5].
    1600  */
    1601  int GetDimensionArcSegments(
    1602  ON_OBSOLETE_V5_RECT gdi_text_rect,
    1603  int gdi_height_of_I,
    1604  ON_Xform gdi_to_world,
    1605  const ON_DimStyle& dimstyle,
    1606  double dimscale,
    1607  const ON_Viewport* vp,
    1608  double a[6],
    1609  bool& bInside
    1610  ) const;
    1611 
    1612 
    1613  /*
    1614  Description:
    1615  Get distance from dimension apex to extension line offset points
    1616  Parameters:
    1617  index - [in] which distance to get
    1618  Returns:
    1619  Distance to offset point [index]
    1620  */
    1621  double DimpointOffset(
    1622  int index) const;
    1623 
    1624  /*
    1625  Description:
    1626  Set distance from dimension apex to extension line offset points
    1627  Parameters:
    1628  index - [in] which distance to set
    1629  offset - [in] Value to set
    1630  */
    1631  void SetDimpointOffset(
    1632  int index,
    1633  double offset);
    1634 };
    1635 
    1636 
    1637 /*
    1638  class ON_OBSOLETE_V5_DimLinear
    1639 
    1640  Description:
    1641  Override od ON_OBSOLETE_V5_Annotation to provide linear dimensions
    1642 */
    1643 class ON_OBSOLETE_V5_DimOrdinate : public ON_OBSOLETE_V5_Annotation
    1644 {
    1645  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_DimOrdinate);
    1646 
    1647 public:
    1648 
    1649  /*
    1650  In the picture below, [n] means ON_OBSOLETE_V5_Annotation::m_points[n].
    1651 
    1652  Measures in X direction
    1653 
    1654  [1]
    1655  |
    1656  |
    1657  |
    1658  |
    1659  |
    1660  [0]
    1661  +
    1662  [plane origin] [plane origin]
    1663  +
    1664 
    1665  or - Measures in Y direction *---[1]
    1666  /
    1667  /
    1668  [0]--------------------[1] [0]---------------*
    1669 
    1670 
    1671  * = calculated, not stored
    1672 
    1673 
    1674  +
    1675  [plane origin]
    1676 
    1677 
    1678  The reference point of for the dimension is at the entity plane origin
    1679  The "x" and "y" coordinates of [1] can be any value.
    1680  The "x" and "y" coordinates of [2] can be any value.
    1681  If Direction is "x", the dimension measures along the "x" axis
    1682  If Direction is "y", the dimension measures along the "y" axis
    1683  If Direction is "x" and [1][x] <> [0][x], an offset segment is drawn
    1684  If Direction is "y" and [1][y] <> [0][y], an offset segment is drawn
    1685  The dimension lines are always drawn in the X or Y directions of the entity plane
    1686  The distance represented by the dimension is measured from the
    1687  plane origin to point [0], parallel to the appropriate axis.
    1688  The points of the offset segment are calculated rather than stored
    1689  */
    1690 
    1691  enum POINT_INDEX
    1692  {
    1693  // Do not change these enum values. They are saved in files as the
    1694  // ON_COMPONENT_INDEX.m_index value.
    1695  //
    1696  // Indices of linear dimension definition points in
    1697  // the m_points[] array
    1698  definition_pt_index = 0, // First end of the dimension line
    1699  leader_end_pt_index = 1, // Other end of the leader (near the text)
    1700  dim_pt_count = 2, // Number of m_points[] in an ordinate dim
    1701 
    1702  // Points calculated from values in m_points[]
    1703  text_pivot_pt = 10000, // Center of dimension text
    1704  offset_pt_0 = 10001, // First offset point (nearest text)
    1705  offset_pt_1 = 10002 // Second offset point
    1706  };
    1707 
    1708  enum DIRECTION
    1709  {
    1710  x = 0, // measures horizontally
    1711  y = 1, // measures vertically
    1712  };
    1713 
    1714  ON_OBSOLETE_V5_DimOrdinate();
    1715  ~ON_OBSOLETE_V5_DimOrdinate();
    1716 
    1717  static ON_OBSOLETE_V5_DimOrdinate* CreateFromV6DimOrdinate(
    1718  const class ON_DimOrdinate& V6_dim_ordinate,
    1719  const class ON_3dmAnnotationContext* annotation_context,
    1720  ON_OBSOLETE_V5_DimOrdinate* destination
    1721  );
    1722 
    1723 
    1724  // overrides virtual ON_Geometry::Transform()
    1725  bool Transform( const ON_Xform& xform ) override;
    1726 
    1727  /*
    1728  Description:
    1729  Get the m_plane coordinates of the dimension point.
    1730  Parameters:
    1731  point_index - [in] One of the POINT_INDEX enum values
    1732  default_offset [in] - kink offset to use if m_kink_offset_0
    1733  or m_kink_offset_1 are ON_UNSET_VALUE
    1734  Returns:
    1735  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1736  array is not valid.
    1737  */
    1738  ON_2dPoint Dim2dPoint(
    1739  int point_index,
    1740  double default_offset = 1.0
    1741  ) const;
    1742 
    1743  /*
    1744  Description:
    1745  Get the m_plane coordinates of the dimension point.
    1746  Parameters:
    1747  point_index - [in] One of the POINT_INDEX enum values
    1748  default_offset [in] - kink offset to use if m_kink_offset_0
    1749  or m_kink_offset_1 are ON_UNSET_VALUE
    1750  Returns:
    1751  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    1752  array is not valid.
    1753  */
    1754  ON_3dPoint Dim3dPoint(
    1755  int point_index,
    1756  double default_offset = 1.0
    1757  ) const;
    1758 
    1759  // overrides virual ON_Object::IsValid
    1760  bool IsValid( ON_TextLog* text_log = nullptr ) const override;
    1761 
    1762  // virtual ON_Geometry GetBBox override
    1763  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1764 
    1765  // virtual ON_Geometry GetTightBoundingBox override
    1766  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    1767 
    1768  /*
    1769  Description:
    1770  Read from or write to a file
    1771  Returns:
    1772  @untitled Table
    1773  true Success
    1774  false Failure
    1775  */
    1776  bool Write( ON_BinaryArchive& file ) const override;
    1777  bool Read( ON_BinaryArchive& file ) override;
    1778 
    1779  /*
    1780  Description:
    1781  Overrides virtual ON_OBSOLETE_V5_Annotation::NumericValue();
    1782  Returns:
    1783  If Direction is 'X', x coordinate of point[1]
    1784  If Direction is 'Y', y coordinate of point[1]
    1785  */
    1786  double NumericValue() const override;
    1787 
    1788  /*
    1789  Description:
    1790  Get or set the DimStyle index in the dimstyle table for the dimension
    1791  Parameters:
    1792  [in] int the new index (Set)
    1793  Returns:
    1794  int - The current index (Get)
    1795  */
    1796  int StyleIndex() const;
    1797  void SetStyleIndex( int);
    1798 
    1799  /*
    1800  Description:
    1801  Gets the direction ( X or Y) that the ordinate dimension measures
    1802  based on the relative location of the defining point and leader endpoint
    1803  Returns:
    1804  0: measures parallel to the entity plane x axis
    1805  1: measures parallel to the entity plane y axis
    1806  Remarks:
    1807  This does not consider the dimension's explicit Direction setting
    1808  */
    1809  int ImpliedDirection() const;
    1810 
    1811  /*
    1812  Description:
    1813  Gets or sets the direction ( X or Y) that the ordinate dimension measures
    1814  Returns:
    1815  -1: direction determined by dim point and leader point
    1816  0: measures parallel to the entity plane x axis
    1817  1: measures parallel to the entity plane y axis
    1818  */
    1819  int Direction() const;
    1820  void SetDirection( int direction);
    1821 
    1822  /*
    1823  Description:
    1824  Get the height of the text in this dimension
    1825  by asking the dimension's dimstyle
    1826  Returns:
    1827  double Height of the text
    1828  Remarks:
    1829  Height is in model units
    1830  double Height() const;
    1831  */
    1832 
    1833  /*
    1834  Description:
    1835  static function to provide the default UserText string for the object
    1836  Returns:
    1837  const wchar_t* - the default string to use
    1838  */
    1839  static const wchar_t* DefaultText();
    1840 
    1841  /*
    1842  Description:
    1843  Returns or sets the offset distance parallel to the dimension
    1844  line direction of from the text end of the dimension line to
    1845  the offset point
    1846  If the offset point hasn't been explicitly defined, returns
    1847  ON_UNSET_VALUE and a default should be used to find the point.
    1848  Parameters:
    1849  index [in] - which offset distance to return
    1850  (0 is closer to the text)
    1851  offset [in] - the offset distance to set
    1852  */
    1853  double KinkOffset( int index) const;
    1854  void SetKinkOffset( int index, double offset);
    1855 
    1856 
    1857  int m_direction; // -1 == underermined
    1858  // 0 == x direction
    1859  // 1 == y direction
    1860 
    1861  // kink offsets added 2-4-06 - LW
    1862  double m_kink_offset_0; // from leader_end_point to first break point
    1863  double m_kink_offset_1; // from first break point to second break point
    1864 
    1865  /*
    1866  Description:
    1867  Calculates the 2d point locations of the dimension line kinks
    1868 
    1869  Parameters:
    1870  p0, p1 [in] - End points of the dimension line
    1871  direction [in] - orientation of the dimension
    1872  default_offset [in] - Use this if offsets are ON_UNSET_VALUE
    1873  k0, k1 [out] - The kink points
    1874  Remarks:
    1875  The offsets must be set to the right values before calling this, or
    1876  If they are ON_UNSET_VALUE, they will be set to the defaults
    1877  */
    1878  void CalcKinkPoints( ON_2dPoint p0, ON_2dPoint p1,
    1879  int direction, double default_offset,
    1880  ON_2dPoint& k0, ON_2dPoint& k1) const;
    1881 
    1882 };
    1883 
    1884 
    1885 //////////
    1886 // class ON_OBSOLETE_V5_TextObject
    1887 class ON_OBSOLETE_V5_TextObject : public ON_OBSOLETE_V5_Annotation
    1888 {
    1889  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_TextObject);
    1890 
    1891 public:
    1892  ON_OBSOLETE_V5_TextObject();
    1893  ~ON_OBSOLETE_V5_TextObject();
    1894 
    1895  /*
    1896  Description:
    1897  Create a V6 text object from a V5 text object.
    1898  The function is used when writing V5 files.
    1899  Parameters:
    1900  v6_text_object -[in]
    1901  dimstyle - [in]
    1902  Dimstyle referenced by v6_text_object or nullptr if not available.
    1903  destination - [in]
    1904  If destination is not nullptr, then the V5 text object is constructed
    1905  in destination. If destination is nullptr, then the new V5 text object
    1906  is allocated with a call to new ON_OBSOLETE_V5_TextObject().
    1907  */
    1908  static ON_OBSOLETE_V5_TextObject* CreateFromV6TextObject(
    1909  const class ON_Text& V6_text_object,
    1910  const class ON_3dmAnnotationContext* annotation_context,
    1911  ON_OBSOLETE_V5_TextObject* destination
    1912  );
    1913 
    1914  static ON_OBSOLETE_V5_TextObject* CreateFromV2TextObject(
    1915  const class ON_OBSOLETE_V2_TextObject& V2_text_object,
    1916  const class ON_3dmAnnotationContext* annotation_context,
    1917  ON_OBSOLETE_V5_TextObject* destination
    1918  );
    1919 
    1920  // overrides virual ON_Object::IsValid
    1921  // Text entities with strings that contain no "printable" characters
    1922  // are considered to be NOT valid.
    1923  bool IsValid( ON_TextLog* text_log = nullptr ) const override;
    1924 
    1925  // overrides virual ON_Object::Write
    1926  bool Write(ON_BinaryArchive&) const override;
    1927 
    1928  // overrides virual ON_Object::Read
    1929  bool Read(ON_BinaryArchive&) override;
    1930 
    1931  // overrides virtual ON_Geometry::Transform()
    1932  bool Transform( const ON_Xform& xform ) override;
    1933 
    1934  // virtual ON_Geometry GetBBox override
    1935  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    1936 
    1937  // virtual ON_Geometry GetTightBoundingBox override
    1938  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    1939 
    1940  void SetJustification( unsigned int justification) override;
    1941 
    1942  unsigned int Justification() const override;
    1943 
    1944  // Determines whether or not to draw a Text Mask
    1945  bool DrawTextMask() const;
    1946  void SetDrawTextMask(bool bDraw);
    1947 
    1948  // Determines where to get the color to draw a Text Mask
    1949  // 0: Use background color of the viewport. Initially, gradient backgrounds will not be supported
    1950  // 1: Use the ON_Color returned by MaskColor()
    1951  int MaskColorSource() const;
    1952  void SetMaskColorSource(int source);
    1953 
    1954  ON_Color MaskColor() const; // Only works right if MaskColorSource returns 1.
    1955  // Does not return viewport background color
    1956  void SetMaskColor(ON_Color color);
    1957 
    1958  // Offset for the border around text to the rectangle used to draw the mask
    1959  // This number * CRhinoAnnotation::TextHeight() for the text is the offset
    1960  // on each side of the tight rectangle around the text characters to the mask rectangle.
    1961  double MaskOffsetFactor() const;
    1962  void SetMaskOffsetFactor(double offset);
    1963 
    1964  // Scale annotation according to detail scale factor in paperspace
    1965  // or by 1.0 in paperspace and not in a detail
    1966  // Otherwise, dimscale or text scale is used
    1967  bool AnnotativeScaling() const;
    1968  void SetAnnotativeScaling(bool b);
    1969 };
    1970 
    1971 //////////
    1972 // class ON_OBSOLETE_V5_Leader
    1973 class ON_OBSOLETE_V5_Leader : public ON_OBSOLETE_V5_Annotation
    1974 {
    1975  ON_OBJECT_DECLARE(ON_OBSOLETE_V5_Leader);
    1976 
    1977 public:
    1978 
    1979  /*
    1980  The annotation's dimstyle controls the position of TEXT,
    1981  the size of the arrowheads, and the amount the ends of
    1982  linear dimension's extension lines extend beyond the
    1983  dimension lines.
    1984 
    1985  Leaders:
    1986 
    1987  Polyline with N=m_points.Count() points (N >= 2).
    1988 
    1989  [N-2] ----- [N-1] TEXT
    1990  / (tail)
    1991  /
    1992  /
    1993  [1]------[2]
    1994  /
    1995  /
    1996  /
    1997  [0] (arrow)
    1998 
    1999  Leaders ignore the m_userpositionedtext setting. If the
    2000  default leader text handling is not adequate, then use
    2001  a leader with no text and an ON_OBSOLETE_V5_TextObject.
    2002  */
    2003 
    2004  enum POINT_INDEX
    2005  {
    2006  // Do not change these enum values. They are saved in files as the
    2007  // ON_COMPONENT_INDEX.m_index value.
    2008  //
    2009  // Indices of leader definition points in
    2010  // the m_points[] array
    2011  arrow_pt_index = 0, // arrow tip
    2012 
    2013  // Points calculated from values in m_points[]
    2014  text_pivot_pt = 10000, // start/end of dimension text at tail
    2015  tail_pt = 10001
    2016  };
    2017 
    2018  // Constructors
    2019  ON_OBSOLETE_V5_Leader();
    2020  ~ON_OBSOLETE_V5_Leader();
    2021  // C++ automatically provides the correct copy constructor and operator= .
    2022  //ON_OBSOLETE_V5_Leader(const ON_OBSOLETE_V5_Leader&);
    2023  //ON_OBSOLETE_V5_Leader& operator=(const ON_OBSOLETE_V5_Leader&);
    2024 
    2025  /*
    2026  Description:
    2027  Create a V5 leader from a V6 leader.
    2028  The function is used when writing V5 files.
    2029  Parameters:
    2030  v6_leader -[in]
    2031  dimstyle - [in]
    2032  Dimstyle referenced by v6_leader or nullptr if not available.
    2033  destination - [in]
    2034  If destination is not nullptr, then the V5 leader is constructed
    2035  in destination. If destination is nullptr, then the new V5 leader
    2036  is allocated with a call to new ON_V5_Leader().
    2037  */
    2038  static ON_OBSOLETE_V5_Leader* CreateFromV6Leader(
    2039  const class ON_Leader& V6_leader,
    2040  const class ON_3dmAnnotationContext* annotation_context,
    2041  ON_OBSOLETE_V5_Leader* destination
    2042  );
    2043 
    2044 
    2045  static ON_OBSOLETE_V5_Leader* CreateFromV2Leader(
    2046  const class ON_OBSOLETE_V2_Leader& V2_leader,
    2047  const class ON_3dmAnnotationContext* annotation_context,
    2048  ON_OBSOLETE_V5_Leader* destination
    2049  );
    2050 
    2051  // overrides virtual ON_Geometry::Transform()
    2052  bool Transform( const ON_Xform& xform ) override;
    2053 
    2054  /*
    2055  Description:
    2056  Get the m_plane coordinates of the dimension point.
    2057  Parameters:
    2058  point_index - [in] One of the POINT_INDEX enum values
    2059  Returns:
    2060  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    2061  array is not valid.
    2062  */
    2063  ON_2dPoint Dim2dPoint(
    2064  int point_index
    2065  ) const;
    2066 
    2067  /*
    2068  Description:
    2069  Get the m_plane coordinates of the dimension point.
    2070  Parameters:
    2071  point_index - [in] One of the POINT_INDEX enum values
    2072  Returns:
    2073  2d point or ON_3dPoint::UnsetPoint if point_index or m_points[]
    2074  array is not valid.
    2075  */
    2076  ON_3dPoint Dim3dPoint(
    2077  int point_index
    2078  ) const;
    2079 
    2080  // overrides virual ON_Object::IsValid
    2081  bool IsValid( ON_TextLog* text_log = nullptr ) const override;
    2082 
    2083  // overrides virual ON_Object::Write
    2084  bool Write(ON_BinaryArchive&) const override;
    2085 
    2086  // overrides virual ON_Object::Read
    2087  bool Read(ON_BinaryArchive&) override;
    2088 
    2089  // virtual ON_Geometry GetBBox override
    2090  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
    2091 
    2092  // virtual ON_Geometry GetTightBoundingBox override
    2093  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
    2094 
    2095  /*
    2096  Description:
    2097  Add or delete points to the leader
    2098  Parameters:
    2099  index [in] the point to delete
    2100  point [in] The point to add
    2101  Returns:
    2102  @untitled table
    2103  true Success
    2104  False Failure
    2105  */
    2106  void AddPoint( const ON_2dPoint& point);
    2107  bool RemovePoint( int index = -1);
    2108 
    2109 // April 22, 2010 Lowell - Added to support right justified text on left pointing leader tails rr64292
    2110  bool GetTextDirection( ON_2dVector& text_dir ) const;
    2111  bool GetArrowHeadDirection( ON_2dVector& arrowhead_dir ) const;
    2112  bool GetArrowHeadTip( ON_2dPoint& arrowhead_tip ) const;
    2113 };
    2114 
    2115 #endif
    2116 
    2117 #endif
    Definition: opennurbs_annotationbase.h:23
    ON_UUID is a 16 byte universally unique identifier.
    Definition: opennurbs_uuid.h:32
    -
    virtual bool GetDescription(ON_wString &description)
    -
    virtual int Dimension() const
    Definition: opennurbs_dimension.h:411
    Definition: opennurbs_arc.h:34
    -
    virtual bool GetBBox(double *boxmin, double *boxmax, bool bGrowBox=false) const
    ON_Leader class.
    Definition: opennurbs_leader.h:23
    -
    void Dump(ON_TextLog &text_log) const override
    -
    virtual bool EvaluatePoint(const class ON_ObjRef &objref, ON_3dPoint &P) const
    Definition: opennurbs_dimension.h:202
    Definition: opennurbs_string.h:2089
    Definition: opennurbs_dimensionstyle.h:224
    -
    virtual ON::object_type ObjectType() const
    Definition: opennurbs_archive.h:1653
    Definition: opennurbs_geometry.h:36
    Definition: opennurbs_color.h:24
    Definition: opennurbs_point.h:292
    -
    virtual bool Archive() const
    -
    virtual bool GetTightBoundingBox(class ON_BoundingBox &tight_bbox, bool bGrowBox=false, const class ON_Xform *xform=nullptr) const
    Definition: opennurbs_3dm_settings.h:108
    Definition: opennurbs_dimension.h:682
    -
    const ON_wString & operator=(const ON_wString &)
    overloaded assignment
    Definition: opennurbs_bounding_box.h:25
    Definition: opennurbs_xform.h:28
    An ON_Font is a face in a font family. It corresponds to a Windows LOGFONT, a .NET System...
    Definition: opennurbs_font.h:225
    -
    void EmergencyDestroy()
    Definition: opennurbs_dimension.h:841
    Definition: opennurbs_line.h:20
    -
    ON_Geometry & operator=(const ON_Geometry &)=default
    Definition: opennurbs_textlog.h:20
    < use for generic serialization of binary data
    Definition: opennurbs_archive.h:1866
    Definition: opennurbs_viewport.h:31
    Definition: opennurbs_userdata.h:20
    -
    virtual bool Read(ON_BinaryArchive &binary_archive)
    Definition: opennurbs_objref.h:163
    Definition: opennurbs_point.h:480
    -
    bool IsValid(class ON_TextLog *text_log=nullptr) const override
    -
    virtual bool Write(ON_BinaryArchive &binary_archive) const
    Definition: opennurbs_plane.h:20
    ON_Table class.
    Definition: opennurbs_textobject.h:18
    Definition: opennurbs_point.h:868
    @@ -118,9 +100,9 @@ $(function() {
    diff --git a/6/dc/daa/opennurbs__light_8h_source.html b/6/dc/daa/opennurbs__light_8h_source.html index 85c98dad..15c44f6b 100644 --- a/6/dc/daa/opennurbs__light_8h_source.html +++ b/6/dc/daa/opennurbs__light_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_light.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_light.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/dc/db0/class_o_n___hatch_pattern.html b/6/dc/db0/class_o_n___hatch_pattern.html index 832d7579..d8cc23af 100644 --- a/6/dc/db0/class_o_n___hatch_pattern.html +++ b/6/dc/db0/class_o_n___hatch_pattern.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_HatchPattern Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -1206,8 +1204,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -1457,9 +1455,9 @@ Additional Inherited Members
    diff --git a/6/dc/db9/class_o_n___r_tree_mem_pool-members.html b/6/dc/db9/class_o_n___r_tree_mem_pool-members.html index 772d887c..9623ef92 100644 --- a/6/dc/db9/class_o_n___r_tree_mem_pool-members.html +++ b/6/dc/db9/class_o_n___r_tree_mem_pool-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/dbb/class_o_n___mapping_ref-members.html b/6/dc/dbb/class_o_n___mapping_ref-members.html index 6f82f7d6..411adfcb 100644 --- a/6/dc/dbb/class_o_n___mapping_ref-members.html +++ b/6/dc/dbb/class_o_n___mapping_ref-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/dbc/class_o_n__3d_point_list_ref-members.html b/6/dc/dbc/class_o_n__3d_point_list_ref-members.html index c7518198..86057d13 100644 --- a/6/dc/dbc/class_o_n__3d_point_list_ref-members.html +++ b/6/dc/dbc/class_o_n__3d_point_list_ref-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/dc1/class_o_n___brep_face_side_array.html b/6/dc/dc1/class_o_n___brep_face_side_array.html index 54d38bfd..d29820e0 100644 --- a/6/dc/dc1/class_o_n___brep_face_side_array.html +++ b/6/dc/dc1/class_o_n___brep_face_side_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepFaceSideArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/dc7/class_o_n___interval.html b/6/dc/dc7/class_o_n___interval.html index 69325044..1feb8d25 100644 --- a/6/dc/dc7/class_o_n___interval.html +++ b/6/dc/dc7/class_o_n___interval.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Interval Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/dce/class_o_n___aerial_photo_camera_position-members.html b/6/dc/dce/class_o_n___aerial_photo_camera_position-members.html index 430b6f07..3aee1725 100644 --- a/6/dc/dce/class_o_n___aerial_photo_camera_position-members.html +++ b/6/dc/dce/class_o_n___aerial_photo_camera_position-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/dd4/opennurbs__version__number_8h_source.html b/6/dc/dd4/opennurbs__version__number_8h_source.html index 6c978a4c..d678124b 100644 --- a/6/dc/dd4/opennurbs__version__number_8h_source.html +++ b/6/dc/dd4/opennurbs__version__number_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_version_number.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_version_number.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/dd6/opennurbs__curveproxy_8h_source.html b/6/dc/dd6/opennurbs__curveproxy_8h_source.html index 4dc75cdf..d1ce0bea 100644 --- a/6/dc/dd6/opennurbs__curveproxy_8h_source.html +++ b/6/dc/dd6/opennurbs__curveproxy_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_curveproxy.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_curveproxy.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/dd9/struct_o_n___mesh_topology_face.html b/6/dc/dd9/struct_o_n___mesh_topology_face.html index 208c1aae..a45b1112 100644 --- a/6/dc/dd9/struct_o_n___mesh_topology_face.html +++ b/6/dc/dd9/struct_o_n___mesh_topology_face.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshTopologyFace Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/dda/class_o_n___curve_proxy.html b/6/dc/dda/class_o_n___curve_proxy.html index 42b5aacb..9f086dfc 100644 --- a/6/dc/dda/class_o_n___curve_proxy.html +++ b/6/dc/dda/class_o_n___curve_proxy.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_CurveProxy Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Get a duplicate of the curve. Returns: A duplicate of the curve.
    -Remarks: The caller must delete the returned curve. For non-ON_CurveProxy objects, this simply duplicates the curve using ON_Object::Duplicate. For ON_CurveProxy objects, this duplicates the actual proxy curve geometry and, if necessary, trims and reverse the result to that the returned curve's parameterization and locus match the proxy curve's.

    +

    Description: Get a duplicate of the curve. Returns: A duplicate of the curve. Remarks: The caller must delete the returned curve. For non-ON_CurveProxy objects, this simply duplicates the curve using ON_Object::Duplicate. For ON_CurveProxy objects, this duplicates the actual proxy curve geometry and, if necessary, trims and reverse the result to that the returned curve's parameterization and locus match the proxy curve's.

    Reimplemented from ON_Curve.

    @@ -952,9 +949,7 @@ Remarks: The caller must delete the returned curve. For non-ON_CurveProxy object
    -

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: c - [in] type of continity to test for. If ON::continuity::C1_continuous t0 - [in] search begins at t0 t1 - [in] (t0 < t1) search ends at t1 t - [out] if a discontinuity is found, the *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search.
    - dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous.
    - ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if a discontinuity was found on the interior of the interval (t0,t1). Remarks: Overrides ON_Curve::GetNextDiscontinuity.

    +

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: c - [in] type of continity to test for. If ON::continuity::C1_continuous t0 - [in] search begins at t0 t1 - [in] (t0 < t1) search ends at t1 t - [out] if a discontinuity is found, the *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search. dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous. ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if a discontinuity was found on the interior of the interval (t0,t1). Remarks: Overrides ON_Curve::GetNextDiscontinuity.

    Reimplemented from ON_Curve.

    @@ -1149,9 +1144,7 @@ Remarks: The caller must delete the returned curve. For non-ON_CurveProxy object
    -

    Description: Does a NURBS curve representation of this curve. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the curve's to wthe desired accuracy 2 success - NURBS point locus matches the curve's and the domain of the NURBS curve is correct.
    - However, This curve's parameterization and the NURBS curve parameterization may not match. This situation happens when getting NURBS representations of curves that have a transendental parameterization like circles Remarks: This is a low-level virtual function.
    -See Also: ON_Curve::GetNurbForm ON_Curve::NurbsCurve

    +

    Description: Does a NURBS curve representation of this curve. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the curve's to wthe desired accuracy 2 success - NURBS point locus matches the curve's and the domain of the NURBS curve is correct. However, This curve's parameterization and the NURBS curve parameterization may not match. This situation happens when getting NURBS representations of curves that have a transendental parameterization like circles Remarks: This is a low-level virtual function. See Also: ON_Curve::GetNurbForm ON_Curve::NurbsCurve

    Reimplemented from ON_Curve.

    @@ -1310,8 +1303,7 @@ See Also: -

    Description: Test continuity at a curve parameter value. Parameters: c - [in] continuity to test for t - [in] parameter to test hint - [in] evaluation hint point_tolerance - [in] if the distance between two points is greater than point_tolerance, then the curve is not C0. d1_tolerance - [in] if the difference between two first derivatives is greater than d1_tolerance, then the curve is not C1. d2_tolerance - [in] if the difference between two second derivatives is greater than d2_tolerance, then the curve is not C2. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous.
    - ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if the curve has at least the c type continuity at the parameter t. Remarks: Overrides
    ON_Curve::IsContinuous.

    +

    Description: Test continuity at a curve parameter value. Parameters: c - [in] continuity to test for t - [in] parameter to test hint - [in] evaluation hint point_tolerance - [in] if the distance between two points is greater than point_tolerance, then the curve is not C0. d1_tolerance - [in] if the difference between two first derivatives is greater than d1_tolerance, then the curve is not C1. d2_tolerance - [in] if the difference between two second derivatives is greater than d2_tolerance, then the curve is not C2. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous or ON::continuity::Gsmooth_continuous. ON::continuity::G2_continuous: If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. ON::continuity::Gsmooth_continuous: If K0 and K1 are curvatures evaluated from above and below and the angle between K0 and K1 is at least twice angle tolerance or ||K0| - |K1|| > (max(|K0|,|K1|) > curvature_tolerance, then a curvature discontinuity is reported. Returns: true if the curve has at least the c type continuity at the parameter t. Remarks: Overrides ON_Curve::IsContinuous.

    Reimplemented from ON_Curve.

    @@ -1773,8 +1765,7 @@ See Also: -

    Description: Sets the curve geometry that "this" is a proxy for.
    - Sets proxy domain to proxy_curve->
    Domain(). Parameters: real_curve - [in]

    +

    Description: Sets the curve geometry that "this" is a proxy for. Sets proxy domain to proxy_curve->Domain(). Parameters: real_curve - [in]

    @@ -1803,8 +1794,7 @@ See Also: -

    Description: Sets the curve geometry that "this" is a proxy for.
    - Sets proxy domain to proxy_curve->
    Domain(). Parameters: real_curve - [in] real_curve_subdomain - [in] increasing sub interval of real_curve->Domain(). This interval defines the portion the "real" curve geometry that "this" proxy uses. bReversed - [in] true if the parameterization of "this" proxy as a curve is reversed from the underlying "real" curve geometry.

    +

    Description: Sets the curve geometry that "this" is a proxy for. Sets proxy domain to proxy_curve->Domain(). Parameters: real_curve - [in] real_curve_subdomain - [in] increasing sub interval of real_curve->Domain(). This interval defines the portion the "real" curve geometry that "this" proxy uses. bReversed - [in] true if the parameterization of "this" proxy as a curve is reversed from the underlying "real" curve geometry.

    @@ -2059,8 +2049,8 @@ See Also: -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -2077,9 +2067,9 @@ See Also: diff --git a/6/dc/de2/opennurbs__textcontext_8h_source.html b/6/dc/de2/opennurbs__textcontext_8h_source.html index 6dd83ede..a22bbd90 100644 --- a/6/dc/de2/opennurbs__textcontext_8h_source.html +++ b/6/dc/de2/opennurbs__textcontext_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_textcontext.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_textcontext.h Source File @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archivereturns false - nothing serialized open binary file
    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/dc/dec/class_o_n___text_box.html b/6/dc/dec/class_o_n___text_box.html index 993c2b8f..832a424a 100644 --- a/6/dc/dec/class_o_n___text_box.html +++ b/6/dc/dec/class_o_n___text_box.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextBox Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    m_advance is a vector that specifies where the basepoint should be moved to after the text is rendered. m_advance.i and m_advance.j are is always >= 0.
    -When glyphs are rendered right to left (Arabic and Hebrew being examples) or bottom to top, the rendering code must apply the correct sign. One reason is that Arabic and Hebrew text can be mixed with latin and Cyrillic text and text rendering is much more complicated than a signed advance can handle. Another is that the sign of y associated with "up" is sometimes positive and sometimes negative. ON_TextBox::Translate does not modify the vector m_advance. ON_TextBox::Union ignored input advance values and returns a box with advance = (0,0). 0 <= m_advance.i will be <= m_max_basepoint.i.

    +

    m_advance is a vector that specifies where the basepoint should be moved to after the text is rendered. m_advance.i and m_advance.j are is always >= 0. When glyphs are rendered right to left (Arabic and Hebrew being examples) or bottom to top, the rendering code must apply the correct sign. One reason is that Arabic and Hebrew text can be mixed with latin and Cyrillic text and text rendering is much more complicated than a signed advance can handle. Another is that the sign of y associated with "up" is sometimes positive and sometimes negative. ON_TextBox::Translate does not modify the vector m_advance. ON_TextBox::Union ignored input advance values and returns a box with advance = (0,0). 0 <= m_advance.i will be <= m_max_basepoint.i.

    @@ -502,9 +499,9 @@ When glyphs are rendered right to left (Arabic and Hebrew being examples) or bot diff --git a/6/dc/df4/class_o_n___serial_number_map-members.html b/6/dc/df4/class_o_n___serial_number_map-members.html index 8af53af2..56bc380a 100644 --- a/6/dc/df4/class_o_n___serial_number_map-members.html +++ b/6/dc/df4/class_o_n___serial_number_map-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/df4/opennurbs__layer_8h_source.html b/6/dc/df4/opennurbs__layer_8h_source.html index 10d38cf6..dcbaa86b 100644 --- a/6/dc/df4/opennurbs__layer_8h_source.html +++ b/6/dc/df4/opennurbs__layer_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_layer.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_layer.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/dfc/class_o_n___brep_face_array.html b/6/dc/dfc/class_o_n___brep_face_array.html index 04210843..28d7d2db 100644 --- a/6/dc/dfc/class_o_n___brep_face_array.html +++ b/6/dc/dfc/class_o_n___brep_face_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepFaceArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/dfe/class_o_n___arithmetic_calculator-members.html b/6/dc/dfe/class_o_n___arithmetic_calculator-members.html index 62051a88..b977dd79 100644 --- a/6/dc/dfe/class_o_n___arithmetic_calculator-members.html +++ b/6/dc/dfe/class_o_n___arithmetic_calculator-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dc/dfe/class_o_n___simple_array.html b/6/dc/dfe/class_o_n___simple_array.html index 1bad003f..2ae9ca58 100644 --- a/6/dc/dfe/class_o_n___simple_array.html +++ b/6/dc/dfe/class_o_n___simple_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SimpleArray< T > Class Template Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    class ON_SimpleArray< T >
    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    The ON_SimpleArray<> template is more efficient than the ON_ClassArray<> template, but ON_SimpleArray<> should not be used for arrays of classes that require explicit construction, destruction, or copy operators.

    Elements returned by AppendNew() are memset to zero.

    By default, ON_SimpleArray<> uses onrealloc() to manage the dynamic array memory. If you want to use something besides onrealloc() to manage the array memory, then override ON_SimpleArray::Realloc().

    @@ -381,9 +375,8 @@ template<class T>

    Append copy of element. Increments count by 1.

    < (int) cast is for 64 bit pointers

    -

    26 Sep 2005 Dale Lear User passed in an element of the m_a[] that will get reallocated by the call to Reserve(newcapacity).
    -
    - < ON_*Array<> templates do not require robust copy constructor.

    +

    26 Sep 2005 Dale Lear User passed in an element of the m_a[] that will get reallocated by the call to Reserve(newcapacity).

    +

    < ON_*Array<> templates do not require robust copy constructor.

    < ON_*Array<> templates require a robust operator=.

    @@ -675,16 +668,13 @@ template<class T>

    See Also: ON_CompareIncreasing<T> and ON_CompareDeccreasing<T>

    -

    BinarySearch( p, compare ) does a fast search of a sorted array and returns the smallest index "i" of the element that satisifies 0==compare(p,&array[i]).
    -
    - BinarySearch( p, compare, count ) does a fast search of the first count element sorted array and returns the smallest index "i" of the element that satisifies 0==compare(p,&array[i]). The version that takes a "count" is useful when elements are being appended during a calculation and the appended elements are not sorted.

    -

    If the search is successful, BinarySearch() returns the index of the element (>=0). If the search is not successful, BinarySearch() returns -1.
    -
    -Use QuickSort( compare ) or, in rare cases and after meaningful performance testing using optimzed release builds, HeapSort( compare ) to sort the array.

    +

    BinarySearch( p, compare ) does a fast search of a sorted array and returns the smallest index "i" of the element that satisifies 0==compare(p,&array[i]).

    +

    BinarySearch( p, compare, count ) does a fast search of the first count element sorted array and returns the smallest index "i" of the element that satisifies 0==compare(p,&array[i]). The version that takes a "count" is useful when elements are being appended during a calculation and the appended elements are not sorted.

    +

    If the search is successful, BinarySearch() returns the index of the element (>=0). If the search is not successful, BinarySearch() returns -1. Use QuickSort( compare ) or, in rare cases and after meaningful performance testing using optimzed release builds, HeapSort( compare ) to sort the array.

    This worked on a wide range of 32 bit compilers.

    Convert "found" pointer to array index.

    -

    In an ideal world, return ((int)(found - m_a)) would work everywhere. In practice, this should work any 32 bit compiler and we can hope the optimzer generates efficient code.
    - "key" not found

    +

    In an ideal world, return ((int)(found - m_a)) would work everywhere. In practice, this should work any 32 bit compiler and we can hope the optimzer generates efficient code.

    +

    "key" not found

    @@ -723,8 +713,8 @@ template<class T>

    This worked on a wide range of 32 bit compilers.

    Convert "found" pointer to array index.

    -

    In an ideal world, return ((int)(found - m_a)) would work everywhere. In practice, this should work any 32 bit compiler and we can hope the optimzer generates efficient code.
    - "key" not found

    +

    In an ideal world, return ((int)(found - m_a)) would work everywhere. In practice, this should work any 32 bit compiler and we can hope the optimzer generates efficient code.

    +

    "key" not found

    @@ -1095,12 +1085,9 @@ template<class T >

    is < current Count(), then count is reduced to value.When the dynamic array needs to grow, this calculates the new value for m_capacity.

    -

    Note: This code appears in ON_SimpleArray<T>::NewCapacity() and ON_ClassArray<T>::NewCapacity(). Changes made to either function should be made to both functions. Because this code is template code that has to support dynamic linking and the code is defined in a header, I'm using copy-and-paste rather than a static.
    -
    -
    - This function returns 2*m_count unless that will result in an additional allocation of more than cap_size bytes. The cap_size concept was added in January 2010 because some calculations on enormous models were slightly underestimating the initial Reserve() size and then wasting gigabytes of memory.
    -
    - cap_size = 128 MB on 32-bit os, 256 MB on 64 bit os

    +

    Note: This code appears in ON_SimpleArray<T>::NewCapacity() and ON_ClassArray<T>::NewCapacity(). Changes made to either function should be made to both functions. Because this code is template code that has to support dynamic linking and the code is defined in a header, I'm using copy-and-paste rather than a static.

    +

    This function returns 2*m_count unless that will result in an additional allocation of more than cap_size bytes. The cap_size concept was added in January 2010 because some calculations on enormous models were slightly underestimating the initial Reserve() size and then wasting gigabytes of memory.

    +

    cap_size = 128 MB on 32-bit os, 256 MB on 64 bit os

    Growing the array will increase the memory use by more than cap_size.

    @@ -1414,21 +1401,7 @@ template<class T>

    1) If ptr and capacity are zero, return nullptr. 2) If ptr is nullptr, an capacity > 0, allocate a memory block of capacity*sizeof(T) bytes and return a pointer to this block. If the allocation request fails, return nullptr. 3) If ptr is not nullptr and capacity is 0, free the memory block pointed to by ptr and return nullptr. 4) If ptr is not nullptr and capacity > 0, then reallocate the memory block and return a pointer to the reallocated block. If the reallocation request fails, return nullptr.

    NOTE WELL: Microsoft's VC 6.0 realloc() contains a bug that can cause crashes and should be avoided. See MSDN Knowledge Base article ID Q225099 for more information. (re)allocated capacity*sizeof(T) bytes

    NoKeywords
    -


    -
    -
    -
    -
    -
    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -
    -
    -
    -
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////When this file is parsed with /W4 warnings, two bogus warnings are generated. The ON_ClassArray<T>::DestroyElement template function generates a C4100: 'x' : unreferenced formal parameter warning. This appears to be caused by a bug in the compiler warning code or the way templates are expanded. This pragma is needed squelch the bogus warning. The ON_CompareIncreasing and ON_CompareDecreasing templates generate a C4211: nonstandard extension used : redefined extern to static warning. Microsoft's compiler appears to have a little trouble when static functions are declared before they are defined in a single .cpp file. This pragma is needed squelch the bogus warning. The main reason the definitions of the functions for the ON_SimpleArray and ON_ClassArray templates are in this separate file is so that the Microsoft developer studio autocomplete functions will work on these classes.

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////When this file is parsed with /W4 warnings, two bogus warnings are generated. The ON_ClassArray<T>::DestroyElement template function generates a C4100: 'x' : unreferenced formal parameter warning. This appears to be caused by a bug in the compiler warning code or the way templates are expanded. This pragma is needed squelch the bogus warning. The ON_CompareIncreasing and ON_CompareDecreasing templates generate a C4211: nonstandard extension used : redefined extern to static warning. Microsoft's compiler appears to have a little trouble when static functions are declared before they are defined in a single .cpp file. This pragma is needed squelch the bogus warning. The main reason the definitions of the functions for the ON_SimpleArray and ON_ClassArray templates are in this separate file is so that the Microsoft developer studio autocomplete functions will work on these classes.

    This file is included by opennurbs_array.h in the appropriate spot. If you need the definitions in the file, then you should include opennurbs_array.h and let it take care of including this file.construction ////////////////////////////////////////////////////////

    @@ -1657,11 +1630,8 @@ template<class T >

    Shrink/grows capacity. If value

    -

    Allow "expert" users of ON_SimpleArray<>.SetArray(*,*,0) to clean up after themselves and deals with the case when the forget to clean up after themselves.
    -
    -
    -
    - sets capacity to input value

    +

    Allow "expert" users of ON_SimpleArray<>.SetArray(*,*,0) to clean up after themselves and deals with the case when the forget to clean up after themselves.

    +

    sets capacity to input value

    NOTE: Realloc() does an allocation if the first argument is nullptr.

    zero new memory

    out of memory

    @@ -1787,10 +1757,8 @@ template<class T>
    -

    Description: Sort() fills in the index[] array so that array[index[i]] <= array[index[i+1]].
    - The array is not modified.
    - Parameters: sort_algorithm - [in]
    - ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort Use ON::sort_algorithm::heap_sort only if you have done extensive testing with optimized release builds and are confident heap sort is significantly faster. index - [out] an array of length Count() that is returned with some permutation of (0,1,...,Count()-1). compare - [in] compare function compare(a,b,p) should return <0 if a<b, 0, if a==b, and >0 if a>b. Returns: true if successful

    +

    Description: Sort() fills in the index[] array so that array[index[i]] <= array[index[i+1]]. The array is not modified.

    +

    Parameters: sort_algorithm - [in] ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort Use ON::sort_algorithm::heap_sort only if you have done extensive testing with optimized release builds and are confident heap sort is significantly faster. index - [out] an array of length Count() that is returned with some permutation of (0,1,...,Count()-1). compare - [in] compare function compare(a,b,p) should return <0 if a<b, 0, if a==b, and >0 if a>b. Returns: true if successful

    @@ -1833,10 +1801,8 @@ template<class T>
    -

    Description: Sort() fills in the index[] array so that array[index[i]] <= array[index[i+1]].
    - The array is not modified.
    - Parameters: sort_algorithm - [in]
    - ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort Use ON::sort_algorithm::heap_sort only if you have done extensive testing with optimized release builds and are confident heap sort is significantly faster. index - [out] an array of length Count() that is returned with some permutation of (0,1,...,Count()-1). compare - [in] compare function compare(a,b,p) should return <0 if a<b, 0, if a==b, and >0 if a>b. p - [in] pointer passed as third argument to compare.

    +

    Description: Sort() fills in the index[] array so that array[index[i]] <= array[index[i+1]]. The array is not modified.

    +

    Parameters: sort_algorithm - [in] ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort Use ON::sort_algorithm::heap_sort only if you have done extensive testing with optimized release builds and are confident heap sort is significantly faster. index - [out] an array of length Count() that is returned with some permutation of (0,1,...,Count()-1). compare - [in] compare function compare(a,b,p) should return <0 if a<b, 0, if a==b, and >0 if a>b. p - [in] pointer passed as third argument to compare.

    Returns: true if successful

    Parameters
    @@ -2002,9 +1968,9 @@ template<class T> diff --git a/6/dd/d03/class_o_n__3dm_i_o_settings-members.html b/6/dd/d03/class_o_n__3dm_i_o_settings-members.html index 5e105eb4..fa719244 100644 --- a/6/dd/d03/class_o_n__3dm_i_o_settings-members.html +++ b/6/dd/d03/class_o_n__3dm_i_o_settings-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/dd/d05/class_o_n___point_grid.html b/6/dd/d05/class_o_n___point_grid.html index 3d51c8df..4b8855ed 100644 --- a/6/dd/d05/class_o_n___point_grid.html +++ b/6/dd/d05/class_o_n___point_grid.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_PointGrid Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_PointGrid() [1/3]

    @@ -1223,8 +1219,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -1311,9 +1307,9 @@ Additional Inherited Members diff --git a/6/dd/d09/class_o_n___arc_curve-members.html b/6/dd/d09/class_o_n___arc_curve-members.html index 40424245..2efac28a 100644 --- a/6/dd/d09/class_o_n___arc_curve-members.html +++ b/6/dd/d09/class_o_n___arc_curve-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archiveopen binary file
    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/dd/d0b/class_o_n___text_box-members.html b/6/dd/d0b/class_o_n___text_box-members.html index 8c94a78c..b2c53374 100644 --- a/6/dd/d0b/class_o_n___text_box-members.html +++ b/6/dd/d0b/class_o_n___text_box-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d11/opennurbs__compstat_8h_source.html b/6/dd/d11/opennurbs__compstat_8h_source.html index d868272c..ad21b6c6 100644 --- a/6/dd/d11/opennurbs__compstat_8h_source.html +++ b/6/dd/d11/opennurbs__compstat_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_compstat.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_compstat.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d15/class_o_n__3dm_view_position-members.html b/6/dd/d15/class_o_n__3dm_view_position-members.html index 3b747592..22e7fc0d 100644 --- a/6/dd/d15/class_o_n__3dm_view_position-members.html +++ b/6/dd/d15/class_o_n__3dm_view_position-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d15/class_o_n___mesh_component_ref.html b/6/dd/d15/class_o_n___mesh_component_ref.html index bd62790a..e90e5026 100644 --- a/6/dd/d15/class_o_n___mesh_component_ref.html +++ b/6/dd/d15/class_o_n___mesh_component_ref.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshComponentRef Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d1b/class_o_n___cylinder-members.html b/6/dd/d1b/class_o_n___cylinder-members.html index 5d6f52b5..18876d5a 100644 --- a/6/dd/d1b/class_o_n___cylinder-members.html +++ b/6/dd/d1b/class_o_n___cylinder-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d1f/class_o_n___rev_surface-members.html b/6/dd/d1f/class_o_n___rev_surface-members.html index c28dbd63..1490936f 100644 --- a/6/dd/d1f/class_o_n___rev_surface-members.html +++ b/6/dd/d1f/class_o_n___rev_surface-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d22/struct_o_n___serial_number_map_1_1_m_a_p___v_a_l_u_e-members.html b/6/dd/d22/struct_o_n___serial_number_map_1_1_m_a_p___v_a_l_u_e-members.html index 0556b46d..9e66d0de 100644 --- a/6/dd/d22/struct_o_n___serial_number_map_1_1_m_a_p___v_a_l_u_e-members.html +++ b/6/dd/d22/struct_o_n___serial_number_map_1_1_m_a_p___v_a_l_u_e-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d25/class_o_n__2i_bounding_box.html b/6/dd/d25/class_o_n__2i_bounding_box.html index 3d4342b9..6328fa80 100644 --- a/6/dd/d25/class_o_n__2i_bounding_box.html +++ b/6/dd/d25/class_o_n__2i_bounding_box.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2iBoundingBox Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d26/class_o_n___point-members.html b/6/dd/d26/class_o_n___point-members.html index ea00a0d7..98a3f724 100644 --- a/6/dd/d26/class_o_n___point-members.html +++ b/6/dd/d26/class_o_n___point-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d29/class_o_n___font_metrics.html b/6/dd/d29/class_o_n___font_metrics.html index 2bd6f4b1..e3e8535f 100644 --- a/6/dd/d29/class_o_n___font_metrics.html +++ b/6/dd/d29/class_o_n___font_metrics.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_FontMetrics Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Returns: The "units per EM". This is the height and width of the square grid where the font glyphs are designed.
    -Remarks: The width of the 'M' glyph in a font can be different from UPM. The height of the 'M' glyph in a font is typically less than UPM. In TrueType fonts, UPM is often a power of two and generally 1024 or 2048. In OpenType fonts, UPM is often 1000. In PostScript fonts, UPM is often 1000.

    +

    Returns: The "units per EM". This is the height and width of the square grid where the font glyphs are designed. Remarks: The width of the 'M' glyph in a font can be different from UPM. The height of the 'M' glyph in a font is typically less than UPM. In TrueType fonts, UPM is often a power of two and generally 1024 or 2048. In OpenType fonts, UPM is often 1000. In PostScript fonts, UPM is often 1000.

    @@ -670,9 +667,9 @@ Remarks: The width of the 'M' glyph in a font can be different from UPM. The hei diff --git a/6/dd/d2f/opennurbs__locale_8h_source.html b/6/dd/d2f/opennurbs__locale_8h_source.html index a597755d..d051794b 100644 --- a/6/dd/d2f/opennurbs__locale_8h_source.html +++ b/6/dd/d2f/opennurbs__locale_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_locale.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_locale.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_locale.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2014 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_LOCALE_INC_)
    18 #define OPENNURBS_LOCALE_INC_
    19 
    20 typedef
    21 #if defined(ON_RUNTIME_WIN)
    22  _locale_t
    23 #elif defined(ON_RUNTIME_APPLE)
    24  locale_t
    25 #elif defined(ON_RUNTIME_ANDROID)
    26  locale_t
    27 #else
    28  ON__UINT_PTR
    29 #endif
    30  ON_CRT_locale_t;
    31 
    32 class ON_CLASS ON_Locale
    33 {
    34 public:
    35 
    36  enum WindowsLCID : unsigned int
    37  {
    38  OrdinalLCID = 0, // not a real Windows LCID
    39 
    40  InvariantCultureLCID = 0x0027, // 39 decimal
    41 
    42  // Windows LCID for languages Rhino supports
    43 
    44  // "cs-CZ" Czech, ???? script implied
    45  cs_CZ_LCID = 0x0405, //1029 decimal
    46 
    47  // "de-DE" German, Germany, Latn script implied
    48  de_DE_LCID = 0x0407, // 1031 decimal
    49 
    50  // "en-US" English, US, Latn script implied
    51  en_US_LCID = 0x0409, // 1033 decimal
    52 
    53  // "en-CA" English, Canada, Latn script implied
    54  en_CA_LCID = 0x1009, // 4105 decimal
    55 
    56  // "es-ES_tradnl" Spanish, Spain, Latn script implied, traditional sort
    57  es_ES_tradnl_LCID = 0x040A, // 1034 decimal
    58 
    59  // "es-ES" Spanish, Spain, Latn script implied, modern sort
    60  es_ES_LCID = 0x0c0a, // 3082 decimal
    61 
    62  // "fr-FR" French, France, Latn script implied
    63  fr_FR_LCID = 0x040c, // 1036 decimal
    64 
    65  // "it-IT" Italian, Italy, Latn script implied
    66  it_IT_LCID = 0x0410, // 1040 decimal
    67 
    68  // "ja-JP" Japanese, Japan, ???? script implied
    69  ja_JP_LCID = 0x0411, // 1041 decimal
    70 
    71  // Korean, Republic of Korea, ???? script implied
    72  ko_KR_LCID = 0x0412, // 1042 decimal
    73 
    74  // Polish, Poland, ???? script implied
    75  pl_PL_LCID = 0x0415, // 1045 decimal
    76 
    77  // Portuguese, Portugal, Latn script implied
    78  pt_PT_LCID = 0x0816, // 2070 decimal
    79 
    80  // According to https://en.wikipedia.org/wiki/Chinese_language, Chinese is a family of language
    81  // varieties, often mutually unintelligible. Specifying both Script and REGION
    82  // (zh-Hans-CN or zh-Hant-TW) doesn't narrow things down nearly enough.
    83  //
    84  // Basically we have to hope the string collate and mapping functions supplied by the OS and
    85  // the translations supplied by our staff work well for our customers who select from the
    86  // two types of "Chinese" Rhino offers.
    87  //
    88 
    89  // Standard Chinese (Mandarin), Peoples Republic of China, Hans script implied (simplified characters)
    90  zh_CN_LCID = 0x0804, // 2052 decimal
    91 
    92  // Standard Chinese (Mandarin), Taiwan, Hant script implied (traditional characters)
    93  zh_TW_LCID = 0x0404 // 1028 decimal
    94  };
    95 
    96  // The ordinal locale.
    97  // String compares use ordinal element values.
    98  // The decimal point is a period.
    99  static const ON_Locale Ordinal;
    100 
    101  // The invariant culture locale.
    102  // The decimal point is a period.
    104 
    105 private:
    106  static ON_Locale m_CurrentCulture;
    107 
    108 public:
    109  // Reference to ON_Locale::m_CurrentCulture.
    110  // The value is set by calling ON_Locale::SetCurrentCulture();
    111  // The default is a copy of ON_Locale::Ordinal.
    112  static const ON_Locale& CurrentCulture;
    113 
    114  /*
    115  Description:
    116  Set the current culture locale
    117  Parameters:
    118  current_culture_locale - [in]
    119  */
    120  static bool SetCurrentCulture(
    121  const ON_Locale& current_culture_locale
    122  );
    123 
    124 
    125  // Default construction creates a copy of ON_Local::Ordinal
    126  ON_Locale() ON_NOEXCEPT;
    127 
    128  ~ON_Locale() = default;
    129  ON_Locale(const ON_Locale&) = default;
    130  ON_Locale& operator=(const ON_Locale&) = default;
    131 
    132  // Maximum buffer capacity for any ON_Locale functions
    133  // that return string information in a buffer.
    134  enum
    135  {
    136  BUFFER_MAXIMUM_CAPACITY = 128
    137  };
    138 
    139  /*
    140  Description:
    141  Get the language id.
    142 
    143  Parameters:
    144  buffer - [out]
    145  A null terminated string containing the language id is returned in this buffer.
    146  The string has the form:
    147 
    148  <language>[-<Script>][-<REGION>]
    149 
    150  <language>
    151  ISO 639 language code.
    152  http://www.iso.org/iso/language_codes
    153 
    154  <Script> is optional.
    155  If present, it is a 4 alpha letter ISO 15924 script code
    156  http://www.unicode.org/iso15924/iso15924-codes.html
    157 
    158  <REGION>
    159  ISO 3166-1 country/region identifier. (2 alpha letters)
    160  or UN M.49 code (3 digits)
    161  http://www.iso.org/iso/home/standards/country_codes.htm
    162 
    163  buffer_capacity - [in]
    164  number of elements in the buffer.
    165  A capacity >= ON_Locale::BUFFER_MAXIMUM_CAPACITY will be large enough to
    166  hold all possible output.
    167 
    168  Returns:
    169  If buffer_capacity is to small or buffer is nullptr, then nullptr is returned.
    170  Otherwise the pointer to buffer is returned.
    171 
    172  Remarks:
    173  The Invariant language name is the empty string "".
    174  */
    175  const char* GetBCP47LanguageTag(
    176  char* buffer,
    177  size_t buffer_capacity
    178  ) const;
    179 
    180  const wchar_t* GetBCP47LanguageTag(
    181  wchar_t* buffer,
    182  size_t buffer_capacity
    183  ) const;
    184 
    185  /*
    186  Parameters:
    187  A string of the form
    188 
    189  <language>[-<Script>][-<REGION>]
    190 
    191  <language>
    192  ISO 639 language code.
    193  http://www.iso.org/iso/language_codes
    194 
    195  <Script> is optional.
    196  If present, it is a 4 alpha letter ISO 15924 script code
    197  http://www.unicode.org/iso15924/iso15924-codes.html
    198 
    199  <REGION>
    200  ISO 3166-1 country/region identifier. (2 alpha letters)
    201  or UN M.49 code (3 digits)
    202  http://www.iso.org/iso/home/standards/country_codes.htm
    203 
    204  Remarks:
    205  ON_Locale::InvariantCulture.BCP47LanguageName() = "";
    206  ON_Locale::Oridnal.BCP47LanguageName() = "";
    207  */
    208  const char* BCP47LanguageTag() const;
    209 
    210 
    211  /*
    212  Returns:
    213  ISO 639 language code.
    214  When avilable, two letter codes from ISO 639-1 are prefered.
    215  Remarks:
    216  The InvariantCulture.LanguageCode() is "".
    217  See Also:
    218  http://www.iso.org/iso/language_codes
    219  */
    220  const char* LanguageCode() const;
    221 
    222  /*
    223  Returns:
    224  ISO 3166-1 country/region identifier (2 alpha) or UN M.49 code (3 digits)
    225  Remarks:
    226  The returned string can be "" if the no region is specified.
    227  The InvariantCulture.RegionCode() is "".
    228  See Also:
    229  http://www.iso.org/iso/home/standards/country_codes.htm
    230  */
    231  const char* RegionCode() const;
    232 
    233  /*
    234  Returns:
    235  A 4 letter ISO 15924 script code
    236  Remarks:
    237  The returned string can be "" if the no script is specified for the locale.
    238  The InvariantCulture.ScriptCode() is "".
    239  See Also:
    240  http://www.unicode.org/iso15924/iso15924-codes.html
    241  */
    242  const char* ScriptCode() const;
    243 
    244 
    245  /*
    246  Returns:
    247  Microsoft Windows LCID value
    248  ON_LocaleLCID::OrdinalLCID (=0)
    249  The locale is a copy of ON_Locale::Ordinal.
    250  ON_Locale::InvariantCultureLCID (=0x00000027U)
    251  The locale is a copy of ON_Locale::InvariantCulture.
    252  */
    253  ON__UINT32 WindowsLCID() const;
    254 
    255  /*
    256  Description:
    257  Get the Microsoft Windows locale id.
    258 
    259  Parameters:
    260  buffer - [out]
    261  A null terminated string containing the Microsoft Windows locale id is returned in this buffer.
    262  The string has the form:
    263 
    264  <language>[-<Script>][-<REGION>][_<sort_order>] (UTF-8 string encoding)
    265 
    266  <language>
    267  ISO 639 language code.
    268  http://www.iso.org/iso/language_codes
    269 
    270  <Script> is optional.
    271  If present, it is a 4 alpha letter ISO 15924 script code
    272  http://www.unicode.org/iso15924/iso15924-codes.html
    273 
    274  <REGION>
    275  ISO 3166-1 country/region identifier. (2 alpha letters)
    276  or UN M.49 code (3 digits)
    277  http://www.iso.org/iso/home/standards/country_codes.htm
    278 
    279  <sort_order>
    280  Up to six letters specifying a sort order.
    281  Microsoft Windows codes are used.
    282 
    283  buffer_capacity - [in]
    284  number of elements in the buffer.
    285  A capacity >= ON_Locale::BUFFER_MAXIMUM_CAPACITY will be large enough to
    286  hold all possible output.
    287 
    288  Returns:
    289  If buffer_capacity is to small or buffer is nullptr, then nullptr is returned.
    290  Otherwise the pointer to buffer is returned.
    291 
    292  Remarks:
    293  The Invariant locale name is the empty string "".
    294  */
    295  const char* GetWindowsLocaleName(
    296  char* buffer,
    297  size_t buffer_capacity
    298  ) const;
    299 
    300  const wchar_t* GetWindowsLocaleName(
    301  wchar_t* buffer,
    302  size_t buffer_capacity
    303  ) const;
    304 
    305  /*
    306  Returns:
    307  Apple OS X / iOS locale name in the form
    308  <language>[-<Script>][_<REGION>]
    309 
    310  <language>
    311  ISO 639 language code.
    312  When avilable, two letter codes from ISO 639-1 are prefered.
    313  http://www.iso.org/iso/language_codes
    314 
    315  <Script> is optional.
    316  If present, it is a 4 alpha letter ISO 15924 script code
    317  http://www.unicode.org/iso15924/iso15924-codes.html
    318 
    319  <REGION>
    320  ISO 3166-1 country/region identifier. (2 alpha letters)
    321  or UN M.49 code (3 digits)
    322  http://www.iso.org/iso/home/standards/country_codes.htm
    323 
    324  Remarks:
    325  The Invariant locale name is the empty string "".
    326  Apple language names have a hyphen (-) before the region.
    327  Apple locale names have an underbar (_) before the region.
    328  */
    329  const char* GetAppleLocaleName(
    330  char* buffer,
    331  size_t buffer_capacity
    332  ) const;
    333 
    334  const wchar_t* GetAppleLocaleName(
    335  wchar_t* buffer,
    336  size_t buffer_capacity
    337  ) const;
    338 
    339  /*
    340  Returns:
    341  Apple OS X / iOS locale name in the form
    342  <language>[-<Script>][-<REGION>]
    343 
    344  <language>
    345  ISO 639 language code.
    346  When avilable, two letter codes from ISO 639-1 are prefered.
    347  http://www.iso.org/iso/language_codes
    348 
    349  <Script> is optional.
    350  If present, it is a 4 alpha letter ISO 15924 script code
    351  http://www.unicode.org/iso15924/iso15924-codes.html
    352 
    353  <REGION>
    354  ISO 3166-1 country/region identifier. (2 alpha letters)
    355  or UN M.49 code (3 digits)
    356  http://www.iso.org/iso/home/standards/country_codes.htm
    357 
    358  Remarks:
    359  The Invariant locale name is the empty string "".
    360  Apple language names have a hyphen (-) before the region.
    361  Apple locale names have an underbar (_) before the region.
    362  */
    363  const char* GetAppleLanguageName(
    364  char* buffer,
    365  size_t buffer_capacity
    366  ) const;
    367 
    368  const wchar_t* GetAppleLanguageName(
    369  wchar_t* buffer,
    370  size_t buffer_capacity
    371  ) const;
    372 
    373  /*
    374  Returns:
    375  A 6 letter locale sort order.
    376  Remarks:
    377  The returned string can be "" if the no sort order is specified for the locale.
    378  The InvariantCulture.WindowsSortOrder() is "".
    379  See Also:
    380  https://msdn.microsoft.com/en-us/library/windows/desktop/dd374060(v=vs.85).aspx
    381  */
    382  const char* WindowsSortOrder() const;
    383 
    384  /*
    385  Returns:
    386  True if the C runtime formatted printing and scanning functions
    387  are using the period character as the decimal point for
    388  doubles and floats.
    389  */
    390  static bool PeriodIsCRuntimeDecimalPoint();
    391 
    392  /*
    393  Description:
    394  Use a call like setlocale(LC_NUMERIC,"C") to configure the
    395  C runtime formatted printing and scanning functions to use the
    396  period character as the decimal point for doubles and floats.
    397  Returns:
    398  True if successful.
    399  */
    400  static bool SetPeriodAsCRuntimeDecimalPoint();
    401 
    402 
    403  /*
    404  Description:
    405  Use a call like setlocale(LC_NUMERIC,"C") to configure the
    406  C runtime formatted printing and scanning functions to use the
    407  period character as the decimal point for doubles and floats.
    408  Returns:
    409  0: failed
    410  1: success
    411  Currently The decimal piont is a period in the C-runtime
    412  formatted printing and scanning functions.
    413  2: success
    414  When called, the decimal piont was not a period, but
    415  a call to ON_Locale::SetPeriodAsCRuntimeDecimalPoint()
    416  restored the defaut behavior.
    417  */
    418  static unsigned int EnforcePeriodAsCRuntimeDecimalPoint();
    419 
    420 
    421  /*
    422  Returns:
    423  True if this is ON_Locale:InvariantCulture or a copy.
    424  */
    425  bool IsInvariantCulture() const;
    426 
    427  /*
    428  Returns:
    429  True if this is ON_Locale:Ordinal or a copy.
    430  */
    431  bool IsOrdinal() const;
    432 
    433  /*
    434  Returns:
    435  True if this is ON_Locale:Ordinal, ON_Locale:InvariantCulture or a copy
    436  of one of them.
    437  */
    438  bool IsOrdinalOrInvariantCulture() const;
    439 
    440  /*
    441  Description:
    442  NumericLocalePtr() is an expert user function needed
    443  to call C-runtime functions that format or parse numbers.
    444  This locale must never be used to collate or map strings.
    445 
    446  The primary use for this function is in opennurbs implementations
    447  of ON_String and ON_wString number formatting and parsing functions.
    448  Example:
    449 
    450  // Call _sprintf_p_l
    451  ON_CRT_locale_t numeric_locale = ON_Locale::CurrentCulture::NumericLocalePtr();
    452  _sprintf_p_l(....,locale,...);
    453 
    454  Returns:
    455  A value that can be passed into C-runtime functions that take
    456  a locale parameter.
    457  */
    458  ON_CRT_locale_t NumericLocalePtr() const;
    459 
    460 
    461  /*
    462  Description:
    463  StringCollateAndMapLocalePtr() is an expert user function needed
    464  to call C-runtime functions that collate (compare)
    465  and map (toupper/tolower) strings. This locale must never be used
    466  for formatting or parsing numbers.
    467 
    468  The primary use for this function is in opennurbs implementations
    469  of ON_String and ON_wString collate and map functions.
    470  Example:
    471 
    472  // Call _wcsicoll_l
    473  ON_CRT_locale_t coll_locale = ON_Locale::CurrentCulture::StringCollateAndMapLocalePtr();
    474  _wcsicoll_l(....,coll_locale);
    475 
    476  Returns:
    477  A value that can be passed into C-runtime functions that take
    478  a locale parameter.
    479  */
    480  ON_CRT_locale_t StringCollateAndMapLocalePtr() const;
    481 
    482  /*
    483  Description:
    484  Create a locale from a Windows locale id.
    485 
    486  Parameters:
    487  lcid - [in]
    488  Windows LCID value or zero for the "ordinal" locale.
    489 
    490  Returns:
    491  ON_Locale identified by lcid.
    492  If lcid is not valid or not supported, a copy of ON_Locale::Ordinal is returned.
    493  */
    494  static ON_Locale FromWindowsLCID(
    495  ON__UINT32 windows_lcid
    496  );
    497 
    498  /*
    499  Description:
    500  Create a locale from a BCP 47 language name.
    501 
    502  Parameters:
    503  language_name - [in]
    504  The language name has the form
    505  <language>[-<Script>][-<REGION>]
    506  Case is not important.
    507 
    508  Returns:
    509  ON_Locale identified by language_name.
    510  If locale_name is not valid or not supported, a copy of ON_Locale::Ordinal is returned.
    511  */
    512  static ON_Locale FromBCP47LanguageName(
    513  const char* language_name
    514  );
    515 
    516  static ON_Locale FromBCP47LanguageName(
    517  const wchar_t* language_name
    518  );
    519 
    520  /*
    521  Description:
    522  Create a locale from a Windows locale name.
    523 
    524  Parameters:
    525  windows_name - [in]
    526  The Windows name has the form
    527  <language>[-<Script>][-<REGION>][_<sort_order>]
    528  Case is not important.
    529 
    530  Returns:
    531  ON_Locale identified by locale_name.
    532  If locale_name is not valid or not supported, a copy of ON_Locale::Ordinal is returned.
    533  */
    534  static ON_Locale FromWindowsName(
    535  const char* windows_name
    536  );
    537 
    538  static ON_Locale FromWindowsName(
    539  const wchar_t* windows_name
    540  );
    541 
    542  /*
    543  Description:
    544  Create a locale from an Apple locale or language name
    545  Parameters:
    546  apple_name - [in]
    547  The Apple name has the form <language>[-<Script>][-<REGION>].
    548  An underbar (_) may be used in place of a hyphen (-).
    549  Case is not important.
    550  Returns:
    551  ON_Locale identified by locale_name.
    552  If locale_name is not valid or not supported, a copy of ON_Locale::Ordinal is returned.
    553 
    554  */
    555  static ON_Locale FromAppleName(
    556  const char* apple_name
    557  );
    558 
    559  static ON_Locale FromAppleName(
    560  const wchar_t* apple_name
    561  );
    562 
    563  /*
    564  Description:
    565  Create a locale from BCP 47 lanugage code, script code and region code.
    566 
    567  Parameters:
    568  language_code - [in]
    569  ISO 639 language code.
    570  When avilable, two letter codes from ISO 639-1 are prefered.
    571  http://www.iso.org/iso/language_codes
    572 
    573  script - [in]
    574  nullptr, empty string, or a 4 letter ISO 15924 script code
    575  http://www.unicode.org/iso15924/iso15924-codes.html
    576 
    577  <REGION>
    578  nullptr, empty string, or an ISO 3166 country/region identifier.
    579  http://www.iso.org/iso/home/standards/country_codes.htm
    580 
    581  Returns:
    582  ON_Locale identified by the locale name.
    583  If the locale name is not valid or not supported, a copy of ON_Locale::Ordinal is returned.
    584  */
    585  static ON_Locale FromSubtags(
    586  const char* language_code,
    587  const char* script_code,
    588  const char* region_code
    589  );
    590 
    591  static ON_Locale FromSubtags(
    592  const wchar_t* language_code,
    593  const wchar_t* script_code,
    594  const wchar_t* region_code
    595  );
    596 
    597  /*
    598  Description:
    599  Attempt to parse a string that is a language name or locale name
    600  and extract language code, extlang code script code, region code
    601  and Windows sort order.
    602 
    603  The language name has the form <language>[<-extlang>][-<Script>][-<REGION>]
    604 
    605  If the Microsoft [_<windows_sort_order>] appears after the language name,
    606  it is parsed.
    607 
    608  Apple "locale ids" of the form <language>_<REGION>" are parsed as well
    609  (an underbar separator instead of a hyphen before <REGION>).
    610 
    611  Parameters:
    612  locale_name - [in]
    613  name to parse. Case is ignored.
    614  locale_name_element_count - [in]
    615  number of elements to parse in locale_name[]
    616  If locale_name_element_count < 0, then a null terminator ends parsing.
    617 
    618  language_code - [out]
    619  language_code_capacity - [in]
    620  number of elements available in language_code[].
    621 
    622  extlang_code - [out]
    623  extlang_code_capacity - [in]
    624  number of elements available in extlang_code[].
    625 
    626  script_code - [out]
    627  script_code_capacity - [in]
    628  number of elements available in script_code[].
    629 
    630  region_code - [out]
    631  region_code_capacity - [in]
    632  number of elements available in region_code[].
    633 
    634  windows_sortorder - [out]
    635  windows_sortorder_capacity - [in]
    636  number of elements available in windows_sortorder[].
    637 
    638  Remarks:
    639  The standards for language identifiers (RFC 5646 and BCP 47) states that a hyphen
    640  ( Unicode U+002D ) is supposed to be the separator between subtags.
    641 
    642  ftp://ftp.isi.edu/in-notes/bcp/bcp47.txt
    643  */
    644  static bool ParseName(
    645  const wchar_t* locale_name,
    646  int locale_name_element_count,
    647  wchar_t* language_code,
    648  size_t language_code_capacity,
    649  wchar_t* extlang_code,
    650  size_t extlang_code_capacity,
    651  wchar_t* script_code,
    652  size_t script_code_capacity,
    653  wchar_t* region_code,
    654  size_t region_code_capacity,
    655  wchar_t* windows_sortorder,
    656  size_t windows_sortorder_capacity
    657  );
    658 
    659  static bool ParseName(
    660  const char* locale_name,
    661  int locale_name_element_count,
    662  char* language_code,
    663  size_t language_code_capacity,
    664  char* extlang_code,
    665  size_t extlang_code_capacity,
    666  char* script_code,
    667  size_t script_code_capacity,
    668  char* region_code,
    669  size_t region_code_capacity,
    670  char* windows_sortorder,
    671  size_t windows_sortorder_capacity
    672  );
    673 
    674 private:
    675  ON_CRT_locale_t m_numeric_locale = 0; // pointer to a C runtime locale type
    676  ON_CRT_locale_t m_string_coll_map_locale = 0; // pointer to a C runtime locale type
    677 
    678  char m_bcp47_language_tag[85]; // <language>-<Script>-<REGION>
    679 
    680  // RFC 4646 language identifier
    681  char m_language_subtag[9]; // ISO 639 code (RFC 4646 reserves 8 alpha elements)
    682  char m_script_subtag[5]; // ISO 15924 code
    683  char m_region_subtag[5]; // ISO 3166 code (2 alpha) or UN M.49 code (3 digit)
    684 
    685  char m_windows_sortorder[7]; // Windows sort order
    686  char m_reserved2[21];
    687 
    688  // Values needed to use Windows tools
    689  ON__UINT32 m_windows_lcid = 0; // Microsoft Windows LCID values (0 = ordinal, 0x0027 = invariant culture)
    690  ON__UINT32 m_reserved3 = 0;
    691 
    692 private:
    693 
    694  // Construct from lcid and matching name
    695  static ON_Locale FromWindowsLCIDAndName(
    696  ON__UINT32 windows_lcid,
    697  const char* name
    698  );
    699 
    700  // Construct from perfect input
    701  //ON_Locale(
    702  // ON__UINT_PTR string_coll_map_locale_ptr,
    703  // ON__UINT32 windows_lcid,
    704  // const char* language_name,
    705  // const char* language_code,
    706  // const char* script_code,
    707  // const char* region_code,
    708  // const char* windows_sortorder
    709  // );
    710 
    711 };
    712 
    713 #endif
    static const ON_Locale InvariantCulture
    Definition: opennurbs_locale.h:103
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2014 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_LOCALE_INC_)
    18 #define OPENNURBS_LOCALE_INC_
    19 
    20 typedef
    21 #if defined(ON_RUNTIME_WIN)
    22  _locale_t
    23 #elif defined(ON_RUNTIME_APPLE)
    24  locale_t
    25 #elif defined(ON_RUNTIME_ANDROID)
    26  locale_t
    27 #else
    28  ON__UINT_PTR
    29 #endif
    30  ON_CRT_locale_t;
    31 
    32 class ON_CLASS ON_Locale
    33 {
    34 public:
    35 
    36  enum WindowsLCID : unsigned int
    37  {
    38  OrdinalLCID = 0, // not a real Windows LCID
    39 
    40  InvariantCultureLCID = 0x0027, // 39 decimal
    41 
    42  // Windows LCID for languages Rhino supports
    43 
    44  // "cs-CZ" Czech, ???? script implied
    45  cs_CZ_LCID = 0x0405, //1029 decimal
    46 
    47  // "de-DE" German, Germany, Latn script implied
    48  de_DE_LCID = 0x0407, // 1031 decimal
    49 
    50  // "en-US" English, US, Latn script implied
    51  en_US_LCID = 0x0409, // 1033 decimal
    52 
    53  // "en-CA" English, Canada, Latn script implied
    54  en_CA_LCID = 0x1009, // 4105 decimal
    55 
    56  // "es-ES_tradnl" Spanish, Spain, Latn script implied, traditional sort
    57  es_ES_tradnl_LCID = 0x040A, // 1034 decimal
    58 
    59  // "es-ES" Spanish, Spain, Latn script implied, modern sort
    60  es_ES_LCID = 0x0c0a, // 3082 decimal
    61 
    62  // "fr-FR" French, France, Latn script implied
    63  fr_FR_LCID = 0x040c, // 1036 decimal
    64 
    65  // "it-IT" Italian, Italy, Latn script implied
    66  it_IT_LCID = 0x0410, // 1040 decimal
    67 
    68  // "ja-JP" Japanese, Japan, ???? script implied
    69  ja_JP_LCID = 0x0411, // 1041 decimal
    70 
    71  // Korean, Republic of Korea, ???? script implied
    72  ko_KR_LCID = 0x0412, // 1042 decimal
    73 
    74  // Polish, Poland, ???? script implied
    75  pl_PL_LCID = 0x0415, // 1045 decimal
    76 
    77  // Portuguese, Portugal, Latn script implied
    78  pt_PT_LCID = 0x0816, // 2070 decimal
    79 
    80  // According to https://en.wikipedia.org/wiki/Chinese_language, Chinese is a family of language
    81  // varieties, often mutually unintelligible. Specifying both Script and REGION
    82  // (zh-Hans-CN or zh-Hant-TW) doesn't narrow things down nearly enough.
    83  //
    84  // Basically we have to hope the string collate and mapping functions supplied by the OS and
    85  // the translations supplied by our staff work well for our customers who select from the
    86  // two types of "Chinese" Rhino offers.
    87  //
    88 
    89  // Standard Chinese (Mandarin), Peoples Republic of China, Hans script implied (simplified characters)
    90  zh_CN_LCID = 0x0804, // 2052 decimal
    91 
    92  // Standard Chinese (Mandarin), Taiwan, Hant script implied (traditional characters)
    93  zh_TW_LCID = 0x0404 // 1028 decimal
    94  };
    95 
    96  // The ordinal locale.
    97  // String compares use ordinal element values.
    98  // The decimal point is a period.
    99  static const ON_Locale Ordinal;
    100 
    101  // The invariant culture locale.
    102  // The decimal point is a period.
    104 
    105 private:
    106  static ON_Locale m_CurrentCulture;
    107 
    108 public:
    109  // Reference to ON_Locale::m_CurrentCulture.
    110  // The value is set by calling ON_Locale::SetCurrentCulture();
    111  // The default is a copy of ON_Locale::Ordinal.
    112  static const ON_Locale& CurrentCulture;
    113 
    114  /*
    115  Description:
    116  Set the current culture locale
    117  Parameters:
    118  current_culture_locale - [in]
    119  */
    120  static bool SetCurrentCulture(
    121  const ON_Locale& current_culture_locale
    122  );
    123 
    124 
    125  // Default construction creates a copy of ON_Local::Ordinal
    126  ON_Locale() ON_NOEXCEPT;
    127 
    128  ~ON_Locale() = default;
    129  ON_Locale(const ON_Locale&) = default;
    130  ON_Locale& operator=(const ON_Locale&) = default;
    131 
    132  // Maximum buffer capacity for any ON_Locale functions
    133  // that return string information in a buffer.
    134  enum
    135  {
    136  BUFFER_MAXIMUM_CAPACITY = 128
    137  };
    138 
    139  /*
    140  Description:
    141  Get the language id.
    142 
    143  Parameters:
    144  buffer - [out]
    145  A null terminated string containing the language id is returned in this buffer.
    146  The string has the form:
    147 
    148  <language>[-<Script>][-<REGION>]
    149 
    150  <language>
    151  ISO 639 language code.
    152  http://www.iso.org/iso/language_codes
    153 
    154  <Script> is optional.
    155  If present, it is a 4 alpha letter ISO 15924 script code
    156  http://www.unicode.org/iso15924/iso15924-codes.html
    157 
    158  <REGION>
    159  ISO 3166-1 country/region identifier. (2 alpha letters)
    160  or UN M.49 code (3 digits)
    161  http://www.iso.org/iso/home/standards/country_codes.htm
    162 
    163  buffer_capacity - [in]
    164  number of elements in the buffer.
    165  A capacity >= ON_Locale::BUFFER_MAXIMUM_CAPACITY will be large enough to
    166  hold all possible output.
    167 
    168  Returns:
    169  If buffer_capacity is to small or buffer is nullptr, then nullptr is returned.
    170  Otherwise the pointer to buffer is returned.
    171 
    172  Remarks:
    173  The Invariant language name is the empty string "".
    174  */
    175  const char* GetBCP47LanguageTag(
    176  char* buffer,
    177  size_t buffer_capacity
    178  ) const;
    179 
    180  const wchar_t* GetBCP47LanguageTag(
    181  wchar_t* buffer,
    182  size_t buffer_capacity
    183  ) const;
    184 
    185  /*
    186  Parameters:
    187  A string of the form
    188 
    189  <language>[-<Script>][-<REGION>]
    190 
    191  <language>
    192  ISO 639 language code.
    193  http://www.iso.org/iso/language_codes
    194 
    195  <Script> is optional.
    196  If present, it is a 4 alpha letter ISO 15924 script code
    197  http://www.unicode.org/iso15924/iso15924-codes.html
    198 
    199  <REGION>
    200  ISO 3166-1 country/region identifier. (2 alpha letters)
    201  or UN M.49 code (3 digits)
    202  http://www.iso.org/iso/home/standards/country_codes.htm
    203 
    204  Remarks:
    205  ON_Locale::InvariantCulture.BCP47LanguageName() = "";
    206  ON_Locale::Oridnal.BCP47LanguageName() = "";
    207  */
    208  const char* BCP47LanguageTag() const;
    209 
    210 
    211  /*
    212  Returns:
    213  ISO 639 language code.
    214  When avilable, two letter codes from ISO 639-1 are prefered.
    215  Remarks:
    216  The InvariantCulture.LanguageCode() is "".
    217  See Also:
    218  http://www.iso.org/iso/language_codes
    219  */
    220  const char* LanguageCode() const;
    221 
    222  /*
    223  Returns:
    224  ISO 3166-1 country/region identifier (2 alpha) or UN M.49 code (3 digits)
    225  Remarks:
    226  The returned string can be "" if the no region is specified.
    227  The InvariantCulture.RegionCode() is "".
    228  See Also:
    229  http://www.iso.org/iso/home/standards/country_codes.htm
    230  */
    231  const char* RegionCode() const;
    232 
    233  /*
    234  Returns:
    235  A 4 letter ISO 15924 script code
    236  Remarks:
    237  The returned string can be "" if the no script is specified for the locale.
    238  The InvariantCulture.ScriptCode() is "".
    239  See Also:
    240  http://www.unicode.org/iso15924/iso15924-codes.html
    241  */
    242  const char* ScriptCode() const;
    243 
    244 
    245  /*
    246  Returns:
    247  Microsoft Windows LCID value
    248  ON_LocaleLCID::OrdinalLCID (=0)
    249  The locale is a copy of ON_Locale::Ordinal.
    250  ON_Locale::InvariantCultureLCID (=0x00000027U)
    251  The locale is a copy of ON_Locale::InvariantCulture.
    252  */
    253  ON__UINT32 WindowsLCID() const;
    254 
    255  /*
    256  Description:
    257  Get the Microsoft Windows locale id.
    258 
    259  Parameters:
    260  buffer - [out]
    261  A null terminated string containing the Microsoft Windows locale id is returned in this buffer.
    262  The string has the form:
    263 
    264  <language>[-<Script>][-<REGION>][_<sort_order>] (UTF-8 string encoding)
    265 
    266  <language>
    267  ISO 639 language code.
    268  http://www.iso.org/iso/language_codes
    269 
    270  <Script> is optional.
    271  If present, it is a 4 alpha letter ISO 15924 script code
    272  http://www.unicode.org/iso15924/iso15924-codes.html
    273 
    274  <REGION>
    275  ISO 3166-1 country/region identifier. (2 alpha letters)
    276  or UN M.49 code (3 digits)
    277  http://www.iso.org/iso/home/standards/country_codes.htm
    278 
    279  <sort_order>
    280  Up to six letters specifying a sort order.
    281  Microsoft Windows codes are used.
    282 
    283  buffer_capacity - [in]
    284  number of elements in the buffer.
    285  A capacity >= ON_Locale::BUFFER_MAXIMUM_CAPACITY will be large enough to
    286  hold all possible output.
    287 
    288  Returns:
    289  If buffer_capacity is to small or buffer is nullptr, then nullptr is returned.
    290  Otherwise the pointer to buffer is returned.
    291 
    292  Remarks:
    293  The Invariant locale name is the empty string "".
    294  */
    295  const char* GetWindowsLocaleName(
    296  char* buffer,
    297  size_t buffer_capacity
    298  ) const;
    299 
    300  const wchar_t* GetWindowsLocaleName(
    301  wchar_t* buffer,
    302  size_t buffer_capacity
    303  ) const;
    304 
    305  /*
    306  Returns:
    307  Apple OS X / iOS locale name in the form
    308  <language>[-<Script>][_<REGION>]
    309 
    310  <language>
    311  ISO 639 language code.
    312  When avilable, two letter codes from ISO 639-1 are prefered.
    313  http://www.iso.org/iso/language_codes
    314 
    315  <Script> is optional.
    316  If present, it is a 4 alpha letter ISO 15924 script code
    317  http://www.unicode.org/iso15924/iso15924-codes.html
    318 
    319  <REGION>
    320  ISO 3166-1 country/region identifier. (2 alpha letters)
    321  or UN M.49 code (3 digits)
    322  http://www.iso.org/iso/home/standards/country_codes.htm
    323 
    324  Remarks:
    325  The Invariant locale name is the empty string "".
    326  Apple language names have a hyphen (-) before the region.
    327  Apple locale names have an underbar (_) before the region.
    328  */
    329  const char* GetAppleLocaleName(
    330  char* buffer,
    331  size_t buffer_capacity
    332  ) const;
    333 
    334  const wchar_t* GetAppleLocaleName(
    335  wchar_t* buffer,
    336  size_t buffer_capacity
    337  ) const;
    338 
    339  /*
    340  Returns:
    341  Apple OS X / iOS locale name in the form
    342  <language>[-<Script>][-<REGION>]
    343 
    344  <language>
    345  ISO 639 language code.
    346  When avilable, two letter codes from ISO 639-1 are prefered.
    347  http://www.iso.org/iso/language_codes
    348 
    349  <Script> is optional.
    350  If present, it is a 4 alpha letter ISO 15924 script code
    351  http://www.unicode.org/iso15924/iso15924-codes.html
    352 
    353  <REGION>
    354  ISO 3166-1 country/region identifier. (2 alpha letters)
    355  or UN M.49 code (3 digits)
    356  http://www.iso.org/iso/home/standards/country_codes.htm
    357 
    358  Remarks:
    359  The Invariant locale name is the empty string "".
    360  Apple language names have a hyphen (-) before the region.
    361  Apple locale names have an underbar (_) before the region.
    362  */
    363  const char* GetAppleLanguageName(
    364  char* buffer,
    365  size_t buffer_capacity
    366  ) const;
    367 
    368  const wchar_t* GetAppleLanguageName(
    369  wchar_t* buffer,
    370  size_t buffer_capacity
    371  ) const;
    372 
    373  /*
    374  Returns:
    375  A 6 letter locale sort order.
    376  Remarks:
    377  The returned string can be "" if the no sort order is specified for the locale.
    378  The InvariantCulture.WindowsSortOrder() is "".
    379  See Also:
    380  https://msdn.microsoft.com/en-us/library/windows/desktop/dd374060(v=vs.85).aspx
    381  */
    382  const char* WindowsSortOrder() const;
    383 
    384  /*
    385  Returns:
    386  True if the C runtime formatted printing and scanning functions
    387  are using the period character as the decimal point for
    388  doubles and floats.
    389  */
    390  static bool PeriodIsCRuntimeDecimalPoint();
    391 
    392  /*
    393  Description:
    394  Use a call like setlocale(LC_NUMERIC,"C") to configure the
    395  C runtime formatted printing and scanning functions to use the
    396  period character as the decimal point for doubles and floats.
    397  Returns:
    398  True if successful.
    399  */
    400  static bool SetPeriodAsCRuntimeDecimalPoint();
    401 
    402 
    403  /*
    404  Description:
    405  Use a call like setlocale(LC_NUMERIC,"C") to configure the
    406  C runtime formatted printing and scanning functions to use the
    407  period character as the decimal point for doubles and floats.
    408  Returns:
    409  0: failed
    410  1: success
    411  Currently The decimal piont is a period in the C-runtime
    412  formatted printing and scanning functions.
    413  2: success
    414  When called, the decimal piont was not a period, but
    415  a call to ON_Locale::SetPeriodAsCRuntimeDecimalPoint()
    416  restored the defaut behavior.
    417  */
    418  static unsigned int EnforcePeriodAsCRuntimeDecimalPoint();
    419 
    420 
    421  /*
    422  Returns:
    423  True if this is ON_Locale:InvariantCulture or a copy.
    424  */
    425  bool IsInvariantCulture() const;
    426 
    427  /*
    428  Returns:
    429  True if this is ON_Locale:Ordinal or a copy.
    430  */
    431  bool IsOrdinal() const;
    432 
    433  /*
    434  Returns:
    435  True if this is ON_Locale:Ordinal, ON_Locale:InvariantCulture or a copy
    436  of one of them.
    437  */
    438  bool IsOrdinalOrInvariantCulture() const;
    439 
    440  /*
    441  Description:
    442  NumericLocalePtr() is an expert user function needed
    443  to call C-runtime functions that format or parse numbers.
    444  This locale must never be used to collate or map strings.
    445 
    446  The primary use for this function is in opennurbs implementations
    447  of ON_String and ON_wString number formatting and parsing functions.
    448  Example:
    449 
    450  // Call _sprintf_p_l
    451  ON_CRT_locale_t numeric_locale = ON_Locale::CurrentCulture::NumericLocalePtr();
    452  _sprintf_p_l(....,locale,...);
    453 
    454  Returns:
    455  A value that can be passed into C-runtime functions that take
    456  a locale parameter.
    457  */
    458  ON_CRT_locale_t NumericLocalePtr() const;
    459 
    460 
    461  /*
    462  Description:
    463  StringCollateAndMapLocalePtr() is an expert user function needed
    464  to call C-runtime functions that collate (compare)
    465  and map (toupper/tolower) strings. This locale must never be used
    466  for formatting or parsing numbers.
    467 
    468  The primary use for this function is in opennurbs implementations
    469  of ON_String and ON_wString collate and map functions.
    470  Example:
    471 
    472  // Call _wcsicoll_l
    473  ON_CRT_locale_t coll_locale = ON_Locale::CurrentCulture::StringCollateAndMapLocalePtr();
    474  _wcsicoll_l(....,coll_locale);
    475 
    476  Returns:
    477  A value that can be passed into C-runtime functions that take
    478  a locale parameter.
    479  */
    480  ON_CRT_locale_t StringCollateAndMapLocalePtr() const;
    481 
    482  /*
    483  Description:
    484  Create a locale from a Windows locale id.
    485 
    486  Parameters:
    487  lcid - [in]
    488  Windows LCID value or zero for the "ordinal" locale.
    489 
    490  Returns:
    491  ON_Locale identified by lcid.
    492  If lcid is not valid or not supported, a copy of ON_Locale::Ordinal is returned.
    493  */
    494  static ON_Locale FromWindowsLCID(
    495  ON__UINT32 windows_lcid
    496  );
    497 
    498  /*
    499  Description:
    500  Create a locale from a BCP 47 language name.
    501 
    502  Parameters:
    503  language_name - [in]
    504  The language name has the form
    505  <language>[-<Script>][-<REGION>]
    506  Case is not important.
    507 
    508  Returns:
    509  ON_Locale identified by language_name.
    510  If locale_name is not valid or not supported, a copy of ON_Locale::Ordinal is returned.
    511  */
    512  static ON_Locale FromBCP47LanguageName(
    513  const char* language_name
    514  );
    515 
    516  static ON_Locale FromBCP47LanguageName(
    517  const wchar_t* language_name
    518  );
    519 
    520  /*
    521  Description:
    522  Create a locale from a Windows locale name.
    523 
    524  Parameters:
    525  windows_name - [in]
    526  The Windows name has the form
    527  <language>[-<Script>][-<REGION>][_<sort_order>]
    528  Case is not important.
    529 
    530  Returns:
    531  ON_Locale identified by locale_name.
    532  If locale_name is not valid or not supported, a copy of ON_Locale::Ordinal is returned.
    533  */
    534  static ON_Locale FromWindowsName(
    535  const char* windows_name
    536  );
    537 
    538  static ON_Locale FromWindowsName(
    539  const wchar_t* windows_name
    540  );
    541 
    542  /*
    543  Description:
    544  Create a locale from an Apple locale or language name
    545  Parameters:
    546  apple_name - [in]
    547  The Apple name has the form <language>[-<Script>][-<REGION>].
    548  An underbar (_) may be used in place of a hyphen (-).
    549  Case is not important.
    550  Returns:
    551  ON_Locale identified by locale_name.
    552  If locale_name is not valid or not supported, a copy of ON_Locale::Ordinal is returned.
    553 
    554  */
    555  static ON_Locale FromAppleName(
    556  const char* apple_name
    557  );
    558 
    559  static ON_Locale FromAppleName(
    560  const wchar_t* apple_name
    561  );
    562 
    563  /*
    564  Description:
    565  Create a locale from BCP 47 lanugage code, script code and region code.
    566 
    567  Parameters:
    568  language_code - [in]
    569  ISO 639 language code.
    570  When avilable, two letter codes from ISO 639-1 are prefered.
    571  http://www.iso.org/iso/language_codes
    572 
    573  script - [in]
    574  nullptr, empty string, or a 4 letter ISO 15924 script code
    575  http://www.unicode.org/iso15924/iso15924-codes.html
    576 
    577  <REGION>
    578  nullptr, empty string, or an ISO 3166 country/region identifier.
    579  http://www.iso.org/iso/home/standards/country_codes.htm
    580 
    581  Returns:
    582  ON_Locale identified by the locale name.
    583  If the locale name is not valid or not supported, a copy of ON_Locale::Ordinal is returned.
    584  */
    585  static ON_Locale FromSubtags(
    586  const char* language_code,
    587  const char* script_code,
    588  const char* region_code
    589  );
    590 
    591  static ON_Locale FromSubtags(
    592  const wchar_t* language_code,
    593  const wchar_t* script_code,
    594  const wchar_t* region_code
    595  );
    596 
    597  /*
    598  Description:
    599  Attempt to parse a string that is a language name or locale name
    600  and extract language code, extlang code script code, region code
    601  and Windows sort order.
    602 
    603  The language name has the form <language>[<-extlang>][-<Script>][-<REGION>]
    604 
    605  If the Microsoft [_<windows_sort_order>] appears after the language name,
    606  it is parsed.
    607 
    608  Apple "locale ids" of the form <language>_<REGION>" are parsed as well
    609  (an underbar separator instead of a hyphen before <REGION>).
    610 
    611  Parameters:
    612  locale_name - [in]
    613  name to parse. Case is ignored.
    614  locale_name_element_count - [in]
    615  number of elements to parse in locale_name[]
    616  If locale_name_element_count < 0, then a null terminator ends parsing.
    617 
    618  language_code - [out]
    619  language_code_capacity - [in]
    620  number of elements available in language_code[].
    621 
    622  extlang_code - [out]
    623  extlang_code_capacity - [in]
    624  number of elements available in extlang_code[].
    625 
    626  script_code - [out]
    627  script_code_capacity - [in]
    628  number of elements available in script_code[].
    629 
    630  region_code - [out]
    631  region_code_capacity - [in]
    632  number of elements available in region_code[].
    633 
    634  windows_sortorder - [out]
    635  windows_sortorder_capacity - [in]
    636  number of elements available in windows_sortorder[].
    637 
    638  Remarks:
    639  The standards for language identifiers (RFC 5646 and BCP 47) states that a hyphen
    640  ( Unicode U+002D ) is supposed to be the separator between subtags.
    641 
    642  ftp://ftp.isi.edu/in-notes/bcp/bcp47.txt
    643  */
    644  static bool ParseName(
    645  const wchar_t* locale_name,
    646  int locale_name_element_count,
    647  wchar_t* language_code,
    648  size_t language_code_capacity,
    649  wchar_t* extlang_code,
    650  size_t extlang_code_capacity,
    651  wchar_t* script_code,
    652  size_t script_code_capacity,
    653  wchar_t* region_code,
    654  size_t region_code_capacity,
    655  wchar_t* windows_sortorder,
    656  size_t windows_sortorder_capacity
    657  );
    658 
    659  static bool ParseName(
    660  const char* locale_name,
    661  int locale_name_element_count,
    662  char* language_code,
    663  size_t language_code_capacity,
    664  char* extlang_code,
    665  size_t extlang_code_capacity,
    666  char* script_code,
    667  size_t script_code_capacity,
    668  char* region_code,
    669  size_t region_code_capacity,
    670  char* windows_sortorder,
    671  size_t windows_sortorder_capacity
    672  );
    673 
    674 private:
    675  ON_CRT_locale_t m_numeric_locale = 0; // pointer to a C runtime locale type
    676  ON_CRT_locale_t m_string_coll_map_locale = 0; // pointer to a C runtime locale type
    677 
    678  char m_bcp47_language_tag[85]; // <language>-<Script>-<REGION>
    679 
    680  // RFC 4646 language identifier
    681  char m_language_subtag[9]; // ISO 639 code (RFC 4646 reserves 8 alpha elements)
    682  char m_script_subtag[5]; // ISO 15924 code
    683  char m_region_subtag[5]; // ISO 3166 code (2 alpha) or UN M.49 code (3 digit)
    684 
    685  char m_windows_sortorder[7]; // Windows sort order
    686  char m_reserved2[21];
    687 
    688  // Values needed to use Windows tools
    689  ON__UINT32 m_windows_lcid = 0; // Microsoft Windows LCID values (0 = ordinal, 0x0027 = invariant culture)
    690  ON__UINT32 m_reserved3 = 0;
    691 
    692 private:
    693 
    694  // Construct from lcid and matching name
    695  static ON_Locale FromWindowsLCIDAndName(
    696  ON__UINT32 windows_lcid,
    697  const char* name
    698  );
    699 
    700  // Construct from perfect input
    701  //ON_Locale(
    702  // ON__UINT_PTR string_coll_map_locale_ptr,
    703  // ON__UINT32 windows_lcid,
    704  // const char* language_name,
    705  // const char* language_code,
    706  // const char* script_code,
    707  // const char* region_code,
    708  // const char* windows_sortorder
    709  // );
    710 
    711 };
    712 
    713 #endif
    static const ON_Locale InvariantCulture
    Definition: opennurbs_locale.h:103
    static const ON_Locale Ordinal
    Definition: opennurbs_locale.h:99
    WindowsLCID
    Definition: opennurbs_locale.h:36
    static const ON_Locale & CurrentCulture
    Definition: opennurbs_locale.h:112
    @@ -77,9 +75,9 @@ $(function() {
    diff --git a/6/dd/d31/class_o_n___texture_coordinates.html b/6/dd/d31/class_o_n___texture_coordinates.html index 2167b139..9b48bf85 100644 --- a/6/dd/d31/class_o_n___texture_coordinates.html +++ b/6/dd/d31/class_o_n___texture_coordinates.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_TextureCoordinates Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/dd/d3e/class_o_n___mesh_ngon_buffer-members.html b/6/dd/d3e/class_o_n___mesh_ngon_buffer-members.html index ca6f4a4e..72c8265f 100644 --- a/6/dd/d3e/class_o_n___mesh_ngon_buffer-members.html +++ b/6/dd/d3e/class_o_n___mesh_ngon_buffer-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d40/class_o_n___class_array.html b/6/dd/d40/class_o_n___class_array.html index 47e566b7..7f3f7422 100644 --- a/6/dd/d40/class_o_n___class_array.html +++ b/6/dd/d40/class_o_n___class_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ClassArray< T > Class Template Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Append copy of element. Increments count by 1.

    < (int) cast is for 64 bit pointers

    -

    26 Sep 2005 Dale Lear User passed in an element of the m_a[] that will get reallocated by the call to Reserve(newcapacity).
    -
    - < ON_*Array<> templates do not require robust copy constructor.

    +

    26 Sep 2005 Dale Lear User passed in an element of the m_a[] that will get reallocated by the call to Reserve(newcapacity).

    +

    < ON_*Array<> templates do not require robust copy constructor.

    < ON_*Array<> templates require a robust operator=.

    @@ -993,8 +990,8 @@ template<class T>

    Insert called with a reference uses operator =.

    Insert copy of element. Uses memmove() to perform any necessary moving. Increases count by 1.

    -

    This call to memset is ok even when T has a vtable because in-place construction is used later.
    - < uses T::operator=() to copy x to array

    +

    This call to memset is ok even when T has a vtable because in-place construction is used later.

    +

    < uses T::operator=() to copy x to array

    @@ -1103,8 +1100,8 @@ template<class T >

    implimentation //////////////////////////////////////////////////////

    array operations ////////////////////////////////////////////////////

    -

    private function for moving blocks of array memory caller is responsible for updating m_count and managing destruction/creation.
    - This call to memmove is ok, even when T is a class with a vtable because the it doesn't change the vtable for the class. Classes that have back pointers, like ON_UserData, are handled elsewhere and cannot be in ON_ClassArray<>s.

    +

    private function for moving blocks of array memory caller is responsible for updating m_count and managing destruction/creation.

    +

    This call to memmove is ok, even when T is a class with a vtable because the it doesn't change the vtable for the class. Classes that have back pointers, like ON_UserData, are handled elsewhere and cannot be in ON_ClassArray<>s.

    @@ -1125,12 +1122,9 @@ template<class T >

    is < current Count(), then count is reduced to value. When the dynamic array needs to grow, this calculates the new value for m_capacity.

    -

    Note: This code appears in ON_SimpleArray<T>::NewCapacity() and ON_ClassArray<T>::NewCapacity(). Changes made to either function should be made to both functions. Because this code is template code that has to support dynamic linking and the code is defined in a header, I'm using copy-and-paste rather than a static.
    -
    -
    - This function returns 2*m_count unless that will result in an additional allocation of more than cap_size bytes. The cap_size concept was added in January 2010 because some calculations on enormous models were slightly underestimating the initial Reserve() size and then wasting gigabytes of memory.
    -
    - cap_size = 128 MB on 32-bit os, 256 MB on 64 bit os

    +

    Note: This code appears in ON_SimpleArray<T>::NewCapacity() and ON_ClassArray<T>::NewCapacity(). Changes made to either function should be made to both functions. Because this code is template code that has to support dynamic linking and the code is defined in a header, I'm using copy-and-paste rather than a static.

    +

    This function returns 2*m_count unless that will result in an additional allocation of more than cap_size bytes. The cap_size concept was added in January 2010 because some calculations on enormous models were slightly underestimating the initial Reserve() size and then wasting gigabytes of memory.

    +

    cap_size = 128 MB on 32-bit os, 256 MB on 64 bit os

    Growing the array will increase the memory use by more than cap_size.

    @@ -1498,8 +1492,8 @@ template<class T >

    Removes element. Uses memmove() to perform any necessary shifting. Decrements count by 1. Does not change capacity

    -

    This call to memset is ok even when T has a vtable because in-place construction is used later.
    - This call to memset is ok even when T has a vtable because in-place construction is used later.

    +

    This call to memset is ok even when T has a vtable because in-place construction is used later.

    +

    This call to memset is ok even when T has a vtable because in-place construction is used later.

    @@ -1656,20 +1650,12 @@ template<class T >

    Shrink/grows capacity. If value

    -

    Allow "expert" users of ON_SimpleArray<>.SetArray(*,*,0) to clean up after themselves and deals with the case when the forget to clean up after themselves.
    -
    -
    -
    -
    -
    -
    - uses "placement" for class construction/destruction

    +

    Allow "expert" users of ON_SimpleArray<>.SetArray(*,*,0) to clean up after themselves and deals with the case when the forget to clean up after themselves.

    +

    uses "placement" for class construction/destruction

    growing

    initialize new elements with default constructor

    -

    even when m_a is an array of classes with vtable pointers, this call to memset(..., 0, ...) is what I want to do because in-place construction will be used when needed on this memory.
    -
    -
    - memory allocation failed

    +

    even when m_a is an array of classes with vtable pointers, this call to memset(..., 0, ...) is what I want to do because in-place construction will be used when needed on this memory.

    +

    memory allocation failed

    shrinking

    memory allocation failed

    @@ -1794,10 +1780,8 @@ template<class T>
    -

    Description: Sort() fills in the index[] array so that array[index[i]] <= array[index[i+1]].
    - The array is not modified.
    - Parameters: sort_algorithm - [in]
    - ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort Use ON::sort_algorithm::heap_sort only if you have done extensive testing with optimized release builds and are confident heap sort is significantly faster. index - [out] an array of length Count() that is returned with some permutation of (0,1,...,Count()-1). compare - [in] compare function compare(a,b) should return <0 if a<b, 0, if a==b, and >0 if a>b.

    +

    Description: Sort() fills in the index[] array so that array[index[i]] <= array[index[i+1]]. The array is not modified.

    +

    Parameters: sort_algorithm - [in] ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort Use ON::sort_algorithm::heap_sort only if you have done extensive testing with optimized release builds and are confident heap sort is significantly faster. index - [out] an array of length Count() that is returned with some permutation of (0,1,...,Count()-1). compare - [in] compare function compare(a,b) should return <0 if a<b, 0, if a==b, and >0 if a>b.

    Returns: true if successful

    @@ -1841,10 +1825,8 @@ template<class T>
    -

    Description: Sort() fills in the index[] array so that array[index[i]] <= array[index[i+1]].
    - The array is not modified.
    - Parameters: sort_algorithm - [in]
    - ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort Use ON::sort_algorithm::heap_sort only if you have done extensive testing with optimized release builds and are confident heap sort is significantly faster. index - [out] an array of length Count() that is returned with some permutation of (0,1,...,Count()-1). compare - [in] compare function compare(a,b,p) should return <0 if a<b, 0, if a==b, and >0 if a>b. p - [in] pointer passed as third argument to compare.

    +

    Description: Sort() fills in the index[] array so that array[index[i]] <= array[index[i+1]]. The array is not modified.

    +

    Parameters: sort_algorithm - [in] ON::sort_algorithm::quick_sort (best in general) or ON::sort_algorithm::heap_sort Use ON::sort_algorithm::heap_sort only if you have done extensive testing with optimized release builds and are confident heap sort is significantly faster. index - [out] an array of length Count() that is returned with some permutation of (0,1,...,Count()-1). compare - [in] compare function compare(a,b,p) should return <0 if a<b, 0, if a==b, and >0 if a>b. p - [in] pointer passed as third argument to compare.

    Returns: true if successful

    Parameters
    @@ -2011,9 +1993,9 @@ template<class T> diff --git a/6/dd/d42/class_o_n__3dm_properties.html b/6/dd/d42/class_o_n__3dm_properties.html index b896693b..e455ef66 100644 --- a/6/dd/d42/class_o_n__3dm_properties.html +++ b/6/dd/d42/class_o_n__3dm_properties.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: ON_3dmProperties Class Reference @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/dd/d4e/class_o_n___stacked_text-members.html b/6/dd/d4e/class_o_n___stacked_text-members.html index b1b821bf..17c2afb1 100644 --- a/6/dd/d4e/class_o_n___stacked_text-members.html +++ b/6/dd/d4e/class_o_n___stacked_text-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d4e/opennurbs__model__geometry_8h_source.html b/6/dd/d4e/opennurbs__model__geometry_8h_source.html index 59414f6b..a4f0abeb 100644 --- a/6/dd/d4e/opennurbs__model__geometry_8h_source.html +++ b/6/dd/d4e/opennurbs__model__geometry_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_model_geometry.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_model_geometry.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_model_geometry.h
    -
    1 /*
    2 //
    3 // Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved.
    4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    5 // McNeel & Associates.
    6 //
    7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    10 //
    11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    12 //
    13 ////////////////////////////////////////////////////////////////
    14 */
    15 
    16 #if !defined(ON_MODEL_GEOMETRY_INC_)
    17 #define ON_MODEL_GEOMETRY_INC_
    18 
    19 /*
    20 Description:
    21  Used to store geometry table object definition and attributes in an ONX_Model.
    22 */
    24 {
    25  ON_OBJECT_DECLARE(ON_ModelGeometryComponent);
    26 
    27 public:
    29 
    30  static const ON_ModelGeometryComponent* FromModelComponentRef(
    31  const class ON_ModelComponentReference& model_component_reference,
    32  const ON_ModelGeometryComponent* none_return_value
    33  );
    34 
    36  const class ON_ComponentManifest& source_manifest,
    37  const class ON_ComponentManifest& destination_manifest,
    38  const class ON_ManifestMap& manifest_map
    39  ) override;
    40 
    41  bool IsEmpty() const;
    42 
    43  bool IsInstanceDefinitionGeometry() const;
    44 
    45 private:
    46 
    47 public:
    48  ON_ModelGeometryComponent() ON_NOEXCEPT;
    49 
    52  ) ON_NOEXCEPT;
    53 
    57 
    58 #if defined(ON_HAS_RVALUEREF)
    59  // rvalue copy constructor
    61  // rvalue assignment operator
    63 #endif
    64 
    65  void Dump(
    66  ON_TextLog& text_log
    67  ) const override;
    68 
    69  /*
    70  Parameters:
    71  geometry - [in]
    72  ON_Curve, ON_Surface, ON_Brep, ON_Mesh, ON_Light, annotation, detail, ...
    73  A new copy of the geometry is managed by the ON_ModelGeometryComponent class.
    74  attributes - [in]
    75  nullptr if not available.
    76  A new copy of the attributes is managed by the ON_ModelGeometryComponent class.
    77  model_geometry_component - [in]
    78  If not nullptr, this class is set. Otherwise operator new allocates
    79  an ON_ModelGeometryComponent class.
    80  Remarks:
    81  The returned ON_ModelGeometryComponent manages geometry and attributes and will
    82  eventually delete them.
    83  */
    84  static ON_ModelGeometryComponent* Create(
    85  const class ON_Object& model_geometry,
    86  const class ON_3dmObjectAttributes* attributes,
    87  ON_ModelGeometryComponent* model_geometry_component
    88  );
    89 
    90  /*
    91  Parameters:
    92  geometry_object - [in]
    93  ON_Curve, ON_Surface, ON_Brep, ON_Mesh, ON_Light, annotation, detail, ...
    94  geometry_object was created on the heap using operator new and
    95  the ON_ModelGeometryComponent destructor will delete geometry_object.
    96  attributes - [in]
    97  attributes is nullptr or was created on the heap using operator new
    98  and the ON_ModelGeometryComponent destructor will delete attributes.
    99  model_geometry - [in]
    100  If not nullptr, this class is set. Otherwise operator new allocates
    101  an ON_ModelGeometryComponent class.
    102  Remarks:
    103  The returned ON_ModelGeometryComponent manages geometry_object and attributes and will
    104  eventually delete them.
    105  */
    106  static ON_ModelGeometryComponent* CreateManaged(
    107  class ON_Object* geometry_object,
    108  class ON_3dmObjectAttributes* attributes,
    109  ON_ModelGeometryComponent* model_geometry_component
    110  );
    111 
    112  /*
    113  Parameters:
    114  bManageGeometry - [in]
    115  If true, geometry_object was created on the heap using operator new and
    116  the ON_ModelGeometryComponent destructor will delete geometry_object. Othewise
    117  the expert caller is carefully managing the geometry_object instance and memory.
    118  geometry_object - [in]
    119  ON_Curve, ON_Surface, ON_Brep, ON_Mesh, ON_Light, annotation, detail, ...
    120  bManageAttributes - [in]
    121  If true, attributes is nullptr or was created on the heap using operator new
    122  and the ON_ModelGeometryComponent destructor will delete attributes. Othewise
    123  the expert caller is carefully managing the attributes instance and memory.
    124  attributes - [in]
    125  nullptr if not available
    126  model_geometry_component - [in]
    127  If not nullptr, this class is set. Otherwise operator new allocates
    128  an ON_ModelGeometryComponent class.
    129  */
    130  static ON_ModelGeometryComponent* CreateForExperts(
    131  bool bManageGeometry,
    132  class ON_Object* geometry_object,
    133  bool bManageAttributes,
    134  class ON_3dmObjectAttributes* attributes,
    135  ON_ModelGeometryComponent* model_geometry_component
    136  );
    137 
    138  /*
    139  Parameters:
    140  no_geometry_return_value - [in]
    141  This value is returned if no geometric object has been set.
    142  A good choices for this parameter's value depends on the context.
    143  Common options are nullptr.
    144  Returns:
    145  The curve, surface, annotation, detail, light, ... geometry,
    146  or no_geometry_return_value if the geometry has not been set.
    147  If the geometry is a light, then ComponentType() will return ON_ModelComponent::Type::RenderLight.
    148  If the geometry is set and something besides light, then ComponentType()
    149  will return ON_ModelComponent::Type::ModelGeometry.
    150  Otherwise, ComponentType() will return ON_ModelComponent::Type::ModelGeometry::Unset.
    151  */
    152  const class ON_Geometry* Geometry(
    153  const class ON_Geometry* no_geometry_return_value
    154  ) const;
    155 
    156  /*
    157  Parameters:
    158  no_attributes_return_value - [in]
    159  This value is returned if no attributes have been set.
    160  A good choices for this parameter's value depends on the context.
    161  Common options are nullptr, &ON_3dmObjectAttributes::Unset,
    162  &ON_3dmObjectAttributes::Default, or the model's current default attributes.
    163  Returns:
    164  The layer, rendering and other attributes for this element,
    165  or no_attributes_return_value if the attributes have not been set.
    166  */
    168  const ON_3dmObjectAttributes* no_attributes_return_value
    169  ) const;
    170 
    171 private:
    172 
    173 #pragma ON_PRAGMA_WARNING_PUSH
    174 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    175  // C4251: ... needs to have dll-interface to be used by clients of class ...
    176  // m_geometry_sp is private and all code that manages m_sp is explicitly implemented in the DLL.
    177  // m_attributes_sp is private and all code that manages m_sp is explicitly implemented in the DLL.
    178 private:
    179  std::shared_ptr<ON_Geometry> m_geometry_sp;
    180 private:
    181  std::shared_ptr<ON_3dmObjectAttributes> m_attributes_sp;
    182 #pragma ON_PRAGMA_WARNING_POP
    183 };
    184 
    185 #if defined(ON_DLL_TEMPLATE)
    186 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_ModelGeometryComponent*>;
    187 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_ModelGeometryComponent*>;
    188 #endif
    189 
    190 #endif
    Definition: opennurbs_model_component.h:25
    +
    1 /*
    2 //
    3 // Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved.
    4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    5 // McNeel & Associates.
    6 //
    7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    10 //
    11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    12 //
    13 ////////////////////////////////////////////////////////////////
    14 */
    15 
    16 #if !defined(ON_MODEL_GEOMETRY_INC_)
    17 #define ON_MODEL_GEOMETRY_INC_
    18 
    19 /*
    20 Description:
    21  Used to store geometry table object definition and attributes in an ONX_Model.
    22 */
    24 {
    25  ON_OBJECT_DECLARE(ON_ModelGeometryComponent);
    26 
    27 public:
    29 
    30  static const ON_ModelGeometryComponent* FromModelComponentRef(
    31  const class ON_ModelComponentReference& model_component_reference,
    32  const ON_ModelGeometryComponent* none_return_value
    33  );
    34 
    36  const class ON_ComponentManifest& source_manifest,
    37  const class ON_ComponentManifest& destination_manifest,
    38  const class ON_ManifestMap& manifest_map
    39  ) override;
    40 
    41  bool IsEmpty() const;
    42 
    43  bool IsInstanceDefinitionGeometry() const;
    44 
    45 private:
    46 
    47 public:
    48  ON_ModelGeometryComponent() ON_NOEXCEPT;
    49 
    52  ) ON_NOEXCEPT;
    53 
    56  ON_ModelGeometryComponent& operator=(const ON_ModelGeometryComponent&);
    57 
    58 #if defined(ON_HAS_RVALUEREF)
    59  // rvalue copy constructor
    60  ON_ModelGeometryComponent( ON_ModelGeometryComponent&& ) ON_NOEXCEPT;
    61  // rvalue assignment operator
    62  ON_ModelGeometryComponent& operator=( ON_ModelGeometryComponent&& );
    63 #endif
    64 
    65  void Dump(
    66  ON_TextLog& text_log
    67  ) const override;
    68 
    69  /*
    70  Parameters:
    71  geometry - [in]
    72  ON_Curve, ON_Surface, ON_Brep, ON_Mesh, ON_Light, annotation, detail, ...
    73  A new copy of the geometry is managed by the ON_ModelGeometryComponent class.
    74  attributes - [in]
    75  nullptr if not available.
    76  A new copy of the attributes is managed by the ON_ModelGeometryComponent class.
    77  model_geometry_component - [in]
    78  If not nullptr, this class is set. Otherwise operator new allocates
    79  an ON_ModelGeometryComponent class.
    80  Remarks:
    81  The returned ON_ModelGeometryComponent manages geometry and attributes and will
    82  eventually delete them.
    83  */
    84  static ON_ModelGeometryComponent* Create(
    85  const class ON_Object& model_geometry,
    86  const class ON_3dmObjectAttributes* attributes,
    87  ON_ModelGeometryComponent* model_geometry_component
    88  );
    89 
    90  /*
    91  Parameters:
    92  geometry_object - [in]
    93  ON_Curve, ON_Surface, ON_Brep, ON_Mesh, ON_Light, annotation, detail, ...
    94  geometry_object was created on the heap using operator new and
    95  the ON_ModelGeometryComponent destructor will delete geometry_object.
    96  attributes - [in]
    97  attributes is nullptr or was created on the heap using operator new
    98  and the ON_ModelGeometryComponent destructor will delete attributes.
    99  model_geometry - [in]
    100  If not nullptr, this class is set. Otherwise operator new allocates
    101  an ON_ModelGeometryComponent class.
    102  Remarks:
    103  The returned ON_ModelGeometryComponent manages geometry_object and attributes and will
    104  eventually delete them.
    105  */
    106  static ON_ModelGeometryComponent* CreateManaged(
    107  class ON_Object* geometry_object,
    108  class ON_3dmObjectAttributes* attributes,
    109  ON_ModelGeometryComponent* model_geometry_component
    110  );
    111 
    112  /*
    113  Parameters:
    114  bManageGeometry - [in]
    115  If true, geometry_object was created on the heap using operator new and
    116  the ON_ModelGeometryComponent destructor will delete geometry_object. Othewise
    117  the expert caller is carefully managing the geometry_object instance and memory.
    118  geometry_object - [in]
    119  ON_Curve, ON_Surface, ON_Brep, ON_Mesh, ON_Light, annotation, detail, ...
    120  bManageAttributes - [in]
    121  If true, attributes is nullptr or was created on the heap using operator new
    122  and the ON_ModelGeometryComponent destructor will delete attributes. Othewise
    123  the expert caller is carefully managing the attributes instance and memory.
    124  attributes - [in]
    125  nullptr if not available
    126  model_geometry_component - [in]
    127  If not nullptr, this class is set. Otherwise operator new allocates
    128  an ON_ModelGeometryComponent class.
    129  */
    130  static ON_ModelGeometryComponent* CreateForExperts(
    131  bool bManageGeometry,
    132  class ON_Object* geometry_object,
    133  bool bManageAttributes,
    134  class ON_3dmObjectAttributes* attributes,
    135  ON_ModelGeometryComponent* model_geometry_component
    136  );
    137 
    138  /*
    139  Parameters:
    140  no_geometry_return_value - [in]
    141  This value is returned if no geometric object has been set.
    142  A good choices for this parameter's value depends on the context.
    143  Common options are nullptr.
    144  Returns:
    145  The curve, surface, annotation, detail, light, ... geometry,
    146  or no_geometry_return_value if the geometry has not been set.
    147  If the geometry is a light, then ComponentType() will return ON_ModelComponent::Type::RenderLight.
    148  If the geometry is set and something besides light, then ComponentType()
    149  will return ON_ModelComponent::Type::ModelGeometry.
    150  Otherwise, ComponentType() will return ON_ModelComponent::Type::ModelGeometry::Unset.
    151  */
    152  const class ON_Geometry* Geometry(
    153  const class ON_Geometry* no_geometry_return_value
    154  ) const;
    155 
    156  /*
    157  Parameters:
    158  no_attributes_return_value - [in]
    159  This value is returned if no attributes have been set.
    160  A good choices for this parameter's value depends on the context.
    161  Common options are nullptr, &ON_3dmObjectAttributes::Unset,
    162  &ON_3dmObjectAttributes::Default, or the model's current default attributes.
    163  Returns:
    164  The layer, rendering and other attributes for this element,
    165  or no_attributes_return_value if the attributes have not been set.
    166  */
    168  const ON_3dmObjectAttributes* no_attributes_return_value
    169  ) const;
    170 
    171 private:
    172 
    173 #pragma ON_PRAGMA_WARNING_PUSH
    174 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 )
    175  // C4251: ... needs to have dll-interface to be used by clients of class ...
    176  // m_geometry_sp is private and all code that manages m_sp is explicitly implemented in the DLL.
    177  // m_attributes_sp is private and all code that manages m_sp is explicitly implemented in the DLL.
    178 private:
    179  std::shared_ptr<ON_Geometry> m_geometry_sp;
    180 private:
    181  std::shared_ptr<ON_3dmObjectAttributes> m_attributes_sp;
    182 #pragma ON_PRAGMA_WARNING_POP
    183 };
    184 
    185 #if defined(ON_DLL_TEMPLATE)
    186 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_ModelGeometryComponent*>;
    187 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_ModelGeometryComponent*>;
    188 #endif
    189 
    190 #endif
    Definition: opennurbs_model_component.h:25
    virtual bool UpdateReferencedComponents(const class ON_ComponentManifest &source_manifest, const class ON_ComponentManifest &destination_manifest, const class ON_ManifestMap &manifest_map)
    void Dump(ON_TextLog &) const override
    Definition: opennurbs_archive.h:1520
    @@ -87,9 +85,9 @@ $(function() {
    diff --git a/6/dd/d50/class_o_n___check_sum.html b/6/dd/d50/class_o_n___check_sum.html index 810f1576..be60137f 100644 --- a/6/dd/d50/class_o_n___check_sum.html +++ b/6/dd/d50/class_o_n___check_sum.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_CheckSum Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    -

    C++ default operator=, operator==, and copy constructor work fine.
    -Descripton: Set check sum values for a buffer Parameters: size - [in] number of bytes in buffer buffer - [in]
    - time - [in] last modified time in seconds since Jan 1, 1970, UCT Returns: True if checksum is set.

    +

    C++ default operator=, operator==, and copy constructor work fine. Descripton: Set check sum values for a buffer Parameters: size - [in] number of bytes in buffer buffer - [in] time - [in] last modified time in seconds since Jan 1, 1970, UCT Returns: True if checksum is set.

    @@ -485,9 +481,9 @@ Descripton: Set check sum values for a buffer Parameters: size - [in] number of diff --git a/6/dd/d51/class_o_n___history_record.html b/6/dd/d51/class_o_n___history_record.html index 914df97b..d74b84da 100644 --- a/6/dd/d51/class_o_n___history_record.html +++ b/6/dd/d51/class_o_n___history_record.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_HistoryRecord Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -764,8 +762,7 @@ Additional Inherited Members
    -

    12 May, 2015 - Lowell When an object is replaced and the old object has a history record with CopyOnReplaceObject() set to tru, then history record is copied and attached to the new object. That allows a descendant object to continue the history linkage after it is edited.
    -See http://mcneel.myjetbrains.com/youtrack/issue/RH-30399

    +

    12 May, 2015 - Lowell When an object is replaced and the old object has a history record with CopyOnReplaceObject() set to tru, then history record is copied and attached to the new object. That allows a descendant object to continue the history linkage after it is edited. See http://mcneel.myjetbrains.com/youtrack/issue/RH-30399

    @@ -2634,8 +2631,8 @@ See http://mcnee
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -2756,9 +2753,9 @@ See http://mcnee
    diff --git a/6/dd/d55/class_o_n___model_component_reference-members.html b/6/dd/d55/class_o_n___model_component_reference-members.html index 2fd62123..31dc27af 100644 --- a/6/dd/d55/class_o_n___model_component_reference-members.html +++ b/6/dd/d55/class_o_n___model_component_reference-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d5b/class_o_n___obsolete_user_data.html b/6/dd/d5b/class_o_n___obsolete_user_data.html index 0ac0dd8a..8fd5795a 100644 --- a/6/dd/d5b/class_o_n___obsolete_user_data.html +++ b/6/dd/d5b/class_o_n___obsolete_user_data.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ObsoleteUserData Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d5c/opennurbs__textglyph_8h_source.html b/6/dd/d5c/opennurbs__textglyph_8h_source.html index eea78554..b6364a33 100644 --- a/6/dd/d5c/opennurbs__textglyph_8h_source.html +++ b/6/dd/d5c/opennurbs__textglyph_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_textglyph.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_textglyph.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /*
    2 //
    3 // Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved.
    4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    5 // McNeel & Associates.
    6 //
    7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    10 //
    11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    12 //
    13 ////////////////////////////////////////////////////////////////
    14 */
    15 #if !defined(OPENNURBS_TEXTGLYPH_INC_)
    16 #define OPENNURBS_TEXTGLYPH_INC_
    17 
    18 
    19 #endif
    diff --git a/6/dd/d60/class_o_n___mapping_channel.html b/6/dd/d60/class_o_n___mapping_channel.html index 40f0c687..a6f066f6 100644 --- a/6/dd/d60/class_o_n___mapping_channel.html +++ b/6/dd/d60/class_o_n___mapping_channel.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MappingChannel Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Class ON_MappingChannel

    Description: ON_3dmObjectAttributes uses ON_MappingChannel to record which texture mapping function to use when applying a texture with a matching mapping channel id. When an object is rendered, if the material has textures and ON_Texture::m_mapping_channel_id = ON_MappingChannel::m_mapping_channel_id, then the mapping with id m_mapping_id is used to map the texture. Otherwise, the mesh m_T[] texture coordinates are used to apply the texture.

    Constructor & Destructor Documentation

    @@ -261,9 +255,9 @@ Public Attributes
    diff --git a/6/dd/d60/class_o_n_x___model_test-members.html b/6/dd/d60/class_o_n_x___model_test-members.html index c43de3fc..e22f63a1 100644 --- a/6/dd/d60/class_o_n_x___model_test-members.html +++ b/6/dd/d60/class_o_n_x___model_test-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d63/struct_o_n___r_tree_capsule-members.html b/6/dd/d63/struct_o_n___r_tree_capsule-members.html index a62bd82d..8783b6de 100644 --- a/6/dd/d63/struct_o_n___r_tree_capsule-members.html +++ b/6/dd/d63/struct_o_n___r_tree_capsule-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d65/class_o_n___angle_unit_name-members.html b/6/dd/d65/class_o_n___angle_unit_name-members.html index 941814ee..13ed29b0 100644 --- a/6/dd/d65/class_o_n___angle_unit_name-members.html +++ b/6/dd/d65/class_o_n___angle_unit_name-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d6b/class_o_n___bezier_surface-members.html b/6/dd/d6b/class_o_n___bezier_surface-members.html index aba81714..8e694608 100644 --- a/6/dd/d6b/class_o_n___bezier_surface-members.html +++ b/6/dd/d6b/class_o_n___bezier_surface-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d73/class_o_n___cage_morph-members.html b/6/dd/d73/class_o_n___cage_morph-members.html index c9f6367e..9dd5566c 100644 --- a/6/dd/d73/class_o_n___cage_morph-members.html +++ b/6/dd/d73/class_o_n___cage_morph-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d76/class_o_n___windows_bitmap-members.html b/6/dd/d76/class_o_n___windows_bitmap-members.html index ddabf729..c99ebf22 100644 --- a/6/dd/d76/class_o_n___windows_bitmap-members.html +++ b/6/dd/d76/class_o_n___windows_bitmap-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d7c/opennurbs__workspace_8h_source.html b/6/dd/d7c/opennurbs__workspace_8h_source.html index 81008667..1216e030 100644 --- a/6/dd/d7c/opennurbs__workspace_8h_source.html +++ b/6/dd/d7c/opennurbs__workspace_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_workspace.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_workspace.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d7d/class_o_n__2d_vector_array.html b/6/dd/d7d/class_o_n__2d_vector_array.html index 6e3f3e24..ef50f626 100644 --- a/6/dd/d7d/class_o_n__2d_vector_array.html +++ b/6/dd/d7d/class_o_n__2d_vector_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2dVectorArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d86/opennurbs__public__examples_8h_source.html b/6/dd/d86/opennurbs__public__examples_8h_source.html index a6e62151..13a3c724 100644 --- a/6/dd/d86/opennurbs__public__examples_8h_source.html +++ b/6/dd/d86/opennurbs__public__examples_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_public_examples.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_public_examples.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /*
    2 // Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved.
    3 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    4 // McNeel & Assoicates.
    5 //
    6 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    7 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    8 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    9 //
    10 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    11 //
    12 ////////////////////////////////////////////////////////////////
    13 */
    14 
    15 #if !defined(OPENNURBS_PUBLIC_EXAMPLES_INC_)
    16 #define OPENNURBS_PUBLIC_EXAMPLES_INC_
    17 
    18 // If "OPENNURBS_IMPORTS" is defined, then the example programs
    19 // dynamically link with opennurbs_public.dll (Windows DLL).
    20 //
    21 // Otherwise, the example programs statically link with opennurbs_public_staticlib.lib.
    22 
    23 //#define OPENNURBS_IMPORTS
    24 
    25 #include "opennurbs_public.h"
    26 
    27 #if defined(ON_COMPILER_MSC)
    28 // Microsoft Compiler linking pragmas
    29 
    30 #if defined(OPENNURBS_EXPORTS) || defined(ON_COMPILING_OPENNURBS)
    31 // If you get the following error, your compiler settings
    32 // indicate you are building an opennurbs library.
    33 // This file is used for linking with opennurbs libraries
    34 // that have been previously built.
    35 #error This file contains linking pragmas for using the opennurbs library.
    36 #endif
    37 
    38 #if defined(OPENNURBS_IMPORTS)
    39 #pragma message( " --- dynamically linking opennurbs (DLL)." )
    40 #pragma comment(lib, "\"" OPENNURBS_OUTPUT_DIR "/" "opennurbs_public.lib" "\"")
    41 #else
    42 #pragma message( " --- statically linking opennurbs." )
    43 #pragma comment(lib, "\"" OPENNURBS_OUTPUT_DIR "/" "opennurbs_public_staticlib.lib" "\"")
    44 #pragma comment(lib, "\"" OPENNURBS_OUTPUT_DIR "/" "zlib.lib" "\"")
    45 #pragma comment(lib, "\"" OPENNURBS_OUTPUT_DIR "/" "freetype263_staticlib.lib" "\"")
    46 #pragma comment(lib, "rpcrt4.lib")
    47 #pragma comment(lib, "shlwapi.lib")
    48 #endif
    49 
    50 #endif
    51 
    52 #endif
    diff --git a/6/dd/d88/class_o_n___point_grid-members.html b/6/dd/d88/class_o_n___point_grid-members.html index 14e3bf96..31b15926 100644 --- a/6/dd/d88/class_o_n___point_grid-members.html +++ b/6/dd/d88/class_o_n___point_grid-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d89/class_o_n___plane_equation.html b/6/dd/d89/class_o_n___plane_equation.html index ce156238..16f827f6 100644 --- a/6/dd/d89/class_o_n___plane_equation.html +++ b/6/dd/d89/class_o_n___plane_equation.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_PlaneEquation Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Test points on a bezier curve to see if they are near the plane. Parameters: bezcrv - [in] s0 - [in] s1 - [in] the interval from s0 to s1 is tested (s0 < s1) sample_count - [in] number of interior points to test.
    - Numbers like 1, 3, 7, 15, ... work best. endpoint_tolerance - [in] If >= 0, then the end points are tested to see if the distance from the endpoints is <= endpoint_tolerance. interior_tolerance - [in] (>=0 and >=endpoint_tolerance) This tolerance is used to test the interior sample points. smin - [put] If not nullptr, *smin = bezier parameter of nearest test point. smax - [put] If not nullptr, *smax = bezier parameter of farthest test point. If false is returned, this is the parameter of the test point that failed. Returns: True if all the tested points passed the tolerance test. False if at least one tested point failed the tolerance test. (The test terminates when the first failure is encountered.)

    +

    Description: Test points on a bezier curve to see if they are near the plane. Parameters: bezcrv - [in] s0 - [in] s1 - [in] the interval from s0 to s1 is tested (s0 < s1) sample_count - [in] number of interior points to test. Numbers like 1, 3, 7, 15, ... work best. endpoint_tolerance - [in] If >= 0, then the end points are tested to see if the distance from the endpoints is <= endpoint_tolerance. interior_tolerance - [in] (>=0 and >=endpoint_tolerance) This tolerance is used to test the interior sample points. smin - [put] If not nullptr, *smin = bezier parameter of nearest test point. smax - [put] If not nullptr, *smax = bezier parameter of farthest test point. If false is returned, this is the parameter of the test point that failed. Returns: True if all the tested points passed the tolerance test. False if at least one tested point failed the tolerance test. (The test terminates when the first failure is encountered.)

    @@ -1386,9 +1383,9 @@ Static Public Attributes diff --git a/6/dd/d8a/class_o_n___poly_curve-members.html b/6/dd/d8a/class_o_n___poly_curve-members.html index 97ba1f5d..6f02b742 100644 --- a/6/dd/d8a/class_o_n___poly_curve-members.html +++ b/6/dd/d8a/class_o_n___poly_curve-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d8e/class_o_n___mesh_face_side-members.html b/6/dd/d8e/class_o_n___mesh_face_side-members.html index ae7c3822..c719452d 100644 --- a/6/dd/d8e/class_o_n___mesh_face_side-members.html +++ b/6/dd/d8e/class_o_n___mesh_face_side-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d8f/class_o_n__2d_point-members.html b/6/dd/d8f/class_o_n__2d_point-members.html index 05d732c6..a7bdf59c 100644 --- a/6/dd/d8f/class_o_n__2d_point-members.html +++ b/6/dd/d8f/class_o_n__2d_point-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d90/class_o_n___simple_fixed_size_pool_iterator.html b/6/dd/d90/class_o_n___simple_fixed_size_pool_iterator.html index dbd7e489..3e0f8ed7 100644 --- a/6/dd/d90/class_o_n___simple_fixed_size_pool_iterator.html +++ b/6/dd/d90/class_o_n___simple_fixed_size_pool_iterator.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SimpleFixedSizePoolIterator< T > Class Template Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d9b/class_o_n___mesh_curve_parameters-members.html b/6/dd/d9b/class_o_n___mesh_curve_parameters-members.html index 6db9a40a..1d1efd05 100644 --- a/6/dd/d9b/class_o_n___mesh_curve_parameters-members.html +++ b/6/dd/d9b/class_o_n___mesh_curve_parameters-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/d9b/opennurbs__system__compiler_8h_source.html b/6/dd/d9b/opennurbs__system__compiler_8h_source.html index 008e0b59..037bee27 100644 --- a/6/dd/d9b/opennurbs__system__compiler_8h_source.html +++ b/6/dd/d9b/opennurbs__system__compiler_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_system_compiler.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_system_compiler.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2014 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 /*
    18 ////////////////////////////////////////////////////////////////
    19 //
    20 // Determines what compiler is being used.
    21 //
    22 ////////////////////////////////////////////////////////////////
    23 */
    24 
    25 
    26 #if !defined(OPENNURBS_SYSTEM_COMPILER_INC_)
    27 #define OPENNURBS_SYSTEM_COMPILER_INC_
    28 
    29 #if !defined(_GNU_SOURCE)
    30 #define _GNU_SOURCE
    31 #endif
    32 
    33 /*
    34 ////////////////////////////////////////////////////////////
    35 ////////////////////////////////////////////////////////////
    36 ////////////////////////////////////////////////////////////
    37 //
    38 // BEGIN - ON_COMPILER_* defines
    39 //
    40 // ON_COMPILER_* specifies the C/C++ compiler used.
    41 // At most one the ON_COMPILER_* should be defined.
    42 //
    43 */
    44 
    45 
    46 /*
    47 // Compilers that require special declaration of callback functions
    48 // will change ON_CALLBACK_CDECL accordingly.
    49 */
    50 #define ON_CALLBACK_CDECL
    51 
    52 /*
    53 // Compilers that require special declaration of callback functions
    54 // will change ON_CALLBACK_CDECL accordingly.
    55 */
    56 #define ON_VARGS_FUNC_CDECL
    57 
    58 
    59 /*
    60 // Compilers that do not support the C++ 11 noexcept keyword
    61 // or similar will change ON_NOEXCEPT accordingly.
    62 */
    63 #define ON_NOEXCEPT noexcept
    64 
    65 /*
    66 // Compilers that do not support the C++ 11 rvalue refs
    67 // will change ON_HAS_RVALUEREF accordingly.
    68 */
    69 #define ON_HAS_RVALUEREF
    70 
    71 #if defined (_MSC_VER)
    72 /*
    73 ////////////////////////////////////////////////////////////
    74 ////////////////////////////////////////////////////////////
    75 //
    76 // ON_COMPILER_MSC
    77 //
    78 */
    79 
    80 #define ON_COMPILER_MSC
    81 
    82 /*
    83 // Usage example - disables warning number 1234 - see CL docs for details
    84 #pragma ON_PRAGMA_WARNING_PUSH
    85 #pragma ON_PRAGMA_WARNING_DISABLE_MSC(1234)
    86 ...
    87 #pragma ON_PRAGMA_WARNING_POP
    88 */
    89 #define ON_PRAGMA_WARNING_PUSH warning( push )
    90 #define ON_PRAGMA_WARNING_POP warning( pop )
    91 #define ON_PRAGMA_WARNING_DISABLE_MSC(ON_PRAGMA_WARNING_DISABLE_param) warning( disable : ON_PRAGMA_WARNING_DISABLE_param ) // Microsoft CL warning disable
    92 
    93 // Opennurbs warning level is /Wall
    94 // Microsoft, Freetype, and other external header files issue warnings we can't do anything about
    95 #define ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE warning( push, 1 )
    96 #define ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE warning( pop )
    97 
    98 #if !defined(_CRT_SECURE_NO_DEPRECATE)
    99 #define _CRT_SECURE_NO_DEPRECATE
    100 /*
    101 // Visual Studio 2005 issues a C4996 warning for lots of
    102 // standard C runtime functions that take string pointers.
    103 // The _CRT_SECURE_NO_DEPRECATE suppresses these warnings.
    104 // TODO - clean up our code and remove do not define _CRT_SECURE_NO_DEPRECATE
    105 */
    106 #endif
    107 
    108 /*
    109 // Microsoft's Visual C/C++ requires functions that use vargs
    110 // to be declared with __cdecl
    111 // Since this code must also compile with non-Micorosoft compilers,
    112 // the ON_VARGS_FUNC_CDECL macro is used to insert __cdecl when needed.
    113 */
    114 #undef ON_VARGS_FUNC_CDECL
    115 #define ON_VARGS_FUNC_CDECL __cdecl
    116 
    117 /*
    118 // Microsoft's Visual C/C++ requires some callback functions
    119 // to be declared with __cdecl
    120 // Since this code must also compile with non-Micorosoft compilers,
    121 // the ON_VARGS_FUNC_CDECL macro is used to insert __cdecl when needed.
    122 */
    123 #undef ON_CALLBACK_CDECL
    124 #define ON_CALLBACK_CDECL __cdecl
    125 
    126 #if _MSC_VER < 1700
    127 #undef ON_HAS_RVALUEREF
    128 #endif
    129 
    130 #if _MSC_VER >= 1700 && _MSC_VER < 1900
    131 
    132 // VC 2012 and 2013 does not support the C++11 noexcept specifier.
    133 // Appending throw() indicates the function does not throw
    134 // exceptions. Using throw() is not 100% equivalent to
    135 // noexcept because you cannot use a bool parameter
    136 // and hence cannot do things like
    137 // class MyClass : public MyOtherClass
    138 // {
    139 // void MyClass() noexcept(std::is_nothrow_default_constructible<MyOtherClass>::value)
    140 // void MyClass(const MyClass& ) noexcept(std::is_nothrow_copy_constructible<MyOtherClass>::value)
    141 // };
    142 #undef ON_NOEXCEPT
    143 #define ON_NOEXCEPT throw()
    144 #endif
    145 
    146 #if _MSC_VER >= 1300
    147 #define ON_COMPILER_MSC1300
    148 #if _MSC_VER >= 1400
    149 /* Using at least Visual C++ 8.0 (2005) */
    150 #define ON_COMPILER_MSC1400
    151 #if _MSC_VER >= 1600
    152 /* Using at least Visual C++ 10.0 (2010) */
    153 #define ON_COMPILER_MSC1600
    154 #if _MSC_VER >= 1700
    155 /* Using at least Visual C++ 11.0 (2012) */
    156 #define ON_COMPILER_MSC1700
    157 #if _MSC_VER >= 1800
    158 /* Using at least Visual C++ 12.0 (2013) */
    159 #define ON_COMPILER_MSC1800
    160 #if _MSC_VER >= 1900
    161 /* Using at least Visual C++ 14.0 (2015) */
    162 #define ON_COMPILER_MSC1900
    163 
    164 #if !defined(OPENNURBS_WALL) && !defined(ON_COMPILING_OPENNURBS)
    165 /*
    166 // TEMPORARY C4456 SUPRESSION Feb 17 2016 - WILL BE REMOVED ASAP
    167 // Rhino code is still too dirty to leave 4456 on.
    168 */
    169 // Supress Warning C4456 declaration of '...' hides previous local declaration ...
    170 #pragma ON_PRAGMA_WARNING_DISABLE_MSC(4456)
    171 #endif
    172 
    173 // C4100 '...': unreferenced formal parameter ...
    174 #pragma ON_PRAGMA_WARNING_DISABLE_MSC(4100)
    175 
    176 // C4061 enumerator '...' in switch of enum '...' is not explicitly handled by a case label
    177 #pragma ON_PRAGMA_WARNING_DISABLE_MSC(4061)
    178 
    179 // C4062 enumerator '...' in switch of enum '...' is not handled
    180 #pragma ON_PRAGMA_WARNING_DISABLE_MSC(4062)
    181 
    182 // C4711 function '...' selected for inline expansion
    183 #pragma ON_PRAGMA_WARNING_DISABLE_MSC(4711)
    184 
    185 // C4820 '...' bytes padding added after construct '...'
    186 #pragma ON_PRAGMA_WARNING_DISABLE_MSC(4820)
    187 
    188 /////////////////////////////////////////////////////////////////////////////////////
    189 //
    190 // Dale Lear April 2017.
    191 // The Visual Stuido 2017 default is to disable warnings 4263, 4264, 4265, 4266
    192 //
    193 // These are the warnings that help detect abuse of virtual functions and failed attempts
    194 // to override virtual functions.
    195 //
    196 // I've enable them for all Rhino core projects.
    197 // "#pragma warning(default:xxxx): is the way to enable warning xxxx.
    198 //
    199 
    200 // 'function' : member function does not override any base class virtual member function
    201 // A class function definition has the same name as a virtual function in a base
    202 // class but not the same number or type of arguments. This effectively hides the
    203 // virtual function in the base class.
    204 #pragma warning(default:4263)
    205 
    206 // 'virtual_function' : no override available for virtual member function from base 'class'; function is hidden
    207 #pragma warning(default:4264)
    208 
    209 // 'class' : class has virtual functions, but destructor is not virtual
    210 // When a class has virtual functions but a nonvirtual destructor, objects
    211 // of the type might not be destroyed properly when the class is destroyed
    212 // through a base class pointer.
    213 // NOTE WELL: Occasionally there are good reasons to have a non-virtual destructor.
    214 // See Guideline #4 in http://www.gotw.ca/publications/mill18.htm for a nice description of the details.
    215 // However, those case are generally rare and this warning can explicitly be disabled for those rare
    216 // cases.
    217 #pragma warning(default:4265)
    218 
    219 #if defined(OPENNURBS_WALL)
    220 // The 4266 warning is enabled only when OPENNURBS_WALL is defined.
    221 //
    222 // In the case of Rhino, this warning is not useful.
    223 // It is reasonable to override some but not all base class virtual functions
    224 // that have the same name.
    225 // For example, almost every class derived from CRhinoObject overrides
    226 // virtual ON_BoundingBox BoundingBox() const;
    227 // but most do not override
    228 // virtual ON_BoundingBox BoundingBox( const class CRhinoViewport* pViewport ) const;
    229 
    230 // 'function' : no override available for virtual member function from base 'type'; function is hidden
    231 // A derived class did not override all overloads of a virtual function.
    232 #pragma warning(default:4266)
    233 #endif
    234 
    235 //
    236 /////////////////////////////////////////////////////////////////////////////////////
    237 
    238 #define ON_CLANG_CONSTRUCTOR_BUG
    239 
    240 
    241 #endif
    242 #endif
    243 #endif
    244 #endif
    245 #endif
    246 #endif
    247 
    248 #define ON_SIZEOF_WCHAR_T 2
    249 
    250 #elif defined(__clang__) | defined(ON_COMPILER_CLANG)
    251 /*
    252 ////////////////////////////////////////////////////////////
    253 ////////////////////////////////////////////////////////////
    254 //
    255 // ON_COMPILER_CLANG
    256 //
    257 */
    258 
    259 /*
    260 // The __clang__ test must come before the gnu tests because Apple's clang
    261 // uncoditionally defines __GNUC__
    262 */
    263 #if !defined(ON_COMPILER_CLANG)
    264 #define ON_COMPILER_CLANG
    265 #endif
    266 
    267 /*
    268 // Usage example - disables CLang warning xyz - See CLang docs for warning options
    269 #pragma ON_PRAGMA_WARNING_PUSH
    270 #pragma ON_PRAGMA_WARNING_DISABLE_CLANG("-Wxyz")
    271 ...
    272 #pragma ON_PRAGMA_WARNING_POP
    273 */
    274 #define ON_PRAGMA_WARNING_PUSH clang diagnostic push // Apple CLang warning state push
    275 #define ON_PRAGMA_WARNING_POP clang diagnostic pop // Apple CLang warning state pop
    276 #define ON_PRAGMA_WARNING_DISABLE_CLANG(ON_PRAGMA_WARNING_DISABLE_param) clang diagnostic ignored ON_PRAGMA_WARNING_DISABLE_param // Apple CLang warning disable
    277 
    278 // clang has a bug that is fails to correctly construct statc const objects
    279 // in the following case
    280 //
    281 // // header file
    282 // class Blah
    283 // {
    284 // public:
    285 // Blah() = default;
    286 // ~Blah() = default;
    287 // Blah(const Blah&) = default;
    288 // Blah& operator=(const Blah&) = default;
    289 //
    290 // static const Blah Zero;
    291 //
    292 // int m_i = 0;
    293 // };
    294 //
    295 // ...
    296 //
    297 // // cpp file
    298 // const Blah Blah::Zero; // correct C++ 11, Apple's clang fails as of February, 2015
    299 // const Blah Blah::Zero( Blah() ); // clang fails to use copy constructor
    300 // const Blah Blah::Zero = Blah(); // clang can handle this
    301 //
    302 // When this bug is fixed, delete this define and the places
    303 // in the code that use it.
    304 #define ON_CLANG_CONSTRUCTOR_BUG
    305 
    306 #if defined(__has_feature) && __has_feature(cxx_noexcept)
    307 #undef ON_NOEXCEPT
    308 #define ON_NOEXCEPT noexcept
    309 #endif
    310 
    311 #if defined(__has_extension) && __has_extension(cxx_rvalue_references) && !defined(ON_HAS_RVALUEREF)
    312 #define ON_HAS_RVALUEREF
    313 #elif defined(ON_HAS_RVALUEREF)
    314 #undef ON_HAS_RVALUEREF
    315 #endif
    316 
    317 #elif defined( ON_COMPILER_ANDROIDNDK )
    318 /*
    319 ////////////////////////////////////////////////////////////
    320 ////////////////////////////////////////////////////////////
    321 //
    322 // ON_COMPILER_ANDROIDNDK
    323 //
    324 */
    325 
    326 /*
    327 // McNeel defines ON_COMPILER_ANDROIDNDK in makefiles
    328 */
    329 
    330 #if defined(__GNUC__) && (__GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 7))
    331 // C++11 noexcept and Rvalue references are in gcc 4.7 and later
    332 #undef ON_NOEXCEPT
    333 #define ON_NOEXCEPT noexcept
    334 #if !defined(ON_HAS_RVALUEREF)
    335 #define ON_HAS_RVALUEREF
    336 #endif
    337 
    338 #else
    339 #undef ON_HAS_RVALUEREF
    340 #undef ON_NOEXCEPT
    341 
    342 #endif
    343 
    344 // You may need to define __GXX_EXPERIMENTAL_CXX0X__ to get
    345 // C++11 std::shared_ptr to work as you expect when using
    346 // the Android NDK gcc 4.7. See
    347 // http://stackoverflow.com/questions/14532057/smart-pointers-not-working-with-android-ndk-r8
    348 // for more details.
    349 //
    350 //#define __GXX_EXPERIMENTAL_CXX0X__
    351 
    352 #elif defined(__GNUG_) || defined(__GNUG__) || defined(__GNUC_) || defined(__GNUC__) || defined(_GNU_SOURCE) || defined(__GNU_SOURCE)
    353 /*
    354 ////////////////////////////////////////////////////////////
    355 ////////////////////////////////////////////////////////////
    356 //
    357 // ON_COMPILER_GNU
    358 //
    359 */
    360 
    361 #define ON_COMPILER_GNU
    362 #if !defined(_GNU_SOURCE)
    363 #define _GNU_SOURCE
    364 #endif
    365 
    366 /*
    367 // Usage example - disables gcc warning xyz - See Gnu gcc docs for warning options
    368 #pragma ON_PRAGMA_WARNING_PUSH
    369 #pragma ON_PRAGMA_WARNING_DISABLE_CLANG("-Wxyx")
    370 ...
    371 #pragma ON_PRAGMA_WARNING_POP
    372 */
    373 #define ON_PRAGMA_WARNING_PUSH GCC diagnostic push // Gnu gcc warning state push
    374 #define ON_PRAGMA_WARNING_POP GCC diagnostic pop // Gnu gcc warning state pop
    375 #define ON_PRAGMA_WARNING_DISABLE_GNU(ON_PRAGMA_WARNING_DISABLE_param) GCC diagnostic ignored ON_PRAGMA_WARNING_DISABLE_param // Apple CLang warning disable
    376 
    377 
    378 #if defined(__GNUC__) && (__GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 7))
    379 // C++11 noexcept and Rvalue references are in gcc 4.7 and later
    380 #undef ON_NOEXCEPT
    381 #define ON_NOEXCEPT noexcept
    382 #if !defined(ON_HAS_RVALUEREF)
    383 #define ON_HAS_RVALUEREF
    384 #endif
    385 
    386 #else
    387 #undef ON_HAS_RVALUEREF
    388 #undef ON_NOEXCEPT
    389 
    390 #endif
    391 
    392 
    393 #elif defined(__BORLANDC__)
    394 /*
    395 ////////////////////////////////////////////////////////////
    396 ////////////////////////////////////////////////////////////
    397 //
    398 // ON_COMPILER_BORLANDC
    399 //
    400 */
    401 #define ON_COMPILER_BORLANDC
    402 
    403 #endif
    404 
    405 
    406 #if defined(ON_CLANG_CONSTRUCTOR_BUG)
    407 // Clang as implemented by Apple has a bug and is unable to use
    408 // a default constructor to initialize const statics.
    409 // The Clang error message is
    410 //
    411 // ...: error: default initialization of an object of const type 'const ...' without a user-provided default constructor
    412 //
    413 // The ON_CLANG_CONSTRUCTOR_BUG_INIT function is used to replace the call to a default constructor with call
    414 // to the copy constructor (which can be default).
    415 //
    416 // Example"
    417 //
    418 // class MyClass
    419 // {
    420 // public:
    421 // MyClass() = default;
    422 // ~MyClass() = default;
    423 // MyClass(const MyClass&) = default;
    424 // MyClass& operator=(const MyClass&) = default;
    425 //
    426 // int m_i = 0;
    427 // };
    428 // ...
    429 // const MyClass c1; // fails with clang, works with gcc, Microsoft CL, ...
    430 // const MyClass c2 ON_CLANG_CONSTRUCTOR_BUG_INIT(MyClass); // works with clang, gcc, Microsoft CL, ...
    431 //
    432 #define ON_CLANG_CONSTRUCTOR_BUG_INIT(ctor) = ctor()
    433 #else
    434 #define ON_CLANG_CONSTRUCTOR_BUG_INIT(ctor)
    435 #endif
    436 
    437 /*
    438 These defines will be set to something more appropriate when
    439 opennurbs_system_compiler detects the compiler and platform.
    440 */
    441 #if !defined(ON_PRAGMA_WARNING_PUSH) && !defined(ON_PRAGMA_WARNING_POP)
    442 #define ON_PRAGMA_WARNING_PUSH
    443 #define ON_PRAGMA_WARNING_POP
    444 #elif !defined(ON_PRAGMA_WARNING_PUSH) || !defined(ON_PRAGMA_WARNING_POP)
    445 #error mistake in the compiler specific define setup above
    446 #endif
    447 
    448 #if !defined(ON_PRAGMA_WARNING_DISABLE_MSC)
    449 #define ON_PRAGMA_WARNING_DISABLE_MSC(ON_PRAGMA_WARNING_DISABLE_param)
    450 #endif
    451 
    452 #if !defined(ON_PRAGMA_WARNING_DISABLE_CLANG)
    453 #define ON_PRAGMA_WARNING_DISABLE_CLANG(ON_PRAGMA_WARNING_DISABLE_param)
    454 #endif
    455 
    456 #if !defined(ON_PRAGMA_WARNING_DISABLE_GNU)
    457 #define ON_PRAGMA_WARNING_DISABLE_GNU(ON_PRAGMA_WARNING_DISABLE_param)
    458 #endif
    459 
    460 #if !defined(ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE) && !defined(ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE)
    461 #define ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE ON_PRAGMA_WARNING_PUSH
    462 #define ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE ON_PRAGMA_WARNING_POP
    463 #endif
    464 
    465 #endif
    466 
    467 
    diff --git a/6/dd/da0/class_o_n___earth_anchor_point-members.html b/6/dd/da0/class_o_n___earth_anchor_point-members.html index b09f4a0e..cf1ea694 100644 --- a/6/dd/da0/class_o_n___earth_anchor_point-members.html +++ b/6/dd/da0/class_o_n___earth_anchor_point-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/da0/class_o_n___uuid_ptr_list-members.html b/6/dd/da0/class_o_n___uuid_ptr_list-members.html index 477ac1e7..30efe154 100644 --- a/6/dd/da0/class_o_n___uuid_ptr_list-members.html +++ b/6/dd/da0/class_o_n___uuid_ptr_list-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/da7/class_o_n___file_stream.html b/6/dd/da7/class_o_n___file_stream.html index 9a9391fa..c5d9c16a 100644 --- a/6/dd/da7/class_o_n___file_stream.html +++ b/6/dd/da7/class_o_n___file_stream.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_FileStream Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Portable wrapper for C runtime fseek(fp,offset,origin). Parameters: fp - [in] FILE pointer returned by ON_FileStream::Open(). offset - [in] origin - [in] SEEK_SET (0): seek from beginning of file.
    - SEEK_CUR (1): seek from current position of file pointer. SEEK_END (2): seek from end of file.

    +

    Description: Portable wrapper for C runtime fseek(fp,offset,origin). Parameters: fp - [in] FILE pointer returned by ON_FileStream::Open(). offset - [in] origin - [in] SEEK_SET (0): seek from beginning of file. SEEK_CUR (1): seek from current position of file pointer. SEEK_END (2): seek from end of file.

    @@ -783,9 +780,9 @@ Static Public Member Functions diff --git a/6/dd/da8/class_o_n___polyline.html b/6/dd/da8/class_o_n___polyline.html index e7850d15..fb409ef4 100644 --- a/6/dd/da8/class_o_n___polyline.html +++ b/6/dd/da8/class_o_n___polyline.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Polyline Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_Polyline() [1/2]

    @@ -816,9 +812,9 @@ Additional Inherited Members
    diff --git a/6/dd/da8/opennurbs__3dm_8h_source.html b/6/dd/da8/opennurbs__3dm_8h_source.html index 6ad25bce..5413e9e7 100644 --- a/6/dd/da8/opennurbs__3dm_8h_source.html +++ b/6/dd/da8/opennurbs__3dm_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_3dm.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_3dm.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_THREEDM_INC_)
    18 #define OPENNURBS_THREEDM_INC_
    19 
    20 /* 3dm defines, structs and typedefs */
    21 
    22 /* Typecode format 4 bytes long
    23 
    24  x xxxxxxxxxxxxxxx,x xxx xxxx xxxx x x xx
    25  | | | | | | |
    26  | | | |
    27  | | | | +--- "stuff" bit
    28  | | | |
    29  | | | +-- specific codes
    30  | | |
    31  | | +-- RESERVED - DO NOT USE (should be 0) (will be used to control CRC on/off)
    32  | |
    33  | +-- category:_000 0000 0000 0001 Legacy geometry TCODE_LEGACY_GEOMETRY
    34  | _000 0000 0000 0010 openNURBS object TCODE_OPENNURBS_OBJECT
    35  | _000 0000 0000 0100 -- RESERVED - DO NOT USE (should be 0 in any typecode) --
    36  | _000 0000 0000 1000 -- RESERVED - DO NOT USE (should be 0 in any typecode) --
    37  | _000 0000 0001 0000 Geometry TCODE_GEOMETRY
    38  | _000 0000 0010 0000 Annotation
    39  | _000 0000 0100 0000 Display Attributes TCODE_DISPLAY
    40  | _000 0000 1000 0000 Rendering TCODE_RENDER
    41  | _000 0001 0000 0000
    42  | _000 0010 0000 0000 Interface TCODE_INTERFACE
    43  | _000 0100 0000 0000 -- RESERVED - DO NOT USE (should be 0 in any typecode) --
    44  | _000 1000 0000 0000 Tolerances TCODE_TOLERANCE
    45  | _001 0000 0000 0000 Tables TCODE_TABLE
    46  | _010 0000 0000 0000 Table record TCODE_TABLEREC
    47  | _100 0000 0000 0000 User information TCODE_USER
    48  |
    49  +-- format: 0 - data size in header - data block follows TCODE_SHORT
    50  1 - data in header - no data block follows
    51 
    52 */
    53 
    54 
    55 /*
    56 // The TCODE_COMMENTBLOCK is the first chunk in the file, starts 32 bytes into
    57 // the file, and contains text information terminated with a ^Z. This ^Z and
    58 // contents of this chunk were expanded in February 2000. Files written with
    59 // code released earlier than this will not have the ^Z.
    60 //
    61 // The TCODE_ENDOFFILE is the last chunk in the file and the first 4 bytes
    62 // of information in this chunk is an integer that contains the file length.
    63 // This chunk was added in February 2000 and files written with code released
    64 // earlier than this will not have this termination block.
    65 */
    66 #define TCODE_COMMENTBLOCK 0x00000001
    67 #define TCODE_ENDOFFILE 0x00007FFF
    68 #define TCODE_ENDOFFILE_GOO 0x00007FFE /*
    69  // this typecode is returned when
    70  // a rogue eof marker is found
    71  // Some v1 3dm file writers put
    72  // these markers in a "goo".
    73  // Simply skip these chunks and continue.
    74  */
    75 #define TCODE_LEGACY_GEOMETRY 0x00010000
    76 #define TCODE_OPENNURBS_OBJECT 0x00020000
    77 #define TCODE_GEOMETRY 0x00100000
    78 #define TCODE_ANNOTATION 0x00200000
    79 #define TCODE_DISPLAY 0x00400000
    80 #define TCODE_RENDER 0x00800000
    81 #define TCODE_INTERFACE 0x02000000
    82 #define TCODE_TOLERANCE 0x08000000
    83 #define TCODE_TABLE 0x10000000
    84 #define TCODE_TABLEREC 0x20000000
    85 #define TCODE_USER 0x40000000
    86 #define TCODE_SHORT 0x80000000
    87 
    88 #define TCODE_CRC 0x8000
    89 
    90 #define TCODE_ANONYMOUS_CHUNK (TCODE_USER | TCODE_CRC | 0x0000 )
    91 #define TCODE_UTF8_STRING_CHUNK (TCODE_USER | TCODE_CRC | 0x0001 )
    92 #define TCODE_MODEL_ATTRIBUTES_CHUNK (TCODE_USER | TCODE_CRC | 0x0002 )
    93 
    94 #define TCODE_DICTIONARY (TCODE_USER | TCODE_CRC | 0x0010)
    95 #define TCODE_DICTIONARY_ID (TCODE_USER | TCODE_CRC | 0x0011)
    96 #define TCODE_DICTIONARY_ENTRY (TCODE_USER | TCODE_CRC | 0x0012)
    97 #define TCODE_DICTIONARY_END (TCODE_USER | TCODE_SHORT | 0x0013)
    98 #define TCODE_XDATA (TCODE_USER | 0x0001)
    99 
    100 
    101 /* The openNURBS toolkit allows users to write all openNURBS classed that are
    102 // derived from ON_Object using using TCODE_OPENNURBS_CLASS chunks.
    103 // In the .3dm file these TCODE_OPENNURBS_CLASS chunks are always have the
    104 // following format.
    105 */
    106 
    107 /* tables added 17 February 2000 */
    108 #define TCODE_MATERIAL_TABLE (TCODE_TABLE | 0x0010) /* rendering materials */
    109 #define TCODE_LAYER_TABLE (TCODE_TABLE | 0x0011) /* layers */
    110 #define TCODE_LIGHT_TABLE (TCODE_TABLE | 0x0012) /* rendering lights */
    111 #define TCODE_OBJECT_TABLE (TCODE_TABLE | 0x0013) /* geometry and annotation */
    112 #define TCODE_PROPERTIES_TABLE (TCODE_TABLE | 0x0014) /* model properties:
    113  // revision history
    114  // notes
    115  // preview image
    116  */
    117 #define TCODE_SETTINGS_TABLE (TCODE_TABLE | 0x0015) /* file properties including,
    118  // units, tolerancess,
    119  // annotation defaults,
    120  // render mesh defaults,
    121  // current layer,
    122  // current material,
    123  // current color,
    124  // named construction planes,
    125  // named viewports,
    126  // current viewports,
    127  */
    128 #define TCODE_BITMAP_TABLE (TCODE_TABLE | 0x0016) /* embedded bitmaps */
    129 #define TCODE_USER_TABLE (TCODE_TABLE | 0x0017) /* user table */
    130 
    131 #define TCODE_GROUP_TABLE (TCODE_TABLE | 0x0018) /* group table */
    132 
    133 #define TCODE_FONT_TABLE (TCODE_TABLE | 0x0019) /* annotation font table */
    134 #define TCODE_DIMSTYLE_TABLE (TCODE_TABLE | 0x0020) /* annotation dimension style table */
    135 
    136 #define TCODE_INSTANCE_DEFINITION_TABLE (TCODE_TABLE | 0x0021) /* instance definition table */
    137 
    138 #define TCODE_HATCHPATTERN_TABLE (TCODE_TABLE | 0x0022) /* hatch pattern table */
    139 
    140 #define TCODE_LINETYPE_TABLE (TCODE_TABLE | 0x0023) /* linetype table */
    141 
    142 #define TCODE_OBSOLETE_LAYERSET_TABLE (TCODE_TABLE | 0x0024) /* obsolete layer set table */
    143 
    144 #define TCODE_TEXTURE_MAPPING_TABLE (TCODE_TABLE | 0x0025) /* texture mappings */
    145 
    146 #define TCODE_HISTORYRECORD_TABLE (TCODE_TABLE | 0x0026) /* history records */
    147 
    148 #define TCODE_ENDOFTABLE 0xFFFFFFFF
    149 
    150 /* records in properties table */
    151 #define TCODE_PROPERTIES_REVISIONHISTORY (TCODE_TABLEREC | TCODE_CRC | 0x0021)
    152 #define TCODE_PROPERTIES_NOTES (TCODE_TABLEREC | TCODE_CRC | 0x0022)
    153 #define TCODE_PROPERTIES_PREVIEWIMAGE (TCODE_TABLEREC | TCODE_CRC | 0x0023)
    154 #define TCODE_PROPERTIES_APPLICATION (TCODE_TABLEREC | TCODE_CRC | 0x0024)
    155 #define TCODE_PROPERTIES_COMPRESSED_PREVIEWIMAGE (TCODE_TABLEREC | TCODE_CRC | 0x0025)
    156 #define TCODE_PROPERTIES_OPENNURBS_VERSION (TCODE_TABLEREC | TCODE_SHORT | 0x0026)
    157 #define TCODE_PROPERTIES_AS_FILE_NAME (TCODE_TABLEREC | TCODE_CRC | 0x0027 )
    158 
    159 /* records in settings table */
    160 #define TCODE_SETTINGS_PLUGINLIST (TCODE_TABLEREC | TCODE_CRC | 0x0135)
    161 #define TCODE_SETTINGS_UNITSANDTOLS (TCODE_TABLEREC | TCODE_CRC | 0x0031)
    162 #define TCODE_SETTINGS_RENDERMESH (TCODE_TABLEREC | TCODE_CRC | 0x0032)
    163 #define TCODE_SETTINGS_ANALYSISMESH (TCODE_TABLEREC | TCODE_CRC | 0x0033)
    164 #define TCODE_SETTINGS_ANNOTATION (TCODE_TABLEREC | TCODE_CRC | 0x0034)
    165 #define TCODE_SETTINGS_NAMED_CPLANE_LIST (TCODE_TABLEREC | TCODE_CRC | 0x0035)
    166 #define TCODE_SETTINGS_NAMED_VIEW_LIST (TCODE_TABLEREC | TCODE_CRC | 0x0036)
    167 #define TCODE_SETTINGS_VIEW_LIST (TCODE_TABLEREC | TCODE_CRC | 0x0037)
    168 #define TCODE_SETTINGS_CURRENT_LAYER_INDEX (TCODE_TABLEREC | TCODE_SHORT | 0x0038)
    169 #define TCODE_SETTINGS_CURRENT_MATERIAL_INDEX (TCODE_TABLEREC | TCODE_CRC | 0x0039)
    170 #define TCODE_SETTINGS_CURRENT_COLOR (TCODE_TABLEREC | TCODE_CRC | 0x003A)
    171 #define TCODE_SETTINGS__NEVER__USE__THIS (TCODE_TABLEREC | TCODE_CRC | 0x003E)
    172 #define TCODE_SETTINGS_CURRENT_WIRE_DENSITY (TCODE_TABLEREC | TCODE_SHORT | 0x003C)
    173 #define TCODE_SETTINGS_RENDER (TCODE_TABLEREC | TCODE_CRC | 0x003D)
    174 #define TCODE_SETTINGS_GRID_DEFAULTS (TCODE_TABLEREC | TCODE_CRC | 0x003F)
    175 #define TCODE_SETTINGS_MODEL_URL (TCODE_TABLEREC | TCODE_CRC | 0x0131)
    176 #define TCODE_SETTINGS_CURRENT_FONT_INDEX (TCODE_TABLEREC | TCODE_SHORT | 0x0132)
    177 #define TCODE_SETTINGS_CURRENT_DIMSTYLE_INDEX (TCODE_TABLEREC | TCODE_SHORT | 0x0133)
    178 /* added 29 October 2002 as a chunk to hold new and future ON_3dmSettings information */
    179 #define TCODE_SETTINGS_ATTRIBUTES (TCODE_TABLEREC | TCODE_CRC | 0x0134)
    180 /* 2016-Nov-28 RH-33298 ON_3dmRenderSettings user data in ON_3dmSettings.m_RenderSettings */
    181 #define TCODE_SETTINGS_RENDER_USERDATA (TCODE_TABLEREC | TCODE_CRC | 0x0136)
    182 
    183 /* views are subrecords in the settings table */
    184 #define TCODE_VIEW_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x003B)
    185 /* subrecords if view record */
    186 #define TCODE_VIEW_CPLANE (TCODE_TABLEREC | TCODE_CRC | 0x013B)
    187 #define TCODE_VIEW_VIEWPORT (TCODE_TABLEREC | TCODE_CRC | 0x023B)
    188 #define TCODE_VIEW_SHOWCONGRID (TCODE_TABLEREC | TCODE_SHORT | 0x033B)
    189 #define TCODE_VIEW_SHOWCONAXES (TCODE_TABLEREC | TCODE_SHORT | 0x043B)
    190 #define TCODE_VIEW_SHOWWORLDAXES (TCODE_TABLEREC | TCODE_SHORT | 0x053B)
    191 #define TCODE_VIEW_TRACEIMAGE (TCODE_TABLEREC | TCODE_CRC | 0x063B)
    192 #define TCODE_VIEW_WALLPAPER (TCODE_TABLEREC | TCODE_CRC | 0x073B)
    193 #define TCODE_VIEW_WALLPAPER_V3 (TCODE_TABLEREC | TCODE_CRC | 0x074B)
    194 #define TCODE_VIEW_TARGET (TCODE_TABLEREC | TCODE_CRC | 0x083B)
    195 #define TCODE_VIEW_V3_DISPLAYMODE (TCODE_TABLEREC | TCODE_SHORT | 0x093B)
    196 #define TCODE_VIEW_NAME (TCODE_TABLEREC | TCODE_CRC | 0x0A3B)
    197 #define TCODE_VIEW_POSITION (TCODE_TABLEREC | TCODE_CRC | 0x0B3B)
    198 
    199 /* added 29 October 2002 as a chunk to hold new and future ON_3dmView information */
    200 #define TCODE_VIEW_ATTRIBUTES (TCODE_TABLEREC | TCODE_CRC | 0x0C3B)
    201 
    202 /* added 27 June 2008 as a chunk to hold userdata on ON_Viewports saved in named view list */
    203 #define TCODE_VIEW_VIEWPORT_USERDATA (TCODE_TABLEREC | TCODE_CRC | 0x0D3B)
    204 
    205 /* records in bitmap table */
    206 #define TCODE_BITMAP_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0090) /* bitmap table record derived from ON_Bitmap */
    207 
    208 /* records in material table */
    209 #define TCODE_MATERIAL_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0040) /* material table record derived from ON_Material */
    210 
    211 /* records in layer table */
    212 #define TCODE_LAYER_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0050) /* layer table record derived from ON_Layer */
    213 
    214 /* records in light table */
    215 #define TCODE_LIGHT_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0060) /* light table record derived from ON_Light */
    216 #define TCODE_LIGHT_RECORD_ATTRIBUTES (TCODE_INTERFACE | TCODE_CRC | 0x0061) /* ON_3dmObjectAttributes chunk */
    217 #define TCODE_LIGHT_RECORD_ATTRIBUTES_USERDATA (TCODE_INTERFACE | 0x0062) /* ON_3dmObjectAttributes userdata chunk */
    218 
    219 #define TCODE_LIGHT_RECORD_END (TCODE_INTERFACE | TCODE_SHORT | 0x006F)
    220 
    221 /* records in user table
    222  Each user table entery has two top level chunks, a TCODE_USER_TABLE_UUID chunk
    223  and a TCODE_USER_RECORD chunk.
    224 */
    225 
    226 /* The TCODE_USER_TABLE_UUID chunk
    227  contains the plug-in id and, if the archive is V5 or later
    228  and was written by an opennurbs with version >= 200910190,
    229  a TCODE_USER_TABLE_RECORD_HEADER chunk.
    230 */
    231 #define TCODE_USER_TABLE_UUID (TCODE_TABLEREC | TCODE_CRC | 0x0080)
    232 /* the user record header was added in 200910190 and is inside the TCODE_USER_TABLE_UUID chunk */
    233 #define TCODE_USER_TABLE_RECORD_HEADER (TCODE_TABLEREC | TCODE_CRC | 0x0082)
    234 /* information saved by the plug-in is in a TCODE_USER_RECORD chunk */
    235 #define TCODE_USER_RECORD (TCODE_TABLEREC | 0x0081)
    236 
    237 
    238 /* records in group table */
    239 #define TCODE_GROUP_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0073)
    240 
    241 /* records in font table */
    242 #define TCODE_FONT_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0074)
    243 
    244 /* records in dimension style table */
    245 #define TCODE_DIMSTYLE_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0075)
    246 
    247 /* records in instance definition table */
    248 #define TCODE_INSTANCE_DEFINITION_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0076)
    249 
    250 /* records in hatch pattern table */
    251 #define TCODE_HATCHPATTERN_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0077)
    252 
    253 /* records in linetye pattern table */
    254 #define TCODE_LINETYPE_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0078)
    255 
    256 /* OBSOLETE records in layer set table */
    257 #define TCODE_OBSOLETE_LAYERSET_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0079)
    258 
    259 /* records in linetye pattern table */
    260 #define TCODE_TEXTURE_MAPPING_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x007A)
    261 
    262 /* records in history record pattern table */
    263 #define TCODE_HISTORYRECORD_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x007B)
    264 
    265 /* records in object table */
    266 #define TCODE_OBJECT_RECORD (TCODE_TABLEREC | TCODE_CRC | 0x0070)
    267 #define TCODE_OBJECT_RECORD_TYPE (TCODE_INTERFACE | TCODE_SHORT | 0x0071) /* ON::object_type value */
    268 #define TCODE_OBJECT_RECORD_ATTRIBUTES (TCODE_INTERFACE | TCODE_CRC | 0x0072) /* ON_3dmObjectAttributes chunk */
    269 #define TCODE_OBJECT_RECORD_ATTRIBUTES_USERDATA (TCODE_INTERFACE | 0x0073) /* ON_3dmObjectAttributes userdata chunk */
    270 #define TCODE_OBJECT_RECORD_HISTORY (TCODE_INTERFACE | TCODE_CRC | 0x0074) /* construction history */
    271 #define TCODE_OBJECT_RECORD_HISTORY_HEADER (TCODE_INTERFACE | TCODE_CRC | 0x0075) /* construction history header*/
    272 #define TCODE_OBJECT_RECORD_HISTORY_DATA (TCODE_INTERFACE | TCODE_CRC | 0x0076) /* construction history data */
    273 #define TCODE_OBJECT_RECORD_END (TCODE_INTERFACE | TCODE_SHORT | 0x007F)
    274 
    275 /*
    276 /////////////////////////////////////////////////////////////////////////////////////
    277 //
    278 // TCODE_OBJECT_RECORD
    279 // 4 byte length of entire object record
    280 //
    281 // TCODE_OBJECT_RECORD_TYPE required - used to quickly filter and skip unwanted objects
    282 // 4 byte ON::object_type
    283 //
    284 // TCODE_OPENNURBS_CLASS
    285 // 4 byte length
    286 // TCODE_OPENNURBS_CLASS_UUID
    287 // 4 byte length = 20
    288 // value of ON_ClassId::m_uuid for this class
    289 // 4 byte CRC
    290 // TCODE_OPENNURBS_CLASS_DATA
    291 // 4 byte length
    292 // class specific data for geometry or annotation object
    293 // 4 byte CRC
    294 // TCODE_OPENNURBS_CLASS_USERDATA (1 chunk per piece of user data)
    295 // 4 byte length
    296 // 2 byte chunk version 2.1
    297 // TCODE_OPENNURBS_CLASS_USERDATA_HEADER
    298 // 4 byte length
    299 // 16 byte value of ON_ClassId::m_uuid for this child class of ON_UserData
    300 // 16 byte value of ON_UserData::m_userdata_uuid
    301 // 4 byte value of ON_UserData::m_userdata_copycount
    302 // 128 byte value of ON_UserData::m_userdata_xform
    303 // 16 byte value of ON_UserData::m_application_uuid (in ver 2.1 chunks)
    304 // TCODE_ANONYMOUS_CHUNK
    305 // 4 byte length
    306 // specific user data
    307 // TCODE_OPENNURBS_CLASS_END
    308 //
    309 // TCODE_OBJECT_RECORD_ATTRIBUTES (optional)
    310 // 4 byte length
    311 // ON_3dmObjectAttributes information
    312 // 4 byte crc
    313 //
    314 // TCODE_OBJECT_RECORD_ATTRIBUTES_USERDATA (optional)
    315 // 4 byte length
    316 // TCODE_OPENNURBS_CLASS_USERDATA (1 chunk per piece of user data)
    317 // 4 byte length
    318 // 2 byte chunk version 2.1
    319 // TCODE_OPENNURBS_CLASS_USERDATA_HEADER
    320 // 4 byte length
    321 // 16 byte value of ON_ClassId::m_uuid for this child class of ON_UserData
    322 // 16 byte value of ON_UserData::m_userdata_uuid
    323 // 4 byte value of ON_UserData::m_userdata_copycount
    324 // 128 byte value of ON_UserData::m_userdata_xform
    325 // 16 byte value of ON_UserData::m_application_uuid (in ver 2.1 chunks)
    326 // TCODE_ANONYMOUS_CHUNK
    327 // 4 byte length
    328 // specific user data
    329 //
    330 // TCODE_OBJECT_RECORD_HISTORY (optional) construction history
    331 // 4 byte length
    332 // 2 byte chunk version
    333 // TCODE_OBJECT_RECORD_HISTORY_HEADER
    334 // 4 byte length
    335 // 2 byte chunk version
    336 // ...
    337 // 4 byte crc
    338 // TCODE_OBJECT_RECORD_HISTORY_DATA
    339 // 4 byte length
    340 // 2 byte chunk version
    341 // ...
    342 // 4 byte crc
    343 //
    344 // TCODE_OBJECT_RECORD_END required - marks end of object record
    345 //
    346 /////////////////////////////////////////////////////////////////////////////////////
    347 */
    348 
    349 #define TCODE_OPENNURBS_CLASS (TCODE_OPENNURBS_OBJECT | 0x7FFA)
    350 #define TCODE_OPENNURBS_CLASS_UUID (TCODE_OPENNURBS_OBJECT | TCODE_CRC | 0x7FFB)
    351 #define TCODE_OPENNURBS_CLASS_DATA (TCODE_OPENNURBS_OBJECT | TCODE_CRC | 0x7FFC)
    352 #define TCODE_OPENNURBS_CLASS_USERDATA (TCODE_OPENNURBS_OBJECT | 0x7FFD)
    353 #define TCODE_OPENNURBS_CLASS_USERDATA_HEADER (TCODE_OPENNURBS_OBJECT | TCODE_CRC | 0x7FF9)
    354 #define TCODE_OPENNURBS_CLASS_END (TCODE_OPENNURBS_OBJECT | TCODE_SHORT | 0x7FFF)
    355 
    356 /*
    357 /////////////////////////////////////////////////////////////////////////////////////
    358 //
    359 // TCODE_OPENNURBS_CLASS
    360 // length of entire openNURBS class object chunk
    361 //
    362 // TCODE_OPENNURBS_CLASS_UUID
    363 // length of uuid (16 byte UUID + 4 byte CRC)
    364 // 16 byte UUID ( a.k.a. GUID ) openNURBS class ID - determines specific openNURBS class
    365 // 4 bytes (32 bit CRC of the UUID)
    366 //
    367 // TCODE_OPENNURBS_CLASS_DATA
    368 // length of object data
    369 // ... data that defines object
    370 // use ON_classname::Read() to read this data and ON_classname::Write()
    371 // to write this data
    372 // 4 bytes (32 bit CRC of the object data)
    373 //
    374 // TCODE_OPENNURBS_CLASS_USERDATA ( 0 or more user data chunks)
    375 //
    376 // TCODE_OPENNURBS_CLASS_END
    377 // 4 bytes = 0
    378 //
    379 /////////////////////////////////////////////////////////////////////////////////////
    380 */
    381 
    382 /*
    383 /////////////////////////////////////////////////////////////////////////////////////
    384 //
    385 //
    386 // The TCODEs below were used in the version 1 file format and are needed so that
    387 // the these files can be read and (optionally) written by the current OpenNURBS
    388 // toolkit.
    389 //
    390 //
    391 /////////////////////////////////////////////////////////////////////////////////////
    392 */
    393 
    394 
    395 #define TCODE_ANNOTATION_SETTINGS (TCODE_ANNOTATION | 0x0001)
    396 
    397 #define TCODE_TEXT_BLOCK (TCODE_ANNOTATION | 0x0004)
    398 #define TCODE_ANNOTATION_LEADER (TCODE_ANNOTATION | 0x0005)
    399 #define TCODE_LINEAR_DIMENSION (TCODE_ANNOTATION | 0x0006)
    400 #define TCODE_ANGULAR_DIMENSION (TCODE_ANNOTATION | 0x0007)
    401 #define TCODE_RADIAL_DIMENSION (TCODE_ANNOTATION | 0x0008)
    402 
    403 /* old RhinoIO toolkit (pre February 2000) defines */
    404 #define TCODE_RHINOIO_OBJECT_NURBS_CURVE (TCODE_OPENNURBS_OBJECT | 0x0008) /* old CRhinoNurbsCurve */
    405 #define TCODE_RHINOIO_OBJECT_NURBS_SURFACE (TCODE_OPENNURBS_OBJECT | 0x0009) /* old CRhinoNurbsSurface */
    406 #define TCODE_RHINOIO_OBJECT_BREP (TCODE_OPENNURBS_OBJECT | 0x000B) /* old CRhinoBrep */
    407 #define TCODE_RHINOIO_OBJECT_DATA (TCODE_OPENNURBS_OBJECT | 0xFFFE) /* obsolete - don't confuse with TCODE_OPENNURBS_OBJECT_DATA */
    408 #define TCODE_RHINOIO_OBJECT_END (TCODE_OPENNURBS_OBJECT | 0xFFFF) /* obsolete - don't confuse with TCODE_OPENNURBS_OBJECT_END */
    409 
    410 /* OpenNURBS classes the require a unique tcode */
    411 #define TCODE_OPENNURBS_BUFFER (TCODE_OPENNURBS_OBJECT | TCODE_CRC | 0x0100) /* chunk stores ON_Buffer classes */
    412 
    413 /* legacy objects from Rhino 1.x */
    414 #define TCODE_LEGACY_ASM (TCODE_LEGACY_GEOMETRY | 0x0001)
    415 #define TCODE_LEGACY_PRT (TCODE_LEGACY_GEOMETRY | 0x0002)
    416 #define TCODE_LEGACY_SHL (TCODE_LEGACY_GEOMETRY | 0x0003)
    417 #define TCODE_LEGACY_FAC (TCODE_LEGACY_GEOMETRY | 0x0004)
    418 #define TCODE_LEGACY_BND (TCODE_LEGACY_GEOMETRY | 0x0005)
    419 #define TCODE_LEGACY_TRM (TCODE_LEGACY_GEOMETRY | 0x0006)
    420 #define TCODE_LEGACY_SRF (TCODE_LEGACY_GEOMETRY | 0x0007)
    421 #define TCODE_LEGACY_CRV (TCODE_LEGACY_GEOMETRY | 0x0008)
    422 #define TCODE_LEGACY_SPL (TCODE_LEGACY_GEOMETRY | 0x0009)
    423 #define TCODE_LEGACY_PNT (TCODE_LEGACY_GEOMETRY | 0x000A)
    424 
    425 #define TCODE_STUFF 0x0100
    426 
    427 #define TCODE_LEGACY_ASMSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_ASM)
    428 #define TCODE_LEGACY_PRTSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_PRT)
    429 #define TCODE_LEGACY_SHLSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_SHL)
    430 #define TCODE_LEGACY_FACSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_FAC)
    431 #define TCODE_LEGACY_BNDSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_BND)
    432 #define TCODE_LEGACY_TRMSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_TRM)
    433 #define TCODE_LEGACY_SRFSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_SRF)
    434 #define TCODE_LEGACY_CRVSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_CRV)
    435 #define TCODE_LEGACY_SPLSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_SPL)
    436 #define TCODE_LEGACY_PNTSTUFF (TCODE_LEGACY_GEOMETRY | TCODE_STUFF | TCODE_LEGACY_PNT)
    437 
    438 /* legacy objects from Rhino 1.x */
    439 #define TCODE_RH_POINT (TCODE_GEOMETRY | 0x0001)
    440 
    441 #define TCODE_RH_SPOTLIGHT (TCODE_RENDER | 0x0001)
    442 
    443 #define TCODE_OLD_RH_TRIMESH (TCODE_GEOMETRY | 0x0011)
    444 #define TCODE_OLD_MESH_VERTEX_NORMALS (TCODE_GEOMETRY | 0x0012)
    445 #define TCODE_OLD_MESH_UV (TCODE_GEOMETRY | 0x0013)
    446 #define TCODE_OLD_FULLMESH (TCODE_GEOMETRY | 0x0014)
    447 
    448 
    449 #define TCODE_MESH_OBJECT (TCODE_GEOMETRY | 0x0015)
    450 #define TCODE_COMPRESSED_MESH_GEOMETRY (TCODE_GEOMETRY | 0x0017)
    451 #define TCODE_ANALYSIS_MESH (TCODE_GEOMETRY | 0x0018)
    452 
    453 #define TCODE_NAME (TCODE_INTERFACE | 0x0001)
    454 #define TCODE_VIEW (TCODE_INTERFACE | 0x0002)
    455 #define TCODE_CPLANE (TCODE_INTERFACE | 0x0003)
    456 
    457 #define TCODE_NAMED_CPLANE (TCODE_INTERFACE | 0x0004)
    458 #define TCODE_NAMED_VIEW (TCODE_INTERFACE | 0x0005)
    459 #define TCODE_VIEWPORT (TCODE_INTERFACE | 0x0006)
    460 
    461 #define TCODE_SHOWGRID (TCODE_SHORT | TCODE_INTERFACE | 0x0007)
    462 #define TCODE_SHOWGRIDAXES (TCODE_SHORT | TCODE_INTERFACE | 0x0008)
    463 #define TCODE_SHOWWORLDAXES (TCODE_SHORT | TCODE_INTERFACE | 0x0009)
    464 
    465 #define TCODE_VIEWPORT_POSITION (TCODE_INTERFACE | 0x000A)
    466 #define TCODE_VIEWPORT_TRACEINFO (TCODE_INTERFACE | 0x000B)
    467 #define TCODE_SNAPSIZE (TCODE_INTERFACE | 0x000C)
    468 #define TCODE_NEAR_CLIP_PLANE (TCODE_INTERFACE | 0x000D)
    469 #define TCODE_HIDE_TRACE (TCODE_INTERFACE | 0x000E)
    470 
    471 #define TCODE_NOTES (TCODE_INTERFACE | 0x000F)
    472 #define TCODE_UNIT_AND_TOLERANCES (TCODE_INTERFACE | 0x0010)
    473 
    474 #define TCODE_MAXIMIZED_VIEWPORT (TCODE_SHORT | TCODE_INTERFACE | 0x0011)
    475 #define TCODE_VIEWPORT_WALLPAPER (TCODE_INTERFACE | 0x0012)
    476 
    477 
    478 #define TCODE_SUMMARY (TCODE_INTERFACE | 0x0013)
    479 #define TCODE_BITMAPPREVIEW (TCODE_INTERFACE | 0x0014)
    480 #define TCODE_VIEWPORT_V1_DISPLAYMODE (TCODE_SHORT | TCODE_INTERFACE | 0x0015)
    481 
    482 
    483 #define TCODE_LAYERTABLE (TCODE_SHORT | TCODE_TABLE | 0x0001) /* obsolete - do not use */
    484 #define TCODE_LAYERREF (TCODE_SHORT | TCODE_TABLEREC | 0x0001)
    485 
    486 #define TCODE_RGB (TCODE_SHORT | TCODE_DISPLAY | 0x0001)
    487 #define TCODE_TEXTUREMAP (TCODE_DISPLAY | 0x0002)
    488 #define TCODE_BUMPMAP (TCODE_DISPLAY | 0x0003)
    489 #define TCODE_TRANSPARENCY (TCODE_SHORT | TCODE_DISPLAY | 0x0004)
    490 #define TCODE_DISP_AM_RESOLUTION (TCODE_SHORT | TCODE_DISPLAY | 0x0005)
    491 #define TCODE_RGBDISPLAY (TCODE_SHORT | TCODE_DISPLAY | 0x0006) /* will be used for color by object */
    492 #define TCODE_RENDER_MATERIAL_ID (TCODE_DISPLAY | 0x0007) /* id for render material */
    493 
    494 #define TCODE_LAYER (TCODE_DISPLAY | 0x0010)
    495 
    496 /* obsolete layer typecodes from earlier betas - not used anymore */
    497 #define TCODE_LAYER_OBSELETE_1 (TCODE_SHORT | TCODE_DISPLAY | 0x0013)
    498 #define TCODE_LAYER_OBSELETE_2 (TCODE_SHORT | TCODE_DISPLAY | 0x0014)
    499 #define TCODE_LAYER_OBSELETE_3 (TCODE_SHORT | TCODE_DISPLAY | 0x0015)
    500 
    501 /* these were only ever used by AccuModel and never by Rhino */
    502 #define TCODE_LAYERON (TCODE_SHORT | TCODE_DISPLAY | 0x0016)
    503 #define TCODE_LAYERTHAWED (TCODE_SHORT | TCODE_DISPLAY | 0x0017)
    504 #define TCODE_LAYERLOCKED (TCODE_SHORT | TCODE_DISPLAY | 0x0018)
    505 
    506 
    507 #define TCODE_LAYERVISIBLE (TCODE_SHORT | TCODE_DISPLAY | 0x0012)
    508 #define TCODE_LAYERPICKABLE (TCODE_SHORT | TCODE_DISPLAY | 0x0030)
    509 #define TCODE_LAYERSNAPABLE (TCODE_SHORT | TCODE_DISPLAY | 0x0031)
    510 #define TCODE_LAYERRENDERABLE (TCODE_SHORT | TCODE_DISPLAY | 0x0032)
    511 
    512 
    513 /* use LAYERSTATE ( 0 = LAYER_ON, 1 = LAYER_OFF, 2 = LAYER_LOCKED ) instead of above individual toggles */
    514 #define TCODE_LAYERSTATE (TCODE_SHORT | TCODE_DISPLAY | 0x0033)
    515 #define TCODE_LAYERINDEX (TCODE_SHORT | TCODE_DISPLAY | 0x0034)
    516 #define TCODE_LAYERMATERIALINDEX (TCODE_SHORT | TCODE_DISPLAY | 0x0035)
    517 
    518 #define TCODE_RENDERMESHPARAMS (TCODE_DISPLAY | 0x0020) /* block of parameters for render meshes */
    519 
    520 
    521 
    522 #define TCODE_DISP_CPLINES (TCODE_SHORT | TCODE_DISPLAY | 0x0022)
    523 #define TCODE_DISP_MAXLENGTH (TCODE_DISPLAY | 0x0023)
    524 
    525 #define TCODE_CURRENTLAYER (TCODE_SHORT | TCODE_DISPLAY | 0x0025 )
    526 
    527 #define TCODE_LAYERNAME (TCODE_DISPLAY | 0x0011)
    528 
    529 #define TCODE_LEGACY_TOL_FIT (TCODE_TOLERANCE | 0x0001)
    530 #define TCODE_LEGACY_TOL_ANGLE (TCODE_TOLERANCE | 0x0002)
    531 
    532 #endif
    diff --git a/6/dd/dbe/opennurbs__hash__table_8h_source.html b/6/dd/dbe/opennurbs__hash__table_8h_source.html index 9bde39ab..205dddf6 100644 --- a/6/dd/dbe/opennurbs__hash__table_8h_source.html +++ b/6/dd/dbe/opennurbs__hash__table_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_hash_table.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_hash_table.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/dc9/struct_o_n___windows_r_g_b_q_u_a_d.html b/6/dd/dc9/struct_o_n___windows_r_g_b_q_u_a_d.html index 577b9748..26f713bb 100644 --- a/6/dd/dc9/struct_o_n___windows_r_g_b_q_u_a_d.html +++ b/6/dd/dc9/struct_o_n___windows_r_g_b_q_u_a_d.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_WindowsRGBQUAD Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/dd5/class_o_n__2f_vector_array-members.html b/6/dd/dd5/class_o_n__2f_vector_array-members.html index ece6734f..952be7c1 100644 --- a/6/dd/dd5/class_o_n__2f_vector_array-members.html +++ b/6/dd/dd5/class_o_n__2f_vector_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/dd9/class_o_n__2d_point.html b/6/dd/dd9/class_o_n__2d_point.html index 195130c5..9c81ecb4 100644 --- a/6/dd/dd9/class_o_n__2d_point.html +++ b/6/dd/dd9/class_o_n__2d_point.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2dPoint Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    ◆ operator<()

    +

    ◆ operator<()

    @@ -1509,7 +1507,7 @@ Static Public Attributes
    -

    ◆ operator<=()

    +

    ◆ operator<=()

    @@ -1777,7 +1775,7 @@ Static Public Attributes
    -

    ◆ operator>()

    +

    ◆ operator>()

    @@ -1795,7 +1793,7 @@ Static Public Attributes
    -

    ◆ operator>=()

    +

    ◆ operator>=()

    @@ -2135,9 +2133,9 @@ Static Public Attributes
    diff --git a/6/dd/ddc/class_o_n___arithmetic_calculator.html b/6/dd/ddc/class_o_n___arithmetic_calculator.html index e101d922..aaa701f6 100644 --- a/6/dd/ddc/class_o_n___arithmetic_calculator.html +++ b/6/dd/ddc/class_o_n___arithmetic_calculator.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ArithmeticCalculator Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Member Enumeration Documentation

    ◆ ERROR_CONDITION

    @@ -383,8 +379,7 @@ Public Member Functions
    -

    Calculator keys
    -Description: Enter a number that can be used as an implied multiplication operand when implied multiplication is enabled and appropriate.

    +

    Calculator keys Description: Enter a number that can be used as an implied multiplication operand when implied multiplication is enabled and appropriate.

    @@ -626,9 +621,9 @@ Description: Enter a number that can be used as an implied multiplication operan diff --git a/6/dd/ddf/class_o_n___s_h_a1___hash.html b/6/dd/ddf/class_o_n___s_h_a1___hash.html index 227f0036..59c76254 100644 --- a/6/dd/ddf/class_o_n___s_h_a1___hash.html +++ b/6/dd/ddf/class_o_n___s_h_a1___hash.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SHA1_Hash Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
     

    Detailed Description

    -

    / / Copyright (c) 1993-2015 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2015 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_SHA1_Hash() [1/2]

    @@ -983,9 +980,9 @@ Static Public Attributes
    diff --git a/6/dd/de8/class_o_n___brep_edge.html b/6/dd/de8/class_o_n___brep_edge.html index d394a5d0..c476f972 100644 --- a/6/dd/de8/class_o_n___brep_edge.html +++ b/6/dd/de8/class_o_n___brep_edge.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepEdge Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +

    Implementation.

    Not necessary. Base class does the right thing. ON_CurveProxy does not have an override. / virtual ON_Curve::SetStartPoint override bool SetStartPoint( ON_3dPoint start_point );

    -

    / virtual ON_Curve::SetEndPoint override bool SetEndPoint( ON_3dPoint end_point );
    -Returns: brep.m_C3[] index of the 3d curve geometry used by this edge or -1.

    +

    / virtual ON_Curve::SetEndPoint override bool SetEndPoint( ON_3dPoint end_point ); Returns: brep.m_C3[] index of the 3d curve geometry used by this edge or -1.

    @@ -1151,9 +1148,9 @@ Returns: brep.m_C3[] index of the 3d curve geometry used by this edge or -1.

    diff --git a/6/dd/df2/class_o_n__3dm_settings.html b/6/dd/df2/class_o_n__3dm_settings.html index 21d9b6d2..64a580ff 100644 --- a/6/dd/df2/class_o_n__3dm_settings.html +++ b/6/dd/df2/class_o_n__3dm_settings.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmSettings Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dd/df6/class_o_n_x___model_test.html b/6/dd/df6/class_o_n_x___model_test.html index 4c95c98a..188c2305 100644 --- a/6/dd/df6/class_o_n_x___model_test.html +++ b/6/dd/df6/class_o_n_x___model_test.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ONX_ModelTest Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
      Result::Pass = 4, Result::Skip = 5
    - } - ONX_ModelTest::Result reports the result of a test. More...
    + } ONX_ModelTest::Result reports the result of a test. More...
    +   enum  Type : unsigned char {
      Type::Unset = 0, @@ -96,8 +94,8 @@ Public Types
      Type::ReadWriteReadCompare = 4
    - } - ONX_ModelTest::Type identifies the type of file reading test to perform. More...
    + } ONX_ModelTest::Type identifies the type of file reading test to perform. More...
    +   diff --git a/6/dd/dfc/class_o_n___manifest_map-members.html b/6/dd/dfc/class_o_n___manifest_map-members.html index 4e6f4af0..692ec919 100644 --- a/6/dd/dfc/class_o_n___manifest_map-members.html +++ b/6/dd/dfc/class_o_n___manifest_map-members.html @@ -3,7 +3,7 @@ - +openNURBS SDK Help: Member List @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@

    @@ -1119,9 +1117,9 @@ Static Public Attributes

    openNURBS SDK Help +  6.0
    - + +
    diff --git a/6/dd/dfe/class_o_n___brep_face_array-members.html b/6/dd/dfe/class_o_n___brep_face_array-members.html index 4d0a57cf..78d0dce9 100644 --- a/6/dd/dfe/class_o_n___brep_face_array-members.html +++ b/6/dd/dfe/class_o_n___brep_face_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d00/class_o_n___nurbs_cage-members.html b/6/de/d00/class_o_n___nurbs_cage-members.html index 17e2d231..1acb9a32 100644 --- a/6/de/d00/class_o_n___nurbs_cage-members.html +++ b/6/de/d00/class_o_n___nurbs_cage-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d04/class_o_n__3f_vector-members.html b/6/de/d04/class_o_n__3f_vector-members.html index 5bc43389..897a7adf 100644 --- a/6/de/d04/class_o_n__3f_vector-members.html +++ b/6/de/d04/class_o_n__3f_vector-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d16/class_o_n__2d_vector_array-members.html b/6/de/d16/class_o_n__2d_vector_array-members.html index d811feb1..af9a19c6 100644 --- a/6/de/d16/class_o_n__2d_vector_array-members.html +++ b/6/de/d16/class_o_n__2d_vector_array-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d18/struct_o_n___r_tree_node.html b/6/de/d18/struct_o_n___r_tree_node.html index 61beca5e..356b0375 100644 --- a/6/de/d18/struct_o_n___r_tree_node.html +++ b/6/de/d18/struct_o_n___r_tree_node.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RTreeNode Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d1d/class_o_n___document_user_string_list.html b/6/de/d1d/class_o_n___document_user_string_list.html index 43c4f84c..ee89beeb 100644 --- a/6/de/d1d/class_o_n___document_user_string_list.html +++ b/6/de/d1d/class_o_n___document_user_string_list.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_DocumentUserStringList Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -377,9 +375,9 @@ Additional Inherited Members
    diff --git a/6/de/d23/class_o_n__3dm_i_o_settings.html b/6/de/d23/class_o_n__3dm_i_o_settings.html index 48c9abd6..8c38f1bd 100644 --- a/6/de/d23/class_o_n__3dm_i_o_settings.html +++ b/6/de/d23/class_o_n__3dm_i_o_settings.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmIOSettings Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d23/class_o_n__w_string-members.html b/6/de/d23/class_o_n__w_string-members.html index f9b0d691..c0826ff3 100644 --- a/6/de/d23/class_o_n__w_string-members.html +++ b/6/de/d23/class_o_n__w_string-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d29/class_o_n__3dm_wallpaper_image.html b/6/de/d29/class_o_n__3dm_wallpaper_image.html index 1eeacff0..87261bbb 100644 --- a/6/de/d29/class_o_n__3dm_wallpaper_image.html +++ b/6/de/d29/class_o_n__3dm_wallpaper_image.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmWallpaperImage Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d34/class_o_n___component_manifest_item.html b/6/de/d34/class_o_n___component_manifest_item.html index 5d3ce6f4..b31866d5 100644 --- a/6/de/d34/class_o_n___component_manifest_item.html +++ b/6/de/d34/class_o_n___component_manifest_item.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ComponentManifestItem Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d36/class_o_n___binary_file.html b/6/de/d36/class_o_n___binary_file.html index beb9059d..6573d956 100644 --- a/6/de/d36/class_o_n___binary_file.html +++ b/6/de/d36/class_o_n___binary_file.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BinaryFile Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    fseek from end (since the file has an end) bool SeekFromEnd( int );
    -To use custom memory buffering instead of relying on fread()/fwrite()'s build in buffering, call EnableMemoryBuffer() with the buffer size immediately after constructing the ON_BinaryFile. There appear to be enough bugs in existing Windows NT/2000 NETWORK I/O that using this hack will speed up I/O by factors of 10 to 100.

    +

    fseek from end (since the file has an end) bool SeekFromEnd( int ); To use custom memory buffering instead of relying on fread()/fwrite()'s build in buffering, call EnableMemoryBuffer() with the buffer size immediately after constructing the ON_BinaryFile. There appear to be enough bugs in existing Windows NT/2000 NETWORK I/O that using this hack will speed up I/O by factors of 10 to 100.

    @@ -1455,9 +1452,9 @@ To use custom memory buffering instead of relying on fread()/fwrite()'s build in diff --git a/6/de/d37/class_o_n___dim_style_1_1_dimstyle_field.html b/6/de/d37/class_o_n___dim_style_1_1_dimstyle_field.html index f6e0f067..49377f96 100644 --- a/6/de/d37/class_o_n___dim_style_1_1_dimstyle_field.html +++ b/6/de/d37/class_o_n___dim_style_1_1_dimstyle_field.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_DimStyle::DimstyleField Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d42/class_o_n___rtf_parser.html b/6/de/d42/class_o_n___rtf_parser.html index e542abe1..825be3fe 100644 --- a/6/de/d42/class_o_n___rtf_parser.html +++ b/6/de/d42/class_o_n___rtf_parser.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RtfParser Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d46/class_o_n___model_component_content_mark-members.html b/6/de/d46/class_o_n___model_component_content_mark-members.html index ba349132..55740505 100644 --- a/6/de/d46/class_o_n___model_component_content_mark-members.html +++ b/6/de/d46/class_o_n___model_component_content_mark-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d58/opennurbs__textiterator_8h_source.html b/6/de/d58/opennurbs__textiterator_8h_source.html index 29d75c39..68020959 100644 --- a/6/de/d58/opennurbs__textiterator_8h_source.html +++ b/6/de/d58/opennurbs__textiterator_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_textiterator.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_textiterator.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_textiterator.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_TEXTITERATOR_INC_)
    18 #define OPENNURBS_TEXTITERATOR_INC_
    19 
    20 #define RTFFIRSTCHAR
    21 
    22 typedef struct tagFontKey
    23 {
    26 } ON_FontKey;
    27 
    29 {
    30 public:
    31  int m_rtf_font_index = -1;
    33  unsigned int m_codepage = 1252;
    34  unsigned int m_charset = 0;
    35 };
    36 
    37 // Converts wchar_t characters to Unicode codepoints
    39 {
    40 private:
    41  ON_TextIterator() = delete;
    42 
    43 public:
    44  ON_TextIterator(const ON_wString& str);
    45  ON_TextIterator(const wchar_t* str, size_t length);
    46 
    47 public:
    48  ~ON_TextIterator() = default;
    49  ON_TextIterator(const ON_TextIterator&) = default;
    50  ON_TextIterator& operator=(const ON_TextIterator&) = default;
    51 
    52  /*
    53  Parameters:
    54  unicode_code_point - [out]
    55  current unicode code point returned here.
    56  0 = end of string
    57  Returns:
    58  true if returned unicode_code_point is not zero
    59  */
    60  bool PeekCodePoint(ON__UINT32& unicode_code_point) const;
    61 
    62  /*
    63  Description:
    64  Gets the current unicode code point and calls Step() to advance the text iterator
    65  by one code point.
    66  Parameters:
    67  unicode_code_point - [out]
    68  current unicode code point returned here.
    69  0 = end of string
    70  Returns:
    71  true if returned unicode_code_point is not zero
    72  */
    73  bool ReadCodePoint(ON__UINT32& unicode_code_point);
    74 
    75 
    76  bool Back(); // move position back and return current codepoint after moving back
    77 
    78  // Get the next UNICODE code point encoded in m_text beginning at m_text[m_next_text_ci];
    79  // Save this code point in m_cur_codepoint.
    80  // Advance m_next_text_ci.
    81  bool Step();
    82 
    83  bool AtBackslashTic() const;
    84  bool ReadCharValue(
    85  unsigned char& c
    86  );
    87 private:
    88 
    89  const wchar_t* m_text = nullptr;
    90  size_t m_length = 0;
    91  size_t m_prev_text_ci = 0; // previous offset in m_text wchar_t string
    92  size_t m_next_text_ci = 0; // previous offset in m_text wchar_t string
    93  size_t m_cur_text_ci = 0; // current offset in m_text wchar_t string
    94  ON__UINT32 m_prev_codepoint = 0; // previous UNICODE code point
    95  ON__UINT32 m_cur_codepoint = 0; // UNICODE code point read by last call to Step()
    96  struct ON_UnicodeErrorParameters m_ue = ON_UnicodeErrorParameters::MaskErrors;
    97 };
    98 
    100 {
    101 public:
    102  ON_TextBuilder();
    103 
    104  virtual ~ON_TextBuilder();
    105 
    106  class TextProps
    107  {
    108  public:
    110  {}
    112  double height,
    113  double stackscale,
    114  ON_Color color,
    115  ON_DimStyle::stack_format stackformat,
    116  bool bold,
    117  bool italic,
    118  bool underlined,
    119  bool strikethrough,
    120  unsigned int charset)
    121  : m_height(height)
    122  , m_stackscale(stackscale)
    123  , m_color(color)
    124  , m_stackformat(stackformat)
    125  , m_bold(bold)
    126  , m_italic(italic)
    127  , m_underlined(underlined)
    128  , m_strikethrough(strikethrough)
    129  , m_codepage(1252)
    130  {}
    131  double Height() const
    132  {
    133  return m_height;
    134  }
    135  void SetHeight(double h)
    136  {
    137  if (h > 1e-8)
    138  m_height = h;
    139  }
    140  double StackScale() const
    141  {
    142  return m_stackscale;
    143  }
    144  void SetStackScale(double s)
    145  {
    146  if (0.0 < s && 10.0 > s)
    147  m_stackscale = s;
    148  }
    149  ON_Color Color() const
    150  {
    151  return m_color;
    152  }
    154  {
    155  m_color = c;
    156  }
    158  {
    159  return m_stackformat;
    160  }
    162  {
    163  m_stackformat = s;
    164  }
    165  bool IsBold()
    166  {
    167  return m_bold;
    168  }
    169  void SetBold(bool bold)
    170  {
    171  m_bold = bold;
    172  }
    173  bool IsItalic()
    174  {
    175  return m_italic;
    176  }
    177  void SetItalic(bool italic)
    178  {
    179  m_italic = italic;
    180  }
    182  {
    183  return m_underlined;
    184  }
    185  void SetUnderlined(bool underlined)
    186  {
    187  m_underlined = underlined;
    188  }
    190  {
    191  return m_strikethrough;
    192  }
    193  void SetStrikethrough(bool strikethrough)
    194  {
    195  m_strikethrough = strikethrough;
    196  }
    197  unsigned int CodePage()
    198  {
    199  return m_codepage;
    200  }
    201  void SetCodePage(unsigned int codepage)
    202  {
    203  m_codepage = codepage;
    204  }
    205 
    206  unsigned int CharSet()
    207  {
    208  return m_charset;
    209  }
    210  void SetCharSet(unsigned int charset, bool setcodepage)
    211  {
    212  m_charset = charset;
    213  if (setcodepage)
    214  {
    215  m_codepage = ON_MapRTFcharsetToWindowsCodePage(charset, 1252);
    216  }
    217  }
    218 
    219  private:
    220  double m_height = 1.0;
    221  double m_stackscale = 0.7;
    222  ON_Color m_color = ON_Color::Black;
    224  bool m_bold = false;
    225  bool m_italic = false;
    226  bool m_underlined = false;
    227  bool m_strikethrough = false;
    228  unsigned int m_codepage = 1252;
    229  unsigned int m_charset = 0; // Charset isn't really needed but is here to make debugging a little easier
    230  };
    231 
    234 
    235  // Rtf uses UTF-16 encoding and surrogate pairs need to be properly handled.
    236  // For example, the single UNICODE code point ON_UnicodeCodePoint::Wastebasket U+1F5D1 (decimal 128465)
    237  // is in the RTF string as ...{\ltrch \u-10179?\u-8751?}...
    238  // The UNICODE code point U+1F5D1 is encoded as a UTF-16 surrogate pair is (0xD83D, 0xDDD1).
    239  // \u-10179? -> unsigned short 0xD83D
    240  // \u-8751? -> unsigned short 0xDDD1
    241  enum : ON__UINT16
    242  {
    243  m_UFT16_waiting_mark = 0xEEEE, // value must be > 0xE000 and uncommon unicode code point
    244  m_UFT16_unused_mark = 0xFFFF // value must be > m_UFT16_waiting, <= 0xFFFF, and uncommon unicode code point
    245  };
    247  ON__UINT16 m_current_UTF16_buffer[2];
    248 
    250  ON__INT32 m_in_run;
    251  ON__INT32 m_level = 0;
    252  ON__INT32 m_font_table_level = -1;
    253  ON__INT32 m_font_index = 0;
    254  ON__INT32 m_default_font_index = 0;
    256 
    258 
    259  virtual void InitBuilder(const ON_Font* default_font);
    260  virtual void FlushText(size_t count, ON__UINT32* cp_array);
    261  virtual void GroupBegin();
    262  virtual void GroupEnd();
    263 
    264  virtual void BeginHeader();
    265  virtual void BeginFontTable();
    266  virtual void DefaultFont(const wchar_t* value);
    267  virtual void FontTag(const wchar_t* value);
    268  virtual void FontSize(const wchar_t* value);
    269  virtual void CharSet(const wchar_t* value);
    270  virtual void CodePage(const wchar_t* value);
    271 
    272  virtual void Newline();
    273  virtual void Paragraph();
    274  virtual void ParagraphDefaults();
    275  virtual void Section();
    276  virtual void Tab();
    277 
    278  virtual void Bold(const wchar_t* value);
    279  virtual void Italic(const wchar_t* value);
    280  virtual void UnderlineOn();
    281  virtual void UnderlineOff();
    282  virtual void Strikethrough(const wchar_t* value);
    283 
    284  virtual void Superscript();
    285  virtual void Subscript();
    286  virtual void NoSuperSub();
    287 
    288  virtual void BeginColorTable();
    289  virtual void ColorRed(const wchar_t* value);
    290  virtual void ColorGreen(const wchar_t* value);
    291  virtual void ColorBlue(const wchar_t* value);
    292  virtual void ColorForeground(const wchar_t* value);
    293  virtual void ColorBackground(const wchar_t* value);
    294 
    295  virtual void SetStackScale(const wchar_t* value);
    296  virtual void StackFraction(const wchar_t* value);
    297  virtual void StackEnd();
    298 
    299  virtual void TextField(const wchar_t* name);
    300 
    301  virtual void UniEmbeddedDest(const wchar_t* value);
    302  virtual void UniDest(const wchar_t* value);
    303 
    304  virtual void UniCpCount(const wchar_t* value);
    305  virtual void UniDecimal(const wchar_t* value);
    306 
    307  virtual void LQuote();
    308  virtual void RQuote();
    309  virtual void LDblQuote();
    310  virtual void RDblQuote();
    311  virtual void Bullet();
    312  virtual void EnDash();
    313  virtual void EmDash();
    314 
    315  virtual bool AppendCodePoint(ON__UINT32 codept);
    316 
    317  ON__UINT32* RunCodePoints(const ON_TextRun& run);
    318 
    319  const ON_wString FaceNameFromMap(int nval);
    320  unsigned int CodePageFromMap(int nval);
    321  unsigned int CharSetFromMap(int nval);
    322 
    323 private:
    324  ON_TextBuilder operator=(const ON_TextBuilder& src);
    325 };
    326 
    327 
    328 
    330 {
    331 public:
    333  ON_TextContent& text,
    334  ON_TextRunArray& runs,
    335  const ON_DimStyle* dimstyle,
    336  double height,
    337  ON_Color color);
    338 
    339  virtual ~ON_TextRunBuilder();
    340 
    343 
    347 
    348  void FinishCurrentRun();
    349  void AppendCurrentRun();
    350 
    351  void InitBuilder(const ON_Font* default_font) override;
    352  void FlushText(size_t count, ON__UINT32* cp_array) override;
    353  void GroupBegin() override;
    354  void GroupEnd() override;
    355 
    356  void BeginHeader() override;
    357  void BeginFontTable() override;
    358  void DefaultFont(const wchar_t* value) override;
    359  void FontTag(const wchar_t* value) override;
    360  void FontSize(const wchar_t* value) override;
    361 
    362  void Newline() override;
    363  void Paragraph() override;
    364  void ParagraphDefaults() override;
    365  void Section() override;
    366  void Tab() override;
    367 
    368  void Bold(const wchar_t* value) override;
    369  void Italic(const wchar_t* value) override;
    370  void UnderlineOn() override;
    371  void UnderlineOff() override;
    372  void Strikethrough(const wchar_t* value) override;
    373 
    374  void Superscript() override;
    375  void Subscript() override;
    376  void NoSuperSub() override;
    377 
    378  void BeginColorTable() override;
    379  void ColorRed(const wchar_t* value) override;
    380  void ColorGreen(const wchar_t* value) override;
    381  void ColorBlue(const wchar_t* value) override;
    382  void ColorForeground(const wchar_t* value) override;
    383  void ColorBackground(const wchar_t* value) override;
    384 
    385  void SetStackScale(const wchar_t* value) override;
    386  void StackFraction(const wchar_t* value) override;
    387  void StackEnd() override;
    388 
    389  void TextField(const wchar_t* name) override;
    390 
    391  void UniEmbeddedDest(const wchar_t* value) override;
    392  void UniDest(const wchar_t* value) override;
    393 
    394 private:
    395  ON_TextRunBuilder operator=(const ON_TextRunBuilder& src);
    396 };
    397 
    399 {
    400 public:
    402  const ON_DimStyle* dimstyle,
    403  double height,
    404  ON_Color color);
    405 
    406  virtual ~ON_RtfStringBuilder();
    407 
    408  class TextRun
    409  {
    410  public:
    411  TextRun() {}
    412 
    414  {
    415  return m_run_type;
    416  }
    418  {
    419  m_run_type = type;
    420  }
    421  void InitRun()
    422  {
    423  m_run_type = ON_TextRun::RunType::kNone;
    424  m_font_index = -1;
    425  m_text.Empty();
    426  m_bold = false;
    427  m_italic = false;
    428  m_underlined = false;
    429  m_strikethrough = false;
    430  }
    431  int FontIndex()
    432  {
    433  return m_font_index;
    434  }
    435  void SetFontIndex(int index)
    436  {
    437  if(index >= -1)
    438  m_font_index = index;
    439  }
    440 
    441  bool IsBold() const
    442  {
    443  return m_bold;
    444  }
    445  bool IsItalic() const
    446  {
    447  return m_italic;
    448  }
    449  bool IsUnderlined() const
    450  {
    451  return m_underlined;
    452  }
    453  bool IsStrikeThrough() const
    454  {
    455  return m_strikethrough;
    456  }
    457  void SetBold(bool b)
    458  {
    459  m_bold = b;
    460  }
    461  void SetItalic(bool b)
    462  {
    463  m_italic = b;
    464  }
    465  void SetUnderlined(bool b)
    466  {
    467  m_underlined = b;
    468  }
    469  void SetStrikeThrough(bool b)
    470  {
    471  m_strikethrough = b;
    472  }
    473 
    474  void AddControl(const wchar_t* str)
    475  {
    476  m_text += str;
    477  size_t i = wcslen(str);
    478  if(str[i-1] == L' ' || str[i-1] == L'{' || str[i-1] == L'}')
    479  m_terminated = true;
    480  else
    481  m_terminated = false;
    482  m_has_content = true;
    483  }
    484 
    485  void AddText(const wchar_t* str)
    486  {
    487  if (!m_terminated)
    488  m_text += L' ';
    489  m_terminated = true;
    490  m_text += str;
    491  m_has_content = true;
    492  }
    493 
    494  void AddChar(const wchar_t ch)
    495  {
    496  if (!m_terminated)
    497  m_text += L' ';
    498  m_terminated = true;
    499  m_text += ch;
    500  m_has_content = true;
    501  }
    502 
    503  void SetTerminated(bool terminated)
    504  {
    505  m_terminated = terminated;
    506  }
    507 
    509  {
    510  return m_terminated;
    511  }
    512 
    513  void EmptyText()
    514  {
    515  m_text = ON_wString::EmptyString;
    516  }
    517 
    519  {
    520  return m_text;
    521  }
    522 
    523  private:
    524  bool m_has_content = false;
    525  bool m_terminated = true;
    526  ON_wString m_text;
    527  bool m_bold = false;
    528  bool m_italic = false;
    529  bool m_underlined = false;
    530  bool m_strikethrough = false;
    531  int m_font_index = -1;
    533  };
    534 
    535 private:
    536  ON_wString m_string_out;
    537  bool m_in_font_table = false;
    538  bool m_in_color_table = false;
    539 
    540  bool m_skip_color_tbl = false;
    541  bool m_skip_bold = false;
    542  bool m_skip_italic = false;
    543  bool m_skip_underline = false;
    544  bool m_skip_facename = false;
    545 
    546  bool m_make_bold = false;
    547  bool m_make_italic = false;
    548  bool m_make_underline = false;
    549  bool m_make_facename = false;
    550 
    551  ON_wString m_default_facename;
    552  ON_wString m_override_facename;
    553 
    554  bool m_have_rtf = false;
    555 
    556 public:
    557 
    560 
    561  void InitStringBuilder(const ON_DimStyle* default_style);
    562  const ON_wString OutputString();
    563  void PushRun(TextRun& run);
    564  TextRun PopRun();
    565 
    566  bool InFontTable();
    567  void SetInFontTable(bool b);
    568  bool InColorTable();
    569  void SetInColorTable(bool b);
    570 
    571  void SetSkipColorTbl(bool b);
    572  void SetSkipBold(bool b);
    573  void SetSkipItalic(bool b);
    574  void SetSkipUnderline(bool b);
    575  void SetSkipFacename(bool b);
    576 
    577  bool SkipColorTbl();
    578  bool SkipBold();
    579  bool SkipItalic();
    580  bool SkipUnderline();
    581  bool SkipFacename();
    582 
    583  void SetMakeBold(bool b);
    584  void SetMakeItalic(bool b);
    585  void SetMakeUnderline(bool b);
    586  void SetMakeFacename(bool b);
    587 
    588  bool MakeBold();
    589  bool MakeItalic();
    590  bool MakeUnderline();
    591  bool MakeFacename();
    592 
    593  bool SkippingFacename();
    594  bool SettingFacename();
    595 
    596  void SetDefaultFacename(const wchar_t* facename);
    597  void SetOverrideFacename(const wchar_t* facename);
    598 
    599  // virtuals
    600 
    601  void GroupBegin() override;
    602  void GroupEnd() override;
    603 
    604  void BeginHeader() override;
    605  void BeginFontTable() override;
    606  void DefaultFont(const wchar_t* value) override;
    607  void FontTag(const wchar_t* value) override;
    608  void FontSize(const wchar_t* value) override;
    609 
    610  void Newline() override;
    611  void Paragraph() override;
    612  void ParagraphDefaults() override;
    613  void Section() override;
    614  void Tab() override;
    615 
    616  void Bold(const wchar_t* value) override;
    617  void Italic(const wchar_t* value) override;
    618  void UnderlineOn() override;
    619  void UnderlineOff() override;
    620  void Strikethrough(const wchar_t* value) override;
    621 
    622  void Superscript() override;
    623  void Subscript() override;
    624  void NoSuperSub() override;
    625 
    626  void BeginColorTable() override;
    627  void ColorRed(const wchar_t* value) override;
    628  void ColorGreen(const wchar_t* value) override;
    629  void ColorBlue(const wchar_t* value) override;
    630  void ColorForeground(const wchar_t* value) override;
    631  void ColorBackground(const wchar_t* value) override;
    632 
    633  void TextField(const wchar_t* name) override;
    634 
    635  bool AppendCodePoint(ON__UINT32 codept) override;
    636 
    637  void UniEmbeddedDest(const wchar_t* value) override;
    638  void UniDecimal(const wchar_t* value) override;
    639  void UniDest(const wchar_t* value) override;
    640 
    641 private:
    642  ON_RtfStringBuilder operator=(const ON_RtfStringBuilder& src);
    643 };
    644 
    645 #ifdef RTFFIRSTCHAR
    646 
    648 {
    649 public:
    651  const ON_DimStyle* dimstyle,
    652  double height,
    653  ON_Color color);
    654 
    655  virtual ~ON_RtfFirstChar();
    656 
    657  class TextRun
    658  {
    659  public:
    660  TextRun() {}
    661 
    663  {
    664  return m_run_type;
    665  }
    667  {
    668  m_run_type = type;
    669  }
    670  void InitRun()
    671  {
    672  m_run_type = ON_TextRun::RunType::kNone;
    673  m_font_index = -1;
    674  m_text.Empty();
    675  m_bold = false;
    676  m_italic = false;
    677  m_underlined = false;
    678  m_strikethrough = false;
    679  }
    680  int FontIndex()
    681  {
    682  return m_font_index;
    683  }
    684  void SetFontIndex(int index)
    685  {
    686  if (index >= -1)
    687  m_font_index = index;
    688  }
    689 
    690  bool IsBold() const
    691  {
    692  return m_bold;
    693  }
    694  bool IsItalic() const
    695  {
    696  return m_italic;
    697  }
    698  bool IsUnderlined() const
    699  {
    700  return m_underlined;
    701  }
    702  bool IsStrikeThrough() const
    703  {
    704  return m_strikethrough;
    705  }
    706  void SetBold(bool b)
    707  {
    708  m_bold = b;
    709  }
    710  void SetItalic(bool b)
    711  {
    712  m_italic = b;
    713  }
    714  void SetUnderlined(bool b)
    715  {
    716  m_underlined = b;
    717  }
    718  void SetStrikeThrough(bool b)
    719  {
    720  m_strikethrough = b;
    721  }
    722 
    723  void AddText(const wchar_t* str)
    724  {
    725  if (!m_terminated)
    726  m_text += L' ';
    727  m_terminated = true;
    728  m_text += str;
    729  m_has_content = true;
    730  }
    731 
    732  const ON_wString& Text()
    733  {
    734  return m_text;
    735  }
    736 
    737  private:
    738  bool m_has_content = false;
    739  bool m_terminated = true;
    740  ON_wString m_text;
    741  bool m_bold = false;
    742  bool m_italic = false;
    743  bool m_underlined = false;
    744  bool m_strikethrough = false;
    745  int m_font_index = -1;
    747  };
    748 
    749 private:
    750  bool m_in_font_table = false;
    751  bool m_in_color_table = false;
    752 
    753  bool m_have_rtf = false;
    754 
    755 public:
    756 
    759 
    760  void InitStringBuilder(const ON_DimStyle* default_style);
    761  const ON_wString OutputString();
    762  void PushRun(TextRun& run);
    763  TextRun PopRun();
    764 
    765  bool InFontTable();
    766  void SetInFontTable(bool b);
    767  bool InColorTable();
    768  void SetInColorTable(bool b);
    769 
    770  // virtuals
    771 
    772  void GroupBegin() override;
    773  void GroupEnd() override;
    774 
    775  void BeginHeader() override;
    776  void BeginFontTable() override;
    777  void BeginColorTable() override;
    778  void TextField(const wchar_t* name) override;
    779  bool AppendCodePoint(ON__UINT32 codept) override;
    780 
    781  void FontTag(const wchar_t* value) override;
    782 
    783  void Bold(const wchar_t* value) override;
    784  void Italic(const wchar_t* value) override;
    785  void UnderlineOn() override;
    786  void UnderlineOff() override;
    787  void Strikethrough(const wchar_t* value) override;
    788 
    789 private:
    790  ON_RtfFirstChar operator=(const ON_RtfFirstChar& src);
    791 };
    792 
    793 #endif
    794 
    796 {
    797 public:
    799  bool Parse();
    800 
    801 private:
    802  ON__UINT32 Internal_ParseMBCSString(
    803  const ON__UINT32 windows_code_page
    804  );
    805 
    806  ON_TextIterator& m_ti;
    807 
    808  ON_TextBuilder& m_builder;
    809  int m_p_level;
    810  bool m_in_real_rtf;
    811 
    812  bool FlushCurText(ON_SimpleArray< ON__UINT32 >& cp_array);
    813  bool ReadTag(bool optional);
    814  bool ProcessTag(const wchar_t* name, const wchar_t* value, bool optional);
    815 
    816  ON_RtfParser operator=(const ON_RtfParser& src);
    817 };
    818 
    819 class ON_CLASS RtfComposer
    820 {
    821 public:
    822  class RunInfo
    823  {
    824  public:
    826  ON_TextRun* m_text_run = nullptr;
    828  bool m_bold = false;
    829  bool m_italic = false;
    830  bool m_underline = false;
    831  bool m_strikeout = false;
    832  ON_wString m_facename = L"Arial";
    833  int m_facename_key = -1;
    834  };
    835 
    836 
    837  static bool ComposeA(
    838  const ON_TextContent* text,
    839  const ON_DimStyle* dimstyle,
    840  ON_wString& rtf);
    841 
    842  static bool Compose(
    843  const ON_TextContent* text,
    844  const ON_DimStyle* dimstyle,
    845  ON_wString& rtf);
    846 
    847  static void ComposeRunA(
    848  const ON_TextRun* run,
    849  const ON_DimStyle* dimstyle,
    850  ON_SimpleArray< wchar_t[34] >& fonttable,
    851  bool multiline,
    852  int& changecount,
    853  int& changefont,
    854  bool& bold,
    855  bool& italic,
    856  bool& underlined,
    857  RunInfo& runinfo);
    858 
    859  static void ComposeRun(
    860  const ON_TextRun* run,
    861  const ON_DimStyle* dimstyle,
    862  ON_SimpleArray< wchar_t[34] >& fonttable,
    863  bool multiline,
    864  int& changecount,
    865  int& changefont,
    866  int& changecolor,
    867  bool& bold,
    868  bool& italic,
    869  bool& underlined,
    870  bool& strikeout,
    871  ON_wString& strings_out);
    872 
    873  static bool RecomposeRTF();
    874  static void SetRecomposeRTF(bool b);
    875 
    876 private:
    877  static bool m_bComposeRTF;
    878 
    879  RtfComposer();
    880  static unsigned int GetFacenameKey(const wchar_t* facename, ON_SimpleArray< wchar_t[34] >& fonttable);
    881  static unsigned int GetColorKey(ON_Color color, ON_SimpleArray< unsigned int >& colortable);
    882  static bool FormatTextHeight(double height, ON_wString& str);
    883 };
    884 
    885 
    886 #endif
    887 
    void SetInFontTable(bool b)
    -
    TextProps()
    Definition: opennurbs_textiterator.h:109
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_TEXTITERATOR_INC_)
    18 #define OPENNURBS_TEXTITERATOR_INC_
    19 
    20 #define RTFFIRSTCHAR
    21 
    22 typedef struct tagFontKey
    23 {
    26 } ON_FontKey;
    27 
    29 {
    30 public:
    31  int m_rtf_font_index = -1;
    33  unsigned int m_codepage = 1252;
    34  unsigned int m_charset = 0;
    35 };
    36 
    37 // Converts wchar_t characters to Unicode codepoints
    39 {
    40 private:
    41  ON_TextIterator() = delete;
    42 
    43 public:
    44  ON_TextIterator(const ON_wString& str);
    45  ON_TextIterator(const wchar_t* str, size_t length);
    46 
    47 public:
    48  ~ON_TextIterator() = default;
    49  ON_TextIterator(const ON_TextIterator&) = default;
    50  ON_TextIterator& operator=(const ON_TextIterator&) = default;
    51 
    52  /*
    53  Parameters:
    54  unicode_code_point - [out]
    55  current unicode code point returned here.
    56  0 = end of string
    57  Returns:
    58  true if returned unicode_code_point is not zero
    59  */
    60  bool PeekCodePoint(ON__UINT32& unicode_code_point) const;
    61 
    62  /*
    63  Description:
    64  Gets the current unicode code point and calls Step() to advance the text iterator
    65  by one code point.
    66  Parameters:
    67  unicode_code_point - [out]
    68  current unicode code point returned here.
    69  0 = end of string
    70  Returns:
    71  true if returned unicode_code_point is not zero
    72  */
    73  bool ReadCodePoint(ON__UINT32& unicode_code_point);
    74 
    75 
    76  bool Back(); // move position back and return current codepoint after moving back
    77 
    78  // Get the next UNICODE code point encoded in m_text beginning at m_text[m_next_text_ci];
    79  // Save this code point in m_cur_codepoint.
    80  // Advance m_next_text_ci.
    81  bool Step();
    82 
    83  bool AtBackslashTic() const;
    84  bool ReadCharValue(
    85  unsigned char& c
    86  );
    87 private:
    88 
    89  const wchar_t* m_text = nullptr;
    90  size_t m_length = 0;
    91  size_t m_prev_text_ci = 0; // previous offset in m_text wchar_t string
    92  size_t m_next_text_ci = 0; // previous offset in m_text wchar_t string
    93  size_t m_cur_text_ci = 0; // current offset in m_text wchar_t string
    94  ON__UINT32 m_prev_codepoint = 0; // previous UNICODE code point
    95  ON__UINT32 m_cur_codepoint = 0; // UNICODE code point read by last call to Step()
    96  struct ON_UnicodeErrorParameters m_ue = ON_UnicodeErrorParameters::MaskErrors;
    97 };
    98 
    100 {
    101 public:
    102  ON_TextBuilder();
    103 
    104  virtual ~ON_TextBuilder();
    105 
    106  class TextProps
    107  {
    108  public:
    110  {}
    112  double height,
    113  double stackscale,
    114  ON_Color color,
    115  ON_DimStyle::stack_format stackformat,
    116  bool bold,
    117  bool italic,
    118  bool underlined,
    119  bool strikethrough,
    120  unsigned int charset)
    121  : m_height(height)
    122  , m_stackscale(stackscale)
    123  , m_color(color)
    124  , m_stackformat(stackformat)
    125  , m_bold(bold)
    126  , m_italic(italic)
    127  , m_underlined(underlined)
    128  , m_strikethrough(strikethrough)
    129  , m_codepage(1252)
    130  {}
    131  double Height() const
    132  {
    133  return m_height;
    134  }
    135  void SetHeight(double h)
    136  {
    137  if (h > 1e-8)
    138  m_height = h;
    139  }
    140  double StackScale() const
    141  {
    142  return m_stackscale;
    143  }
    144  void SetStackScale(double s)
    145  {
    146  if (0.0 < s && 10.0 > s)
    147  m_stackscale = s;
    148  }
    149  ON_Color Color() const
    150  {
    151  return m_color;
    152  }
    154  {
    155  m_color = c;
    156  }
    158  {
    159  return m_stackformat;
    160  }
    162  {
    163  m_stackformat = s;
    164  }
    165  bool IsBold()
    166  {
    167  return m_bold;
    168  }
    169  void SetBold(bool bold)
    170  {
    171  m_bold = bold;
    172  }
    173  bool IsItalic()
    174  {
    175  return m_italic;
    176  }
    177  void SetItalic(bool italic)
    178  {
    179  m_italic = italic;
    180  }
    182  {
    183  return m_underlined;
    184  }
    185  void SetUnderlined(bool underlined)
    186  {
    187  m_underlined = underlined;
    188  }
    190  {
    191  return m_strikethrough;
    192  }
    193  void SetStrikethrough(bool strikethrough)
    194  {
    195  m_strikethrough = strikethrough;
    196  }
    197  unsigned int CodePage()
    198  {
    199  return m_codepage;
    200  }
    201  void SetCodePage(unsigned int codepage)
    202  {
    203  m_codepage = codepage;
    204  }
    205 
    206  unsigned int CharSet()
    207  {
    208  return m_charset;
    209  }
    210  void SetCharSet(unsigned int charset, bool setcodepage)
    211  {
    212  m_charset = charset;
    213  if (setcodepage)
    214  {
    215  m_codepage = ON_MapRTFcharsetToWindowsCodePage(charset, 1252);
    216  }
    217  }
    218 
    219  private:
    220  double m_height = 1.0;
    221  double m_stackscale = 0.7;
    222  ON_Color m_color = ON_Color::Black;
    224  bool m_bold = false;
    225  bool m_italic = false;
    226  bool m_underlined = false;
    227  bool m_strikethrough = false;
    228  unsigned int m_codepage = 1252;
    229  unsigned int m_charset = 0; // Charset isn't really needed but is here to make debugging a little easier
    230  };
    231 
    234 
    235  // Rtf uses UTF-16 encoding and surrogate pairs need to be properly handled.
    236  // For example, the single UNICODE code point ON_UnicodeCodePoint::Wastebasket U+1F5D1 (decimal 128465)
    237  // is in the RTF string as ...{\ltrch \u-10179?\u-8751?}...
    238  // The UNICODE code point U+1F5D1 is encoded as a UTF-16 surrogate pair is (0xD83D, 0xDDD1).
    239  // \u-10179? -> unsigned short 0xD83D
    240  // \u-8751? -> unsigned short 0xDDD1
    241  enum : ON__UINT16
    242  {
    243  m_UFT16_waiting_mark = 0xEEEE, // value must be > 0xE000 and uncommon unicode code point
    244  m_UFT16_unused_mark = 0xFFFF // value must be > m_UFT16_waiting, <= 0xFFFF, and uncommon unicode code point
    245  };
    246  ON__INT32 m_current_UTF16_buffer_count = 0;
    247  ON__UINT16 m_current_UTF16_buffer[2];
    248 
    250  ON__INT32 m_in_run;
    251  ON__INT32 m_level = 0;
    252  ON__INT32 m_font_table_level = -1;
    253  ON__INT32 m_font_index = 0;
    254  ON__INT32 m_default_font_index = 0;
    255  ON_SimpleArray< int > m_ansi_equiv_chars = 0;
    256 
    258 
    259  virtual void InitBuilder(const ON_Font* default_font);
    260  virtual void FlushText(size_t count, ON__UINT32* cp_array);
    261  virtual void GroupBegin();
    262  virtual void GroupEnd();
    263 
    264  virtual void BeginHeader();
    265  virtual void BeginFontTable();
    266  virtual void DefaultFont(const wchar_t* value);
    267  virtual void FontTag(const wchar_t* value);
    268  virtual void FontSize(const wchar_t* value);
    269  virtual void CharSet(const wchar_t* value);
    270  virtual void CodePage(const wchar_t* value);
    271 
    272  virtual void Newline();
    273  virtual void Paragraph();
    274  virtual void ParagraphDefaults();
    275  virtual void Section();
    276  virtual void Tab();
    277 
    278  virtual void Bold(const wchar_t* value);
    279  virtual void Italic(const wchar_t* value);
    280  virtual void UnderlineOn();
    281  virtual void UnderlineOff();
    282  virtual void Strikethrough(const wchar_t* value);
    283 
    284  virtual void Superscript();
    285  virtual void Subscript();
    286  virtual void NoSuperSub();
    287 
    288  virtual void BeginColorTable();
    289  virtual void ColorRed(const wchar_t* value);
    290  virtual void ColorGreen(const wchar_t* value);
    291  virtual void ColorBlue(const wchar_t* value);
    292  virtual void ColorForeground(const wchar_t* value);
    293  virtual void ColorBackground(const wchar_t* value);
    294 
    295  virtual void SetStackScale(const wchar_t* value);
    296  virtual void StackFraction(const wchar_t* value);
    297  virtual void StackEnd();
    298 
    299  virtual void TextField(const wchar_t* name);
    300 
    301  virtual void UniEmbeddedDest(const wchar_t* value);
    302  virtual void UniDest(const wchar_t* value);
    303 
    304  virtual void UniCpCount(const wchar_t* value);
    305  virtual void UniDecimal(const wchar_t* value);
    306 
    307  virtual void LQuote();
    308  virtual void RQuote();
    309  virtual void LDblQuote();
    310  virtual void RDblQuote();
    311  virtual void Bullet();
    312  virtual void EnDash();
    313  virtual void EmDash();
    314 
    315  virtual bool AppendCodePoint(ON__UINT32 codept);
    316 
    317  ON__UINT32* RunCodePoints(const ON_TextRun& run);
    318 
    319  const ON_wString FaceNameFromMap(int nval);
    320  unsigned int CodePageFromMap(int nval);
    321  unsigned int CharSetFromMap(int nval);
    322 
    323 private:
    324  ON_TextBuilder operator=(const ON_TextBuilder& src);
    325 };
    326 
    327 
    328 
    330 {
    331 public:
    333  ON_TextContent& text,
    334  ON_TextRunArray& runs,
    335  const ON_DimStyle* dimstyle,
    336  double height,
    337  ON_Color color);
    338 
    339  virtual ~ON_TextRunBuilder();
    340 
    342  const ON_Font* m_current_font = &ON_Font::Default;
    343 
    347 
    348  void FinishCurrentRun();
    349  void AppendCurrentRun();
    350 
    351  void InitBuilder(const ON_Font* default_font) override;
    352  void FlushText(size_t count, ON__UINT32* cp_array) override;
    353  void GroupBegin() override;
    354  void GroupEnd() override;
    355 
    356  void BeginHeader() override;
    357  void BeginFontTable() override;
    358  void DefaultFont(const wchar_t* value) override;
    359  void FontTag(const wchar_t* value) override;
    360  void FontSize(const wchar_t* value) override;
    361 
    362  void Newline() override;
    363  void Paragraph() override;
    364  void ParagraphDefaults() override;
    365  void Section() override;
    366  void Tab() override;
    367 
    368  void Bold(const wchar_t* value) override;
    369  void Italic(const wchar_t* value) override;
    370  void UnderlineOn() override;
    371  void UnderlineOff() override;
    372  void Strikethrough(const wchar_t* value) override;
    373 
    374  void Superscript() override;
    375  void Subscript() override;
    376  void NoSuperSub() override;
    377 
    378  void BeginColorTable() override;
    379  void ColorRed(const wchar_t* value) override;
    380  void ColorGreen(const wchar_t* value) override;
    381  void ColorBlue(const wchar_t* value) override;
    382  void ColorForeground(const wchar_t* value) override;
    383  void ColorBackground(const wchar_t* value) override;
    384 
    385  void SetStackScale(const wchar_t* value) override;
    386  void StackFraction(const wchar_t* value) override;
    387  void StackEnd() override;
    388 
    389  void TextField(const wchar_t* name) override;
    390 
    391  void UniEmbeddedDest(const wchar_t* value) override;
    392  void UniDest(const wchar_t* value) override;
    393 
    394 private:
    395  ON_TextRunBuilder operator=(const ON_TextRunBuilder& src);
    396 };
    397 
    399 {
    400 public:
    402  const ON_DimStyle* dimstyle,
    403  double height,
    404  ON_Color color);
    405 
    406  virtual ~ON_RtfStringBuilder();
    407 
    408  class TextRun
    409  {
    410  public:
    411  TextRun() {}
    412 
    414  {
    415  return m_run_type;
    416  }
    418  {
    419  m_run_type = type;
    420  }
    421  void InitRun()
    422  {
    423  m_run_type = ON_TextRun::RunType::kNone;
    424  m_font_index = -1;
    425  m_text.Empty();
    426  m_bold = false;
    427  m_italic = false;
    428  m_underlined = false;
    429  m_strikethrough = false;
    430  }
    431  int FontIndex()
    432  {
    433  return m_font_index;
    434  }
    435  void SetFontIndex(int index)
    436  {
    437  if(index >= -1)
    438  m_font_index = index;
    439  }
    440 
    441  bool IsBold() const
    442  {
    443  return m_bold;
    444  }
    445  bool IsItalic() const
    446  {
    447  return m_italic;
    448  }
    449  bool IsUnderlined() const
    450  {
    451  return m_underlined;
    452  }
    453  bool IsStrikeThrough() const
    454  {
    455  return m_strikethrough;
    456  }
    457  void SetBold(bool b)
    458  {
    459  m_bold = b;
    460  }
    461  void SetItalic(bool b)
    462  {
    463  m_italic = b;
    464  }
    465  void SetUnderlined(bool b)
    466  {
    467  m_underlined = b;
    468  }
    469  void SetStrikeThrough(bool b)
    470  {
    471  m_strikethrough = b;
    472  }
    473 
    474  void AddControl(const wchar_t* str)
    475  {
    476  m_text += str;
    477  size_t i = wcslen(str);
    478  if(str[i-1] == L' ' || str[i-1] == L'{' || str[i-1] == L'}')
    479  m_terminated = true;
    480  else
    481  m_terminated = false;
    482  m_has_content = true;
    483  }
    484 
    485  void AddText(const wchar_t* str)
    486  {
    487  if (!m_terminated)
    488  m_text += L' ';
    489  m_terminated = true;
    490  m_text += str;
    491  m_has_content = true;
    492  }
    493 
    494  void AddChar(const wchar_t ch)
    495  {
    496  if (!m_terminated)
    497  m_text += L' ';
    498  m_terminated = true;
    499  m_text += ch;
    500  m_has_content = true;
    501  }
    502 
    503  void SetTerminated(bool terminated)
    504  {
    505  m_terminated = terminated;
    506  }
    507 
    509  {
    510  return m_terminated;
    511  }
    512 
    513  void EmptyText()
    514  {
    515  m_text = ON_wString::EmptyString;
    516  }
    517 
    519  {
    520  return m_text;
    521  }
    522 
    523  private:
    524  bool m_has_content = false;
    525  bool m_terminated = true;
    526  ON_wString m_text;
    527  bool m_bold = false;
    528  bool m_italic = false;
    529  bool m_underlined = false;
    530  bool m_strikethrough = false;
    531  int m_font_index = -1;
    533  };
    534 
    535 private:
    536  ON_wString m_string_out;
    537  bool m_in_font_table = false;
    538  bool m_in_color_table = false;
    539 
    540  bool m_skip_color_tbl = false;
    541  bool m_skip_bold = false;
    542  bool m_skip_italic = false;
    543  bool m_skip_underline = false;
    544  bool m_skip_facename = false;
    545 
    546  bool m_make_bold = false;
    547  bool m_make_italic = false;
    548  bool m_make_underline = false;
    549  bool m_make_facename = false;
    550 
    551  ON_wString m_default_facename;
    552  ON_wString m_override_facename;
    553 
    554  bool m_have_rtf = false;
    555 
    556 public:
    557 
    560 
    561  void InitStringBuilder(const ON_DimStyle* default_style);
    562  const ON_wString OutputString();
    563  void PushRun(TextRun& run);
    564  TextRun PopRun();
    565 
    566  bool InFontTable();
    567  void SetInFontTable(bool b);
    568  bool InColorTable();
    569  void SetInColorTable(bool b);
    570 
    571  void SetSkipColorTbl(bool b);
    572  void SetSkipBold(bool b);
    573  void SetSkipItalic(bool b);
    574  void SetSkipUnderline(bool b);
    575  void SetSkipFacename(bool b);
    576 
    577  bool SkipColorTbl();
    578  bool SkipBold();
    579  bool SkipItalic();
    580  bool SkipUnderline();
    581  bool SkipFacename();
    582 
    583  void SetMakeBold(bool b);
    584  void SetMakeItalic(bool b);
    585  void SetMakeUnderline(bool b);
    586  void SetMakeFacename(bool b);
    587 
    588  bool MakeBold();
    589  bool MakeItalic();
    590  bool MakeUnderline();
    591  bool MakeFacename();
    592 
    593  bool SkippingFacename();
    594  bool SettingFacename();
    595 
    596  void SetDefaultFacename(const wchar_t* facename);
    597  void SetOverrideFacename(const wchar_t* facename);
    598 
    599  // virtuals
    600 
    601  void GroupBegin() override;
    602  void GroupEnd() override;
    603 
    604  void BeginHeader() override;
    605  void BeginFontTable() override;
    606  void DefaultFont(const wchar_t* value) override;
    607  void FontTag(const wchar_t* value) override;
    608  void FontSize(const wchar_t* value) override;
    609 
    610  void Newline() override;
    611  void Paragraph() override;
    612  void ParagraphDefaults() override;
    613  void Section() override;
    614  void Tab() override;
    615 
    616  void Bold(const wchar_t* value) override;
    617  void Italic(const wchar_t* value) override;
    618  void UnderlineOn() override;
    619  void UnderlineOff() override;
    620  void Strikethrough(const wchar_t* value) override;
    621 
    622  void Superscript() override;
    623  void Subscript() override;
    624  void NoSuperSub() override;
    625 
    626  void BeginColorTable() override;
    627  void ColorRed(const wchar_t* value) override;
    628  void ColorGreen(const wchar_t* value) override;
    629  void ColorBlue(const wchar_t* value) override;
    630  void ColorForeground(const wchar_t* value) override;
    631  void ColorBackground(const wchar_t* value) override;
    632 
    633  void TextField(const wchar_t* name) override;
    634 
    635  bool AppendCodePoint(ON__UINT32 codept) override;
    636 
    637  void UniEmbeddedDest(const wchar_t* value) override;
    638  void UniDecimal(const wchar_t* value) override;
    639  void UniDest(const wchar_t* value) override;
    640 
    641 private:
    642  ON_RtfStringBuilder operator=(const ON_RtfStringBuilder& src);
    643 };
    644 
    645 #ifdef RTFFIRSTCHAR
    646 
    648 {
    649 public:
    651  const ON_DimStyle* dimstyle,
    652  double height,
    653  ON_Color color);
    654 
    655  virtual ~ON_RtfFirstChar();
    656 
    657  class TextRun
    658  {
    659  public:
    660  TextRun() {}
    661 
    663  {
    664  return m_run_type;
    665  }
    667  {
    668  m_run_type = type;
    669  }
    670  void InitRun()
    671  {
    672  m_run_type = ON_TextRun::RunType::kNone;
    673  m_font_index = -1;
    674  m_text.Empty();
    675  m_bold = false;
    676  m_italic = false;
    677  m_underlined = false;
    678  m_strikethrough = false;
    679  }
    680  int FontIndex()
    681  {
    682  return m_font_index;
    683  }
    684  void SetFontIndex(int index)
    685  {
    686  if (index >= -1)
    687  m_font_index = index;
    688  }
    689 
    690  bool IsBold() const
    691  {
    692  return m_bold;
    693  }
    694  bool IsItalic() const
    695  {
    696  return m_italic;
    697  }
    698  bool IsUnderlined() const
    699  {
    700  return m_underlined;
    701  }
    702  bool IsStrikeThrough() const
    703  {
    704  return m_strikethrough;
    705  }
    706  void SetBold(bool b)
    707  {
    708  m_bold = b;
    709  }
    710  void SetItalic(bool b)
    711  {
    712  m_italic = b;
    713  }
    714  void SetUnderlined(bool b)
    715  {
    716  m_underlined = b;
    717  }
    718  void SetStrikeThrough(bool b)
    719  {
    720  m_strikethrough = b;
    721  }
    722 
    723  void AddText(const wchar_t* str)
    724  {
    725  if (!m_terminated)
    726  m_text += L' ';
    727  m_terminated = true;
    728  m_text += str;
    729  m_has_content = true;
    730  }
    731 
    732  const ON_wString& Text()
    733  {
    734  return m_text;
    735  }
    736 
    737  private:
    738  bool m_has_content = false;
    739  bool m_terminated = true;
    740  ON_wString m_text;
    741  bool m_bold = false;
    742  bool m_italic = false;
    743  bool m_underlined = false;
    744  bool m_strikethrough = false;
    745  int m_font_index = -1;
    747  };
    748 
    749 private:
    750  bool m_in_font_table = false;
    751  bool m_in_color_table = false;
    752 
    753  bool m_have_rtf = false;
    754 
    755 public:
    756 
    759 
    760  void InitStringBuilder(const ON_DimStyle* default_style);
    761  const ON_wString OutputString();
    762  void PushRun(TextRun& run);
    763  TextRun PopRun();
    764 
    765  bool InFontTable();
    766  void SetInFontTable(bool b);
    767  bool InColorTable();
    768  void SetInColorTable(bool b);
    769 
    770  // virtuals
    771 
    772  void GroupBegin() override;
    773  void GroupEnd() override;
    774 
    775  void BeginHeader() override;
    776  void BeginFontTable() override;
    777  void BeginColorTable() override;
    778  void TextField(const wchar_t* name) override;
    779  bool AppendCodePoint(ON__UINT32 codept) override;
    780 
    781  void FontTag(const wchar_t* value) override;
    782 
    783  void Bold(const wchar_t* value) override;
    784  void Italic(const wchar_t* value) override;
    785  void UnderlineOn() override;
    786  void UnderlineOff() override;
    787  void Strikethrough(const wchar_t* value) override;
    788 
    789 private:
    790  ON_RtfFirstChar operator=(const ON_RtfFirstChar& src);
    791 };
    792 
    793 #endif
    794 
    796 {
    797 public:
    799  bool Parse();
    800 
    801 private:
    802  ON__UINT32 Internal_ParseMBCSString(
    803  const ON__UINT32 windows_code_page
    804  );
    805 
    806  ON_TextIterator& m_ti;
    807 
    808  ON_TextBuilder& m_builder;
    809  int m_p_level;
    810  bool m_in_real_rtf;
    811 
    812  bool FlushCurText(ON_SimpleArray< ON__UINT32 >& cp_array);
    813  bool ReadTag(bool optional);
    814  bool ProcessTag(const wchar_t* name, const wchar_t* value, bool optional);
    815 
    816  ON_RtfParser operator=(const ON_RtfParser& src);
    817 };
    818 
    819 class ON_CLASS RtfComposer
    820 {
    821 public:
    822  class RunInfo
    823  {
    824  public:
    826  ON_TextRun* m_text_run = nullptr;
    828  bool m_bold = false;
    829  bool m_italic = false;
    830  bool m_underline = false;
    831  bool m_strikeout = false;
    832  ON_wString m_facename = L"Arial";
    833  int m_facename_key = -1;
    834  };
    835 
    836 
    837  static bool ComposeA(
    838  const ON_TextContent* text,
    839  const ON_DimStyle* dimstyle,
    840  ON_wString& rtf);
    841 
    842  static bool Compose(
    843  const ON_TextContent* text,
    844  const ON_DimStyle* dimstyle,
    845  ON_wString& rtf);
    846 
    847  static void ComposeRunA(
    848  const ON_TextRun* run,
    849  const ON_DimStyle* dimstyle,
    850  ON_SimpleArray< wchar_t[34] >& fonttable,
    851  bool multiline,
    852  int& changecount,
    853  int& changefont,
    854  bool& bold,
    855  bool& italic,
    856  bool& underlined,
    857  RunInfo& runinfo);
    858 
    859  static void ComposeRun(
    860  const ON_TextRun* run,
    861  const ON_DimStyle* dimstyle,
    862  ON_SimpleArray< wchar_t[34] >& fonttable,
    863  bool multiline,
    864  int& changecount,
    865  int& changefont,
    866  int& changecolor,
    867  bool& bold,
    868  bool& italic,
    869  bool& underlined,
    870  bool& strikeout,
    871  ON_wString& strings_out);
    872 
    873  static bool RecomposeRTF();
    874  static void SetRecomposeRTF(bool b);
    875 
    876 private:
    877  static bool m_bComposeRTF;
    878 
    879  RtfComposer();
    880  static unsigned int GetFacenameKey(const wchar_t* facename, ON_SimpleArray< wchar_t[34] >& fonttable);
    881  static unsigned int GetColorKey(ON_Color color, ON_SimpleArray< unsigned int >& colortable);
    882  static bool FormatTextHeight(double height, ON_wString& str);
    883 };
    884 
    885 
    886 #endif
    887 
    TextProps()
    Definition: opennurbs_textiterator.h:109
    ON_SimpleArray< const ON_Font *> m_font_stack
    Definition: opennurbs_textiterator.h:341
    TextRun()
    Definition: opennurbs_textiterator.h:660
    -
    void SetOverrideFacename(const wchar_t *facename)
    -
    unsigned int CharSetFromMap(int nval)
    void EmptyText()
    Definition: opennurbs_textiterator.h:513
    Definition: opennurbs_textiterator.h:819
    -
    virtual void UnderlineOn()
    Definition: opennurbs_unicode.h:345
    Definition: opennurbs_textiterator.h:22
    -
    ON_TextRunBuilder(ON_TextContent &text, ON_TextRunArray &runs, const ON_DimStyle *dimstyle, double height, ON_Color color)
    -
    void TextField(const wchar_t *name) override
    double StackScale() const
    Definition: opennurbs_textiterator.h:140
    ON_TextRun::RunType Type() const
    Definition: opennurbs_textiterator.h:413
    void SetType(ON_TextRun::RunType type)
    Definition: opennurbs_textiterator.h:417
    ON_TextRun m_current_run
    Definition: opennurbs_textiterator.h:344
    -
    bool ReadCharValue(unsigned char &c)
    -
    void ColorBlue(const wchar_t *value) override
    -
    void ColorRed(const wchar_t *value) override
    bool IsUnderlined() const
    Definition: opennurbs_textiterator.h:449
    -
    ~ON_TextIterator()=default
    -
    void Strikethrough(const wchar_t *value) override
    -
    ON__INT32 m_current_UTF16_buffer_count
    Definition: opennurbs_textiterator.h:246
    - -
    void Bold(const wchar_t *value) override
    -
    int m_rtf_font_index
    Definition: opennurbs_textiterator.h:31
    ON_DimStyle::stack_format StackFormat() const
    Definition: opennurbs_textiterator.h:157
    -
    virtual void Strikethrough(const wchar_t *value)
    void SetHeight(double h)
    Definition: opennurbs_textiterator.h:135
    ON__INT32 m_in_run
    Definition: opennurbs_textiterator.h:250
    void SetCodePage(unsigned int codepage)
    Definition: opennurbs_textiterator.h:201
    -
    void BeginFontTable() override
    void SetUnderlined(bool b)
    Definition: opennurbs_textiterator.h:465
    -
    void SetMakeUnderline(bool b)
    -
    void UniDest(const wchar_t *value) override
    -
    void SetMakeFacename(bool b)
    -
    void BeginHeader() override
    A range of text with all the same attributes.
    Definition: opennurbs_textrun.h:66
    - -
    virtual void LQuote()
    -
    ON__UINT32 * RunCodePoints(const ON_TextRun &run)
    -
    virtual void BeginFontTable()
    Definition: opennurbs_textiterator.h:657
    Converts wchar_t characters to Unicode codepoints.
    Definition: opennurbs_textiterator.h:38
    -
    virtual ~ON_RtfStringBuilder()
    -
    void Bold(const wchar_t *value) override
    -
    virtual void ColorForeground(const wchar_t *value)
    bool IsUnderlined() const
    Definition: opennurbs_textiterator.h:698
    -
    virtual void FontSize(const wchar_t *value)
    -
    void BeginColorTable() override
    -
    void TextField(const wchar_t *name) override
    ON_wString m_facename
    Definition: opennurbs_textiterator.h:32
    -
    void SetSkipColorTbl(bool b)
    -
    const ON_wString FaceNameFromMap(int nval)
    -
    ON__INT32 m_level
    Definition: opennurbs_textiterator.h:251
    bool IsItalic() const
    Definition: opennurbs_textiterator.h:694
    -
    ON__INT32 m_font_table_level
    Definition: opennurbs_textiterator.h:252
    -
    void SetSkipUnderline(bool b)
    -
    virtual void BeginHeader()
    void AddControl(const wchar_t *str)
    Definition: opennurbs_textiterator.h:474
    - -
    void InitStringBuilder(const ON_DimStyle *default_style)
    -
    void FontSize(const wchar_t *value) override
    -
    void UnderlineOff() override
    -
    virtual void UniDest(const wchar_t *value)
    stack_format
    Format of stacked fractions
    Definition: opennurbs_dimensionstyle.h:1000
    -
    void PushRun(TextRun &run)
    -
    virtual void Italic(const wchar_t *value)
    Definition: opennurbs_textiterator.h:647
    -
    void BeginHeader() override
    -
    void FontSize(const wchar_t *value) override
    -
    void Newline() override
    void SetStackScale(double s)
    Definition: opennurbs_textiterator.h:144
    Definition: opennurbs_textrun.h:366
    TextProps(double height, double stackscale, ON_Color color, ON_DimStyle::stack_format stackformat, bool bold, bool italic, bool underlined, bool strikethrough, unsigned int charset)
    Definition: opennurbs_textiterator.h:111
    Definition: opennurbs_textiterator.h:28
    - -
    void Section() override
    Definition: opennurbs_textiterator.h:822
    -
    virtual void UniEmbeddedDest(const wchar_t *value)
    -
    TextRun PopRun()
    -
    void UniDest(const wchar_t *value) override
    bool IsUnderlined()
    Definition: opennurbs_textiterator.h:181
    -
    void SetMakeItalic(bool b)
    -
    virtual void Bullet()
    -
    void UnderlineOn() override
    bool IsBold() const
    Definition: opennurbs_textiterator.h:690
    Definition: opennurbs_textiterator.h:795
    -
    void Newline() override
    void SetStackFormat(ON_DimStyle::stack_format s)
    Definition: opennurbs_textiterator.h:161
    Definition: opennurbs_string.h:2089
    bool IsStrikethrough()
    Definition: opennurbs_textiterator.h:189
    bool IsStrikeThrough() const
    Definition: opennurbs_textiterator.h:702
    Definition: opennurbs_dimensionstyle.h:224
    -
    virtual void ParagraphDefaults()
    -
    void ColorGreen(const wchar_t *value) override
    -
    virtual void CharSet(const wchar_t *value)
    -
    bool ReadCodePoint(ON__UINT32 &unicode_code_point)
    -
    unsigned int m_codepage
    Definition: opennurbs_textiterator.h:33
    ON_ClassArray< ON_FaceNameKey > m_facename_map
    Definition: opennurbs_textiterator.h:257
    void SetItalic(bool b)
    Definition: opennurbs_textiterator.h:710
    -
    void SetSkipBold(bool b)
    void SetTerminated(bool terminated)
    Definition: opennurbs_textiterator.h:503
    - -
    virtual void ColorBackground(const wchar_t *value)
    -
    void SetSkipItalic(bool b)
    void SetType(ON_TextRun::RunType type)
    Definition: opennurbs_textiterator.h:666
    ON_ClassArray< TextProps > m_prop_stack
    Definition: opennurbs_textiterator.h:232
    -
    void ParagraphDefaults() override
    -
    void ParagraphDefaults() override
    -
    void InitBuilder(const ON_Font *default_font) override
    -
    virtual void UniCpCount(const wchar_t *value)
    const ON_wString & TextString()
    Definition: opennurbs_textiterator.h:518
    -
    void Strikethrough(const wchar_t *value) override
    -
    virtual void StackFraction(const wchar_t *value)
    -
    unsigned int CodePageFromMap(int nval)
    -
    void ColorBlue(const wchar_t *value) override
    void SetStrikeThrough(bool b)
    Definition: opennurbs_textiterator.h:469
    -
    virtual void StackEnd()
    -
    void PushRun(TextRun &run)
    Definition: opennurbs_color.h:24
    -
    value must be > 0xE000 and uncommon unicode code point
    Definition: opennurbs_textiterator.h:243
    TextRun m_current_run
    Definition: opennurbs_textiterator.h:757
    -
    void BeginColorTable() override
    -
    void DefaultFont(const wchar_t *value) override
    void SetStrikethrough(bool strikethrough)
    Definition: opennurbs_textiterator.h:193
    -
    bool PeekCodePoint(ON__UINT32 &unicode_code_point) const
    -
    void ColorGreen(const wchar_t *value) override
    Definition: opennurbs_text.h:28
    -
    void FlushText(size_t count, ON__UINT32 *cp_array) override
    -
    virtual void Bold(const wchar_t *value)
    - -
    virtual void ColorGreen(const wchar_t *value)
    -
    void SetStackScale(const wchar_t *value) override
    -
    void GroupBegin() override
    virtuals
    -
    ON_RtfParser(ON_TextIterator &iter, ON_TextBuilder &builder)
    -
    void BeginColorTable() override
    -
    void SetMakeBold(bool b)
    -
    void ColorBackground(const wchar_t *value) override
    ON_Color Color() const
    Definition: opennurbs_textiterator.h:149
    ON_TextRun::RunType Type() const
    Definition: opennurbs_textiterator.h:662
    -
    void FontTag(const wchar_t *value) override
    -
    virtual ~ON_TextBuilder()
    - -
    ON_TextIterator & operator=(const ON_TextIterator &)=default
    -
    void GroupBegin() override
    virtuals
    -
    void FontTag(const wchar_t *value) override
    -
    void UniEmbeddedDest(const wchar_t *value) override
    bool IsTerminated()
    Definition: opennurbs_textiterator.h:508
    bool IsBold() const
    Definition: opennurbs_textiterator.h:441
    bool IsItalic()
    Definition: opennurbs_textiterator.h:173
    -
    void InitStringBuilder(const ON_DimStyle *default_style)
    int FontIndex()
    Definition: opennurbs_textiterator.h:680
    void SetBold(bool b)
    Definition: opennurbs_textiterator.h:706
    -
    virtual void Tab()
    void SetBold(bool b)
    Definition: opennurbs_textiterator.h:457
    -
    ON_SimpleArray< int > m_ansi_equiv_chars
    Definition: opennurbs_textiterator.h:255
    -
    bool Back()
    move position back and return current codepoint after moving back
    void SetCharSet(unsigned int charset, bool setcodepage)
    Definition: opennurbs_textiterator.h:210
    -
    void UnderlineOn() override
    -
    void UniDecimal(const wchar_t *value) override
    -
    void BeginFontTable() override
    -
    virtual void BeginColorTable()
    - -
    unsigned int m_charset
    Definition: opennurbs_textiterator.h:34
    void SetColor(ON_Color c)
    Definition: opennurbs_textiterator.h:153
    Definition: opennurbs_textiterator.h:106
    -
    virtual void InitBuilder(const ON_Font *default_font)
    -
    An ON_Font is a face in a font family. It corresponds to a Windows LOGFONT, a .NET System...
    Definition: opennurbs_font.h:225
    -
    virtual void Section()
    -
    void SetSkipFacename(bool b)
    -
    virtual void Paragraph()
    -
    virtual void FlushText(size_t count, ON__UINT32 *cp_array)
    -
    const ON_wString OutputString()
    - -
    virtual void FontTag(const wchar_t *value)
    RunType
    Definition: opennurbs_textrun.h:125
    void SetItalic(bool italic)
    Definition: opennurbs_textiterator.h:177
    bool IsBold()
    Definition: opennurbs_textiterator.h:165
    -
    void FontTag(const wchar_t *value) override
    -
    virtual bool AppendCodePoint(ON__UINT32 codept)
    void SetFontIndex(int index)
    Definition: opennurbs_textiterator.h:435
    void SetBold(bool bold)
    Definition: opennurbs_textiterator.h:169
    Definition: opennurbs_textiterator.h:99
    void InitRun()
    Definition: opennurbs_textiterator.h:421
    -
    virtual void TextField(const wchar_t *name)
    -
    const ON_wString OutputString()
    -
    const ON_Font * m_current_font
    Definition: opennurbs_textiterator.h:342
    ON_TextRunArray & m_runs
    Definition: opennurbs_textiterator.h:345
    -
    virtual void RQuote()
    - -
    void NoSuperSub() override
    ON_wString m_run_text
    Definition: opennurbs_textiterator.h:827
    -
    void Paragraph() override
    -
    void DefaultFont(const wchar_t *value) override
    Definition: opennurbs_textiterator.h:408
    -
    void BeginFontTable() override
    -
    virtual void SetStackScale(const wchar_t *value)
    -
    void StackEnd() override
    -
    void UnderlineOn() override
    -
    virtual void CodePage(const wchar_t *value)
    - -
    ON_RtfFirstChar(const ON_DimStyle *dimstyle, double height, ON_Color color)
    -
    virtual void GroupBegin()
    -
    bool AtBackslashTic() const
    -
    ON_RtfStringBuilder(const ON_DimStyle *dimstyle, double height, ON_Color color)
    -
    void GroupEnd() override
    - -
    void ColorForeground(const wchar_t *value) override
    void AddChar(const wchar_t ch)
    Definition: opennurbs_textiterator.h:494
    - -
    void Italic(const wchar_t *value) override
    int FontIndex()
    Definition: opennurbs_textiterator.h:431
    -
    void TextField(const wchar_t *name) override
    -
    void SetUnderlined(bool b)
    Definition: opennurbs_textiterator.h:714
    -
    ON__INT32 m_default_font_index
    Definition: opennurbs_textiterator.h:254
    -
    void UnderlineOff() override
    -
    void Italic(const wchar_t *value) override
    -
    void ColorForeground(const wchar_t *value) override
    const ON_Font * managed_font
    Definition: opennurbs_textiterator.h:25
    void SetItalic(bool b)
    Definition: opennurbs_textiterator.h:461
    -
    void GroupEnd() override
    int rtf_font_index
    Definition: opennurbs_textiterator.h:24
    - -
    void Superscript() override
    -
    virtual void Superscript()
    -
    void StackFraction(const wchar_t *value) override
    -
    virtual void Subscript()
    void SetUnderlined(bool underlined)
    Definition: opennurbs_textiterator.h:185
    - -
    void SetInColorTable(bool b)
    -
    bool AppendCodePoint(ON__UINT32 codept) override
    - -
    void SetInColorTable(bool b)
    -
    void SetInFontTable(bool b)
    Definition: opennurbs_array.h:412
    bool IsItalic() const
    Definition: opennurbs_textiterator.h:445
    -
    virtual void LDblQuote()
    ON_ClassArray< TextRun > m_run_stack
    Definition: opennurbs_textiterator.h:559
    TextProps m_current_props
    Definition: opennurbs_textiterator.h:233
    - -
    void Superscript() override
    TextRun m_current_run
    Definition: opennurbs_textiterator.h:558
    void AddText(const wchar_t *str)
    Definition: opennurbs_textiterator.h:723
    -
    void NoSuperSub() override
    void AddText(const wchar_t *str)
    Definition: opennurbs_textiterator.h:485
    static const ON_wString EmptyString
    Definition: opennurbs_string.h:2095
    -
    virtual void GroupEnd()
    -
    void Empty()
    sets length to zero - if possible, memory is retained
    -
    void ColorBackground(const wchar_t *value) override
    ON_TextContent & m_text
    Definition: opennurbs_textiterator.h:346
    void SetFontIndex(int index)
    Definition: opennurbs_textiterator.h:684
    -
    void ColorRed(const wchar_t *value) override
    void InitRun()
    Definition: opennurbs_textiterator.h:670
    static const ON_Font Default
    Definition: opennurbs_font.h:512
    -
    void BeginHeader() override
    -
    virtual void EnDash()
    Definition: opennurbs_textiterator.h:398
    unsigned int CodePage()
    Definition: opennurbs_textiterator.h:197
    -
    virtual void UniDecimal(const wchar_t *value)
    -
    ON__UINT16 m_current_UTF16_buffer[2]
    Definition: opennurbs_textiterator.h:247
    -
    virtual void DefaultFont(const wchar_t *value)
    -
    void Subscript() override
    -
    void Tab() override
    double Height() const
    Definition: opennurbs_textiterator.h:131
    -
    void GroupBegin() override
    -
    virtual void ColorBlue(const wchar_t *value)
    -
    void UniEmbeddedDest(const wchar_t *value) override
    -
    virtual void Newline()
    -
    void Subscript() override
    -
    void Tab() override
    Definition: opennurbs_textiterator.h:329
    -
    void Italic(const wchar_t *value) override
    -
    void Strikethrough(const wchar_t *value) override
    -
    virtual ~ON_RtfFirstChar()
    -
    void SetDefaultFacename(const wchar_t *facename)
    ON_SimpleArray< ON__UINT32 > m_current_codepoints
    Definition: opennurbs_textiterator.h:249
    -
    value must be > m_UFT16_waiting, <= 0xFFFF, and uncommon unicode code point
    Definition: opennurbs_textiterator.h:244
    const ON_wString & Text()
    Definition: opennurbs_textiterator.h:732
    -
    virtual void NoSuperSub()
    -
    virtual void UnderlineOff()
    - -
    bool AppendCodePoint(ON__UINT32 codept) override
    -
    ON__INT32 m_font_index
    Definition: opennurbs_textiterator.h:253
    TextRun()
    Definition: opennurbs_textiterator.h:411
    void SetStrikeThrough(bool b)
    Definition: opennurbs_textiterator.h:718
    -
    void UnderlineOff() override
    -
    void Section() override
    static const ON_Color Black
    0x00000000u
    Definition: opennurbs_color.h:33
    unsigned int CharSet()
    Definition: opennurbs_textiterator.h:206
    - -
    virtual void ColorRed(const wchar_t *value)
    -
    virtual ~ON_TextRunBuilder()
    -
    virtual void EmDash()
    -
    void GroupEnd() override
    ON_ClassArray< TextRun > m_run_stack
    Definition: opennurbs_textiterator.h:758
    -
    void Paragraph() override
    -
    void Bold(const wchar_t *value) override
    bool IsStrikeThrough() const
    Definition: opennurbs_textiterator.h:453
    -
    virtual void RDblQuote()
    diff --git a/6/de/d5b/class_o_n__2f_point.html b/6/de/d5b/class_o_n__2f_point.html index 093820af..d9adf59c 100644 --- a/6/de/d5b/class_o_n__2f_point.html +++ b/6/de/d5b/class_o_n__2f_point.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2fPoint Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    -

    ◆ operator<()

    +

    ◆ operator<()

    @@ -1469,7 +1467,7 @@ Static Public Attributes
    -

    ◆ operator<=()

    +

    ◆ operator<=()

    @@ -1737,7 +1735,7 @@ Static Public Attributes
    -

    ◆ operator>()

    +

    ◆ operator>()

    @@ -1755,7 +1753,7 @@ Static Public Attributes
    -

    ◆ operator>=()

    +

    ◆ operator>=()

    @@ -2056,9 +2054,9 @@ Static Public Attributes
    diff --git a/6/de/d5d/class_o_n___obj_ref___i_ref_i_d.html b/6/de/d5d/class_o_n___obj_ref___i_ref_i_d.html index fb1da6f8..147b132e 100644 --- a/6/de/d5d/class_o_n___obj_ref___i_ref_i_d.html +++ b/6/de/d5d/class_o_n___obj_ref___i_ref_i_d.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ObjRef_IRefID Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    -

    If this ON_ObjRef_IRefID is the first entry in the ON_ObjRef.m__iref[] array, then it references a "real" piece of geometry (not a nested instance reference).
    -If the reference is to a subobject of the real piece of geometry, then m_component_index records the subobject index. In all other cases, m_component_index is not set.

    +

    If this ON_ObjRef_IRefID is the first entry in the ON_ObjRef.m__iref[] array, then it references a "real" piece of geometry (not a nested instance reference). If the reference is to a subobject of the real piece of geometry, then m_component_index records the subobject index. In all other cases, m_component_index is not set.

    @@ -292,8 +289,7 @@ If the reference is to a subobject of the real piece of geometry, then m_compone
    -

    If this ON_ObjRef_IRefID is the first entry in the ON_ObjRef.m__iref[] array, then it references a "real" piece of geometry (not a nested instance reference).
    -If there is an evaluation parameter for the geometry, it is saved in m_evp. In all other cases, m_evp is not set.

    +

    If this ON_ObjRef_IRefID is the first entry in the ON_ObjRef.m__iref[] array, then it references a "real" piece of geometry (not a nested instance reference). If there is an evaluation parameter for the geometry, it is saved in m_evp. In all other cases, m_evp is not set.

    @@ -376,9 +372,9 @@ If there is an evaluation parameter for the geometry, it is saved in m_evp. In a diff --git a/6/de/d63/class_o_n___obj_ref_evaluation_parameter.html b/6/de/d63/class_o_n___obj_ref_evaluation_parameter.html index 0e5c32cc..784328cb 100644 --- a/6/de/d63/class_o_n___obj_ref_evaluation_parameter.html +++ b/6/de/d63/class_o_n___obj_ref_evaluation_parameter.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ObjRefEvaluationParameter Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Constructor & Destructor Documentation

    ◆ ON_ObjRefEvaluationParameter()

    @@ -265,9 +261,9 @@ Public Attributes
    diff --git a/6/de/d65/struct_o_n___mesh_topology_vertex.html b/6/de/d65/struct_o_n___mesh_topology_vertex.html index 2cfb7d9a..aec5060d 100644 --- a/6/de/d65/struct_o_n___mesh_topology_vertex.html +++ b/6/de/d65/struct_o_n___mesh_topology_vertex.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshTopologyVertex Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d67/opennurbs__matrix_8h_source.html b/6/de/d67/opennurbs__matrix_8h_source.html index a5bf2977..8f36571f 100644 --- a/6/de/d67/opennurbs__matrix_8h_source.html +++ b/6/de/d67/opennurbs__matrix_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_matrix.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_matrix.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d76/opennurbs__object__history_8h_source.html b/6/de/d76/opennurbs__object__history_8h_source.html index 90bf1f49..cd43ae52 100644 --- a/6/de/d76/opennurbs__object__history_8h_source.html +++ b/6/de/d76/opennurbs__object__history_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_object_history.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_object_history.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d84/openurbs__public_8h_source.html b/6/de/d84/openurbs__public_8h_source.html index 6a28cd74..0128d661 100644 --- a/6/de/d84/openurbs__public_8h_source.html +++ b/6/de/d84/openurbs__public_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/openurbs_public.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/openurbs_public.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 ////////////////////////////////////////////////////////////////
    18 //
    19 // Includes all openNURBS toolkit headers required to use the
    20 // openNURBS toolkit library. See readme.txt for details.
    21 //
    22 ////////////////////////////////////////////////////////////////
    23 
    24 #if !defined(OPENNURBS_PUBLIC_INC_)
    25 #define OPENNURBS_PUBLIC_INC_
    26 
    27 #if defined(ON_COMPILING_OPENNURBS)
    28 #error Never include opennurbs_public.h when building opennurbs libraries.
    29 #endif
    30 
    31 #if defined(OPENNURBS_INC_)
    32 
    33 // If you are building a Rhino plug-in or using opennurbs as
    34 // part of the Rhino SDK, then include opennurbs.h.
    35 //
    36 // If you are building your own application and linking with one of the
    37 // opennurbs_public libraries for .3dm file IO, then include opennurbs_public.h.
    38 //
    39 #error Your project should include exactly one of opennurbs_public.h or opennurbs.h. See comment above.
    40 #endif
    41 
    42 #if !defined(OPENNURBS_PUBLIC)
    43 #define OPENNURBS_PUBLIC
    44 #endif
    45 
    46 #include "opennurbs.h"
    47 
    48 #endif
    diff --git a/6/de/d85/opennurbs__photogrammetry_8h_source.html b/6/de/d85/opennurbs__photogrammetry_8h_source.html index f9816153..2e6f7ee1 100644 --- a/6/de/d85/opennurbs__photogrammetry_8h_source.html +++ b/6/de/d85/opennurbs__photogrammetry_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_photogrammetry.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_photogrammetry.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d86/class_o_n___windows_bitmap_ex-members.html b/6/de/d86/class_o_n___windows_bitmap_ex-members.html index 1a1cfc5f..8b8be0ad 100644 --- a/6/de/d86/class_o_n___windows_bitmap_ex-members.html +++ b/6/de/d86/class_o_n___windows_bitmap_ex-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d88/class_o_n___class_id-members.html b/6/de/d88/class_o_n___class_id-members.html index bc46c6f3..b6fc0173 100644 --- a/6/de/d88/class_o_n___class_id-members.html +++ b/6/de/d88/class_o_n___class_id-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d8b/class_o_n__2i_bounding_box-members.html b/6/de/d8b/class_o_n__2i_bounding_box-members.html index 9f1cf33e..bf33270d 100644 --- a/6/de/d8b/class_o_n__2i_bounding_box-members.html +++ b/6/de/d8b/class_o_n__2i_bounding_box-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d91/class_o_n___mesh_face.html b/6/de/d91/class_o_n___mesh_face.html index 65da4f2e..18ca50ea 100644 --- a/6/de/d91/class_o_n___mesh_face.html +++ b/6/de/d91/class_o_n___mesh_face.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshFace Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d92/opennurbs__base32_8h_source.html b/6/de/d92/opennurbs__base32_8h_source.html index 2fd0c77c..43370958 100644 --- a/6/de/d92/opennurbs__base32_8h_source.html +++ b/6/de/d92/opennurbs__base32_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_base32.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_base32.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d9b/class_o_n___bezier_cage_morph.html b/6/de/d9b/class_o_n___bezier_cage_morph.html index 73b150fa..3ea87c30 100644 --- a/6/de/d9b/class_o_n___bezier_cage_morph.html +++ b/6/de/d9b/class_o_n___bezier_cage_morph.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BezierCageMorph Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/d9f/class_o_n___bitmap.html b/6/de/d9f/class_o_n___bitmap.html index 7300cfc0..5c67d619 100644 --- a/6/de/d9f/class_o_n___bitmap.html +++ b/6/de/d9f/class_o_n___bitmap.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Bitmap Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    Type::HistoryRecord = 13, Type::Mixed = 0xFE
    - } - The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    + } The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -553,11 +551,7 @@ Additional Inherited Members

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Defines ON_WindowsBITMAPINFO class that is used to provide OS independent serialization of Windows device independent bitmaps (BITMAPINFO) used to store preview images.

    Constructor & Destructor Documentation

    @@ -1060,8 +1054,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -1095,9 +1089,9 @@ Additional Inherited Members
    diff --git a/6/de/da1/class_o_n___fixed_size_pool_iterator.html b/6/de/da1/class_o_n___fixed_size_pool_iterator.html index 2113e4f2..c0737189 100644 --- a/6/de/da1/class_o_n___fixed_size_pool_iterator.html +++ b/6/de/da1/class_o_n___fixed_size_pool_iterator.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_FixedSizePoolIterator Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/da2/class_o_n___hash32_table_item.html b/6/de/da2/class_o_n___hash32_table_item.html index 8071b398..fcefd482 100644 --- a/6/de/da2/class_o_n___hash32_table_item.html +++ b/6/de/da2/class_o_n___hash32_table_item.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Hash32TableItem Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
     

    Detailed Description

    -

    / / Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2016 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    defines ON_Hash32Table

    Constructor & Destructor Documentation

    @@ -302,9 +298,9 @@ Friends
    diff --git a/6/de/da2/opennurbs__ipoint_8h_source.html b/6/de/da2/opennurbs__ipoint_8h_source.html index 62700a27..8114d8dd 100644 --- a/6/de/da2/opennurbs__ipoint_8h_source.html +++ b/6/de/da2/opennurbs__ipoint_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_ipoint.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_ipoint.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +
    diff --git a/6/de/da8/struct_o_n___mesh_topology_edge-members.html b/6/de/da8/struct_o_n___mesh_topology_edge-members.html index cd363c19..af2609c6 100644 --- a/6/de/da8/struct_o_n___mesh_topology_edge-members.html +++ b/6/de/da8/struct_o_n___mesh_topology_edge-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/daf/class_o_n_x___model___user_data-members.html b/6/de/daf/class_o_n_x___model___user_data-members.html index 81f8ebe6..66a51d12 100644 --- a/6/de/daf/class_o_n_x___model___user_data-members.html +++ b/6/de/daf/class_o_n_x___model___user_data-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/db8/class_o_n___group-members.html b/6/de/db8/class_o_n___group-members.html index 1c96fb95..982c5b0f 100644 --- a/6/de/db8/class_o_n___group-members.html +++ b/6/de/db8/class_o_n___group-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/db9/class_o_n___evaluator-members.html b/6/de/db9/class_o_n___evaluator-members.html index 942bef33..8336cde2 100644 --- a/6/de/db9/class_o_n___evaluator-members.html +++ b/6/de/db9/class_o_n___evaluator-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/dc7/class_o_n___brep-members.html b/6/de/dc7/class_o_n___brep-members.html index a57e0b16..b1608472 100644 --- a/6/de/dc7/class_o_n___brep-members.html +++ b/6/de/dc7/class_o_n___brep-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/dcf/class_o_n___extrusion.html b/6/de/dcf/class_o_n___extrusion.html index d6b820c5..76bd8c07 100644 --- a/6/de/dcf/class_o_n___extrusion.html +++ b/6/de/dcf/class_o_n___extrusion.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Extrusion Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    N_iso = 6, iso_count = 7
    - } - pure virtual class for surface objects More...
    + } pure virtual class for surface objects More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -1120,8 +1118,7 @@ Additional Inherited Members
    -

    Description: Pure virtual function. Default returns false. Where possible, analytically extends surface to include domain. Parameters: dir - [in] 0 new Domain(0) will include domain. (the first surface parameter). 1 new Domain(1) will include domain. (the second surface parameter). domain - [in] if domain is not included in surface domain, surface will be extended so that its domain includes domain.
    - Will not work if surface is closed in direction dir. Original surface is identical to the restriction of the resulting surface to the original surface domain, Returns: true if successful.

    +

    Description: Pure virtual function. Default returns false. Where possible, analytically extends surface to include domain. Parameters: dir - [in] 0 new Domain(0) will include domain. (the first surface parameter). 1 new Domain(1) will include domain. (the second surface parameter). domain - [in] if domain is not included in surface domain, surface will be extended so that its domain includes domain. Will not work if surface is closed in direction dir. Original surface is identical to the restriction of the resulting surface to the original surface domain, Returns: true if successful.

    Reimplemented from ON_Surface.

    @@ -1385,8 +1382,7 @@ Additional Inherited Members
    -

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search.
    - dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    +

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search. dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    true if a parametric discontinuity was found strictly between t0 and t1. Note well that all curves are parametrically continuous at the ends of their domains.

    Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous):

    true if a locus discontinuity was found strictly between t0 and t1 or at t1 is the at the end of a curve. Note well that all open curves (IsClosed()=false) are locus discontinuous at the ends of their domains. All closed curves (IsClosed()=true) are at least C0_locus_continuous at the ends of their domains.

    @@ -1951,8 +1947,7 @@ Additional Inherited Members
    -

    Description: Is there a NURBS surface representation of this surface. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the surface's 2 success - NURBS point locus matches the surface's and the domain of the NURBS surface is correct.
    - However, This surface's parameterization and the NURBS surface parameterization may not match. This situation happens when getting NURBS representations of surfaces that have a transendental parameterization like spheres, cylinders, and cones. Remarks: This is a low-level virtual function. See Also: ON_Surface::GetNurbForm ON_Surface::NurbsSurface

    +

    Description: Is there a NURBS surface representation of this surface. Parameters: Returns: 0 unable to create NURBS representation with desired accuracy. 1 success - NURBS parameterization matches the surface's 2 success - NURBS point locus matches the surface's and the domain of the NURBS surface is correct. However, This surface's parameterization and the NURBS surface parameterization may not match. This situation happens when getting NURBS representations of surfaces that have a transendental parameterization like spheres, cylinders, and cones. Remarks: This is a low-level virtual function. See Also: ON_Surface::GetNurbForm ON_Surface::NurbsSurface

    Reimplemented from ON_Surface.

    @@ -2377,8 +2372,7 @@ Additional Inherited Members
    -

    Description: Get a mesh attached to the ON_Extrusion. Parameters: mt - [in] type of mesh to get. ON::render_mesh, ON::analysis_mesh and ON::preview_mesh remove the meshes of those types. If mt is ON::default_mesh or ON::any_mesh, then the first non null mesh is returned. Returns: A pointer to a mesh on the ON_Extusion object.
    - This mesh will be deleted by ~ON_Extrusion(). If a mesh of the requested type is not available, then null is returned. Remarks: DEPRECATED. Use ON_Extrusion.m_mesh_cache to managed chached meshes.

    +

    Description: Get a mesh attached to the ON_Extrusion. Parameters: mt - [in] type of mesh to get. ON::render_mesh, ON::analysis_mesh and ON::preview_mesh remove the meshes of those types. If mt is ON::default_mesh or ON::any_mesh, then the first non null mesh is returned. Returns: A pointer to a mesh on the ON_Extusion object. This mesh will be deleted by ~ON_Extrusion(). If a mesh of the requested type is not available, then null is returned. Remarks: DEPRECATED. Use ON_Extrusion.m_mesh_cache to managed chached meshes.

    @@ -2924,9 +2918,7 @@ Additional Inherited Members
    -

    ON_Extrusion mesh interface
    -Description: Attach a mesh to the ON_Extrusion. Parameters: mt - [in] type of mesh that is being attached. If mt is ON::render_mesh, ON::analysis_mesh or ON::preview_mesh, the mesh is attached as that type of mesh. If mt is ON::default_mesh or ON::any_mesh, then nothing is done and false is returned. mesh - [in] mesh to attach.
    - mesh must be on the heap because ~ON_Extrusion() will delete it. if there is already of mesh of the prescribed type, it will be deleted. if mesh is null, any existing mesh is deleted and nothing is attached. Remarks: DEPRECATED. Use ON_Extrusion.m_mesh_cache to managed chached meshes.

    +

    ON_Extrusion mesh interface Description: Attach a mesh to the ON_Extrusion. Parameters: mt - [in] type of mesh that is being attached. If mt is ON::render_mesh, ON::analysis_mesh or ON::preview_mesh, the mesh is attached as that type of mesh. If mt is ON::default_mesh or ON::any_mesh, then nothing is done and false is returned. mesh - [in] mesh to attach. mesh must be on the heap because ~ON_Extrusion() will delete it. if there is already of mesh of the prescribed type, it will be deleted. if mesh is null, any existing mesh is deleted and nothing is attached. Remarks: DEPRECATED. Use ON_Extrusion.m_mesh_cache to managed chached meshes.

    @@ -3348,8 +3340,8 @@ Description: Attach a mesh to the -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -3581,9 +3573,9 @@ Description: Attach a mesh to the diff --git a/6/de/dd1/opennurbs__linetype_8h_source.html b/6/de/dd1/opennurbs__linetype_8h_source.html index af52e842..00fa2bc1 100644 --- a/6/de/dd1/opennurbs__linetype_8h_source.html +++ b/6/de/dd1/opennurbs__linetype_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_linetype.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_linetype.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_linetype.h
    -
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_LINETYPE_INC_)
    18 #define OPENNURBS_LINETYPE_INC_
    19 
    20 
    21 // Description:
    22 // Determine if a line width is deemed to be a "hairline width" in Rhino
    23 // Any width that is >0 and < 0.001 mm is a hairline width for printing
    24 // Parameters:
    25 // width_mm: [in] the width to examine in millimeters
    26 // Returns:
    27 // true if this is a hairline width
    28 ON_DECL bool ON_IsHairlinePrintWidth( double width_mm );
    29 
    30 // Description:
    31 // Return a width in millimeters that is a valid hairline width in rhino
    32 ON_DECL double ON_HairlinePrintWidth();
    33 
    34 
    35 
    36 
    37 //////////////////////////////////////////////////////////////////////
    38 // class ON_Linetype
    39 
    40 class ON_CLASS ON_Linetype : public ON_ModelComponent
    41 {
    42  ON_OBJECT_DECLARE(ON_Linetype);
    43 
    44 public:
    45  // no attributes are set.
    46  static const ON_Linetype Unset;
    47 
    48  // index = -1, id, name and pattern are set.
    49  static const ON_Linetype Continuous;
    50 
    51  // index = -2, id, name and pattern are set.
    52  static const ON_Linetype ByLayer;
    53 
    54  // index = -3, id, name and pattern are set.
    55  static const ON_Linetype ByParent;
    56 
    57  /*
    58  Parameters:
    59  model_component_reference - [in]
    60  none_return_value - [in]
    61  value to return if ON_Linetype::Cast(model_component_ref.ModelComponent())
    62  is nullptr
    63  Returns:
    64  If ON_Linetype::Cast(model_component_ref.ModelComponent()) is not nullptr,
    65  that pointer is returned. Otherwise, none_return_value is returned.
    66  */
    67  static const ON_Linetype* FromModelComponentRef(
    68  const class ON_ModelComponentReference& model_component_reference,
    69  const ON_Linetype* none_return_value
    70  );
    71 
    72 public:
    73 
    74  ON_Linetype() ON_NOEXCEPT;
    75  ~ON_Linetype() = default;
    76  ON_Linetype(const ON_Linetype&);
    77  ON_Linetype& operator=(const ON_Linetype&) = default;
    78 
    79  /*
    80  Description:
    81  Tests that name is set and there is at least one non-zero length segment
    82  */
    83  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    84 
    85  void Dump( ON_TextLog& ) const override; // for debugging
    86 
    87  /*
    88  Description:
    89  Write to file
    90  */
    91  bool Write(
    92  ON_BinaryArchive& // serialize definition to binary archive
    93  ) const override;
    94 
    95  /*
    96  Description:
    97  Read from file
    98  */
    99  bool Read(
    100  ON_BinaryArchive& // restore definition from binary archive
    101  ) override;
    102 
    103 
    104  //////////////////////////////////////////////////////////////////////
    105  //
    106  // Interface
    107 
    108  bool PatternIsSet() const;
    109  bool ClearPattern();
    110  bool PatternIsLocked() const;
    111  void LockPattern();
    112 
    113  /*
    114  Description:
    115  Returns the total length of one repeat of the pattern
    116  */
    117  double PatternLength() const;
    118 
    119 
    120  /*
    121  Description:
    122  Returns the number of segments in the pattern
    123  */
    124  int SegmentCount() const;
    125 
    126  /*
    127  Description:
    128  Adds a segment to the pattern
    129  Returns:
    130  Index of the added segment.
    131  */
    132  int AppendSegment( const ON_LinetypeSegment& segment);
    133 
    134  /*
    135  Description:
    136  Removes a segment in the linetype.
    137  Parameters:
    138  index - [in]
    139  Zero based index of the segment to remove.
    140  Returns:
    141  True if the segment index was removed.
    142  */
    143  bool RemoveSegment( int index );
    144 
    145  /*
    146  Description:
    147  Sets the segment at index to match segment
    148  */
    149  bool SetSegment( int index, const ON_LinetypeSegment& segment);
    150 
    151  /*
    152  Description:
    153  Sets the length and type of the segment at index
    154  */
    155  bool SetSegment( int index, double length, ON_LinetypeSegment::eSegType type);
    156 
    157  /*
    158  Description:
    159  Returns a copy of the segment at index
    160  */
    161  ON_LinetypeSegment Segment( int index) const;
    162 
    163  /*
    164  Description:
    165  Expert user function to get access to the segment array
    166  for rapid calculations.
    167  */
    168  // Returns nullptr if the line pattern is locked.
    169  ON_SimpleArray<ON_LinetypeSegment>* ExpertSegments();
    170 
    171  const ON_SimpleArray<ON_LinetypeSegment>& Segments() const;
    172 
    173 private:
    174  enum : unsigned char
    175  {
    176  pattern_bit = 1
    177  };
    178  unsigned char m_is_set_bits = 0;
    179  unsigned char m_is_locked_bits = 0;
    180  unsigned short m_reserved1 = 0;
    181  unsigned int m_reserved2 = 0;
    183 };
    184 
    185 #if defined(ON_DLL_TEMPLATE)
    186 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Linetype*>;
    187 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_Linetype*>;
    188 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_Linetype>;
    189 #endif
    190 
    191 #endif
    192 
    static const ON_Linetype Continuous
    index = -1, id, name and pattern are set.
    Definition: opennurbs_linetype.h:49
    +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(OPENNURBS_LINETYPE_INC_)
    18 #define OPENNURBS_LINETYPE_INC_
    19 
    20 
    21 // Description:
    22 // Determine if a line width is deemed to be a "hairline width" in Rhino
    23 // Any width that is >0 and < 0.001 mm is a hairline width for printing
    24 // Parameters:
    25 // width_mm: [in] the width to examine in millimeters
    26 // Returns:
    27 // true if this is a hairline width
    28 ON_DECL bool ON_IsHairlinePrintWidth( double width_mm );
    29 
    30 // Description:
    31 // Return a width in millimeters that is a valid hairline width in rhino
    32 ON_DECL double ON_HairlinePrintWidth();
    33 
    34 
    35 
    36 
    37 //////////////////////////////////////////////////////////////////////
    38 // class ON_Linetype
    39 
    40 class ON_CLASS ON_Linetype : public ON_ModelComponent
    41 {
    42  ON_OBJECT_DECLARE(ON_Linetype);
    43 
    44 public:
    45  // no attributes are set.
    46  static const ON_Linetype Unset;
    47 
    48  // index = -1, id, name and pattern are set.
    49  static const ON_Linetype Continuous;
    50 
    51  // index = -2, id, name and pattern are set.
    52  static const ON_Linetype ByLayer;
    53 
    54  // index = -3, id, name and pattern are set.
    55  static const ON_Linetype ByParent;
    56 
    57  /*
    58  Parameters:
    59  model_component_reference - [in]
    60  none_return_value - [in]
    61  value to return if ON_Linetype::Cast(model_component_ref.ModelComponent())
    62  is nullptr
    63  Returns:
    64  If ON_Linetype::Cast(model_component_ref.ModelComponent()) is not nullptr,
    65  that pointer is returned. Otherwise, none_return_value is returned.
    66  */
    67  static const ON_Linetype* FromModelComponentRef(
    68  const class ON_ModelComponentReference& model_component_reference,
    69  const ON_Linetype* none_return_value
    70  );
    71 
    72 public:
    73 
    74  ON_Linetype() ON_NOEXCEPT;
    75  ~ON_Linetype() = default;
    76  ON_Linetype(const ON_Linetype&);
    77  ON_Linetype& operator=(const ON_Linetype&) = default;
    78 
    79  /*
    80  Description:
    81  Tests that name is set and there is at least one non-zero length segment
    82  */
    83  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
    84 
    85  void Dump( ON_TextLog& ) const override; // for debugging
    86 
    87  /*
    88  Description:
    89  Write to file
    90  */
    91  bool Write(
    92  ON_BinaryArchive& // serialize definition to binary archive
    93  ) const override;
    94 
    95  /*
    96  Description:
    97  Read from file
    98  */
    99  bool Read(
    100  ON_BinaryArchive& // restore definition from binary archive
    101  ) override;
    102 
    103 
    104  //////////////////////////////////////////////////////////////////////
    105  //
    106  // Interface
    107 
    108  bool PatternIsSet() const;
    109  bool ClearPattern();
    110  bool PatternIsLocked() const;
    111  void LockPattern();
    112 
    113  /*
    114  Description:
    115  Returns the total length of one repeat of the pattern
    116  */
    117  double PatternLength() const;
    118 
    119 
    120  /*
    121  Description:
    122  Returns the number of segments in the pattern
    123  */
    124  int SegmentCount() const;
    125 
    126  /*
    127  Description:
    128  Adds a segment to the pattern
    129  Returns:
    130  Index of the added segment.
    131  */
    132  int AppendSegment( const ON_LinetypeSegment& segment);
    133 
    134  /*
    135  Description:
    136  Removes a segment in the linetype.
    137  Parameters:
    138  index - [in]
    139  Zero based index of the segment to remove.
    140  Returns:
    141  True if the segment index was removed.
    142  */
    143  bool RemoveSegment( int index );
    144 
    145  /*
    146  Description:
    147  Sets the segment at index to match segment
    148  */
    149  bool SetSegment( int index, const ON_LinetypeSegment& segment);
    150 
    151  /*
    152  Description:
    153  Sets the length and type of the segment at index
    154  */
    155  bool SetSegment( int index, double length, ON_LinetypeSegment::eSegType type);
    156 
    157  /*
    158  Description:
    159  Returns a copy of the segment at index
    160  */
    161  ON_LinetypeSegment Segment( int index) const;
    162 
    163  /*
    164  Description:
    165  Expert user function to get access to the segment array
    166  for rapid calculations.
    167  */
    168  // Returns nullptr if the line pattern is locked.
    169  ON_SimpleArray<ON_LinetypeSegment>* ExpertSegments();
    170 
    171  const ON_SimpleArray<ON_LinetypeSegment>& Segments() const;
    172 
    173 private:
    174  enum : unsigned char
    175  {
    176  pattern_bit = 1
    177  };
    178  unsigned char m_is_set_bits = 0;
    179  unsigned char m_is_locked_bits = 0;
    180  unsigned short m_reserved1 = 0;
    181  unsigned int m_reserved2 = 0;
    183 };
    184 
    185 #if defined(ON_DLL_TEMPLATE)
    186 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Linetype*>;
    187 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<const ON_Linetype*>;
    188 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_Linetype>;
    189 #endif
    190 
    191 #endif
    192 
    static const ON_Linetype Continuous
    index = -1, id, name and pattern are set.
    Definition: opennurbs_linetype.h:49
    static const ON_Linetype Unset
    no attributes are set.
    Definition: opennurbs_linetype.h:46
    Definition: opennurbs_model_component.h:25
    Definition: opennurbs_array.h:36
    @@ -84,9 +82,9 @@ $(function() {
    diff --git a/6/de/dd6/class_o_n__2i_point.html b/6/de/dd6/class_o_n__2i_point.html index 6f04f190..bc1ce837 100644 --- a/6/de/dd6/class_o_n__2i_point.html +++ b/6/de/dd6/class_o_n__2i_point.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2iPoint Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@
    - + +

    Detailed Description

    Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

    THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

    -

    For complete openNURBS copyright information see http://www.opennurbs.org.
    -A 2 dimensional point with integer coordinates. Clear code will distinguish between situation where (x,y) is a location (ON_2iPoint) or a direction (ON_2iVector) and use the appropriate class.

    +

    For complete openNURBS copyright information see http://www.opennurbs.org. A 2 dimensional point with integer coordinates. Clear code will distinguish between situation where (x,y) is a location (ON_2iPoint) or a direction (ON_2iVector) and use the appropriate class.

    Constructor & Destructor Documentation

    ◆ ON_2iPoint() [1/3]

    @@ -318,8 +315,7 @@ A 2 dimensional point with integer coordinates. Clear code will distinguish betw
    -

    It is intentional that points are not added to points to encourage code that is clear about what is a location and what is diplacement.
    -For those times when a location was incorrectly represented by a vector. It is intentional that ther is not an ON_2iPoint constructor from an ON_2iVector.

    +

    It is intentional that points are not added to points to encourage code that is clear about what is a location and what is diplacement. For those times when a location was incorrectly represented by a vector. It is intentional that ther is not an ON_2iPoint constructor from an ON_2iVector.

    @@ -501,9 +497,9 @@ For those times when a location was incorrectly represented by a vector. It is i diff --git a/6/de/ddc/class_o_n___nurbs_surface.html b/6/de/ddc/class_o_n___nurbs_surface.html index 7e82c080..babe3de4 100644 --- a/6/de/ddc/class_o_n___nurbs_surface.html +++ b/6/de/ddc/class_o_n___nurbs_surface.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_NurbsSurface Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    N_iso = 6, iso_count = 7
    - } - pure virtual class for surface objects More...
    + } pure virtual class for surface objects More...
    +   - Public Types inherited from ON_Object enum  UserDataConflictResolution : unsigned char {
    @@ -1435,8 +1433,7 @@ Additional Inherited Members
    -

    Description: Where possible, analytically extends surface to include domain. Parameters: dir - [in] 0 new Domain(0) will include domain. (the first surface parameter). 1 new Domain(1) will include domain. (the second surface parameter). domain - [in] if domain is not included in surface domain, surface will be extended so that its domain includes domain.
    - Will not work if surface is closed in direction dir. Original surface is identical to the restriction of the resulting surface to the original surface domain, Returns: true if successful.

    +

    Description: Where possible, analytically extends surface to include domain. Parameters: dir - [in] 0 new Domain(0) will include domain. (the first surface parameter). 1 new Domain(1) will include domain. (the second surface parameter). domain - [in] if domain is not included in surface domain, surface will be extended so that its domain includes domain. Will not work if surface is closed in direction dir. Original surface is identical to the restriction of the resulting surface to the original surface domain, Returns: true if successful.

    Reimplemented from ON_Surface.

    @@ -1730,8 +1727,7 @@ Additional Inherited Members
    -

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search.
    - dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    +

    Description: Search for a derivatitive, tangent, or curvature discontinuity. Parameters: dir - [in] If 0, then "u" parameter is checked. If 1, then the "v" parameter is checked. c - [in] type of continity to test for. t0 - [in] Search begins at t0. If there is a discontinuity at t0, it will be ignored. This makes it possible to repeatedly call GetNextDiscontinuity and step through the discontinuities. t1 - [in] (t0 != t1) If there is a discontinuity at t1 is will be ingored unless c is a locus discontinuity type and t1 is at the start or end of the curve. t - [out] if a discontinuity is found, then *t reports the parameter at the discontinuity. hint - [in/out] if GetNextDiscontinuity will be called repeatedly, passing a "hint" with initial value *hint=0 will increase the speed of the search. dtype - [out] if not nullptr, *dtype reports the kind of discontinuity found at *t. A value of 1 means the first derivative or unit tangent was discontinuous. A value of 2 means the second derivative or curvature was discontinuous. A value of 0 means teh curve is not closed, a locus discontinuity test was applied, and t1 is at the start of end of the curve. cos_angle_tolerance - [in] default = cos(1 degree) Used only when c is ON::continuity::G1_continuous or ON::continuity::G2_continuous. If the cosine of the angle between two tangent vectors is <= cos_angle_tolerance, then a G1 discontinuity is reported. curvature_tolerance - [in] (default = ON_SQRT_EPSILON) Used only when c is ON::continuity::G2_continuous. If K0 and K1 are curvatures evaluated from above and below and |K0 - K1| > curvature_tolerance, then a curvature discontinuity is reported. Returns: Parametric continuity tests c = (C0_continuous, ..., G2_continuous):

    true if a parametric discontinuity was found strictly between t0 and t1. Note well that all curves are parametrically continuous at the ends of their domains.

    Locus continuity tests c = (C0_locus_continuous, ...,G2_locus_continuous):

    true if a locus discontinuity was found strictly between t0 and t1 or at t1 is the at the end of a curve. Note well that all open curves (IsClosed()=false) are locus discontinuous at the ends of their domains. All closed curves (IsClosed()=true) are at least C0_locus_continuous at the ends of their domains.

    @@ -3954,8 +3950,8 @@ Additional Inherited Members
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Parameters
    @@ -4133,9 +4129,9 @@ Additional Inherited Members diff --git a/6/de/de7/opennurbs__std__string_8h_source.html b/6/de/de7/opennurbs__std__string_8h_source.html index 5b7b38d3..d572d899 100644 --- a/6/de/de7/opennurbs__std__string_8h_source.html +++ b/6/de/de7/opennurbs__std__string_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_std_string.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_std_string.h Source File @@ -22,6 +22,7 @@ @@ -29,21 +30,18 @@
    binary_archiveopen binary file
    openNURBS SDK Help +  6.0
    - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(ON_STD_STRING_INC_)
    18 #define ON_STD_STRING_INC_
    19 
    20 /*
    21 When the predecessor of opennurbs was released in 1995, there was
    22 no robust corss platform support for dynamic string classes.
    23 In order to provide robust dynamic string support, openNURBS
    24 had to implement ON_String and ON_wString.
    25 
    26 It's now 2013 and current C++ compilers from the
    27 GNU Project (gcc 4.7), Microsoft (Visual C++ 11 (2012)),
    28 Google (Android NDK r8e) and Apple (LLVM 4.2) provide
    29 reasonable support for much of the C++11 standard and provide
    30 working implementations std::basic_string, std:string and
    31 std::wstring classes.
    32 
    33 Over time, opennurbs will transition from using ON_String and
    34 ON_wString to using std::string and std::wstring.
    35 
    36 The tools in the opennurbs_std_string*.* files provide support
    37 for string formatting and UTF conversion that are not available
    38 from the standard C++ string classes.
    39 
    40 These implementations assume the compiler has solid support for
    41 std:basic_string, std::string, std::wstring, std::u16string,
    42 std::u32string and for using rvalue references to efficient
    43 return dynamic strings.
    44 */
    45 
    46 ON_DECL
    47 std::string ON_VARGS_FUNC_CDECL ON_std_string_format(
    48  const char* format,
    49  ...
    50  ) ON_NOEXCEPT;
    51 
    52 ON_DECL
    53 std::wstring ON_VARGS_FUNC_CDECL ON_std_wstring_format(
    54  const wchar_t* format,
    55  ...
    56  ) ON_NOEXCEPT;
    57 
    58 /*
    59 Description:
    60  Convert a UTF-8 encoded char string to a UTF-8 encoded std::string.
    61  This function removes byte order marks (BOM) and can repair encoding
    62  errors.
    63 
    64 Parameters:
    65  bTestByteOrder - [in]
    66  If bTestByteOrder is true and the the input buffer is a
    67  byte order mark (BOM), then the BOM is skipped. It the value
    68  of the BOM is byte swapped, then subsequent input elements are
    69  byte swapped before being decoded. Specifically:
    70  - If the size of an input buffer element is 1 byte and the
    71  values of the first three input elements are a UTF-8 BOM
    72  (0xEF, 0xBB, 0xBF), then the first three input elements are
    73  ignored and decoding begins at the forth input element.
    74  - If the size of an input buffer element is 2 bytes and the value
    75  of the first element is a UTF-16 BOM (0xFEFF), then the first
    76  element is ignored and decoding begins with the second element.
    77  - If the size of an input buffer element is 2 bytes and the value
    78  of the first element is a byte swapped UTF-16 BOM (0xFFFE),
    79  then the first element is ignored, decoding begins with the
    80  second element, and input element bytes are swapped before
    81  being decoded.
    82  - If the size of an input buffer element is 4 bytes and the value
    83  of the first element is a UTF-32 BOM (0x0000FEFF), then the
    84  first element is ignored and decoding begins with the second
    85  element.
    86  - If the size of an input buffer element is 4 bytes and the value
    87  of the first element is bytes swapped UTF-32 BOM (0xFFFE0000),
    88  then the first element is ignored, decoding begins with the
    89  second element, and input element bytes are swapped before
    90  being decoded.
    91  - In all other cases the first element of the input buffer is
    92  decoded and no byte swapping is performed.
    93 
    94  sInputUTF - [in]
    95  UTF-8 encoded char string to convert.
    96 
    97  sInputUTF_count - [in]
    98  If sInputUTF_count >= 0, then it specifies the number of
    99  elements in sInputUTF[] to convert.
    100 
    101  If sInputUTF_count == -1, then sInputUTF must be a zero
    102  terminated array and all the elements up to the first zero
    103  element are converted.
    104 
    105  error_status - [out]
    106  If error_status is not null, then bits of *error_status are
    107  set to indicate the success or failure of the conversion.
    108  When the error_mask parameter is used to used to mask some
    109  conversion errors, multiple bits may be set.
    110  0: Successful conversion with no errors.
    111  1: The input parameters were invalid.
    112  This error cannot be masked.
    113  2: The ouput buffer was not large enough to hold the converted
    114  string. As much conversion as possible is performed in this
    115  case and the error cannot be masked.
    116  4: When parsing a UTF-8 or UTF-32 string, the values of two
    117  consecutive encoding sequences formed a valid UTF-16
    118  surrogate pair.
    119  This error is masked if 0 != (4 & m_error_mask).
    120  If the error is masked, then the surrogate pair is
    121  decoded, the value of the resulting unicode code point
    122  is used, and parsing continues.
    123  8: An overlong UTF-8 encoding sequence was encountered and
    124  the value of the overlong sUTF-8 equence was a valid
    125  unicode code point.
    126  This error is masked if 0 != (8 & m_error_mask).
    127  If the error is masked, then the unicode code point
    128  is used and parsing continues.
    129  16: An illegal UTF-8, UTF-16 or UTF-32 encoding sequence occured
    130  or an invalid unicode code point value resulted from decoding
    131  a UTF-8 sequence.
    132  This error is masked if 0 != (16 & m_error_mask).
    133  If the error is masked and the value of error_code_point is
    134  a valid unicode code point, then error_code_point is encoded
    135  in the output string and parsing continues.
    136 
    137  error_mask - [in]
    138  If 0 != (error_mask & 4), then type 4 errors are masked.
    139  If 0 != (error_mask & 8), then type 8 errors are masked.
    140  If 0 != (error_mask & 16) and error_code_point is a valid unicode
    141  code point value, then type 16 errors are masked.
    142 
    143  error_code_point - [in]
    144  Unicode code point value to use in when masking type 16 errors.
    145  If 0 == (error_mask & 16), then this parameter is ignored.
    146  0xFFFD is a popular choice for the error_code_point value.
    147 
    148  sEndElement - [out]
    149  If sEndElement is not null, then *sEndElement points to the
    150  element of sInputUTF[] were conversion stopped.
    151 
    152  If an error occured and was not masked, then *sEndElement points
    153  to the element of sInputUTF[] where the conversion failed.
    154  If no errors occured or all errors were masked, then
    155  *sEndElement = sInputUTF + sInputUTF_count or points to
    156  the zero terminator in sInputUTF[], depending on the input
    157  value of sInputUTF_count.
    158 
    159 Returns:
    160  A UTF-8 encoded std::string.
    161  The returned string does not have a byte order mark (BOM).
    162 */
    163 ON_DECL
    164 std::string ON_UTF8_to_std_string(
    165  int bTestByteOrder,
    166  const char* sInputUTF,
    167  int sInputUTF_count,
    168  unsigned int* error_status,
    169  unsigned int error_mask,
    170  ON__UINT32 error_code_point,
    171  const char** sEndElement
    172  ) ON_NOEXCEPT;
    173 
    174 /*
    175 Description:
    176  Convert a UTF-16 encoded ON__UINT16 string to a UTF-8 encoded std:string.
    177  This function removes byte order marks (BOM) and can repair encoding
    178  errors.
    179 
    180 Parameters:
    181  bTestByteOrder - [in]
    182  If bTestByteOrder is true and the the input buffer is a
    183  byte order mark (BOM), then the BOM is skipped. It the value
    184  of the BOM is byte swapped, then subsequent input elements are
    185  byte swapped before being decoded. Specifically:
    186  - If the size of an input buffer element is 1 byte and the
    187  values of the first three input elements are a UTF-8 BOM
    188  (0xEF, 0xBB, 0xBF), then the first three input elements are
    189  ignored and decoding begins at the forth input element.
    190  - If the size of an input buffer element is 2 bytes and the value
    191  of the first element is a UTF-16 BOM (0xFEFF), then the first
    192  element is ignored and decoding begins with the second element.
    193  - If the size of an input buffer element is 2 bytes and the value
    194  of the first element is a byte swapped UTF-16 BOM (0xFFFE),
    195  then the first element is ignored, decoding begins with the
    196  second element, and input element bytes are swapped before
    197  being decoded.
    198  - If the size of an input buffer element is 4 bytes and the value
    199  of the first element is a UTF-32 BOM (0x0000FEFF), then the
    200  first element is ignored and decoding begins with the second
    201  element.
    202  - If the size of an input buffer element is 4 bytes and the value
    203  of the first element is bytes swapped UTF-32 BOM (0xFFFE0000),
    204  then the first element is ignored, decoding begins with the
    205  second element, and input element bytes are swapped before
    206  being decoded.
    207  - In all other cases the first element of the input buffer is
    208  decoded and no byte swapping is performed.
    209 
    210  sInputUTF - [in]
    211  UTF-16 encoded ON__UINT16 string to convert.
    212 
    213 
    214  sInputUTF_count - [in]
    215  If sInputUTF_count >= 0, then it specifies the number of
    216  elements in sInputUTF[] to convert.
    217 
    218  If sInputUTF_count == -1, then sInputUTF must be a zero
    219  terminated array and all the elements up to the first zero
    220  element are converted.
    221 
    222  sUTF8 - [out]
    223  If sUTF8 is not null and sUTF8_count > 0, then the UTF-8
    224  encoded string is returned in this buffer. If there is room
    225  for the null terminator, the converted string will be null
    226  terminated. The null terminator is never included in the count
    227  of returned by this function. The converted string is in the
    228  CPU's native byte order. No byte order mark is prepended.
    229 
    230  sUTF8_count - [in]
    231  If sUTF8_count > 0, then it specifies the number of available
    232  ON__UINT8 elements in the sUTF8[] buffer.
    233 
    234  If sUTF8_count == 0, then the sUTF8 parameter is ignored.
    235 
    236  error_status - [out]
    237  If error_status is not null, then bits of *error_status are
    238  set to indicate the success or failure of the conversion.
    239  When the error_mask parameter is used to used to mask some
    240  conversion errors, multiple bits may be set.
    241  0: Successful conversion with no errors.
    242  1: The input parameters were invalid.
    243  This error cannot be masked.
    244  2: The ouput buffer was not large enough to hold the converted
    245  string. As much conversion as possible is performed in this
    246  case and the error cannot be masked.
    247  4: When parsing a UTF-8 or UTF-32 string, the values of two
    248  consecutive encoding sequences formed a valid UTF-16
    249  surrogate pair.
    250  This error is masked if 0 != (4 & m_error_mask).
    251  If the error is masked, then the surrogate pair is
    252  decoded, the value of the resulting unicode code point
    253  is used, and parsing continues.
    254  8: An overlong UTF-8 encoding sequence was encountered and
    255  the value of the overlong sUTF-8 equence was a valid
    256  unicode code point.
    257  This error is masked if 0 != (8 & m_error_mask).
    258  If the error is masked, then the unicode code point
    259  is used and parsing continues.
    260  16: An illegal UTF-8, UTF-16 or UTF-32 encoding sequence occured
    261  or an invalid unicode code point value resulted from decoding
    262  a UTF-8 sequence.
    263  This error is masked if 0 != (16 & m_error_mask).
    264  If the error is masked and the value of error_code_point is
    265  a valid unicode code point, then error_code_point is encoded
    266  in the output string and parsing continues.
    267 
    268  error_mask - [in]
    269  If 0 != (error_mask & 4), then type 4 errors are masked.
    270  If 0 != (error_mask & 8), then type 8 errors are masked.
    271  If 0 != (error_mask & 16) and error_code_point is a valid unicode
    272  code point value, then type 16 errors are masked.
    273 
    274  error_code_point - [in]
    275  Unicode code point value to use in when masking type 16 errors.
    276  If 0 == (error_mask & 16), then this parameter is ignored.
    277  0xFFFD is a popular choice for the error_code_point value.
    278 
    279  sEndElement - [out]
    280  If sEndElement is not null, then *sEndElement points to the
    281  element of sInputUTF[] were conversion stopped.
    282 
    283  If an error occured and was not masked, then *sEndElement points
    284  to the element of sInputUTF[] where the conversion failed.
    285  If no errors occured or all errors were masked, then
    286  *sEndElement = sInputUTF + sInputUTF_count or points to
    287  the zero terminator in sInputUTF[], depending on the input
    288  value of sInputUTF_count.
    289 
    290 
    291 Returns:
    292  A UTF-8 encoded std::string.
    293  The returned string does not have a byte order mark (BOM).
    294 */
    295 ON_DECL
    296 std::string ON_UTF16_to_std_string(
    297  int bTestByteOrder,
    298  const ON__UINT16* sInputUTF,
    299  int sInputUTF_count,
    300  unsigned int* error_status,
    301  unsigned int error_mask,
    302  ON__UINT32 error_code_point,
    303  const ON__UINT16** sEndElement
    304  ) ON_NOEXCEPT;
    305 
    306 /*
    307 Description:
    308  Convert a UTF-32 encoded ON__UINT16 string to a UTF-8 encoded std:string.
    309  This function removes byte order marks (BOM) and can repair encoding
    310  errors.
    311 
    312 Parameters:
    313  bTestByteOrder - [in]
    314  If bTestByteOrder is true and the the input buffer is a
    315  byte order mark (BOM), then the BOM is skipped. It the value
    316  of the BOM is byte swapped, then subsequent input elements are
    317  byte swapped before being decoded. Specifically:
    318  - If the size of an input buffer element is 1 byte and the
    319  values of the first three input elements are a UTF-8 BOM
    320  (0xEF, 0xBB, 0xBF), then the first three input elements are
    321  ignored and decoding begins at the forth input element.
    322  - If the size of an input buffer element is 2 bytes and the value
    323  of the first element is a UTF-16 BOM (0xFEFF), then the first
    324  element is ignored and decoding begins with the second element.
    325  - If the size of an input buffer element is 2 bytes and the value
    326  of the first element is a byte swapped UTF-16 BOM (0xFFFE),
    327  then the first element is ignored, decoding begins with the
    328  second element, and input element bytes are swapped before
    329  being decoded.
    330  - If the size of an input buffer element is 4 bytes and the value
    331  of the first element is a UTF-32 BOM (0x0000FEFF), then the
    332  first element is ignored and decoding begins with the second
    333  element.
    334  - If the size of an input buffer element is 4 bytes and the value
    335  of the first element is bytes swapped UTF-32 BOM (0xFFFE0000),
    336  then the first element is ignored, decoding begins with the
    337  second element, and input element bytes are swapped before
    338  being decoded.
    339  - In all other cases the first element of the input buffer is
    340  decoded and no byte swapping is performed.
    341 
    342  sInputUTF - [in]
    343  UTF-32 encoded ON__UINT32 string to convert.
    344 
    345  sInputUTF_count - [in]
    346  If sInputUTF_count >= 0, then it specifies the number of
    347  elements in sInputUTF[] to convert.
    348 
    349  If sInputUTF_count == -1, then sInputUTF must be a zero
    350  terminated array and all the elements up to the first zero
    351  element are converted.
    352 
    353  error_status - [out]
    354  If error_status is not null, then bits of *error_status are
    355  set to indicate the success or failure of the conversion.
    356  When the error_mask parameter is used to used to mask some
    357  conversion errors, multiple bits may be set.
    358  0: Successful conversion with no errors.
    359  1: The input parameters were invalid.
    360  This error cannot be masked.
    361  2: The ouput buffer was not large enough to hold the converted
    362  string. As much conversion as possible is performed in this
    363  case and the error cannot be masked.
    364  4: When parsing a UTF-8 or UTF-32 string, the values of two
    365  consecutive encoding sequences formed a valid UTF-16
    366  surrogate pair.
    367  This error is masked if 0 != (4 & m_error_mask).
    368  If the error is masked, then the surrogate pair is
    369  decoded, the value of the resulting unicode code point
    370  is used, and parsing continues.
    371  8: An overlong UTF-8 encoding sequence was encountered and
    372  the value of the overlong sUTF-8 equence was a valid
    373  unicode code point.
    374  This error is masked if 0 != (8 & m_error_mask).
    375  If the error is masked, then the unicode code point
    376  is used and parsing continues.
    377  16: An illegal UTF-8, UTF-16 or UTF-32 encoding sequence occured
    378  or an invalid unicode code point value resulted from decoding
    379  a UTF-8 sequence.
    380  This error is masked if 0 != (16 & m_error_mask).
    381  If the error is masked and the value of error_code_point is
    382  a valid unicode code point, then error_code_point is encoded
    383  in the output string and parsing continues.
    384 
    385  error_mask - [in]
    386  If 0 != (error_mask & 4), then type 4 errors are masked.
    387  If 0 != (error_mask & 8), then type 8 errors are masked.
    388  If 0 != (error_mask & 16) and error_code_point is a valid unicode
    389  code point value, then type 16 errors are masked.
    390 
    391  error_code_point - [in]
    392  Unicode code point value to use in when masking type 16 errors.
    393  If 0 == (error_mask & 16), then this parameter is ignored.
    394  0xFFFD is a popular choice for the error_code_point value.
    395 
    396  sEndElement - [out]
    397  If sEndElement is not null, then *sEndElement points to the
    398  element of sInputUTF[] were conversion stopped.
    399 
    400  If an error occured and was not masked, then *sEndElement points
    401  to the element of sInputUTF[] where the conversion failed.
    402  If no errors occured or all errors were masked, then
    403  *sEndElement = sInputUTF + sInputUTF_count or points to
    404  the zero terminator in sInputUTF[], depending on the input
    405  value of sInputUTF_count.
    406 
    407 Returns:
    408  A UTF-8 encoded std::string.
    409  The returned string does not have a byte order mark (BOM).
    410 */
    411 ON_DECL
    412 std::string ON_UTF32_to_std_string(
    413  int bTestByteOrder,
    414  const ON__UINT32* sInputUTF,
    415  int sInputUTF_count,
    416  unsigned int* error_status,
    417  unsigned int error_mask,
    418  ON__UINT32 error_code_point,
    419  const ON__UINT32** sEndElement
    420  ) ON_NOEXCEPT;
    421 
    422 /*
    423 Description:
    424  Convert a UTF-XX encoded wchar_t string to a UTF-8 encoded std:string.
    425  This function removes byte order marks (BOM) and can repair encoding
    426  errors.
    427 
    428  The value of sizeof(wchar_t) determines which UTF-XX encoding is used.
    429  sizeof(wchar_t) UTF-XX
    430  1 UTF-8
    431  2 UTF-16
    432  4 UTF-32
    433 
    434 Parameters:
    435  bTestByteOrder - [in]
    436  If bTestByteOrder is true and the the input buffer is a
    437  byte order mark (BOM), then the BOM is skipped. It the value
    438  of the BOM is byte swapped, then subsequent input elements are
    439  byte swapped before being decoded. Specifically:
    440  - If the size of an input buffer element is 1 byte and the
    441  values of the first three input elements are a UTF-8 BOM
    442  (0xEF, 0xBB, 0xBF), then the first three input elements are
    443  ignored and decoding begins at the forth input element.
    444  - If the size of an input buffer element is 2 bytes and the value
    445  of the first element is a UTF-16 BOM (0xFEFF), then the first
    446  element is ignored and decoding begins with the second element.
    447  - If the size of an input buffer element is 2 bytes and the value
    448  of the first element is a byte swapped UTF-16 BOM (0xFFFE),
    449  then the first element is ignored, decoding begins with the
    450  second element, and input element bytes are swapped before
    451  being decoded.
    452  - If the size of an input buffer element is 4 bytes and the value
    453  of the first element is a UTF-32 BOM (0x0000FEFF), then the
    454  first element is ignored and decoding begins with the second
    455  element.
    456  - If the size of an input buffer element is 4 bytes and the value
    457  of the first element is bytes swapped UTF-32 BOM (0xFFFE0000),
    458  then the first element is ignored, decoding begins with the
    459  second element, and input element bytes are swapped before
    460  being decoded.
    461  - In all other cases the first element of the input buffer is
    462  decoded and no byte swapping is performed.
    463 
    464  sInputUTF - [in]
    465  UTF-XX encoded wchar_t string to convert.
    466 
    467  sInputUTF_count - [in]
    468  If sInputUTF_count >= 0, then it specifies the number of
    469  elements in sInputUTF[] to convert.
    470 
    471  If sInputUTF_count == -1, then sInputUTF must be a zero
    472  terminated array and all the elements up to the first zero
    473  element are converted.
    474 
    475  error_status - [out]
    476  If error_status is not null, then bits of *error_status are
    477  set to indicate the success or failure of the conversion.
    478  When the error_mask parameter is used to used to mask some
    479  conversion errors, multiple bits may be set.
    480  0: Successful conversion with no errors.
    481  1: The input parameters were invalid.
    482  This error cannot be masked.
    483  2: The ouput buffer was not large enough to hold the converted
    484  string. As much conversion as possible is performed in this
    485  case and the error cannot be masked.
    486  4: When parsing a UTF-8 or UTF-32 string, the values of two
    487  consecutive encoding sequences formed a valid UTF-16
    488  surrogate pair.
    489  This error is masked if 0 != (4 & m_error_mask).
    490  If the error is masked, then the surrogate pair is
    491  decoded, the value of the resulting unicode code point
    492  is used, and parsing continues.
    493  8: An overlong UTF-8 encoding sequence was encountered and
    494  the value of the overlong sUTF-8 equence was a valid
    495  unicode code point.
    496  This error is masked if 0 != (8 & m_error_mask).
    497  If the error is masked, then the unicode code point
    498  is used and parsing continues.
    499  16: An illegal UTF-8, UTF-16 or UTF-32 encoding sequence occured
    500  or an invalid unicode code point value resulted from decoding
    501  a UTF-8 sequence.
    502  This error is masked if 0 != (16 & m_error_mask).
    503  If the error is masked and the value of error_code_point is
    504  a valid unicode code point, then error_code_point is encoded
    505  in the output string and parsing continues.
    506 
    507  error_mask - [in]
    508  If 0 != (error_mask & 4), then type 4 errors are masked.
    509  If 0 != (error_mask & 8), then type 8 errors are masked.
    510  If 0 != (error_mask & 16) and error_code_point is a valid unicode
    511  code point value, then type 16 errors are masked.
    512 
    513  error_code_point - [in]
    514  Unicode code point value to use in when masking type 16 errors.
    515  If 0 == (error_mask & 16), then this parameter is ignored.
    516  0xFFFD is a popular choice for the error_code_point value.
    517 
    518  end_element_index - [out]
    519  If end_element_index is not null, then *end_element_index is the
    520  index of the first element in sInputUTF that was not converted.
    521 
    522  If an error occured and was not masked, then *end_element_index
    523  is the index of the element of sInputUTF[] where the conversion
    524  failed.
    525  If no errors occured or all errors were masked, then
    526  *end_element_index is the number of elements in sInputUTF[] that
    527  were converted.
    528 
    529 Returns:
    530  A UTF-8 encoded std::string.
    531  The returned string does not have a byte order mark (BOM).
    532 */
    533 std::string ON_UTF_WideChar_to_std_string(
    534  int bTestByteOrder,
    535  const wchar_t* sInputUTF,
    536  int sInputUTF_count,
    537  unsigned int* error_status,
    538  unsigned int error_mask,
    539  ON__UINT32 error_code_point,
    540  int* end_element_index
    541  ) ON_NOEXCEPT;
    542 
    543 /*
    544 Description:
    545  Convert a UTF-XX encoded std::wstring to a UTF-8 encoded std:string.
    546  This function removes byte order marks (BOM) and can repair encoding
    547  errors.
    548 
    549  The value of sizeof(wchar_t) determines which UTF-XX encoding is used.
    550  sizeof(wchar_t) UTF-XX
    551  1 UTF-8
    552  2 UTF-16
    553  4 UTF-32
    554 
    555 Parameters:
    556  bTestByteOrder - [in]
    557  If bTestByteOrder is true and the the input buffer is a
    558  byte order mark (BOM), then the BOM is skipped. It the value
    559  of the BOM is byte swapped, then subsequent input elements are
    560  byte swapped before being decoded. Specifically:
    561  - If the size of an input buffer element is 1 byte and the
    562  values of the first three input elements are a UTF-8 BOM
    563  (0xEF, 0xBB, 0xBF), then the first three input elements are
    564  ignored and decoding begins at the forth input element.
    565  - If the size of an input buffer element is 2 bytes and the value
    566  of the first element is a UTF-16 BOM (0xFEFF), then the first
    567  element is ignored and decoding begins with the second element.
    568  - If the size of an input buffer element is 2 bytes and the value
    569  of the first element is a byte swapped UTF-16 BOM (0xFFFE),
    570  then the first element is ignored, decoding begins with the
    571  second element, and input element bytes are swapped before
    572  being decoded.
    573  - If the size of an input buffer element is 4 bytes and the value
    574  of the first element is a UTF-32 BOM (0x0000FEFF), then the
    575  first element is ignored and decoding begins with the second
    576  element.
    577  - If the size of an input buffer element is 4 bytes and the value
    578  of the first element is bytes swapped UTF-32 BOM (0xFFFE0000),
    579  then the first element is ignored, decoding begins with the
    580  second element, and input element bytes are swapped before
    581  being decoded.
    582  - In all other cases the first element of the input buffer is
    583  decoded and no byte swapping is performed.
    584 
    585  sInputUTF - [in]
    586  UTF-XX encoded std::wstring to convert.
    587 
    588  sInputUTF_count - [in]
    589  If sInputUTF_count >= 0, then it specifies the number of
    590  elements in sInputUTF[] to convert.
    591 
    592  If sInputUTF_count == -1, then sInputUTF must be a zero
    593  terminated array and all the elements up to the first zero
    594  element are converted.
    595 
    596  sUTF8 - [out]
    597  If sUTF8 is not null and sUTF8_count > 0, then the UTF-8
    598  encoded string is returned in this buffer. If there is room
    599  for the null terminator, the converted string will be null
    600  terminated. The null terminator is never included in the count
    601  of returned by this function. The converted string is in the
    602  CPU's native byte order. No byte order mark is prepended.
    603 
    604  sUTF8_count - [in]
    605  If sUTF8_count > 0, then it specifies the number of available
    606  ON__UINT8 elements in the sUTF8[] buffer.
    607 
    608  If sUTF8_count == 0, then the sUTF8 parameter is ignored.
    609 
    610  error_status - [out]
    611  If error_status is not null, then bits of *error_status are
    612  set to indicate the success or failure of the conversion.
    613  When the error_mask parameter is used to used to mask some
    614  conversion errors, multiple bits may be set.
    615  0: Successful conversion with no errors.
    616  1: The input parameters were invalid.
    617  This error cannot be masked.
    618  2: The ouput buffer was not large enough to hold the converted
    619  string. As much conversion as possible is performed in this
    620  case and the error cannot be masked.
    621  4: When parsing a UTF-8 or UTF-32 string, the values of two
    622  consecutive encoding sequences formed a valid UTF-16
    623  surrogate pair.
    624  This error is masked if 0 != (4 & m_error_mask).
    625  If the error is masked, then the surrogate pair is
    626  decoded, the value of the resulting unicode code point
    627  is used, and parsing continues.
    628  8: An overlong UTF-8 encoding sequence was encountered and
    629  the value of the overlong sUTF-8 equence was a valid
    630  unicode code point.
    631  This error is masked if 0 != (8 & m_error_mask).
    632  If the error is masked, then the unicode code point
    633  is used and parsing continues.
    634  16: An illegal UTF-8, UTF-16 or UTF-32 encoding sequence occured
    635  or an invalid unicode code point value resulted from decoding
    636  a UTF-8 sequence.
    637  This error is masked if 0 != (16 & m_error_mask).
    638  If the error is masked and the value of error_code_point is
    639  a valid unicode code point, then error_code_point is encoded
    640  in the output string and parsing continues.
    641 
    642  error_mask - [in]
    643  If 0 != (error_mask & 4), then type 4 errors are masked.
    644  If 0 != (error_mask & 8), then type 8 errors are masked.
    645  If 0 != (error_mask & 16) and error_code_point is a valid unicode
    646  code point value, then type 16 errors are masked.
    647 
    648  error_code_point - [in]
    649  Unicode code point value to use in when masking type 16 errors.
    650  If 0 == (error_mask & 16), then this parameter is ignored.
    651  0xFFFD is a popular choice for the error_code_point value.
    652 
    653  end_element_index - [out]
    654  If end_element_index is not null, then *end_element_index is the
    655  index of the first element in sInputUTF that was not converted.
    656 
    657  If an error occured and was not masked, then *end_element_index
    658  is the index of the element of sInputUTF[] where the conversion
    659  failed.
    660  If no errors occured or all errors were masked, then
    661  *end_element_index is the number of elements in sInputUTF[] that
    662  were converted.
    663 
    664 Returns:
    665  A UTF-8 encoded std::string.
    666  The returned string does not have a byte order mark (BOM).
    667 */
    668 ON_DECL
    669 std::string ON_UTF_std_wstring_to_std_string(
    670  int bTestByteOrder,
    671  const std::wstring& sInputUTF,
    672  int sInputUTF_count,
    673  unsigned int* error_status,
    674  unsigned int error_mask,
    675  ON__UINT32 error_code_point,
    676  int* end_element_index
    677  ) ON_NOEXCEPT;
    678 
    679 /*
    680 Description:
    681  Convert a UTF-8 encoded char string to a UTF-XX encoded std::wstring.
    682  This function removes byte order marks (BOM) and can repair encoding
    683  errors.
    684 
    685  The value of sizeof(wchar_t) determines which UTF-XX encoding is used.
    686  sizeof(wchar_t) UTF-XX
    687  1 UTF-8
    688  2 UTF-16
    689  4 UTF-32
    690 
    691 Parameters:
    692  bTestByteOrder - [in]
    693  If bTestByteOrder is true and the the input buffer is a
    694  byte order mark (BOM), then the BOM is skipped. It the value
    695  of the BOM is byte swapped, then subsequent input elements are
    696  byte swapped before being decoded. Specifically:
    697  - If the size of an input buffer element is 1 byte and the
    698  values of the first three input elements are a UTF-8 BOM
    699  (0xEF, 0xBB, 0xBF), then the first three input elements are
    700  ignored and decoding begins at the forth input element.
    701  - If the size of an input buffer element is 2 bytes and the value
    702  of the first element is a UTF-16 BOM (0xFEFF), then the first
    703  element is ignored and decoding begins with the second element.
    704  - If the size of an input buffer element is 2 bytes and the value
    705  of the first element is a byte swapped UTF-16 BOM (0xFFFE),
    706  then the first element is ignored, decoding begins with the
    707  second element, and input element bytes are swapped before
    708  being decoded.
    709  - If the size of an input buffer element is 4 bytes and the value
    710  of the first element is a UTF-32 BOM (0x0000FEFF), then the
    711  first element is ignored and decoding begins with the second
    712  element.
    713  - If the size of an input buffer element is 4 bytes and the value
    714  of the first element is bytes swapped UTF-32 BOM (0xFFFE0000),
    715  then the first element is ignored, decoding begins with the
    716  second element, and input element bytes are swapped before
    717  being decoded.
    718  - In all other cases the first element of the input buffer is
    719  decoded and no byte swapping is performed.
    720 
    721  sInputUTF - [in]
    722  UTF-8 encoded char string to convert.
    723 
    724 
    725  sInputUTF_count - [in]
    726  If sInputUTF_count >= 0, then it specifies the number of
    727  elements in sInputUTF[] to convert.
    728 
    729  If sInputUTF_count == -1, then sInputUTF must be a zero
    730  terminated array and all the elements up to the first zero
    731  element are converted.
    732 
    733  error_status - [out]
    734  If error_status is not null, then bits of *error_status are
    735  set to indicate the success or failure of the conversion.
    736  When the error_mask parameter is used to used to mask some
    737  conversion errors, multiple bits may be set.
    738  0: Successful conversion with no errors.
    739  1: The input parameters were invalid.
    740  This error cannot be masked.
    741  2: The ouput buffer was not large enough to hold the converted
    742  string. As much conversion as possible is performed in this
    743  case and the error cannot be masked.
    744  4: When parsing a UTF-8 or UTF-32 string, the values of two
    745  consecutive encoding sequences formed a valid UTF-16
    746  surrogate pair.
    747  This error is masked if 0 != (4 & m_error_mask).
    748  If the error is masked, then the surrogate pair is
    749  decoded, the value of the resulting unicode code point
    750  is used, and parsing continues.
    751  8: An overlong UTF-8 encoding sequence was encountered and
    752  the value of the overlong sUTF-8 equence was a valid
    753  unicode code point.
    754  This error is masked if 0 != (8 & m_error_mask).
    755  If the error is masked, then the unicode code point
    756  is used and parsing continues.
    757  16: An illegal UTF-8, UTF-16 or UTF-32 encoding sequence occured
    758  or an invalid unicode code point value resulted from decoding
    759  a UTF-8 sequence.
    760  This error is masked if 0 != (16 & m_error_mask).
    761  If the error is masked and the value of error_code_point is
    762  a valid unicode code point, then error_code_point is encoded
    763  in the output string and parsing continues.
    764 
    765  error_mask - [in]
    766  If 0 != (error_mask & 4), then type 4 errors are masked.
    767  If 0 != (error_mask & 8), then type 8 errors are masked.
    768  If 0 != (error_mask & 16) and error_code_point is a valid unicode
    769  code point value, then type 16 errors are masked.
    770 
    771  error_code_point - [in]
    772  Unicode code point value to use in when masking type 16 errors.
    773  If 0 == (error_mask & 16), then this parameter is ignored.
    774  0xFFFD is a popular choice for the error_code_point value.
    775 
    776  sEndElement - [out]
    777  If sEndElement is not null, then *sEndElement points to the
    778  element of sInputUTF[] were conversion stopped.
    779 
    780  If an error occured and was not masked, then *sEndElement points
    781  to the element of sInputUTF[] where the conversion failed.
    782  If no errors occured or all errors were masked, then
    783  *sEndElement = sInputUTF + sInputUTF_count or points to
    784  the zero terminator in sInputUTF[], depending on the input
    785  value of sInputUTF_count.
    786 
    787 Returns:
    788  A UTF-XX encoded std::wstring.
    789  The returned string does not have a byte order mark (BOM).
    790 */
    791 ON_DECL
    792 std::wstring ON_UTF8_to_std_wstring(
    793  int bTestByteOrder,
    794  const char* sInputUTF,
    795  int sInputUTF_count,
    796  unsigned int* error_status,
    797  unsigned int error_mask,
    798  ON__UINT32 error_code_point,
    799  const char** sEndElement
    800  ) ON_NOEXCEPT;
    801 
    802 /*
    803 Description:
    804  Convert a UTF-16 encoded ON__UINT16 string to a UTF-XX encoded std::wstring.
    805  This function removes byte order marks (BOM) and can repair encoding
    806  errors.
    807 
    808  The value of sizeof(wchar_t) determines which UTF-XX encoding is used.
    809  sizeof(wchar_t) UTF-XX
    810  1 UTF-8
    811  2 UTF-16
    812  4 UTF-32
    813 
    814 Parameters:
    815  bTestByteOrder - [in]
    816  If bTestByteOrder is true and the the input buffer is a
    817  byte order mark (BOM), then the BOM is skipped. It the value
    818  of the BOM is byte swapped, then subsequent input elements are
    819  byte swapped before being decoded. Specifically:
    820  - If the size of an input buffer element is 1 byte and the
    821  values of the first three input elements are a UTF-8 BOM
    822  (0xEF, 0xBB, 0xBF), then the first three input elements are
    823  ignored and decoding begins at the forth input element.
    824  - If the size of an input buffer element is 2 bytes and the value
    825  of the first element is a UTF-16 BOM (0xFEFF), then the first
    826  element is ignored and decoding begins with the second element.
    827  - If the size of an input buffer element is 2 bytes and the value
    828  of the first element is a byte swapped UTF-16 BOM (0xFFFE),
    829  then the first element is ignored, decoding begins with the
    830  second element, and input element bytes are swapped before
    831  being decoded.
    832  - If the size of an input buffer element is 4 bytes and the value
    833  of the first element is a UTF-32 BOM (0x0000FEFF), then the
    834  first element is ignored and decoding begins with the second
    835  element.
    836  - If the size of an input buffer element is 4 bytes and the value
    837  of the first element is bytes swapped UTF-32 BOM (0xFFFE0000),
    838  then the first element is ignored, decoding begins with the
    839  second element, and input element bytes are swapped before
    840  being decoded.
    841  - In all other cases the first element of the input buffer is
    842  decoded and no byte swapping is performed.
    843 
    844  sInputUTF - [in]
    845  UTF-16 encoded ON__UINT16 string to convert.
    846 
    847  sInputUTF_count - [in]
    848  If sInputUTF_count >= 0, then it specifies the number of
    849  elements in sInputUTF[] to convert.
    850 
    851  If sInputUTF_count == -1, then sInputUTF must be a zero
    852  terminated array and all the elements up to the first zero
    853  element are converted.
    854 
    855  sUTF8 - [out]
    856  If sUTF8 is not null and sUTF8_count > 0, then the UTF-8
    857  encoded string is returned in this buffer. If there is room
    858  for the null terminator, the converted string will be null
    859  terminated. The null terminator is never included in the count
    860  of returned by this function. The converted string is in the
    861  CPU's native byte order. No byte order mark is prepended.
    862 
    863  sUTF8_count - [in]
    864  If sUTF8_count > 0, then it specifies the number of available
    865  ON__UINT8 elements in the sUTF8[] buffer.
    866 
    867  If sUTF8_count == 0, then the sUTF8 parameter is ignored.
    868 
    869  error_status - [out]
    870  If error_status is not null, then bits of *error_status are
    871  set to indicate the success or failure of the conversion.
    872  When the error_mask parameter is used to used to mask some
    873  conversion errors, multiple bits may be set.
    874  0: Successful conversion with no errors.
    875  1: The input parameters were invalid.
    876  This error cannot be masked.
    877  2: The ouput buffer was not large enough to hold the converted
    878  string. As much conversion as possible is performed in this
    879  case and the error cannot be masked.
    880  4: When parsing a UTF-8 or UTF-32 string, the values of two
    881  consecutive encoding sequences formed a valid UTF-16
    882  surrogate pair.
    883  This error is masked if 0 != (4 & m_error_mask).
    884  If the error is masked, then the surrogate pair is
    885  decoded, the value of the resulting unicode code point
    886  is used, and parsing continues.
    887  8: An overlong UTF-8 encoding sequence was encountered and
    888  the value of the overlong sUTF-8 equence was a valid
    889  unicode code point.
    890  This error is masked if 0 != (8 & m_error_mask).
    891  If the error is masked, then the unicode code point
    892  is used and parsing continues.
    893  16: An illegal UTF-8, UTF-16 or UTF-32 encoding sequence occured
    894  or an invalid unicode code point value resulted from decoding
    895  a UTF-8 sequence.
    896  This error is masked if 0 != (16 & m_error_mask).
    897  If the error is masked and the value of error_code_point is
    898  a valid unicode code point, then error_code_point is encoded
    899  in the output string and parsing continues.
    900 
    901  error_mask - [in]
    902  If 0 != (error_mask & 4), then type 4 errors are masked.
    903  If 0 != (error_mask & 8), then type 8 errors are masked.
    904  If 0 != (error_mask & 16) and error_code_point is a valid unicode
    905  code point value, then type 16 errors are masked.
    906 
    907  error_code_point - [in]
    908  Unicode code point value to use in when masking type 16 errors.
    909  If 0 == (error_mask & 16), then this parameter is ignored.
    910  0xFFFD is a popular choice for the error_code_point value.
    911 
    912  sEndElement - [out]
    913  If sEndElement is not null, then *sEndElement points to the
    914  element of sInputUTF[] were conversion stopped.
    915 
    916  If an error occured and was not masked, then *sEndElement points
    917  to the element of sInputUTF[] where the conversion failed.
    918  If no errors occured or all errors were masked, then
    919  *sEndElement = sInputUTF + sInputUTF_count or points to
    920  the zero terminator in sInputUTF[], depending on the input
    921  value of sInputUTF_count.
    922 
    923 Returns:
    924  A UTF-XX encoded std::wstring.
    925  The returned string does not have a byte order mark (BOM).
    926 */
    927 ON_DECL
    928 std::wstring ON_UTF16_to_std_wstring(
    929  int bTestByteOrder,
    930  const ON__UINT16* sInputUTF,
    931  int sInputUTF_count,
    932  unsigned int* error_status,
    933  unsigned int error_mask,
    934  ON__UINT32 error_code_point,
    935  const ON__UINT16** sEndElement
    936  ) ON_NOEXCEPT;
    937 
    938 /*
    939 Description:
    940  Convert a UTF-32 encoded ON__UINT32 string to a UTF-XX encoded std::wstring.
    941  This function removes byte order marks (BOM) and can repair encoding
    942  errors.
    943 
    944  The value of sizeof(wchar_t) determines which UTF-XX encoding is used.
    945  sizeof(wchar_t) UTF-XX
    946  1 UTF-8
    947  2 UTF-16
    948  4 UTF-32
    949 
    950 Parameters:
    951  bTestByteOrder - [in]
    952  If bTestByteOrder is true and the the input buffer is a
    953  byte order mark (BOM), then the BOM is skipped. It the value
    954  of the BOM is byte swapped, then subsequent input elements are
    955  byte swapped before being decoded. Specifically:
    956  - If the size of an input buffer element is 1 byte and the
    957  values of the first three input elements are a UTF-8 BOM
    958  (0xEF, 0xBB, 0xBF), then the first three input elements are
    959  ignored and decoding begins at the forth input element.
    960  - If the size of an input buffer element is 2 bytes and the value
    961  of the first element is a UTF-16 BOM (0xFEFF), then the first
    962  element is ignored and decoding begins with the second element.
    963  - If the size of an input buffer element is 2 bytes and the value
    964  of the first element is a byte swapped UTF-16 BOM (0xFFFE),
    965  then the first element is ignored, decoding begins with the
    966  second element, and input element bytes are swapped before
    967  being decoded.
    968  - If the size of an input buffer element is 4 bytes and the value
    969  of the first element is a UTF-32 BOM (0x0000FEFF), then the
    970  first element is ignored and decoding begins with the second
    971  element.
    972  - If the size of an input buffer element is 4 bytes and the value
    973  of the first element is bytes swapped UTF-32 BOM (0xFFFE0000),
    974  then the first element is ignored, decoding begins with the
    975  second element, and input element bytes are swapped before
    976  being decoded.
    977  - In all other cases the first element of the input buffer is
    978  decoded and no byte swapping is performed.
    979 
    980  sInputUTF - [in]
    981  UTF-32 encoded ON__UINT32 string to convert.
    982 
    983  sInputUTF_count - [in]
    984  If sInputUTF_count >= 0, then it specifies the number of
    985  elements in sInputUTF[] to convert.
    986 
    987  If sInputUTF_count == -1, then sInputUTF must be a zero
    988  terminated array and all the elements up to the first zero
    989  element are converted.
    990 
    991  error_status - [out]
    992  If error_status is not null, then bits of *error_status are
    993  set to indicate the success or failure of the conversion.
    994  When the error_mask parameter is used to used to mask some
    995  conversion errors, multiple bits may be set.
    996  0: Successful conversion with no errors.
    997  1: The input parameters were invalid.
    998  This error cannot be masked.
    999  2: The ouput buffer was not large enough to hold the converted
    1000  string. As much conversion as possible is performed in this
    1001  case and the error cannot be masked.
    1002  4: When parsing a UTF-8 or UTF-32 string, the values of two
    1003  consecutive encoding sequences formed a valid UTF-16
    1004  surrogate pair.
    1005  This error is masked if 0 != (4 & m_error_mask).
    1006  If the error is masked, then the surrogate pair is
    1007  decoded, the value of the resulting unicode code point
    1008  is used, and parsing continues.
    1009  8: An overlong UTF-8 encoding sequence was encountered and
    1010  the value of the overlong sUTF-8 equence was a valid
    1011  unicode code point.
    1012  This error is masked if 0 != (8 & m_error_mask).
    1013  If the error is masked, then the unicode code point
    1014  is used and parsing continues.
    1015  16: An illegal UTF-8, UTF-16 or UTF-32 encoding sequence occured
    1016  or an invalid unicode code point value resulted from decoding
    1017  a UTF-8 sequence.
    1018  This error is masked if 0 != (16 & m_error_mask).
    1019  If the error is masked and the value of error_code_point is
    1020  a valid unicode code point, then error_code_point is encoded
    1021  in the output string and parsing continues.
    1022 
    1023  error_mask - [in]
    1024  If 0 != (error_mask & 4), then type 4 errors are masked.
    1025  If 0 != (error_mask & 8), then type 8 errors are masked.
    1026  If 0 != (error_mask & 16) and error_code_point is a valid unicode
    1027  code point value, then type 16 errors are masked.
    1028 
    1029  error_code_point - [in]
    1030  Unicode code point value to use in when masking type 16 errors.
    1031  If 0 == (error_mask & 16), then this parameter is ignored.
    1032  0xFFFD is a popular choice for the error_code_point value.
    1033 
    1034  sEndElement - [out]
    1035  If sEndElement is not null, then *sEndElement points to the
    1036  element of sInputUTF[] were conversion stopped.
    1037 
    1038  If an error occured and was not masked, then *sEndElement points
    1039  to the element of sInputUTF[] where the conversion failed.
    1040  If no errors occured or all errors were masked, then
    1041  *sEndElement = sInputUTF + sInputUTF_count or points to
    1042  the zero terminator in sInputUTF[], depending on the input
    1043  value of sInputUTF_count.
    1044 
    1045 Returns:
    1046  A UTF-XX encoded std::wstring.
    1047  The returned string does not have a byte order mark (BOM).
    1048 */
    1049 ON_DECL
    1050 std::wstring ON_UTF32_to_std_wstring(
    1051  int bTestByteOrder,
    1052  const ON__UINT32* sInputUTF,
    1053  int sInputUTF_count,
    1054  unsigned int* error_status,
    1055  unsigned int error_mask,
    1056  ON__UINT32 error_code_point,
    1057  const ON__UINT32** sEndElement
    1058  ) ON_NOEXCEPT;
    1059 
    1060 /*
    1061 Description:
    1062  Convert a UTF-XX encoded wchar_t string to a UTF-XX encoded std::wstring.
    1063  This function removes byte order marks (BOM) and can repair encoding
    1064  errors.
    1065 
    1066  The value of sizeof(wchar_t) determines which UTF-XX encoding is used.
    1067  sizeof(wchar_t) UTF-XX
    1068  1 UTF-8
    1069  2 UTF-16
    1070  4 UTF-32
    1071 
    1072 Parameters:
    1073  bTestByteOrder - [in]
    1074  If bTestByteOrder is true and the the input buffer is a
    1075  byte order mark (BOM), then the BOM is skipped. It the value
    1076  of the BOM is byte swapped, then subsequent input elements are
    1077  byte swapped before being decoded. Specifically:
    1078  - If the size of an input buffer element is 1 byte and the
    1079  values of the first three input elements are a UTF-8 BOM
    1080  (0xEF, 0xBB, 0xBF), then the first three input elements are
    1081  ignored and decoding begins at the forth input element.
    1082  - If the size of an input buffer element is 2 bytes and the value
    1083  of the first element is a UTF-16 BOM (0xFEFF), then the first
    1084  element is ignored and decoding begins with the second element.
    1085  - If the size of an input buffer element is 2 bytes and the value
    1086  of the first element is a byte swapped UTF-16 BOM (0xFFFE),
    1087  then the first element is ignored, decoding begins with the
    1088  second element, and input element bytes are swapped before
    1089  being decoded.
    1090  - If the size of an input buffer element is 4 bytes and the value
    1091  of the first element is a UTF-32 BOM (0x0000FEFF), then the
    1092  first element is ignored and decoding begins with the second
    1093  element.
    1094  - If the size of an input buffer element is 4 bytes and the value
    1095  of the first element is bytes swapped UTF-32 BOM (0xFFFE0000),
    1096  then the first element is ignored, decoding begins with the
    1097  second element, and input element bytes are swapped before
    1098  being decoded.
    1099  - In all other cases the first element of the input buffer is
    1100  decoded and no byte swapping is performed.
    1101 
    1102  sInputUTF - [in]
    1103  UTF-XX encoded wchar_t string to convert.
    1104 
    1105  sInputUTF_count - [in]
    1106  If sInputUTF_count >= 0, then it specifies the number of
    1107  elements in sInputUTF[] to convert.
    1108 
    1109  If sInputUTF_count == -1, then sInputUTF must be a zero
    1110  terminated array and all the elements up to the first zero
    1111  element are converted.
    1112 
    1113  error_status - [out]
    1114  If error_status is not null, then bits of *error_status are
    1115  set to indicate the success or failure of the conversion.
    1116  When the error_mask parameter is used to used to mask some
    1117  conversion errors, multiple bits may be set.
    1118  0: Successful conversion with no errors.
    1119  1: The input parameters were invalid.
    1120  This error cannot be masked.
    1121  2: The ouput buffer was not large enough to hold the converted
    1122  string. As much conversion as possible is performed in this
    1123  case and the error cannot be masked.
    1124  4: When parsing a UTF-8 or UTF-32 string, the values of two
    1125  consecutive encoding sequences formed a valid UTF-16
    1126  surrogate pair.
    1127  This error is masked if 0 != (4 & m_error_mask).
    1128  If the error is masked, then the surrogate pair is
    1129  decoded, the value of the resulting unicode code point
    1130  is used, and parsing continues.
    1131  8: An overlong UTF-8 encoding sequence was encountered and
    1132  the value of the overlong sUTF-8 equence was a valid
    1133  unicode code point.
    1134  This error is masked if 0 != (8 & m_error_mask).
    1135  If the error is masked, then the unicode code point
    1136  is used and parsing continues.
    1137  16: An illegal UTF-8, UTF-16 or UTF-32 encoding sequence occured
    1138  or an invalid unicode code point value resulted from decoding
    1139  a UTF-8 sequence.
    1140  This error is masked if 0 != (16 & m_error_mask).
    1141  If the error is masked and the value of error_code_point is
    1142  a valid unicode code point, then error_code_point is encoded
    1143  in the output string and parsing continues.
    1144 
    1145  error_mask - [in]
    1146  If 0 != (error_mask & 4), then type 4 errors are masked.
    1147  If 0 != (error_mask & 8), then type 8 errors are masked.
    1148  If 0 != (error_mask & 16) and error_code_point is a valid unicode
    1149  code point value, then type 16 errors are masked.
    1150 
    1151  error_code_point - [in]
    1152  Unicode code point value to use in when masking type 16 errors.
    1153  If 0 == (error_mask & 16), then this parameter is ignored.
    1154  0xFFFD is a popular choice for the error_code_point value.
    1155 
    1156  end_element_index - [out]
    1157  If end_element_index is not null, then *end_element_index is the
    1158  index of the first element in sInputUTF that was not converted.
    1159 
    1160  If an error occured and was not masked, then *end_element_index
    1161  is the index of the element of sInputUTF[] where the conversion
    1162  failed.
    1163  If no errors occured or all errors were masked, then
    1164  *end_element_index is the number of elements in sInputUTF[] that
    1165  were converted.
    1166 
    1167 Returns:
    1168  A UTF-XX encoded std::wstring.
    1169  The returned string does not have a byte order mark (BOM).
    1170 */
    1171 std::wstring ON_UTF_WideChar_to_std_wstring(
    1172  int bTestByteOrder,
    1173  const wchar_t* sInputUTF,
    1174  int sInputUTF_count,
    1175  unsigned int* error_status,
    1176  unsigned int error_mask,
    1177  ON__UINT32 error_code_point,
    1178  int* end_element_index
    1179  ) ON_NOEXCEPT;
    1180 
    1181 /*
    1182 Description:
    1183  Convert a UTF-8 encoded std::string to a UTF-XX encoded std::wstring.
    1184  This function removes byte order marks (BOM) and can repair encoding
    1185  errors.
    1186 
    1187  The value of sizeof(wchar_t) determines which UTF-XX encoding is used.
    1188  sizeof(wchar_t) UTF-XX
    1189  1 UTF-8
    1190  2 UTF-16
    1191  4 UTF-32
    1192 
    1193 Parameters:
    1194  bTestByteOrder - [in]
    1195  If bTestByteOrder is true and the the input buffer is a
    1196  byte order mark (BOM), then the BOM is skipped. It the value
    1197  of the BOM is byte swapped, then subsequent input elements are
    1198  byte swapped before being decoded. Specifically:
    1199  - If the size of an input buffer element is 1 byte and the
    1200  values of the first three input elements are a UTF-8 BOM
    1201  (0xEF, 0xBB, 0xBF), then the first three input elements are
    1202  ignored and decoding begins at the forth input element.
    1203  - If the size of an input buffer element is 2 bytes and the value
    1204  of the first element is a UTF-16 BOM (0xFEFF), then the first
    1205  element is ignored and decoding begins with the second element.
    1206  - If the size of an input buffer element is 2 bytes and the value
    1207  of the first element is a byte swapped UTF-16 BOM (0xFFFE),
    1208  then the first element is ignored, decoding begins with the
    1209  second element, and input element bytes are swapped before
    1210  being decoded.
    1211  - If the size of an input buffer element is 4 bytes and the value
    1212  of the first element is a UTF-32 BOM (0x0000FEFF), then the
    1213  first element is ignored and decoding begins with the second
    1214  element.
    1215  - If the size of an input buffer element is 4 bytes and the value
    1216  of the first element is bytes swapped UTF-32 BOM (0xFFFE0000),
    1217  then the first element is ignored, decoding begins with the
    1218  second element, and input element bytes are swapped before
    1219  being decoded.
    1220  - In all other cases the first element of the input buffer is
    1221  decoded and no byte swapping is performed.
    1222 
    1223  sInputUTF - [in]
    1224  UTF-8 encoded std::string to convert.
    1225 
    1226 
    1227  sInputUTF_count - [in]
    1228  If sInputUTF_count >= 0, then it specifies the number of
    1229  elements in sInputUTF[] to convert.
    1230 
    1231  If sInputUTF_count == -1, then sInputUTF must be a zero
    1232  terminated array and all the elements up to the first zero
    1233  element are converted.
    1234 
    1235  sUTF8 - [out]
    1236  If sUTF8 is not null and sUTF8_count > 0, then the UTF-8
    1237  encoded string is returned in this buffer. If there is room
    1238  for the null terminator, the converted string will be null
    1239  terminated. The null terminator is never included in the count
    1240  of returned by this function. The converted string is in the
    1241  CPU's native byte order. No byte order mark is prepended.
    1242 
    1243  sUTF8_count - [in]
    1244  If sUTF8_count > 0, then it specifies the number of available
    1245  ON__UINT8 elements in the sUTF8[] buffer.
    1246 
    1247  If sUTF8_count == 0, then the sUTF8 parameter is ignored.
    1248 
    1249  error_status - [out]
    1250  If error_status is not null, then bits of *error_status are
    1251  set to indicate the success or failure of the conversion.
    1252  When the error_mask parameter is used to used to mask some
    1253  conversion errors, multiple bits may be set.
    1254  0: Successful conversion with no errors.
    1255  1: The input parameters were invalid.
    1256  This error cannot be masked.
    1257  2: The ouput buffer was not large enough to hold the converted
    1258  string. As much conversion as possible is performed in this
    1259  case and the error cannot be masked.
    1260  4: When parsing a UTF-8 or UTF-32 string, the values of two
    1261  consecutive encoding sequences formed a valid UTF-16
    1262  surrogate pair.
    1263  This error is masked if 0 != (4 & m_error_mask).
    1264  If the error is masked, then the surrogate pair is
    1265  decoded, the value of the resulting unicode code point
    1266  is used, and parsing continues.
    1267  8: An overlong UTF-8 encoding sequence was encountered and
    1268  the value of the overlong sUTF-8 equence was a valid
    1269  unicode code point.
    1270  This error is masked if 0 != (8 & m_error_mask).
    1271  If the error is masked, then the unicode code point
    1272  is used and parsing continues.
    1273  16: An illegal UTF-8, UTF-16 or UTF-32 encoding sequence occured
    1274  or an invalid unicode code point value resulted from decoding
    1275  a UTF-8 sequence.
    1276  This error is masked if 0 != (16 & m_error_mask).
    1277  If the error is masked and the value of error_code_point is
    1278  a valid unicode code point, then error_code_point is encoded
    1279  in the output string and parsing continues.
    1280 
    1281  error_mask - [in]
    1282  If 0 != (error_mask & 4), then type 4 errors are masked.
    1283  If 0 != (error_mask & 8), then type 8 errors are masked.
    1284  If 0 != (error_mask & 16) and error_code_point is a valid unicode
    1285  code point value, then type 16 errors are masked.
    1286 
    1287  error_code_point - [in]
    1288  Unicode code point value to use in when masking type 16 errors.
    1289  If 0 == (error_mask & 16), then this parameter is ignored.
    1290  0xFFFD is a popular choice for the error_code_point value.
    1291 
    1292  end_element_index - [out]
    1293  If end_element_index is not null, then *end_element_index is the
    1294  index of the first element in sInputUTF that was not converted.
    1295 
    1296  If an error occured and was not masked, then *end_element_index
    1297  is the index of the element of sInputUTF[] where the conversion
    1298  failed.
    1299  If no errors occured or all errors were masked, then
    1300  *end_element_index is the number of elements in sInputUTF[] that
    1301  were converted.
    1302 
    1303 Returns:
    1304  A UTF-XX encoded std::wstring.
    1305  The returned string does not have a byte order mark (BOM).
    1306 */
    1307 ON_DECL
    1308 std::wstring ON_UTF_std_string_to_std_wstring(
    1309  int bTestByteOrder,
    1310  const std::string& sInputUTF,
    1311  int sInputUTF_count,
    1312  unsigned int* error_status,
    1313  unsigned int error_mask,
    1314  ON__UINT32 error_code_point,
    1315  int* end_element_index
    1316  ) ON_NOEXCEPT;
    1317 
    1318 #endif
    diff --git a/6/de/de8/class_o_n___instance_ref.html b/6/de/de8/class_o_n___instance_ref.html index 6740b1d2..866f5308 100644 --- a/6/de/de8/class_o_n___instance_ref.html +++ b/6/de/de8/class_o_n___instance_ref.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_InstanceRef Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -728,9 +726,9 @@ Additional Inherited Members
    diff --git a/6/de/df2/class_o_n___s_h_a1___hash-members.html b/6/de/df2/class_o_n___s_h_a1___hash-members.html index 560364a3..91ae41f7 100644 --- a/6/de/df2/class_o_n___s_h_a1___hash-members.html +++ b/6/de/df2/class_o_n___s_h_a1___hash-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/dfb/opennurbs__lock_8h_source.html b/6/de/dfb/opennurbs__lock_8h_source.html index b70e1f75..64431a29 100644 --- a/6/de/dfb/opennurbs__lock_8h_source.html +++ b/6/de/dfb/opennurbs__lock_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_lock.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_lock.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/dfd/opennurbs__intersect_8h_source.html b/6/de/dfd/opennurbs__intersect_8h_source.html index 20f4fe8a..4c930aab 100644 --- a/6/de/dfd/opennurbs__intersect_8h_source.html +++ b/6/de/dfd/opennurbs__intersect_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_intersect.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_intersect.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/de/dfe/opennurbs__windows__targetver_8h_source.html b/6/de/dfe/opennurbs__windows__targetver_8h_source.html index e11337b7..ba2c5f31 100644 --- a/6/de/dfe/opennurbs__windows__targetver_8h_source.html +++ b/6/de/dfe/opennurbs__windows__targetver_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_windows_targetver.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_windows_targetver.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined(ON_WINDOWS_TARGETVER_INC_)
    18 #define ON_WINDOWS_TARGETVER_INC_
    19 
    20 // Including SDKDDKVer.h defines the highest available Windows platform.
    21 
    22 // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
    23 // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
    24 
    25 #if defined(_MSC_VER)
    26 
    27 #if _MSC_VER >= 1700
    28 // Using Microsoft Visual Studio 2012 or later
    29 
    30 // Including SDKDDKVer.h defines the highest available Windows platform.
    31 
    32 // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
    33 // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
    34 #if !defined(RHINO_SDK_WINVER_H_INCLUDED_)
    35 
    36 
    37 #endif
    38 
    39 #pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
    40 #include <SDKDDKVer.h>
    41 #pragma ON_PRAGMA_WARNING_AFTER_DIRTY_INCLUDE
    42 
    43 #endif // _MSC_VER >= 1700
    44 
    45 
    46 #endif // defined(_MSC_VER)
    47 
    48 #endif
    diff --git a/6/df/d02/class_o_n__4i_rect.html b/6/df/d02/class_o_n__4i_rect.html index b75c02ea..c92ef97d 100644 --- a/6/df/d02/class_o_n__4i_rect.html +++ b/6/df/d02/class_o_n__4i_rect.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_4iRect Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d03/struct_o_n___serial_number_map_1_1_s_n___e_l_e_m_e_n_t.html b/6/df/d03/struct_o_n___serial_number_map_1_1_s_n___e_l_e_m_e_n_t.html index aea4bef1..343cb7bd 100644 --- a/6/df/d03/struct_o_n___serial_number_map_1_1_s_n___e_l_e_m_e_n_t.html +++ b/6/df/d03/struct_o_n___serial_number_map_1_1_s_n___e_l_e_m_e_n_t.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_SerialNumberMap::SN_ELEMENT Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d05/class_o_n___buffer.html b/6/df/d05/class_o_n___buffer.html index 151b0a34..d11fdbf7 100644 --- a/6/df/d05/class_o_n___buffer.html +++ b/6/df/d05/class_o_n___buffer.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Buffer Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Parameters: buffer_size - [in] new size of buffer. Returns: True if successful.
    -Remarks: The current position is not changed and may be beyond the end of the file. Use Seek to set the current position after calling ChangeSize().

    +

    Parameters: buffer_size - [in] new size of buffer. Returns: True if successful. Remarks: The current position is not changed and may be beyond the end of the file. Use Seek to set the current position after calling ChangeSize().

    @@ -736,9 +733,9 @@ Remarks: The current position is not changed and may be beyond the end of the fi diff --git a/6/df/d0d/class_o_n___brep_region_topology-members.html b/6/df/d0d/class_o_n___brep_region_topology-members.html index f090da5c..37ab69d9 100644 --- a/6/df/d0d/class_o_n___brep_region_topology-members.html +++ b/6/df/d0d/class_o_n___brep_region_topology-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d10/class_o_n__3dm_annotation_settings.html b/6/df/d10/class_o_n__3dm_annotation_settings.html index 4b73e7a9..0b53b184 100644 --- a/6/df/d10/class_o_n__3dm_annotation_settings.html +++ b/6/df/d10/class_o_n__3dm_annotation_settings.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmAnnotationSettings Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d10/class_o_n___lock.html b/6/df/d10/class_o_n___lock.html index b406a3bc..25ac1b48 100644 --- a/6/df/d10/class_o_n___lock.html +++ b/6/df/d10/class_o_n___lock.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Lock Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    enum  : int { UnlockedValue = 0, DefaultLockedValue = 1, InvalidLockValue = -1 - } - ON_Lock::InvalidLockValue (= -1) may never be used as a lock value. More...
    + } ON_Lock::InvalidLockValue (= -1) may never be used as a lock value. More...
    +  

    @@ -106,12 +104,7 @@ Public Member Functions

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////
    -Description: ON_Lock is a thread safe lock semephore. It is implemented using platform specfic compare and set functions.

    +

    / / Copyright (c) 1993-2013 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// Description: ON_Lock is a thread safe lock semephore. It is implemented using platform specfic compare and set functions.

    Member Enumeration Documentation

    ◆ anonymous enum

    @@ -351,9 +344,9 @@ Description: ON_Lock
    diff --git a/6/df/d11/class_o_n___mesh.html b/6/df/d11/class_o_n___mesh.html index 9d743fe6..d2a7c0cd 100644 --- a/6/df/d11/class_o_n___mesh.html +++ b/6/df/d11/class_o_n___mesh.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Mesh Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    mesh editing
    -Description: Replace a mesh edge with a vertex at its center and update adjacent faces as needed. Parameters: topei - [in] index of edge in MeshTopology().m_tope[] array Returns: true if successful.

    +

    mesh editing Description: Replace a mesh edge with a vertex at its center and update adjacent faces as needed. Parameters: topei - [in] index of edge in MeshTopology().m_tope[] array Returns: true if successful.

    @@ -1260,8 +1257,8 @@ Description: Replace a mesh edge with a vertex at its center and update adjacent

    Description: Splits non-planer quads into two triangles.

    -

    Parameters: planar_tolerance - [in] If planar_tolerance >= 0, then a quad is split if its vertices are not coplaner.
    - If both planar_tolerance = ON_UNSET_VALUE and angle_tolerance_radians >= 0.0, then the planarity test is skipped.

    +

    Parameters: planar_tolerance - [in] If planar_tolerance >= 0, then a quad is split if its vertices are not coplaner.

    +

    If both planar_tolerance = ON_UNSET_VALUE and angle_tolerance_radians >= 0.0, then the planarity test is skipped.

    If both planar_tolerance = ON_UNSET_VALUE and angle_tolerance_radians = ON_UNSET_VALUE, then all quads are split.

    angle_tolerance_radians - [in] If angle_tolerance_radians >= 0.0, then a quad is split if the angle between opposite corner normals is > angle_tolerance_radians. The corner normal is the normal to the triangle formed by two adjacent edges and the diagonal connecting their endpoints. A quad has for corner normals.

    If both angle_tolerance_radians = ON_UNSET_VALUE and planar_tolerance >= 0.0, then the corner normal angle test is skipped.

    @@ -1944,8 +1941,7 @@ Description: Replace a mesh edge with a vertex at its center and update adjacent

    Implementation - mesh geometry.

    -

    Vertex locations In a case where adjacent facets share a vertex location but have distinct normals or texture coordinates at that location, the vertex must be duplicated.
    - Description: Get double precision vertices. If they do not exist, they will be created and match the existing single precision vertices. Returns: Array of double precision vertices. If you modify the values in this array, you must make the same modifications to the single precision vertices, or call UpdateSinglePrecisonVertices(). Example:

    +

    Vertex locations In a case where adjacent facets share a vertex location but have distinct normals or texture coordinates at that location, the vertex must be duplicated. Description: Get double precision vertices. If they do not exist, they will be created and match the existing single precision vertices. Returns: Array of double precision vertices. If you modify the values in this array, you must make the same modifications to the single precision vertices, or call UpdateSinglePrecisonVertices(). Example:

    / add a bunch of double precision information ON_3dPointArray& dv = mesh.DoublePrecisionVertices(); for ( i = 0; i < lots; i++ ) { dv[i] = ... } / This call updates the single precison values / in m_V[] and sets all the counts and CRCs that / are used in validity checking. mesh.UpdateSinglePrecisonVertices();

    Remarks: Avoid mulitple calls to DoublePrecisionVertices(). It is most efficient to make one call, save a local reference, and use the local reference as needed.

    @@ -2358,8 +2354,7 @@ Description: Replace a mesh edge with a vertex at its center and update adjacent
    -

    mesh components ON_Mesh objects can consist of sets of faces that are isolated from any other sets of faces. The following 2 functions will dissect a mesh into these sets, called components. Not to be confused with ON_COMPONENT_INDEX.
    -Description: Calculates the components of a mesh and sets a label for each face in the facet_component_labels array. Parameters: bUseVertexConnections- [in] If this parameter is true, then facets that share a common vertex are considered connected. If this parameter is false, then facets must share an edge to be considered connected. bUseTopologicalConnections - [in] If this parameter is true, then geometric location is used to determine if facets are connected. If this parameter is false, then facets must share the same vertex or vertices to be considered connected. facet_component_labels- [out] facet_component_labels[] will be an array with the same size as ON_Mesh.m_F.Count() and facet_component_labels[i] is the component id m_F[i] belongs to. The component id will be 1 to the number of compoents. Returns: Number of components on success, 0 on failure

    +

    mesh components ON_Mesh objects can consist of sets of faces that are isolated from any other sets of faces. The following 2 functions will dissect a mesh into these sets, called components. Not to be confused with ON_COMPONENT_INDEX. Description: Calculates the components of a mesh and sets a label for each face in the facet_component_labels array. Parameters: bUseVertexConnections- [in] If this parameter is true, then facets that share a common vertex are considered connected. If this parameter is false, then facets must share an edge to be considered connected. bUseTopologicalConnections - [in] If this parameter is true, then geometric location is used to determine if facets are connected. If this parameter is false, then facets must share the same vertex or vertices to be considered connected. facet_component_labels- [out] facet_component_labels[] will be an array with the same size as ON_Mesh.m_F.Count() and facet_component_labels[i] is the component id m_F[i] belongs to. The component id will be 1 to the number of compoents. Returns: Number of components on success, 0 on failure

    @@ -2470,8 +2465,7 @@ Description: Calculates the components of a mesh and sets a label for each face
    -

    Description: Get a list of the sides of every face. Parameters: Vid - [in] (can be null) If Vid is null, then the mesh m_V[] index values are used to set the ON_MeshFaceSide::vi[] values. If Vid is not null, then it must be an array of length VertexCount(). The value Vid[mesh m_V[] index] will be used to set the ON_MeshFaceSide::vi[] values. sides - [out] If the input value of sides is not null, then sides[] must be long enough to hold the returned side list. The maximum posssible length is 4*FaceCount() for a mesh contining FaceCount() nondegenerate quads. If the input value of sides is null, memory will be allocated using onmalloc() and the caller is responsible for calling onfree() at an appropriate time. This function fills in the sides[] array with face side information. The returned list is sorted by sides[].fi and the sides[].side and each element has vi[0] <= vi[1].
    - The function ON_SortMeshFaceSidesByVertexIndex() can be used to sort the list by the sides[].vi[] values. Returns: Number of elements added to sides[]. Remarks: Faces with out of range ON_MeshFace.vi[] values are skipped. Degenerate faces are processed, but degenerate sides (equal vertex indices) are not added to the list.

    +

    Description: Get a list of the sides of every face. Parameters: Vid - [in] (can be null) If Vid is null, then the mesh m_V[] index values are used to set the ON_MeshFaceSide::vi[] values. If Vid is not null, then it must be an array of length VertexCount(). The value Vid[mesh m_V[] index] will be used to set the ON_MeshFaceSide::vi[] values. sides - [out] If the input value of sides is not null, then sides[] must be long enough to hold the returned side list. The maximum posssible length is 4*FaceCount() for a mesh contining FaceCount() nondegenerate quads. If the input value of sides is null, memory will be allocated using onmalloc() and the caller is responsible for calling onfree() at an appropriate time. This function fills in the sides[] array with face side information. The returned list is sorted by sides[].fi and the sides[].side and each element has vi[0] <= vi[1]. The function ON_SortMeshFaceSidesByVertexIndex() can be used to sort the list by the sides[].vi[] values. Returns: Number of elements added to sides[]. Remarks: Faces with out of range ON_MeshFace.vi[] values are skipped. Degenerate faces are processed, but degenerate sides (equal vertex indices) are not added to the list.

    @@ -2912,8 +2906,7 @@ Description: Calculates the components of a mesh and sets a label for each face
    -

    Double precision vertex support
    -Returns: True if the mesh vertex count is > 0, the mesh has single and double precision vertices, and the values of the locations are synchronized.

    +

    Double precision vertex support Returns: True if the mesh vertex count is > 0, the mesh has single and double precision vertices, and the values of the locations are synchronized.

    @@ -3213,8 +3206,7 @@ Returns: True if the mesh vertex count is > 0, the mesh has single and double
    -

    Interface
    -Returns true if there are zero vertices or zero faces.

    +

    Interface Returns true if there are zero vertices or zero faces.

    @@ -3795,8 +3787,7 @@ Returns true if there are zero vertices or zero faces.

    N-gon

    An n-gon is a collection of faces that are grouped together. The outer boundary of the face collection must be a closed polyline.

    -

    N-gon interface
    -Number of n-gons in this mesh.

    +

    N-gon interface Number of n-gons in this mesh.

    @@ -4159,8 +4150,7 @@ Number of n-gons in this mesh.

    Description: For each ngon with index in the specified range that has interior vertices, remove the interior vertices and triangluate the ngon. Parameters: vertex_face_map - [in]

    • Pass null if you don't have one.
    • See ON_MeshVertexFaceMap for details about making one. The only reason to pass one in is because you need it for other reasons or you already have one.
    • -
    • If true is returned, then the information in this vertex_face_map will be invalid because vertices will be removed. ngon_index0 - [in] ngon_index1 - [in] ngons with indices ni satisfying ngon_index0 <= ni < ngon_index1 will be separated. To separate every ngon in a mesh, pass ngon_index0 = 0 and ngon_index1 = mesh->NgonCount().
      -Returns: true one or more vertices were removed and one or more ngons were triangluated. This changes the mesh's vertex and face information and invalidates any input vertex_face_map. false The mesh was not modified. Remarks: If true is returned and you are finished modify the mesh, then call ON_Mesh::Compact() or ON_Mesh::CullUnusedVertices() to remove the unreferenced interior vertices.
    • +
    • If true is returned, then the information in this vertex_face_map will be invalid because vertices will be removed. ngon_index0 - [in] ngon_index1 - [in] ngons with indices ni satisfying ngon_index0 <= ni < ngon_index1 will be separated. To separate every ngon in a mesh, pass ngon_index0 = 0 and ngon_index1 = mesh->NgonCount(). Returns: true one or more vertices were removed and one or more ngons were triangluated. This changes the mesh's vertex and face information and invalidates any input vertex_face_map. false The mesh was not modified. Remarks: If true is returned and you are finished modify the mesh, then call ON_Mesh::Compact() or ON_Mesh::CullUnusedVertices() to remove the unreferenced interior vertices.
    @@ -4301,8 +4291,7 @@ Returns: true one or more vertices were removed and one or more ngons were trian

    Description: For each ngon with index in the specified range, duplicate vertices as needed so that the ngon does not share any vertices with faces that do not belong to the ngon. Parameters: vertex_face_map - [in]

    • Pass null if you don't have one.
    • See ON_MeshVertexFaceMap for details about making one. The only reason to pass one in is because you need it for other reasons or you already have one.
    • -
    • Note that if true is returned, then the information in this vertex_face_map will be changed and no information will be added for the new vertices. ngon_index0 - [in] ngon_index1 - [in] ngons with indices ni satisfying ngon_index0 <= ni < ngon_index1 will be separated. To separate every ngon in a mesh, pass ngon_index0 = 0 and ngon_index1 = mesh->NgonCount().
      -Returns: true one or more vertices were duplicated to separate an ngon from it's neighboring faces. This changes the mesh's vertex and face information and invalidates any input vertex_face_map. false The mesh was not modified.
    • +
    • Note that if true is returned, then the information in this vertex_face_map will be changed and no information will be added for the new vertices. ngon_index0 - [in] ngon_index1 - [in] ngons with indices ni satisfying ngon_index0 <= ni < ngon_index1 will be separated. To separate every ngon in a mesh, pass ngon_index0 = 0 and ngon_index1 = mesh->NgonCount(). Returns: true one or more vertices were duplicated to separate an ngon from it's neighboring faces. This changes the mesh's vertex and face information and invalidates any input vertex_face_map. false The mesh was not modified.
    @@ -4356,8 +4345,7 @@ Returns: true one or more vertices were duplicated to separate an ngon from it's
    -

    Description: Expert user function to set m_is_closed member.
    - Setting this value correctly after a mesh is constructed can save time when IsClosed() is called. This function sets the private member variable m_is_closed. Paramters: closed - [in] 0: The mesh is not closed. There is at least one face with an edge that is geometrically distinct (as an unoriented line segment) from all other edges. 1: The mesh is closed. Every geometrically distict edge is used by two or more faces.

    +

    Description: Expert user function to set m_is_closed member. Setting this value correctly after a mesh is constructed can save time when IsClosed() is called. This function sets the private member variable m_is_closed. Paramters: closed - [in] 0: The mesh is not closed. There is at least one face with an edge that is geometrically distinct (as an unoriented line segment) from all other edges. 1: The mesh is closed. Every geometrically distict edge is used by two or more faces.

    @@ -4423,8 +4411,7 @@ Returns: true one or more vertices were duplicated to separate an ngon from it's
    -

    Description: For each ngon with index in the specified range, all vertices in the ngon will have their vertex normal set to the normal of the first face in the ngon. Parameters: ngon_index0 - [in] ngon_index1 - [in] ngons with indices ni satisfying ngon_index0 <= ni < ngon_index1 will be separated. To separate every ngon in a mesh, pass ngon_index0 = 0 and ngon_index1 = mesh->NgonCount().
    -Returns: true one or more vertices were duplicated to separate an ngon from it's neighboring faces. This changes the mesh's vertex and face information and invalidates any input vertex_face_map. false The mesh was not modified.

    +

    Description: For each ngon with index in the specified range, all vertices in the ngon will have their vertex normal set to the normal of the first face in the ngon. Parameters: ngon_index0 - [in] ngon_index1 - [in] ngons with indices ni satisfying ngon_index0 <= ni < ngon_index1 will be separated. To separate every ngon in a mesh, pass ngon_index0 = 0 and ngon_index1 = mesh->NgonCount(). Returns: true one or more vertices were duplicated to separate an ngon from it's neighboring faces. This changes the mesh's vertex and face information and invalidates any input vertex_face_map. false The mesh was not modified.

    @@ -4489,8 +4476,7 @@ Returns: true one or more vertices were duplicated to separate an ngon from it's
    -

    Description: Expert user function to set m_is_solid member.
    - Setting this value correctly after a mesh is constructed can save time when IsSolid() is called. This function sets the private member variable m_is_solid. If solid is nonzero, it will set m_is_closed to 1. Paramters: solid - [in] 0: The mesh is not an oriented manifold solid mesh. Either the mesh is not closed, not manifold, or the faces are not oriented compatibly. 1: The mesh is an oriented manifold solid whose face normals point outwards. -1: The mesh is an oriented manifold solid whose face normals point inwards.

    +

    Description: Expert user function to set m_is_solid member. Setting this value correctly after a mesh is constructed can save time when IsSolid() is called. This function sets the private member variable m_is_solid. If solid is nonzero, it will set m_is_closed to 1. Paramters: solid - [in] 0: The mesh is not an oriented manifold solid mesh. Either the mesh is not closed, not manifold, or the faces are not oriented compatibly. 1: The mesh is an oriented manifold solid whose face normals point outwards. -1: The mesh is an oriented manifold solid whose face normals point inwards.

    @@ -5124,10 +5110,7 @@ Returns: true one or more vertices were duplicated to separate an ngon from it's
    -

    mesh N-gon lists.
    -
    - ON_Mesh objects support faces that are triangle or quads. When a mesh is created from a format that supports N-gons for N larger than 4, an optional N-gon list can be added that specifies the vertices and faces that make up the N-gon.
    -Description: If the mesh has an N-gon list, return a pointer to it. Returns: A pointer to the current N-gon list or nullptr.

    +

    mesh N-gon lists. ON_Mesh objects support faces that are triangle or quads. When a mesh is created from a format that supports N-gons for N larger than 4, an optional N-gon list can be added that specifies the vertices and faces that make up the N-gon. Description: If the mesh has an N-gon list, return a pointer to it. Returns: A pointer to the current N-gon list or nullptr.

    @@ -5228,8 +5211,8 @@ Description: If the mesh has an N-gon list, return a pointer to it. Returns: A p
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -5631,9 +5614,7 @@ Description: If the mesh has an N-gon list, return a pointer to it. Returns: A p

    If m_T.Count() == m_V.Count(), then the mesh has texture coordinates and m_T[j] is the texture coordinate for vertex m_V[j].

    When opennurbs or Rhino meshes an ON_Surface or ON_Brep, the texture coordinates have a "canonical" linear relationship with the surface parameters that is described in the next section. However, various mappings, spherical, planar, cylindrical, etc., can be applied that change the values of the texture coordinates.

    -

    If a texture mapping function was used to set the m_T[] values, then the id and serial number of the mapping function is saved in m_mapping_id and m_mapping_sn. The intended use of these fields is to make it easy to avoid unnecessary recalculation.
    -
    -If a mesh is modified, then m_mapping_id should be set to nil and m_mapping_crc should be set to 0. Implementation - surface parameters and packed texture information

    +

    If a texture mapping function was used to set the m_T[] values, then the id and serial number of the mapping function is saved in m_mapping_id and m_mapping_sn. The intended use of these fields is to make it easy to avoid unnecessary recalculation. If a mesh is modified, then m_mapping_id should be set to nil and m_mapping_crc should be set to 0. Implementation - surface parameters and packed texture information

    If m_S.Count() == m_V.Count(), then the mesh is a tesselation of a parameteric surface and m_S[j] is the surface parameter at m_V[j]. Storing values in m_S[] is OPTIONAL.

    If m_srf_scale[] has positive values, then they report the world coordinate size of a rectangle that would minimize texture distortion if it were mapped to the mesh using normalized surface evaluation parameters. This information is used to calculate high quality packed texture coordinates.

    @@ -5805,9 +5786,9 @@ If a mesh is modified, then m_mapping_id should be set to nil and m_mapping_crc
    diff --git a/6/df/d15/opennurbs__public__version_8h_source.html b/6/df/d15/opennurbs__public__version_8h_source.html index 03ffcc87..59e3bdb0 100644 --- a/6/df/d15/opennurbs__public__version_8h_source.html +++ b/6/df/d15/opennurbs__public__version_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_public_version.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_public_version.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    opennurbs_public_version.h
    -
    1 #pragma once
    2 
    3 // This file is included by BOTH RC files and C++ files
    4 // This means you have a very limited set of preprocessor instructions
    5 // at your disposal.
    6 
    7 // To update version numbers, edit ..\build\build_dates.msbuild
    8 #define RMA_VERSION_MAJOR 7
    9 #define RMA_VERSION_MINOR 0
    10 
    11 ////////////////////////////////////////////////////////////////
    12 //
    13 // These are set automatically by the build system as the
    14 // first step in each build.
    15 //
    16 #define RMA_VERSION_YEAR 2018
    17 #define RMA_VERSION_MONTH 1
    18 #define RMA_VERSION_DATE 17
    19 #define RMA_VERSION_HOUR 1
    20 #define RMA_VERSION_MINUTE 0
    21 
    22 ////////////////////////////////////////////////////////////////
    23 //
    24 // branch = 0 to 3
    25 // This number identifies the branch used in the build.
    26 //
    27 // The build system automatically sets the value to
    28 // 1, 2 or 3 before compiling any code.
    29 //
    30 // The file checked into the source code repository
    31 // always has branch set to 0.
    32 // 0 = developer build
    33 // 1 = build system trunk build
    34 // 2 = build system release candidate build
    35 // 3 = build system release build
    36 #define RMA_VERSION_BRANCH 0
    37 
    38 #define VERSION_WITH_COMMAS 7,0,18017,1000
    39 #define VERSION_WITH_PERIODS 7.0.18017.01000
    40 #define COPYRIGHT "Copyright (C) 1993-2018, Robert McNeel & Associates. All Rights Reserved."
    41 #define SPECIAL_BUILD_DESCRIPTION "Public OpenNURBS C++ 3dm file IO library."
    42 
    43 #define RMA_VERSION_NUMBER_MAJOR_STRING "7"
    44 #define RMA_VERSION_NUMBER_MAJOR_WSTRING L"7"
    45 #define RMA_PREVIOUS_VERSION_NUMBER_MAJOR_WSTRING L"6"
    46 
    47 #define RMA_VERSION_NUMBER_SR_STRING "SR0"
    48 #define RMA_VERSION_NUMBER_SR_WSTRING L"SR0"
    49 
    50 #define RMA_VERSION_WITH_PERIODS_STRING "7.0.18017.01000"
    51 #define RMA_VERSION_WITH_PERIODS_WSTRING L"7.0.18017.01000"
    52 
    53 
    54 
    55 // git revision SHA-1 hash as char hexadecimal string
    56 #define RMA_GIT_REVISION_HASH_STRING ""
    57 #define RMA_GIT_REVISION_HASH_WSTRING L""
    58 
    59 // git branch name as char string
    60 #define RMA_GIT_BRANCH_NAME_STRING ""
    61 #define RMA_GIT_BRANCH_NAME_WSTRING L""
    62 
    63 
    64 
    65 // RHINO_FILE_FLAGS_MASK can be one or more of the following:
    66 // VS_FF_DEBUG - File contains debugging information or is compiled with debugging features enabled.
    67 // VS_FF_PATCHED - File has been modified and is not identical to the original shipping file of the same version number.
    68 // VS_FF_PRERELEASE - File is a development version, not a commercially released product.
    69 // VS_FF_PRIVATEBUILD - File was not built using standard release procedures. If this value is given, the StringFileInfo block must contain a PrivateBuild string.
    70 // VS_FF_SPECIALBUILD - File was built by the original company using standard release procedures but is a variation of the standard file of the same version number. If this value is given, the StringFileInfo block block must contain a SpecialBuild string.
    71 #if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) || defined(WINDOWS) || defined(_WINDOWS_) || defined(__WINDOWS__)
    72 #if !defined(VS_FF_PRERELEASE)
    73 // At this time, verrsrc.h does not have protection against multiple includes.
    74 // Testing for VS_FF_PRERELEASE seems to prevent double incudes and the
    75 // redef errors it generates.
    76 #include "verrsrc.h"
    77 #endif
    78 #endif
    79 
    80 #define RHINO_FILE_FLAGS_MASK VS_FF_PRERELEASE
    81 
    82 
    +
    1 #pragma once
    2 
    3 // This file is included by BOTH RC files and C++ files
    4 // This means you have a very limited set of preprocessor instructions
    5 // at your disposal.
    6 
    7 #define RMA_VERSION_MAJOR 6
    8 #define RMA_VERSION_MINOR 1
    9 
    10 ////////////////////////////////////////////////////////////////
    11 //
    12 // These are set automatically by the build system as the
    13 // first step in each build.
    14 //
    15 #define RMA_VERSION_YEAR 2018
    16 #define RMA_VERSION_MONTH 1
    17 #define RMA_VERSION_DATE 26
    18 #define RMA_VERSION_HOUR 4
    19 #define RMA_VERSION_MINUTE 53
    20 
    21 ////////////////////////////////////////////////////////////////
    22 //
    23 // branch = 0 to 3
    24 // This number identifies the branch used in the build.
    25 //
    26 // The build system automatically sets the value to
    27 // 1, 2 or 3 before compiling any code.
    28 //
    29 // The file checked into the source code repository
    30 // always has branch set to 0.
    31 // 0 = developer build
    32 // 1 = build system trunk build
    33 // 2 = build system release candidate build
    34 // 3 = build system release build
    35 #define RMA_VERSION_BRANCH 1
    36 
    37 #define VERSION_WITH_COMMAS 6,1,18026,4531
    38 #define VERSION_WITH_PERIODS 6.1.18026.04531
    39 #define COPYRIGHT "Copyright (C) 1993-2018, Robert McNeel & Associates. All Rights Reserved."
    40 #define SPECIAL_BUILD_DESCRIPTION "Public OpenNURBS C++ 3dm file IO library."
    41 
    42 #define RMA_VERSION_NUMBER_MAJOR_STRING "6"
    43 #define RMA_VERSION_NUMBER_MAJOR_WSTRING L"6"
    44 
    45 #define RMA_VERSION_NUMBER_SR_STRING "SR1"
    46 #define RMA_VERSION_NUMBER_SR_WSTRING L"SR1"
    47 
    48 #define RMA_VERSION_WITH_PERIODS_STRING "6.1.18026.04531"
    49 #define RMA_VERSION_WITH_PERIODS_WSTRING L"6.1.18026.04531"
    50 
    51 
    52 
    53 // git revision SHA-1 hash as char hexadecimal string
    54 #define RMA_GIT_REVISION_HASH_STRING ""
    55 #define RMA_GIT_REVISION_HASH_WSTRING L""
    56 
    57 // git branch name as char string
    58 #define RMA_GIT_BRANCH_NAME_STRING ""
    59 #define RMA_GIT_BRANCH_NAME_WSTRING L""
    60 
    61 
    62 
    63 // RHINO_FILE_FLAGS_MASK can be one or more of the following:
    64 // VS_FF_DEBUG - File contains debugging information or is compiled with debugging features enabled.
    65 // VS_FF_PATCHED - File has been modified and is not identical to the original shipping file of the same version number.
    66 // VS_FF_PRERELEASE - File is a development version, not a commercially released product.
    67 // VS_FF_PRIVATEBUILD - File was not built using standard release procedures. If this value is given, the StringFileInfo block must contain a PrivateBuild string.
    68 // VS_FF_SPECIALBUILD - File was built by the original company using standard release procedures but is a variation of the standard file of the same version number. If this value is given, the StringFileInfo block block must contain a SpecialBuild string.
    69 #if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) || defined(WINDOWS) || defined(_WINDOWS_) || defined(__WINDOWS__)
    70 #if !defined(VS_FF_PRERELEASE)
    71 // At this time, verrsrc.h does not have protection against multiple includes.
    72 // Testing for VS_FF_PRERELEASE seems to prevent double incudes and the
    73 // redef errors it generates.
    74 #include "verrsrc.h"
    75 #endif
    76 #endif
    77 
    78 #define RHINO_FILE_FLAGS_MASK VS_FF_PRERELEASE
    79 
    80 
    diff --git a/6/df/d19/class_rtf_composer-members.html b/6/df/d19/class_rtf_composer-members.html index 64e48a94..90acc656 100644 --- a/6/df/d19/class_rtf_composer-members.html +++ b/6/df/d19/class_rtf_composer-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d28/class_o_n___brep_face_side.html b/6/df/d28/class_o_n___brep_face_side.html index 62a3cf38..f9714c27 100644 --- a/6/df/d28/class_o_n___brep_face_side.html +++ b/6/df/d28/class_o_n___brep_face_side.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BrepFaceSide Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.
    - The default implementation of this virtual function returns false and does nothing.

    +

    Description: Low level archive writing tool used by ON_BinaryArchive::WriteObject(). Parameters: binary_archive - archive to write to Returns: Returns true if the write is successful. Remarks: Use ON_BinaryArchive::WriteObject() to write objects. This Write() function should just write the specific definition of this object. It should not write and any chunk typecode or length information.

    +

    The default implementation of this virtual function returns false and does nothing.

    Reimplemented from ON_Object.

    @@ -591,9 +589,9 @@ Additional Inherited Members
    diff --git a/6/df/d2d/class_o_n___font-members.html b/6/df/d2d/class_o_n___font-members.html index c63a0097..1def763a 100644 --- a/6/df/d2d/class_o_n___font-members.html +++ b/6/df/d2d/class_o_n___font-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    This is the complete list of members for ON_Font, including all inherited members.

    - - - - - - - - - - - + + + + + + + + + @@ -113,69 +109,67 @@ $(function() { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -201,9 +195,9 @@ $(function() {
    AnnotationFontApplePointSize enum valueON_Font
    AnnotationFontCellHeight enum valueON_Font
    AppleFontName() constON_Font
    AppleFontNameAsPointer() constON_Font
    AppleFontWeightTrait() constON_Font
    AppleFontWeightTraitFromWeight(ON_Font::Weight font_weight)ON_Fontstatic
    AppleWeightOfFont() constON_Font
    AppleWeightOfFontFromWeight(ON_Font::Weight font_weight)ON_Fontstatic
    CodePointGlyph(ON__UINT32 unicode_code_point) constON_Font
    CompareFontCharacteristics(const ON_Font &a, const ON_Font &b)ON_Fontstatic
    ComparePlatformIndependentFontCharacteristics(const ON_Font &a, const ON_Font &b)ON_Fontstatic
    AnnotationFontCellHeight enum valueON_Font
    AppleFontName() constON_Font
    AppleFontNameAsPointer() constON_Font
    AppleFontWeightTrait() constON_Font
    AppleFontWeightTraitFromWeight(ON_Font::Weight font_weight)ON_Fontstatic
    AppleWeightOfFont() constON_Font
    AppleWeightOfFontFromWeight(ON_Font::Weight font_weight)ON_Fontstatic
    CodePointGlyph(ON__UINT32 unicode_code_point) constON_Font
    CompareFontCharacteristics(const ON_Font &a, const ON_Font &b)ON_Fontstatic
    CompareWeight(ON_Font::Weight weight_a, ON_Font::Weight weight_b)ON_Fontstatic
    Constants enum nameON_Font
    CRC32(bool bIgnoreFaceNameOrdinalCase) constON_Font
    GetManagedFont(const wchar_t *face_name, ON_Font::Weight font_weight, ON_Font::Style font_style, ON_Font::Stretch font_stretch, bool bUnderlined, bool bStrikethrough, double linefeed_ratio, unsigned int logfont_charset)ON_Fontstatic
    GetManagedFont(double point_size, const wchar_t *face_name, ON_Font::Weight font_weight, ON_Font::Style font_style, ON_Font::Stretch font_stretch, bool bUnderlined, bool bStrikethrough, double linefeed_ratio, unsigned int logfont_charset)ON_Fontstatic
    GetManagedFont(const ON_Font &font_characteristics, bool bCreateIfNotFound)ON_Fontstatic
    GetManagedFontFromAppleFontName(const char *apple_font_name)ON_Fontstatic
    GetManagedFontFromAppleFontName(const wchar_t *apple_font_name)ON_Fontstatic
    GetManagedFontFromFontDescription(const wchar_t *font_description)ON_Fontstatic
    GetManagedFontFromSerialNumber(unsigned int managed_font_runtime_serial_number)ON_Fontstatic
    GetManagedFontList(ON_SimpleArray< const ON_Font * > &managed_fonts)ON_Fontstatic
    GetRunBounds(const ON_Font &font, const wchar_t *text, double fontSizePixels, ON::TextHorizontalAlignment horizontalAlignment, ON::TextVerticalAlignment verticalAlignment, ON_2dPoint &boundsMin, ON_2dPoint &boundsMax, int &lineCount)ON_Fontstatic
    IsBold() constON_Font
    IsItalic() constON_Font
    IsLight() constON_Font
    IsManagedFont() constON_Font
    IsNormalWeight() constON_Font
    IsNotAppleFontName(const wchar_t *font_description)ON_Fontstatic
    IsOblique()ON_Font
    IsStrikethrough() constON_Font
    IsUnderlined() constON_Font
    IsUpright() constON_Font
    IsValid(ON_TextLog *text_log=nullptr) constON_Font
    IsValidFaceName(const wchar_t *face_name)ON_Fontstatic
    LinefeedRatio() constON_Font
    logfont_ansi_charset enum valueON_Font
    logfont_default_charset enum valueON_Font
    logfont_out_precis enum valueON_Font
    logfont_pitch_and_family enum valueON_Font
    logfont_quality enum valueON_Font
    logfont_symbol_charset enum valueON_Font
    LogfontCharSet() constON_Font
    ManagedFont() constON_Font
    ManagedFontSerialNumber() constON_Font
    MetricsGlyphCodePoint enum valueON_Font
    NormalizedToFontUnitScale() constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().AscentOfI()") int HeightOfI() constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().LineSpace()") int HeightOfLinefeed() constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().GlyphScale()") double HeightScale(double text_height) constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().StrikeoutThickness()") int GetStrikeoutSize() constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().StrikeoutPosition()") int GetStrikeoutPosition() constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().UnderscoreThickness()") int GetUnderscoreSize() constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().UnderscorePosition()") int GetUnderscorePosition() constON_Font
    ON_Font()ON_Font
    ON_Font(const ON_Font &src)ON_Font
    ON_FontGlyph classON_Fontfriend
    ON_GetFontMetricsFuncType typedefON_Font
    ON_GetGlyphMetricsFuncType typedefON_Font
    ON_ManagedFonts classON_Fontfriend
    operator=(const ON_Font &src)ON_Font
    PointSize() constON_Font
    Read(ON_BinaryArchive &)ON_Font
    ReadV5(ON_BinaryArchive &, int *V5_font_index, ON_UUID *V5_font_id)ON_Font
    RuntimeSerialNumber() constON_Font
    SetAppleFontWeightTrait(double apple_font_weight_trait)ON_Font
    SetAppleWeightOfFont(int apple_weight_of_font)ON_Font
    SetCustomMeasurementFunctions(ON_GetGlyphMetricsFuncType measureGlyphFunc, ON_GetFontMetricsFuncType metricsFunction)ON_Fontstatic
    SetFontCharacteristics(const wchar_t *face_name, bool bBold, bool bItalic, bool bUnderlined, bool bStrikethrough)ON_Font
    SetFontCharacteristics(double point_size, const wchar_t *face_name, bool bBold, bool bItalic, bool bUnderlined, bool bStrikethrough)ON_Font
    SetFontCharacteristics(const wchar_t *face_name, ON_Font::Weight font_weight, ON_Font::Style font_style, ON_Font::Stretch font_stretch, bool bUnderlined, bool bStrikethrough)ON_Font
    SetFontCharacteristics(double point_size, const wchar_t *face_name, ON_Font::Weight font_weight, ON_Font::Style font_style, ON_Font::Stretch font_stretch, bool bUnderlined, bool bStrikethrough)ON_Font
    SetFontCharacteristics(const wchar_t *face_name, ON_Font::Weight font_weight, ON_Font::Style font_style, ON_Font::Stretch font_stretch, bool bUnderlined, bool bStrikethrough, double linefeed_ratio, unsigned int logfont_charset)ON_Font
    SetFontCharacteristics(double point_size, const wchar_t *face_name, ON_Font::Weight font_weight, ON_Font::Style font_style, ON_Font::Stretch font_stretch, bool bUnderlined, bool bStrikethrough, double linefeed_ratio, unsigned int logfont_charset)ON_Font
    SetFontFaceName(const wchar_t *face_name)ON_Font
    SetFontStretch(ON_Font::Stretch font_stretch)ON_Font
    SetFontStyle(ON_Font::Style font_style)ON_Font
    SetFontWeight(ON_Font::Weight font_weight)ON_Font
    SetFromAppleFontName(const wchar_t *apple_font_name)ON_Font
    SetFromAppleFontName(const wchar_t *apple_font_name, double point_size)ON_Font
    GetManagedFontFromAppleFontName(const wchar_t *apple_font_name)ON_Fontstatic
    GetManagedFontFromFontDescription(const wchar_t *font_description)ON_Fontstatic
    GetManagedFontFromSerialNumber(unsigned int managed_font_runtime_serial_number)ON_Fontstatic
    GetManagedFontList(ON_SimpleArray< const ON_Font * > &managed_fonts)ON_Fontstatic
    GetRunBounds(const ON_Font &font, const wchar_t *text, double fontSizePixels, ON::TextHorizontalAlignment horizontalAlignment, ON::TextVerticalAlignment verticalAlignment, ON_2dPoint &boundsMin, ON_2dPoint &boundsMax, int &lineCount)ON_Fontstatic
    IsBold() constON_Font
    IsItalic() constON_Font
    IsLight() constON_Font
    IsManagedFont() constON_Font
    IsNormalWeight() constON_Font
    IsNotAppleFontName(const wchar_t *font_description)ON_Fontstatic
    IsOblique()ON_Font
    IsStrikethrough() constON_Font
    IsUnderlined() constON_Font
    IsUpright() constON_Font
    IsValid(ON_TextLog *text_log=nullptr) constON_Font
    IsValidFaceName(const wchar_t *face_name)ON_Fontstatic
    LinefeedRatio() constON_Font
    logfont_ansi_charset enum valueON_Font
    logfont_default_charset enum valueON_Font
    logfont_out_precis enum valueON_Font
    logfont_pitch_and_family enum valueON_Font
    logfont_quality enum valueON_Font
    logfont_symbol_charset enum valueON_Font
    LogfontCharSet() constON_Font
    ManagedFont() constON_Font
    ManagedFontSerialNumber() constON_Font
    MetricsGlyphCodePoint enum valueON_Font
    NormalizedToFontUnitScale() constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().AscentOfI()") int HeightOfI() constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().LineSpace()") int HeightOfLinefeed() constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().GlyphScale()") double HeightScale(double text_height) constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().StrikeoutThickness()") int GetStrikeoutSize() constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().StrikeoutPosition()") int GetStrikeoutPosition() constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().UnderscoreThickness()") int GetUnderscoreSize() constON_Font
    ON_DEPRECATED_MSG("Use FontMetrics().UnderscorePosition()") int GetUnderscorePosition() constON_Font
    ON_Font()ON_Font
    ON_Font(const ON_Font &src)ON_Font
    ON_FontGlyph classON_Fontfriend
    ON_GetFontMetricsFuncType typedefON_Font
    ON_GetGlyphMetricsFuncType typedefON_Font
    ON_ManagedFonts classON_Fontfriend
    operator=(const ON_Font &src)ON_Font
    PointSize() constON_Font
    Read(ON_BinaryArchive &)ON_Font
    ReadV5(ON_BinaryArchive &, int *V5_font_index, ON_UUID *V5_font_id)ON_Font
    RuntimeSerialNumber() constON_Font
    SetAppleFontWeightTrait(double apple_font_weight_trait)ON_Font
    SetAppleWeightOfFont(int apple_weight_of_font)ON_Font
    SetCustomMeasurementFunctions(ON_GetGlyphMetricsFuncType measureGlyphFunc, ON_GetFontMetricsFuncType metricsFunction)ON_Fontstatic
    SetFontCharacteristics(const wchar_t *face_name, bool bBold, bool bItalic, bool bUnderlined, bool bStrikethrough)ON_Font
    SetFontCharacteristics(double point_size, const wchar_t *face_name, bool bBold, bool bItalic, bool bUnderlined, bool bStrikethrough)ON_Font
    SetFontCharacteristics(const wchar_t *face_name, ON_Font::Weight font_weight, ON_Font::Style font_style, ON_Font::Stretch font_stretch, bool bUnderlined, bool bStrikethrough)ON_Font
    SetFontCharacteristics(double point_size, const wchar_t *face_name, ON_Font::Weight font_weight, ON_Font::Style font_style, ON_Font::Stretch font_stretch, bool bUnderlined, bool bStrikethrough)ON_Font
    SetFontCharacteristics(const wchar_t *face_name, ON_Font::Weight font_weight, ON_Font::Style font_style, ON_Font::Stretch font_stretch, bool bUnderlined, bool bStrikethrough, double linefeed_ratio, unsigned int logfont_charset)ON_Font
    SetFontCharacteristics(double point_size, const wchar_t *face_name, ON_Font::Weight font_weight, ON_Font::Style font_style, ON_Font::Stretch font_stretch, bool bUnderlined, bool bStrikethrough, double linefeed_ratio, unsigned int logfont_charset)ON_Font
    SetFontFaceName(const wchar_t *face_name)ON_Font
    SetFontStretch(ON_Font::Stretch font_stretch)ON_Font
    SetFontStyle(ON_Font::Style font_style)ON_Font
    SetFontWeight(ON_Font::Weight font_weight)ON_Font
    SetFromAppleFontName(const wchar_t *apple_font_name)ON_Font
    SetFromFontDescription(const wchar_t *font_description)ON_Font
    SetFromFontDescription(const wchar_t *font_description, const wchar_t *apple_font_name)ON_Font
    SetLogfontCharSet(unsigned char logfont_charset)ON_Font
    diff --git a/6/df/d2e/class_o_n__2f_vector_array.html b/6/df/d2e/class_o_n__2f_vector_array.html index 64d694cc..31eab4b6 100644 --- a/6/df/d2e/class_o_n__2f_vector_array.html +++ b/6/df/d2e/class_o_n__2f_vector_array.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2fVectorArray Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d32/class_o_n__2d_size.html b/6/df/d32/class_o_n__2d_size.html index 57fa148a..76779499 100644 --- a/6/df/d32/class_o_n__2d_size.html +++ b/6/df/d32/class_o_n__2d_size.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_2dSize Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d35/class_o_n___mesh_ngon_buffer.html b/6/df/d35/class_o_n___mesh_ngon_buffer.html index 7db6779a..6095998d 100644 --- a/6/df/d35/class_o_n___mesh_ngon_buffer.html +++ b/6/df/d35/class_o_n___mesh_ngon_buffer.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshNgonBuffer Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d3c/class_o_n__3dm_revision_history-members.html b/6/df/d3c/class_o_n__3dm_revision_history-members.html index efbad71c..a3d21ad9 100644 --- a/6/df/d3c/class_o_n__3dm_revision_history-members.html +++ b/6/df/d3c/class_o_n__3dm_revision_history-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d40/class_o_n___local_zero1-members.html b/6/df/d40/class_o_n___local_zero1-members.html index 73bc7ed1..a107df9f 100644 --- a/6/df/d40/class_o_n___local_zero1-members.html +++ b/6/df/d40/class_o_n___local_zero1-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d43/class_o_n___arc-members.html b/6/df/d43/class_o_n___arc-members.html index 00cab83f..81820276 100644 --- a/6/df/d43/class_o_n___arc-members.html +++ b/6/df/d43/class_o_n___arc-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d45/class_o_n___text_log-members.html b/6/df/d45/class_o_n___text_log-members.html index 796b3114..5f021dbf 100644 --- a/6/df/d45/class_o_n___text_log-members.html +++ b/6/df/d45/class_o_n___text_log-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d46/struct_o_n___r_tree_capsule.html b/6/df/d46/struct_o_n___r_tree_capsule.html index 58ab1f79..9eca9237 100644 --- a/6/df/d46/struct_o_n___r_tree_capsule.html +++ b/6/df/d46/struct_o_n___r_tree_capsule.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_RTreeCapsule Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d4e/class_o_n___polynomial_surface.html b/6/df/d4e/class_o_n___polynomial_surface.html index edb090fb..a84812f3 100644 --- a/6/df/d4e/class_o_n___polynomial_surface.html +++ b/6/df/d4e/class_o_n___polynomial_surface.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_PolynomialSurface Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d54/class_o_n___plug_in_ref.html b/6/df/d54/class_o_n___plug_in_ref.html index 0cb0f4c7..c5d03a3c 100644 --- a/6/df/d54/class_o_n___plug_in_ref.html +++ b/6/df/d54/class_o_n___plug_in_ref.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_PlugInRef Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////
    -Description: The ON_PluginRef class is used to store a list of application plug-ins that may have saved user data in a 3dm file so they can be loaded as needed for reading their user data.

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// Description: The ON_PluginRef class is used to store a list of application plug-ins that may have saved user data in a 3dm file so they can be loaded as needed for reading their user data.

    Constructor & Destructor Documentation

    ◆ ON_PlugInRef()

    @@ -461,9 +454,9 @@ Description: The ON_PluginRef class is used to store a list of application plug-
    diff --git a/6/df/d5f/class_o_n___bump_function-members.html b/6/df/d5f/class_o_n___bump_function-members.html index 767279f7..7df618bd 100644 --- a/6/df/d5f/class_o_n___bump_function-members.html +++ b/6/df/d5f/class_o_n___bump_function-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d60/class_o_n___history_record-members.html b/6/df/d60/class_o_n___history_record-members.html index 9bddcb76..38a49241 100644 --- a/6/df/d60/class_o_n___history_record-members.html +++ b/6/df/d60/class_o_n___history_record-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d67/class_o_n__3dm_units_and_tolerances.html b/6/df/d67/class_o_n__3dm_units_and_tolerances.html index dae64aca..b2000e11 100644 --- a/6/df/d67/class_o_n__3dm_units_and_tolerances.html +++ b/6/df/d67/class_o_n__3dm_units_and_tolerances.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_3dmUnitsAndTolerances Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    units and tolerances

    Constructor & Destructor Documentation

    @@ -286,8 +280,7 @@ Static Public Attributes
    -

    Returns scale factor that needs to be applied to change from the argument's unit system to m_unit_system.
    -When m_unit_system is not ON::LengthUnitSystem::CustomUnits, Scale(us) = ON::UnitScale(us,m_unit_system). When Scale(us) When m_unit_system is ON::LengthUnitSystem::CustomUnits, Scale(us) = ON::UnitScale(us,ON::LengthUnitSystem::Meters)*m_custom_unit_scale.

    +

    Returns scale factor that needs to be applied to change from the argument's unit system to m_unit_system. When m_unit_system is not ON::LengthUnitSystem::CustomUnits, Scale(us) = ON::UnitScale(us,m_unit_system). When Scale(us) When m_unit_system is ON::LengthUnitSystem::CustomUnits, Scale(us) = ON::UnitScale(us,ON::LengthUnitSystem::Meters)*m_custom_unit_scale.

    @@ -458,17 +451,16 @@ When m_unit_system is not ON::LengthUnitSystem::CustomUnits, Scale(us) = ON::Uni
    -

    fractional modes: denominator = (1/2)^m_distance_display_precision
    -DefaultValue m_unit_system ON::LengthUnitSystem::Millimeters m_absolute_tolerance 0.001 m_angle_tolerance pi/180 = 1 degree m_relative_tolerance 0.01 = 1% m_distance_display_mode ON::OBSOLETE_DistanceDisplayMode::Decimal m_distance_display_precision 3

    +

    fractional modes: denominator = (1/2)^m_distance_display_precision DefaultValue m_unit_system ON::LengthUnitSystem::Millimeters m_absolute_tolerance 0.001 m_angle_tolerance pi/180 = 1 degree m_relative_tolerance 0.01 = 1% m_distance_display_mode ON::OBSOLETE_DistanceDisplayMode::Decimal m_distance_display_precision 3

    diff --git a/6/df/d6f/class_o_n___poly_edge_history.html b/6/df/d6f/class_o_n___poly_edge_history.html index 9ef82446..88950eb2 100644 --- a/6/df/d6f/class_o_n___poly_edge_history.html +++ b/6/df/d6f/class_o_n___poly_edge_history.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_PolyEdgeHistory Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d78/structtag_font_key.html b/6/df/d78/structtag_font_key.html index e71835c2..c73160a9 100644 --- a/6/df/d78/structtag_font_key.html +++ b/6/df/d78/structtag_font_key.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: tagFontKey Struct Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d7f/class_o_n___s_h_a1-members.html b/6/df/d7f/class_o_n___s_h_a1-members.html index cbdc8729..18e0616a 100644 --- a/6/df/d7f/class_o_n___s_h_a1-members.html +++ b/6/df/d7f/class_o_n___s_h_a1-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d95/class_o_n___obj_ref-members.html b/6/df/d95/class_o_n___obj_ref-members.html index 60bfff0c..f1ae02ac 100644 --- a/6/df/d95/class_o_n___obj_ref-members.html +++ b/6/df/d95/class_o_n___obj_ref-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/d97/class_o_n__2i_vector-members.html b/6/df/d97/class_o_n__2i_vector-members.html index 44cdadf6..f83270d6 100644 --- a/6/df/d97/class_o_n__2i_vector-members.html +++ b/6/df/d97/class_o_n__2i_vector-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/dab/class_o_n___debug_write_archive-members.html b/6/df/dab/class_o_n___debug_write_archive-members.html index ca7c6f57..e59155a2 100644 --- a/6/df/dab/class_o_n___debug_write_archive-members.html +++ b/6/df/dab/class_o_n___debug_write_archive-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/dae/class_o_n___color-members.html b/6/df/dae/class_o_n___color-members.html index 93ecd0f8..75c7f754 100644 --- a/6/df/dae/class_o_n___color-members.html +++ b/6/df/dae/class_o_n___color-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/dbc/class_o_n___mesh_parameters.html b/6/df/dbc/class_o_n___mesh_parameters.html index 94ec4d59..090e6344 100644 --- a/6/df/dbc/class_o_n___mesh_parameters.html +++ b/6/df/dbc/class_o_n___mesh_parameters.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshParameters Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Class ON_Mesh

    Member Enumeration Documentation

    @@ -2009,9 +2003,9 @@ Static Public Attributes
    diff --git a/6/df/dbe/class_o_n__3dm_properties-members.html b/6/df/dbe/class_o_n__3dm_properties-members.html index 6b805519..dc4f625f 100644 --- a/6/df/dbe/class_o_n__3dm_properties-members.html +++ b/6/df/dbe/class_o_n__3dm_properties-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/dc4/class_o_n___hatch_line.html b/6/df/dc4/class_o_n___hatch_line.html index 9fbb3c0b..8cdac0e5 100644 --- a/6/df/dc4/class_o_n___hatch_line.html +++ b/6/df/dc4/class_o_n___hatch_line.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_HatchLine Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Interface
    -Description: Get angle of the hatch line. CCW from x-axis Parameters: Return: The angle in radians

    +

    Interface Description: Get angle of the hatch line. CCW from x-axis Parameters: Return: The angle in radians

    @@ -846,9 +843,9 @@ Description: Get angle of the hatch line. CCW from x-axis Parameters: Return: Th diff --git a/6/df/dc9/class_o_n___bounding_box_cache.html b/6/df/dc9/class_o_n___bounding_box_cache.html index 5900c7c0..4f45e0c8 100644 --- a/6/df/dc9/class_o_n___bounding_box_cache.html +++ b/6/df/dc9/class_o_n___bounding_box_cache.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_BoundingBoxCache Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/dcf/class_rtf_composer_1_1_run_info-members.html b/6/df/dcf/class_rtf_composer_1_1_run_info-members.html index c1683de3..e9474166 100644 --- a/6/df/dcf/class_rtf_composer_1_1_run_info-members.html +++ b/6/df/dcf/class_rtf_composer_1_1_run_info-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/dd0/class_o_n__3_d_m___b_i_g___c_h_u_n_k-members.html b/6/df/dd0/class_o_n__3_d_m___b_i_g___c_h_u_n_k-members.html index 76c55c8f..d6d73e57 100644 --- a/6/df/dd0/class_o_n__3_d_m___b_i_g___c_h_u_n_k-members.html +++ b/6/df/dd0/class_o_n__3_d_m___b_i_g___c_h_u_n_k-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/dd1/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o_h_e_a_d_e_r-members.html b/6/df/dd1/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o_h_e_a_d_e_r-members.html index d9dbc0ff..96cbcdb3 100644 --- a/6/df/dd1/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o_h_e_a_d_e_r-members.html +++ b/6/df/dd1/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o_h_e_a_d_e_r-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/dd4/class_o_n___light-members.html b/6/df/dd4/class_o_n___light-members.html index 33bb5903..6fc9b7a5 100644 --- a/6/df/dd4/class_o_n___light-members.html +++ b/6/df/dd4/class_o_n___light-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/dd4/class_o_n___text_hash-members.html b/6/df/dd4/class_o_n___text_hash-members.html index b0b17d53..02850d2a 100644 --- a/6/df/dd4/class_o_n___text_hash-members.html +++ b/6/df/dd4/class_o_n___text_hash-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/ddb/class_o_n___curve-members.html b/6/df/ddb/class_o_n___curve-members.html index d7220a39..353831f3 100644 --- a/6/df/ddb/class_o_n___curve-members.html +++ b/6/df/ddb/class_o_n___curve-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/dde/class_o_n___mesh_partition.html b/6/df/dde/class_o_n___mesh_partition.html index e8432884..a842aaac 100644 --- a/6/df/dde/class_o_n___mesh_partition.html +++ b/6/df/dde/class_o_n___mesh_partition.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_MeshPartition Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/de0/class_o_n___geometry.html b/6/df/de0/class_o_n___geometry.html index e6755c39..c99b36a5 100644 --- a/6/df/de0/class_o_n___geometry.html +++ b/6/df/de0/class_o_n___geometry.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_Geometry Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    -

    Description: Some objects cache bounding box information. If you modify an object, then call ClearBoundingBox() to inform the object that any cached bounding boxes are invalid.
    - Remarks: Generally, ClearBoundingBox() overrides simply invalidate a cached bounding box and then wait for a call to GetBBox() before recomputing the bounding box.

    +

    Description: Some objects cache bounding box information. If you modify an object, then call ClearBoundingBox() to inform the object that any cached bounding boxes are invalid.

    +

    Remarks: Generally, ClearBoundingBox() overrides simply invalidate a cached bounding box and then wait for a call to GetBBox() before recomputing the bounding box.

    The default implementation does nothing.

    Reimplemented in ON_Brep, ON_MorphControl, ON_BrepFace, ON_TextContent, ON_SumSurface, and ON_RevSurface.

    @@ -546,8 +544,7 @@ Additional Inherited Members
    -

    Description: This is the virtual function that actually calculates axis aligned bounding boxes. Parameters: boxmin - [in/out] array of Dimension() doubles boxmax - [in/out] array of Dimension() doubles bGrowBox - [in] (default=false) If true, then the union of the input bbox and the object's bounding box is returned in bbox.
    - If false, the object's bounding box is returned in bbox. Returns: true if object has bounding box and calculation was successful

    +

    Description: This is the virtual function that actually calculates axis aligned bounding boxes. Parameters: boxmin - [in/out] array of Dimension() doubles boxmax - [in/out] array of Dimension() doubles bGrowBox - [in] (default=false) If true, then the union of the input bbox and the object's bounding box is returned in bbox. If false, the object's bounding box is returned in bbox. Returns: true if object has bounding box and calculation was successful

    Reimplemented in ON_MeshComponentRef, ON_Mesh, ON_Brep, ON_MorphControl, ON_NurbsCage, ON_Centermark, ON_BrepFace, ON_TextDot, ON_DimOrdinate, ON_BrepLoop, ON_DimRadial, ON_InstanceRef, ON_Hatch, ON_DimAngular, ON_OffsetSurface, ON_DimLinear, ON_NurbsSurface, ON_TextContent, ON_CurveProxy, ON_NurbsCurve, ON_Viewport, ON_SumSurface, ON_ArcCurve, ON_RevSurface, ON_PolyCurve, ON_Text, ON_CurveOnSurface, ON_Leader, ON_PolylineCurve, ON_SurfaceProxy, ON_Extrusion, ON_PointCloud, ON_LineCurve, ON_PlaneSurface, ON_Point, ON_PointGrid, ON_Light, and ON_DetailView.

    @@ -578,8 +575,7 @@ Additional Inherited Members
    -

    Description: Get object's 3d axis aligned bounding box or the union of the input box with the object's bounding box. Parameters: bbox - [in/out] 3d axis aligned bounding box bGrowBox - [in] (default=false) If true, then the union of the input bbox and the object's bounding box is returned in bbox.
    - If false, the object's bounding box is returned in bbox. Returns: true if object has bounding box and calculation was successful. Remarks: Uses virtual GetBBox() function to calculate the result.

    +

    Description: Get object's 3d axis aligned bounding box or the union of the input box with the object's bounding box. Parameters: bbox - [in/out] 3d axis aligned bounding box bGrowBox - [in] (default=false) If true, then the union of the input bbox and the object's bounding box is returned in bbox. If false, the object's bounding box is returned in bbox. Returns: true if object has bounding box and calculation was successful. Remarks: Uses virtual GetBBox() function to calculate the result.

    @@ -657,8 +653,7 @@ Additional Inherited Members
    -

    Description: Get tight bounding box. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false)
    - If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the curve's tight bounding box. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed geometry is calculated. The geometry is not modified. Returns: True if a valid tight_bbox is returned. Remarks: In general, GetTightBoundingBox is slower that BoundingBox, especially when xform is not null.

    +

    Description: Get tight bounding box. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false) If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the curve's tight bounding box. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed geometry is calculated. The geometry is not modified. Returns: True if a valid tight_bbox is returned. Remarks: In general, GetTightBoundingBox is slower that BoundingBox, especially when xform is not null.

    Reimplemented in ON_Mesh, ON_Brep, ON_MorphControl, ON_NurbsCage, ON_Hatch, ON_Curve, ON_ArcCurve, ON_PolyCurve, ON_PolylineCurve, ON_Extrusion, ON_PointCloud, ON_LineCurve, ON_PointGrid, and ON_DetailView.

    @@ -1021,9 +1016,9 @@ Additional Inherited Members
    diff --git a/6/df/de4/class_o_n___box-members.html b/6/df/de4/class_o_n___box-members.html index dc5e7413..1e31a235 100644 --- a/6/df/de4/class_o_n___box-members.html +++ b/6/df/de4/class_o_n___box-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/de4/class_o_n___model_component_reference.html b/6/df/de4/class_o_n___model_component_reference.html index b350bab0..19ffc790 100644 --- a/6/df/de4/class_o_n___model_component_reference.html +++ b/6/df/de4/class_o_n___model_component_reference.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_ModelComponentReference Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/df1/opennurbs__wip_8h_source.html b/6/df/df1/opennurbs__wip_8h_source.html index 3e800afc..d2fc0ae2 100644 --- a/6/df/df1/opennurbs__wip_8h_source.html +++ b/6/df/df1/opennurbs__wip_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_wip.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_wip.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    1 /* $NoKeywords: $ */
    2 /*
    3 //
    4 // Copyright (c) 1993-2014 Robert McNeel & Associates. All rights reserved.
    5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
    6 // McNeel & Associates.
    7 //
    8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
    9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
    10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
    11 //
    12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
    13 //
    14 ////////////////////////////////////////////////////////////////
    15 */
    16 
    17 #if !defined OPENNURBS_WIP_INC__
    18 #define OPENNURBS_WIP_INC__
    19 
    20 #if !defined(OPENNURBS_SUBD_WIP)
    21 #if defined(ON_COMPILING_OPENNURBS) || defined(TL_INC_) || defined(RHINO_WIP_BUILD) || defined(RHINO_BETA_BUILD) || defined(RHINO_SUBD_WIP)
    22 // SubD classes and .3dm support for reading it.
    23 // SubD is alwasy available internally (ON_COMPILING_OPENNURBS is defined)
    24 // so .3dm files can be read and written by all versions of opennurbs.
    25 #define OPENNURBS_SUBD_WIP
    26 
    27 #elif defined(RHINO_CORE_COMPONENT) && 0 != RHINO_CORE_COMPONENT
    28 // SubD is available to core Rhino 6 and core Rhino WIP code
    29 #define OPENNURBS_SUBD_WIP
    30 
    31 #elif !defined(RHINO_COMMERCIAL_BUILD)
    32 // SubD is available in the Rhino WIP C++ SDK.
    33 // SubD is not avaialable in the Rhino 6 commercial C++ SDK.
    34 #define OPENNURBS_SUBD_WIP
    35 
    36 #endif
    37 #endif
    38 
    39 
    40 // Annotation table is being prototyped and on hold
    41 // until V6 ships.
    42 //#define OPENNURBS_ANNOTATION_TABLE_WIP
    43 
    44 #endif
    diff --git a/6/df/df2/class_o_n___point_cloud.html b/6/df/df2/class_o_n___point_cloud.html index 49e8d381..5df49311 100644 --- a/6/df/df2/class_o_n___point_cloud.html +++ b/6/df/df2/class_o_n___point_cloud.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: ON_PointCloud Class Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +

    Detailed Description

    NoKeywords
    -


    -
    -/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
    -
    -/ For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    +

    / / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. / / For complete openNURBS copyright information see http://www.opennurbs.org. / //////////////////////////////////////////////////////////////

    Class ON_PointCloud - unordered set of points ON_PointField - point height field

    Constructor & Destructor Documentation

    @@ -1430,9 +1424,9 @@ Additional Inherited Members
    diff --git a/6/df/df5/opennurbs__torus_8h_source.html b/6/df/df5/opennurbs__torus_8h_source.html index 073eafdd..f2b2fdaf 100644 --- a/6/df/df5/opennurbs__torus_8h_source.html +++ b/6/df/df5/opennurbs__torus_8h_source.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public/opennurbs_torus.h Source File +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public/opennurbs_torus.h Source File @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/dfc/class_o_n__w_string_buffer-members.html b/6/df/dfc/class_o_n__w_string_buffer-members.html index 1eb4fef5..81a99876 100644 --- a/6/df/dfc/class_o_n__w_string_buffer-members.html +++ b/6/df/dfc/class_o_n__w_string_buffer-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/dfd/class_o_n___text_mask-members.html b/6/df/dfd/class_o_n___text_mask-members.html index 349fa994..c29db9b7 100644 --- a/6/df/dfd/class_o_n___text_mask-members.html +++ b/6/df/dfd/class_o_n___text_mask-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/df/dfe/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o-members.html b/6/df/dfe/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o-members.html index 03af00cd..182a98c0 100644 --- a/6/df/dfe/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o-members.html +++ b/6/df/dfe/struct_o_n___windows_b_i_t_m_a_p_i_n_f_o-members.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Member List @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dir_2ea30aa2956a8db99dd22aa5e597f384.html b/6/dir_2ea30aa2956a8db99dd22aa5e597f384.html index 74efe85c..871c40d8 100644 --- a/6/dir_2ea30aa2956a8db99dd22aa5e597f384.html +++ b/6/dir_2ea30aa2956a8db99dd22aa5e597f384.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin Directory Reference +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin Directory Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/dir_7a6cfee8d318bd47c162fe536aecd3a7.html b/6/dir_7a6cfee8d318bd47c162fe536aecd3a7.html index 9ccc576d..1f47a1c2 100644 --- a/6/dir_7a6cfee8d318bd47c162fe536aecd3a7.html +++ b/6/dir_7a6cfee8d318bd47c162fe536aecd3a7.html @@ -3,9 +3,9 @@ - + -openNURBS SDK Help: /Users/will/dev/github/mcneel/rhino/src4/bin/opennurbs_public Directory Reference +openNURBS SDK Help: D:/BuildAgent/work/d8e3bf9e94f4c621/src4/bin/opennurbs_public Directory Reference @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + +
    diff --git a/6/doxygen.css b/6/doxygen.css index 266c8b3a..4f1ab919 100644 --- a/6/doxygen.css +++ b/6/doxygen.css @@ -1,4 +1,4 @@ -/* The standard CSS for doxygen 1.8.14 */ +/* The standard CSS for doxygen 1.8.13 */ body, table, div, p, dl { font: 400 14px/22px Roboto,sans-serif; diff --git a/6/dynsections.js b/6/dynsections.js index c1ce1226..85e18369 100644 --- a/6/dynsections.js +++ b/6/dynsections.js @@ -1,26 +1,3 @@ -/* - @licstart The following is the entire license notice for the - JavaScript code in this file. - - Copyright (C) 1997-2017 by Dimitri van Heesch - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - @licend The above is the entire license notice - for the JavaScript code in this file - */ function toggleVisibility(linkObj) { var base = $(linkObj).attr('id'); @@ -38,7 +15,7 @@ function toggleVisibility(linkObj) summary.hide(); $(linkObj).removeClass('closed').addClass('opened'); $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); - } + } return false; } @@ -60,7 +37,7 @@ function toggleLevel(level) $(this).show(); } else if (l==level+1) { i.removeClass('iconfclosed iconfopen').addClass('iconfclosed'); - a.html('▶'); + a.html('►'); $(this).show(); } else { $(this).hide(); @@ -87,7 +64,7 @@ function toggleFolder(id) // replace down arrow by right arrow for current row var currentRowSpans = currentRow.find("span"); currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed"); - currentRowSpans.filter(".arrow").html('▶'); + currentRowSpans.filter(".arrow").html('►'); rows.filter("[id^=row_"+id+"]").hide(); // hide all children } else { // we are SHOWING // replace right arrow by down arrow for current row @@ -97,7 +74,7 @@ function toggleFolder(id) // replace down arrows by right arrows for child rows var childRowsSpans = childRows.find("span"); childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed"); - childRowsSpans.filter(".arrow").html('▶'); + childRowsSpans.filter(".arrow").html('►'); childRows.show(); //show all children } updateStripes(); @@ -117,4 +94,4 @@ function toggleInherit(id) $(img).attr('src',src.substring(0,src.length-10)+'open.png'); } } -/* @license-end */ + diff --git a/6/functions.html b/6/functions.html index 96db2b09..1dfb4bb6 100644 --- a/6/functions.html +++ b/6/functions.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -537,9 +535,6 @@ $(function() {
  • Angstroms : ON_UnitSystem
  • -
  • AnnotationFontApplePointSize -: ON_Font -
  • AnnotationFontCellHeight : ON_Font
  • @@ -565,14 +560,14 @@ $(function() { , ON_PolylineCurve , ON_SimpleArray< T > , ON_String -, ON_wString +, ON_wString
  • AppendAndMatch() : ON_PolyCurve , ON_PolyEdgeCurve
  • AppendClipPoint() -: ON_ClippingRegionPoints +: ON_ClippingRegionPoints
  • AppendClipPoints() : ON_ClippingRegionPoints @@ -614,11 +609,11 @@ $(function() { : ON_TextLog
  • AppendToArray() -: ON_String -, ON_wString +: ON_String +, ON_wString
  • AppendToString() -: ON_MeshNgon +: ON_MeshNgon
  • AppleFontName() : ON_Font @@ -734,7 +729,7 @@ $(function() {
  • Array() : ON_2dexMap , ON_ClassArray< T > -, ON_SimpleArray< T > +, ON_SimpleArray< T > , ON_String , ON_TextRunArray , ON_UuidList @@ -808,8 +803,8 @@ $(function() { : ON_UnitSystem
  • At() -: ON_ClassArray< T > -, ON_SimpleArray< T > +: ON_ClassArray< T > +, ON_SimpleArray< T >
  • AtBackslashTic() : ON_TextIterator @@ -829,7 +824,7 @@ $(function() { : ON_Object
  • Attenuation() -: ON_Light +: ON_Light
  • Attributes : ON_ModelComponent @@ -844,9 +839,9 @@ $(function() { diff --git a/6/functions_0x7e.html b/6/functions_0x7e.html index dc713f5e..447d5976 100644 --- a/6/functions_0x7e.html +++ b/6/functions_0x7e.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -863,9 +861,9 @@ $(function() { diff --git a/6/functions_b.html b/6/functions_b.html index d76dec79..374efbcf 100644 --- a/6/functions_b.html +++ b/6/functions_b.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -460,9 +458,9 @@ $(function() { diff --git a/6/functions_c.html b/6/functions_c.html index 294632c8..b6dad086 100644 --- a/6/functions_c.html +++ b/6/functions_c.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -696,7 +694,7 @@ $(function() { , ON_wString
  • CompareCodePointAndFont() -: ON_FontGlyph +: ON_FontGlyph
  • CompareColorAttributes() : ON_Material @@ -786,9 +784,6 @@ $(function() { : ON_String , ON_wString
  • -
  • ComparePlatformIndependentFontCharacteristics() -: ON_Font -
  • ComparePointer() : ON_2dSize , ON_2iSize @@ -937,7 +932,7 @@ $(function() {
  • ComputeFaceNormal() : ON_Mesh -, ON_MeshFace +, ON_MeshFace
  • ComputeFaceNormals() : ON_Mesh @@ -1030,7 +1025,7 @@ $(function() { : ON_TextContext
  • ConvertNonPlanarQuadsToTriangles() -: ON_Mesh +: ON_Mesh
  • ConvertQuadsToTriangles() : ON_Mesh @@ -1065,14 +1060,14 @@ $(function() { : ON_HistoryRecord
  • CopyPerViewportSettings() -: ON_Layer +: ON_Layer
  • CopyToArray() -: ON_String -, ON_wString +: ON_String +, ON_wString
  • CopyUserData() -: ON_Object +: ON_Object
  • CopyUserDataFrom() : ON_UserDataHolder @@ -1112,41 +1107,41 @@ $(function() { , ON_AngleUnitName , ON_AngleValue , ON_Arc -, ON_BezierCage +, ON_BezierCage , ON_BezierCageMorph , ON_BezierCurve , ON_BezierSurface , ON_Box -, ON_Brep +, ON_Brep , ON_Centermark -, ON_Circle +, ON_Circle , ON_ClassId , ON_Cone , ON_ContentHash -, ON_Cylinder -, ON_DimAngular +, ON_Cylinder +, ON_DimAngular , ON_DimLinear , ON_DimOrdinate , ON_DimRadial -, ON_Ellipse +, ON_Ellipse , ON_EmbeddedBitmap , ON_FixedSizePool , ON_FixedSizePoolIterator , ON_Hatch , ON_Leader , ON_LengthUnitName -, ON_LengthValue -, ON_Line -, ON_Matrix +, ON_LengthValue +, ON_Line +, ON_Matrix , ON_ModelGeometryComponent -, ON_NameHash +, ON_NameHash , ON_NurbsCage , ON_NurbsCurve , ON_NurbsSurface , ON_PlaneEquation , ON_PointGrid -, ON_PolyEdgeCurve -, ON_PolyEdgeSegment +, ON_PolyEdgeCurve +, ON_PolyEdgeSegment , ON_PolynomialCurve , ON_PolynomialSurface , ON_ProgressStepCounter @@ -1154,11 +1149,11 @@ $(function() { , ON_SimpleFixedSizePool< T > , ON_Sphere , ON_String -, ON_SumSurface +, ON_SumSurface , ON_Text -, ON_TextContent -, ON_Torus -, ON_Triangle +, ON_TextContent +, ON_Torus +, ON_Triangle , ON_WindowsBitmap , ON_wString
  • @@ -1201,10 +1196,10 @@ $(function() { : ON_ContentHash
  • CreateFromEquation() -: ON_Plane +: ON_Plane
  • CreateFromFile() -: ON_ContentHash +: ON_ContentHash
  • CreateFromFont() : ON_DimStyle @@ -1228,7 +1223,7 @@ $(function() { : ON_Plane
  • CreateFromProperties() -: ON_DimStyle +: ON_DimStyle
  • CreateFromQuad() : ON_MeshNgonBuffer @@ -1307,7 +1302,7 @@ $(function() { : ON_Localizer
  • CreatePseudoInfinitePlane() -: ON_PlaneSurface +: ON_PlaneSurface
  • CreateRotated() : ON_DimLinear @@ -1560,9 +1555,9 @@ $(function() { diff --git a/6/functions_d.html b/6/functions_d.html index ff0fe7a7..26a5ea7c 100644 --- a/6/functions_d.html +++ b/6/functions_d.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -1060,9 +1058,9 @@ $(function() { diff --git a/6/functions_e.html b/6/functions_e.html index dbdfbba4..5827ffda 100644 --- a/6/functions_e.html +++ b/6/functions_e.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -649,9 +647,9 @@ $(function() { diff --git a/6/functions_enum.html b/6/functions_enum.html index d43f39a4..28e25e5d 100644 --- a/6/functions_enum.html +++ b/6/functions_enum.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Enumerations @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -317,9 +315,9 @@ $(function() { diff --git a/6/functions_eval.html b/6/functions_eval.html index 61feda2a..23bfa381 100644 --- a/6/functions_eval.html +++ b/6/functions_eval.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Enumerator @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -70,9 +68,6 @@ $(function() {
  • AllAttributes : ON_ModelComponent
  • -
  • AnnotationFontApplePointSize -: ON_Font -
  • AnnotationFontCellHeight : ON_Font
  • @@ -539,9 +534,9 @@ $(function() { diff --git a/6/functions_f.html b/6/functions_f.html index f8baa49e..725802a7 100644 --- a/6/functions_f.html +++ b/6/functions_f.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -771,9 +769,9 @@ $(function() { diff --git a/6/functions_func.html b/6/functions_func.html index 791f87cc..8a5e4576 100644 --- a/6/functions_func.html +++ b/6/functions_func.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -795,9 +793,9 @@ $(function() { diff --git a/6/functions_func_0x7e.html b/6/functions_func_0x7e.html index d3640e65..f04d4c90 100644 --- a/6/functions_func_0x7e.html +++ b/6/functions_func_0x7e.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -863,9 +861,9 @@ $(function() { diff --git a/6/functions_func_b.html b/6/functions_func_b.html index a11097d3..d4bb718b 100644 --- a/6/functions_func_b.html +++ b/6/functions_func_b.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -358,9 +356,9 @@ $(function() { diff --git a/6/functions_func_c.html b/6/functions_func_c.html index 933e9b9c..e0837e29 100644 --- a/6/functions_func_c.html +++ b/6/functions_func_c.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -668,7 +666,7 @@ $(function() { , ON_wString
  • CompareCodePointAndFont() -: ON_FontGlyph +: ON_FontGlyph
  • CompareColorAttributes() : ON_Material @@ -758,9 +756,6 @@ $(function() { : ON_String , ON_wString
  • -
  • ComparePlatformIndependentFontCharacteristics() -: ON_Font -
  • ComparePointer() : ON_2dSize , ON_2iSize @@ -900,7 +895,7 @@ $(function() {
  • ComputeFaceNormal() : ON_Mesh -, ON_MeshFace +, ON_MeshFace
  • ComputeFaceNormals() : ON_Mesh @@ -1001,7 +996,7 @@ $(function() { , ON_wString
  • CopyComponents() -: ON_Mesh +: ON_Mesh
  • CopyFrom() : ON_ModelComponent @@ -1016,11 +1011,11 @@ $(function() { : ON_Layer
  • CopyToArray() -: ON_String -, ON_wString +: ON_String +, ON_wString
  • CopyUserData() -: ON_Object +: ON_Object
  • CopyUserDataFrom() : ON_UserDataHolder @@ -1053,7 +1048,7 @@ $(function() {
  • Create() : ON_2dexMap -, ON_3dPointArray +, ON_3dPointArray , ON_AngleUnitName , ON_AngleValue , ON_Arc @@ -1064,12 +1059,12 @@ $(function() { , ON_Box , ON_Brep , ON_Centermark -, ON_Circle +, ON_Circle , ON_ClassId , ON_Cone , ON_ContentHash -, ON_Cylinder -, ON_DimAngular +, ON_Cylinder +, ON_DimAngular , ON_DimLinear , ON_DimOrdinate , ON_DimRadial @@ -1081,30 +1076,30 @@ $(function() { , ON_Leader , ON_LengthUnitName , ON_LengthValue -, ON_Line +, ON_Line , ON_Matrix , ON_ModelGeometryComponent -, ON_NameHash -, ON_NurbsCage +, ON_NameHash +, ON_NurbsCage , ON_NurbsCurve , ON_NurbsSurface , ON_PlaneEquation , ON_PointGrid -, ON_PolyEdgeCurve -, ON_PolyEdgeSegment +, ON_PolyEdgeCurve +, ON_PolyEdgeSegment , ON_PolynomialCurve , ON_PolynomialSurface -, ON_ProgressStepCounter +, ON_ProgressStepCounter , ON_ScaleValue , ON_SimpleFixedSizePool< T > , ON_Sphere , ON_String -, ON_SumSurface -, ON_Text -, ON_TextContent +, ON_SumSurface +, ON_Text +, ON_TextContent , ON_Torus -, ON_Triangle -, ON_WindowsBitmap +, ON_Triangle +, ON_WindowsBitmap , ON_wString
  • CreateAligned() @@ -1264,7 +1259,7 @@ $(function() { : ON_Localizer
  • CreateStackedText() -: ON_TextContent +: ON_TextContent
  • CreateStarPolygon() : ON_Polyline @@ -1481,9 +1476,9 @@ $(function() { diff --git a/6/functions_func_d.html b/6/functions_func_d.html index e104f0df..496fd58b 100644 --- a/6/functions_func_d.html +++ b/6/functions_func_d.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -907,9 +905,9 @@ $(function() { diff --git a/6/functions_func_e.html b/6/functions_func_e.html index 3bbc9738..e5db3769 100644 --- a/6/functions_func_e.html +++ b/6/functions_func_e.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -551,9 +549,9 @@ $(function() { diff --git a/6/functions_func_f.html b/6/functions_func_f.html index b890fb71..fe6f49fc 100644 --- a/6/functions_func_f.html +++ b/6/functions_func_f.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -716,9 +714,9 @@ $(function() { diff --git a/6/functions_func_g.html b/6/functions_func_g.html index ed121ea4..15216202 100644 --- a/6/functions_func_g.html +++ b/6/functions_func_g.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -431,6 +429,9 @@ $(function() {
  • GetFontMetrics() : ON_ManagedFonts
  • +
  • GetFromAppleFontName() +: ON_ManagedFonts +
  • GetFromFontCharacteristics() : ON_ManagedFonts
  • @@ -520,7 +521,7 @@ $(function() { : ON_MeshTopology
  • GetIntMemory() -: ON_Workspace +: ON_Workspace
  • GetIntValue() : ON_HistoryRecord @@ -556,7 +557,7 @@ $(function() { : ON_Font
  • GetManagedFontFromAppleFontName() -: ON_Font +: ON_Font
  • GetManagedFontFromFontDescription() : ON_Font @@ -670,7 +671,7 @@ $(function() { , ON_SurfaceProxy
  • GetNgonBoundaryPoints() -: ON_Mesh +: ON_Mesh
  • GetNgonOuterBoundary() : ON_Mesh @@ -1052,7 +1053,7 @@ $(function() { : ON_Locale
  • GetWorldToScreenScale() -: ON_Viewport +: ON_Viewport
  • GetXform() : ON_Viewport @@ -1143,9 +1144,9 @@ $(function() { diff --git a/6/functions_func_h.html b/6/functions_func_h.html index e31e08f4..e0eb77c4 100644 --- a/6/functions_func_h.html +++ b/6/functions_func_h.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -293,9 +291,9 @@ $(function() { diff --git a/6/functions_func_i.html b/6/functions_func_i.html index d6b08642..fb74e411 100644 --- a/6/functions_func_i.html +++ b/6/functions_func_i.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -1632,9 +1630,9 @@ $(function() { diff --git a/6/functions_func_j.html b/6/functions_func_j.html index 81504785..b838cc8c 100644 --- a/6/functions_func_j.html +++ b/6/functions_func_j.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -71,9 +69,9 @@ $(function() { diff --git a/6/functions_func_k.html b/6/functions_func_k.html index aea83264..0fd5399d 100644 --- a/6/functions_func_k.html +++ b/6/functions_func_k.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -111,9 +109,9 @@ $(function() { diff --git a/6/functions_func_l.html b/6/functions_func_l.html index cf0ba401..976bcba0 100644 --- a/6/functions_func_l.html +++ b/6/functions_func_l.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -458,9 +456,9 @@ $(function() { diff --git a/6/functions_func_m.html b/6/functions_func_m.html index 5b15766a..d3a6e035 100644 --- a/6/functions_func_m.html +++ b/6/functions_func_m.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -600,9 +598,9 @@ $(function() { diff --git a/6/functions_func_n.html b/6/functions_func_n.html index a7dbe882..db3fc90e 100644 --- a/6/functions_func_n.html +++ b/6/functions_func_n.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -318,9 +316,9 @@ $(function() { diff --git a/6/functions_func_o.html b/6/functions_func_o.html index 6e2cd976..11dc6d6d 100644 --- a/6/functions_func_o.html +++ b/6/functions_func_o.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -1643,9 +1641,9 @@ $(function() { diff --git a/6/functions_func_p.html b/6/functions_func_p.html index d04467d6..d0432b8a 100644 --- a/6/functions_func_p.html +++ b/6/functions_func_p.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -714,9 +712,9 @@ $(function() { diff --git a/6/functions_func_q.html b/6/functions_func_q.html index 6f75420e..f329b2cb 100644 --- a/6/functions_func_q.html +++ b/6/functions_func_q.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -82,9 +80,9 @@ $(function() { diff --git a/6/functions_func_r.html b/6/functions_func_r.html index 40334eff..0ae759ea 100644 --- a/6/functions_func_r.html +++ b/6/functions_func_r.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -1068,9 +1066,9 @@ $(function() { diff --git a/6/functions_func_s.html b/6/functions_func_s.html index 0f349aab..4b221e20 100644 --- a/6/functions_func_s.html +++ b/6/functions_func_s.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -1584,7 +1582,7 @@ $(function() { : ON_TextHash
  • SetOverrideDimensionStyle() -: ON_Annotation +: ON_Annotation
  • SetOverrideFacename() : ON_RtfStringBuilder @@ -1900,7 +1898,7 @@ $(function() { : ON_ObjRef
  • SetProxyCurve() -: ON_CurveProxy +: ON_CurveProxy
  • SetProxyCurveDomain() : ON_CurveProxy @@ -1965,7 +1963,7 @@ $(function() { : ON_Material
  • SetRelativePath() -: ON_FileReference +: ON_FileReference
  • SetRelativePathFromBasePath() : ON_FileReference @@ -1999,7 +1997,7 @@ $(function() { : ON_Annotation
  • SetRuntimeMark() -: ON_ComponentStatus +: ON_ComponentStatus
  • SetSave3dmPreviewImage() : ON_BinaryArchive @@ -2018,7 +2016,7 @@ $(function() { , ON_PolyCurve
  • SetSelectedState() -: ON_ComponentStatus +: ON_ComponentStatus
  • SetShadowIntensity() : ON_Light @@ -2342,10 +2340,10 @@ $(function() { : ON_Brep
  • SetTrimIsoFlag() -: ON_Brep +: ON_Brep
  • SetTrimIsoFlags() -: ON_Brep +: ON_Brep
  • SetTrimStartVertex() : ON_Brep @@ -2357,7 +2355,7 @@ $(function() { : ON_Brep
  • SetTrimTypeFlags() -: ON_Brep +: ON_Brep
  • SetType() : ON_HatchLoop @@ -2431,13 +2429,13 @@ $(function() { : ON_HistoryRecord
  • SetVertex() -: ON_Mesh +: ON_Mesh
  • SetVertexHiddenFlag() : ON_Mesh
  • SetVertexNormal() -: ON_Mesh +: ON_Mesh
  • SetVertexTolerance() : ON_Brep @@ -2459,7 +2457,7 @@ $(function() {
  • SetVisible() : ON_3dmObjectAttributes -, ON_Layer +, ON_Layer
  • SetWeight() : ON_BezierCage @@ -2718,7 +2716,7 @@ $(function() { : ON_Brep
  • SortVertexEdges() -: ON_MeshTopology +: ON_MeshTopology
  • Source3dmFilePath() : ONX_ModelTest @@ -2787,7 +2785,7 @@ $(function() { , ON_SurfaceProxy
  • SpanIsLinear() -: ON_NurbsCurve +: ON_NurbsCurve
  • SpanIsSingular() : ON_NurbsCurve @@ -2820,7 +2818,7 @@ $(function() { : ON_ModelComponent
  • SplitPath() -: ON_FileSystemPath +: ON_FileSystemPath , ON_String , ON_wString
  • @@ -2871,7 +2869,7 @@ $(function() { : ON_Brep
  • StandardizeEdgeCurve() -: ON_Brep +: ON_Brep
  • StandardizeEdgeCurves() : ON_Brep @@ -2923,8 +2921,8 @@ $(function() { : ON_Locale
  • StringHash() -: ON_MD5_Hash -, ON_SHA1_Hash +: ON_MD5_Hash +, ON_SHA1_Hash
  • StringMapLocale() : ON_TextHash @@ -2953,7 +2951,7 @@ $(function() { : ON_FontGlyph
  • SubString() -: ON_wString +: ON_wString
  • Subtract() : ON_ArithmeticCalculator @@ -3106,9 +3104,9 @@ $(function() { diff --git a/6/functions_func_t.html b/6/functions_func_t.html index b5e54c38..8573e00c 100644 --- a/6/functions_func_t.html +++ b/6/functions_func_t.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -588,9 +586,9 @@ $(function() { diff --git a/6/functions_func_u.html b/6/functions_func_u.html index 738b9905..4c2d805f 100644 --- a/6/functions_func_u.html +++ b/6/functions_func_u.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -339,9 +337,9 @@ $(function() { diff --git a/6/functions_func_v.html b/6/functions_func_v.html index 63020290..97c485fe 100644 --- a/6/functions_func_v.html +++ b/6/functions_func_v.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -185,9 +183,9 @@ $(function() { diff --git a/6/functions_func_w.html b/6/functions_func_w.html index 00f1749d..f3a3b3a5 100644 --- a/6/functions_func_w.html +++ b/6/functions_func_w.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -542,9 +540,9 @@ $(function() { diff --git a/6/functions_func_x.html b/6/functions_func_x.html index f60f1cf2..10ce759a 100644 --- a/6/functions_func_x.html +++ b/6/functions_func_x.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -71,9 +69,9 @@ $(function() { diff --git a/6/functions_func_y.html b/6/functions_func_y.html index b8071fba..23e3272b 100644 --- a/6/functions_func_y.html +++ b/6/functions_func_y.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -71,9 +69,9 @@ $(function() { diff --git a/6/functions_func_z.html b/6/functions_func_z.html index f346517c..b851c2e2 100644 --- a/6/functions_func_z.html +++ b/6/functions_func_z.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -106,9 +104,9 @@ $(function() { diff --git a/6/functions_g.html b/6/functions_g.html index c1531053..49a585d9 100644 --- a/6/functions_g.html +++ b/6/functions_g.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -431,6 +429,9 @@ $(function() {
  • GetFontMetrics() : ON_ManagedFonts
  • +
  • GetFromAppleFontName() +: ON_ManagedFonts +
  • GetFromFontCharacteristics() : ON_ManagedFonts
  • @@ -520,7 +521,7 @@ $(function() { : ON_MeshTopology
  • GetIntMemory() -: ON_Workspace +: ON_Workspace
  • GetIntValue() : ON_HistoryRecord @@ -556,7 +557,7 @@ $(function() { : ON_Font
  • GetManagedFontFromAppleFontName() -: ON_Font +: ON_Font
  • GetManagedFontFromFontDescription() : ON_Font @@ -1164,9 +1165,9 @@ $(function() { diff --git a/6/functions_h.html b/6/functions_h.html index 6e9256f1..f2d1ada8 100644 --- a/6/functions_h.html +++ b/6/functions_h.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -333,9 +331,9 @@ $(function() { diff --git a/6/functions_i.html b/6/functions_i.html index f7704fc8..cbc18a5a 100644 --- a/6/functions_i.html +++ b/6/functions_i.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -1709,9 +1707,9 @@ $(function() { diff --git a/6/functions_j.html b/6/functions_j.html index 824a3f10..f7605821 100644 --- a/6/functions_j.html +++ b/6/functions_j.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -80,9 +78,9 @@ $(function() { diff --git a/6/functions_k.html b/6/functions_k.html index 2958fbea..51a36c95 100644 --- a/6/functions_k.html +++ b/6/functions_k.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -138,9 +136,9 @@ $(function() { diff --git a/6/functions_l.html b/6/functions_l.html index 000335b4..0bf591b8 100644 --- a/6/functions_l.html +++ b/6/functions_l.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -505,9 +503,9 @@ $(function() { diff --git a/6/functions_m.html b/6/functions_m.html index d6747362..d171b939 100644 --- a/6/functions_m.html +++ b/6/functions_m.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -3052,9 +3050,9 @@ $(function() { diff --git a/6/functions_n.html b/6/functions_n.html index 9cc093fd..72307136 100644 --- a/6/functions_n.html +++ b/6/functions_n.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -402,9 +400,9 @@ $(function() { diff --git a/6/functions_o.html b/6/functions_o.html index 15b2c4c3..074f313c 100644 --- a/6/functions_o.html +++ b/6/functions_o.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -1757,9 +1755,9 @@ $(function() { diff --git a/6/functions_p.html b/6/functions_p.html index 3ff2cbd6..563e624c 100644 --- a/6/functions_p.html +++ b/6/functions_p.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -818,9 +816,9 @@ $(function() { diff --git a/6/functions_q.html b/6/functions_q.html index 8effad4f..84402386 100644 --- a/6/functions_q.html +++ b/6/functions_q.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -85,9 +83,9 @@ $(function() { diff --git a/6/functions_r.html b/6/functions_r.html index 8ccc6706..88f4e061 100644 --- a/6/functions_r.html +++ b/6/functions_r.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -67,23 +65,23 @@ $(function() {
  • Radius() : ON_ArcCurve , ON_Centermark -, ON_Circle
  • radius : ON_Circle -, ON_Cone +
  • +
  • Radius() +: ON_Circle +
  • +
  • radius +: ON_Cone
  • Radius() : ON_DimAngular +, ON_Ellipse
  • radius : ON_Ellipse -
  • -
  • Radius() -: ON_Ellipse -
  • -
  • radius -: ON_Sphere +, ON_Sphere
  • Radius() : ON_Sphere @@ -1151,9 +1149,9 @@ $(function() { diff --git a/6/functions_rela.html b/6/functions_rela.html index 6b6f7936..670a3cce 100644 --- a/6/functions_rela.html +++ b/6/functions_rela.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Related Functions @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -185,9 +183,9 @@ $(function() { diff --git a/6/functions_s.html b/6/functions_s.html index 80ac587c..28a39215 100644 --- a/6/functions_s.html +++ b/6/functions_s.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -1635,7 +1633,7 @@ $(function() { : ON_TextHash
  • SetOverrideDimensionStyle() -: ON_Annotation +: ON_Annotation
  • SetOverrideFacename() : ON_RtfStringBuilder @@ -2019,7 +2017,7 @@ $(function() { : ON_FileReference
  • SetRelativePathFromBasePath() -: ON_FileReference +: ON_FileReference
  • SetRelativeTolerance() : ON_MeshParameters @@ -2050,7 +2048,7 @@ $(function() { : ON_Annotation
  • SetRuntimeMark() -: ON_ComponentStatus +: ON_ComponentStatus
  • SetSave3dmPreviewImage() : ON_BinaryArchive @@ -2124,7 +2122,7 @@ $(function() { : ON_DimStyle
  • SetSourceIdentification() -: ON_ManifestMapItem +: ON_ManifestMapItem
  • SetSpecificViewport() : ON_3dmRenderSettings @@ -2384,7 +2382,7 @@ $(function() { : ON_Brep
  • SetTrimBoundingBoxes() -: ON_Brep +: ON_Brep
  • SetTrimCurve() : ON_Brep @@ -2408,7 +2406,7 @@ $(function() { : ON_Brep
  • SetTrimTypeFlags() -: ON_Brep +: ON_Brep
  • SetType() : ON_HatchLoop @@ -2488,7 +2486,7 @@ $(function() { : ON_Mesh
  • SetVertexNormal() -: ON_Mesh +: ON_Mesh
  • SetVertexTolerance() : ON_Brep @@ -2510,7 +2508,7 @@ $(function() {
  • SetVisible() : ON_3dmObjectAttributes -, ON_Layer +, ON_Layer
  • SetWeight() : ON_BezierCage @@ -2789,7 +2787,7 @@ $(function() {
  • Sort() : ON_ClassArray< T > -, ON_SimpleArray< T > +, ON_SimpleArray< T >
  • SortByFaceIndex() : ON_MeshFaceSide @@ -2801,7 +2799,7 @@ $(function() { : ON_Brep
  • SortVertexEdges() -: ON_MeshTopology +: ON_MeshTopology
  • Source3dmFilePath() : ONX_ModelTest @@ -2874,7 +2872,7 @@ $(function() { , ON_SurfaceProxy
  • SpanIsLinear() -: ON_NurbsCurve +: ON_NurbsCurve
  • SpanIsSingular() : ON_NurbsCurve @@ -2910,9 +2908,9 @@ $(function() { : ON_ModelComponent
  • SplitPath() -: ON_FileSystemPath +: ON_FileSystemPath , ON_String -, ON_wString +, ON_wString
  • SpotAngleDegrees() : ON_Light @@ -3035,8 +3033,8 @@ $(function() { , ON_LengthValue
  • StringHash() -: ON_MD5_Hash -, ON_SHA1_Hash +: ON_MD5_Hash +, ON_SHA1_Hash
  • StringMapLocale() : ON_TextHash @@ -3066,7 +3064,7 @@ $(function() { : ON_FontGlyph
  • SubString() -: ON_wString +: ON_wString
  • Subtract() : ON_ArithmeticCalculator @@ -3231,9 +3229,9 @@ $(function() { diff --git a/6/functions_t.html b/6/functions_t.html index f097dc43..3b811fa1 100644 --- a/6/functions_t.html +++ b/6/functions_t.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -649,9 +647,9 @@ $(function() { diff --git a/6/functions_type.html b/6/functions_type.html index 6a7935ff..dbb625de 100644 --- a/6/functions_type.html +++ b/6/functions_type.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Typedefs @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -72,9 +70,9 @@ $(function() { diff --git a/6/functions_u.html b/6/functions_u.html index 03e7c133..4d3d863c 100644 --- a/6/functions_u.html +++ b/6/functions_u.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -459,9 +457,9 @@ $(function() { diff --git a/6/functions_v.html b/6/functions_v.html index fd76d903..8f20d0ee 100644 --- a/6/functions_v.html +++ b/6/functions_v.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -196,9 +194,9 @@ $(function() { diff --git a/6/functions_vars.html b/6/functions_vars.html index f444fd64..d2980d81 100644 --- a/6/functions_vars.html +++ b/6/functions_vars.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -98,9 +96,9 @@ $(function() { diff --git a/6/functions_vars_b.html b/6/functions_vars_b.html index 4880f63c..5129ab57 100644 --- a/6/functions_vars_b.html +++ b/6/functions_vars_b.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -158,9 +156,9 @@ $(function() { diff --git a/6/functions_vars_c.html b/6/functions_vars_c.html index 1ff1794a..25207bed 100644 --- a/6/functions_vars_c.html +++ b/6/functions_vars_c.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -104,9 +102,9 @@ $(function() { diff --git a/6/functions_vars_d.html b/6/functions_vars_d.html index 93fdb265..857544fe 100644 --- a/6/functions_vars_d.html +++ b/6/functions_vars_d.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -201,9 +199,9 @@ $(function() { diff --git a/6/functions_vars_e.html b/6/functions_vars_e.html index 9ecaa0d7..dc0f4346 100644 --- a/6/functions_vars_e.html +++ b/6/functions_vars_e.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -137,9 +135,9 @@ $(function() { diff --git a/6/functions_vars_f.html b/6/functions_vars_f.html index 7554ddf2..094d2ce8 100644 --- a/6/functions_vars_f.html +++ b/6/functions_vars_f.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -90,9 +88,9 @@ $(function() { diff --git a/6/functions_vars_g.html b/6/functions_vars_g.html index 9002a6e9..8bae6961 100644 --- a/6/functions_vars_g.html +++ b/6/functions_vars_g.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -89,9 +87,9 @@ $(function() { diff --git a/6/functions_vars_h.html b/6/functions_vars_h.html index 832224e5..646f4704 100644 --- a/6/functions_vars_h.html +++ b/6/functions_vars_h.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -99,9 +97,9 @@ $(function() { diff --git a/6/functions_vars_i.html b/6/functions_vars_i.html index 8ea9d1f2..3a459465 100644 --- a/6/functions_vars_i.html +++ b/6/functions_vars_i.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -96,9 +94,9 @@ $(function() { diff --git a/6/functions_vars_j.html b/6/functions_vars_j.html index a45a2979..c64934b1 100644 --- a/6/functions_vars_j.html +++ b/6/functions_vars_j.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -74,9 +72,9 @@ $(function() { diff --git a/6/functions_vars_k.html b/6/functions_vars_k.html index 1987dd89..697b866d 100644 --- a/6/functions_vars_k.html +++ b/6/functions_vars_k.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -80,9 +78,9 @@ $(function() { diff --git a/6/functions_vars_l.html b/6/functions_vars_l.html index c2fc7b57..0090ae46 100644 --- a/6/functions_vars_l.html +++ b/6/functions_vars_l.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -85,9 +83,9 @@ $(function() { diff --git a/6/functions_vars_m.html b/6/functions_vars_m.html index fd866c02..cefedb02 100644 --- a/6/functions_vars_m.html +++ b/6/functions_vars_m.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -2475,9 +2473,9 @@ $(function() { diff --git a/6/functions_vars_n.html b/6/functions_vars_n.html index b5d62a94..f3b82394 100644 --- a/6/functions_vars_n.html +++ b/6/functions_vars_n.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -119,9 +117,9 @@ $(function() { diff --git a/6/functions_vars_o.html b/6/functions_vars_o.html index e84428b5..a85a37bf 100644 --- a/6/functions_vars_o.html +++ b/6/functions_vars_o.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -87,9 +85,9 @@ $(function() { diff --git a/6/functions_vars_p.html b/6/functions_vars_p.html index 210e5bf5..b4f1b108 100644 --- a/6/functions_vars_p.html +++ b/6/functions_vars_p.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -114,9 +112,9 @@ $(function() { diff --git a/6/functions_vars_q.html b/6/functions_vars_q.html index 42bedb4c..7783a534 100644 --- a/6/functions_vars_q.html +++ b/6/functions_vars_q.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -71,9 +69,9 @@ $(function() { diff --git a/6/functions_vars_r.html b/6/functions_vars_r.html index ab1fc6c6..3fa0eab0 100644 --- a/6/functions_vars_r.html +++ b/6/functions_vars_r.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -120,9 +118,9 @@ $(function() { diff --git a/6/functions_vars_s.html b/6/functions_vars_s.html index faba5891..731e6c62 100644 --- a/6/functions_vars_s.html +++ b/6/functions_vars_s.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -127,9 +125,9 @@ $(function() { diff --git a/6/functions_vars_t.html b/6/functions_vars_t.html index 1f89b703..92645813 100644 --- a/6/functions_vars_t.html +++ b/6/functions_vars_t.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -91,9 +89,9 @@ $(function() { diff --git a/6/functions_vars_u.html b/6/functions_vars_u.html index 7a070dec..54a73822 100644 --- a/6/functions_vars_u.html +++ b/6/functions_vars_u.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -177,9 +175,9 @@ $(function() { diff --git a/6/functions_vars_v.html b/6/functions_vars_v.html index 448d2fac..fd51e578 100644 --- a/6/functions_vars_v.html +++ b/6/functions_vars_v.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -79,9 +77,9 @@ $(function() { diff --git a/6/functions_vars_w.html b/6/functions_vars_w.html index 68d74088..4d5ddcc0 100644 --- a/6/functions_vars_w.html +++ b/6/functions_vars_w.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -84,9 +82,9 @@ $(function() { diff --git a/6/functions_vars_x.html b/6/functions_vars_x.html index 0f113ef0..507bf744 100644 --- a/6/functions_vars_x.html +++ b/6/functions_vars_x.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -95,9 +93,9 @@ $(function() { diff --git a/6/functions_vars_y.html b/6/functions_vars_y.html index 760d24ab..889d6dbc 100644 --- a/6/functions_vars_y.html +++ b/6/functions_vars_y.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -95,9 +93,9 @@ $(function() { diff --git a/6/functions_vars_z.html b/6/functions_vars_z.html index 058d7364..41093b99 100644 --- a/6/functions_vars_z.html +++ b/6/functions_vars_z.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members - Variables @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -129,9 +127,9 @@ $(function() { diff --git a/6/functions_w.html b/6/functions_w.html index 1f204815..67277a60 100644 --- a/6/functions_w.html +++ b/6/functions_w.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -571,9 +569,9 @@ $(function() { diff --git a/6/functions_x.html b/6/functions_x.html index debc6f82..6157b5c1 100644 --- a/6/functions_x.html +++ b/6/functions_x.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -101,9 +99,9 @@ $(function() { diff --git a/6/functions_y.html b/6/functions_y.html index 3d4b640c..643bb939 100644 --- a/6/functions_y.html +++ b/6/functions_y.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -101,9 +99,9 @@ $(function() { diff --git a/6/functions_z.html b/6/functions_z.html index ac6da79e..7eb94e15 100644 --- a/6/functions_z.html +++ b/6/functions_z.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Members @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -171,9 +169,9 @@ $(function() { diff --git a/6/hierarchy.html b/6/hierarchy.html index 2d386e98..9b073333 100644 --- a/6/hierarchy.html +++ b/6/hierarchy.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Class Hierarchy @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -120,7 +118,7 @@ $(function() {  CON_BezierCage  CON_BezierCurve  CON_BezierSurface - CON_BinaryArchive< use for generic serialization of binary data + CON_BinaryArchive< use for generic serialization of binary data  CON_BinaryArchiveBuffer  CON_BinaryFile  CON_Read3dmBufferArchive @@ -134,32 +132,32 @@ $(function() {  CON_Buffer  CON_BumpFunction  CON_CheckSum - CON_Circle + CON_Circle  CON_Arc - CON_ClassArray< T > + CON_ClassArray< T >  CON_ObjectArray< T >  CON_ClassArray< ON_3dmConstructionPlane >  CON_ClassArray< ON_3dmView > - CON_ClassArray< ON_BrepEdge > - CON_ObjectArray< ON_BrepEdge > + CON_ClassArray< ON_BrepEdge > + CON_ObjectArray< ON_BrepEdge >  CON_BrepEdgeArray - CON_ClassArray< ON_BrepFace > - CON_ObjectArray< ON_BrepFace > + CON_ClassArray< ON_BrepFace > + CON_ObjectArray< ON_BrepFace >  CON_BrepFaceArray - CON_ClassArray< ON_BrepFaceSide > - CON_ObjectArray< ON_BrepFaceSide > + CON_ClassArray< ON_BrepFaceSide > + CON_ObjectArray< ON_BrepFaceSide >  CON_BrepFaceSideArray - CON_ClassArray< ON_BrepLoop > - CON_ObjectArray< ON_BrepLoop > + CON_ClassArray< ON_BrepLoop > + CON_ObjectArray< ON_BrepLoop >  CON_BrepLoopArray - CON_ClassArray< ON_BrepRegion > - CON_ObjectArray< ON_BrepRegion > + CON_ClassArray< ON_BrepRegion > + CON_ObjectArray< ON_BrepRegion >  CON_BrepRegionArray - CON_ClassArray< ON_BrepTrim > - CON_ObjectArray< ON_BrepTrim > + CON_ClassArray< ON_BrepTrim > + CON_ObjectArray< ON_BrepTrim >  CON_BrepTrimArray - CON_ClassArray< ON_BrepVertex > - CON_ObjectArray< ON_BrepVertex > + CON_ClassArray< ON_BrepVertex > + CON_ObjectArray< ON_BrepVertex >  CON_BrepVertexArray  CON_ClassArray< ON_CurveProxyHistory >  CON_ClassArray< ON_FaceNameKey > @@ -171,7 +169,7 @@ $(function() {  CON_ClassArray< ON_RtfFirstChar::TextRun >  CON_ClassArray< ON_RtfStringBuilder::TextRun >  CON_ClassArray< ON_TextBuilder::TextProps > - CON_ClassArray< ON_Texture > + CON_ClassArray< ON_Texture >  CON_ObjectArray< ON_Texture >  CON_ClassArray< ON_TextureCoordinates >  CON_ClassArray< ON_UserString > @@ -204,10 +202,10 @@ $(function() {  CON_FileStream  CON_FileSystem  CON_FileSystemPath - CON_FixedSizePool + CON_FixedSizePool  CON_Internal_FontGlyphPool  CON_SimpleFixedSizePool< T > - CON_FixedSizePoolIterator + CON_FixedSizePoolIterator  CON_SimpleFixedSizePoolIterator< T >  CON_FontAn ON_Font is a face in a font family. It corresponds to a Windows LOGFONT, a .NET System.Drawing.Font or a FreeType FT_Face.  CON_FontGlyph @@ -262,15 +260,15 @@ $(function() {  CON_ModelComponentTypeIterator  CON_NameHash  CON_NumberFormatterON_Table class - CON_Object + CON_Object  CON_3dmObjectAttributes  CON_3dmRenderSettings  CON_BrepFaceSide  CON_BrepRegion  CON_DocumentUserStringList - CON_Geometry - CON_Annotation - CON_Dimension + CON_Geometry + CON_Annotation + CON_Dimension  CON_Centermark
     CON_DimAngular
    @@ -283,16 +281,16 @@ $(function() {  CON_TextON_Table class  CON_Brep  CON_BrepLoop - CON_Curve + CON_Curve  CON_ArcCurve  CON_CurveOnSurface - CON_CurveProxy + CON_CurveProxy  CON_BrepEdge  CON_BrepTrim  CON_PolyEdgeSegment  CON_LineCurve  CON_NurbsCurve - CON_PolyCurve + CON_PolyCurve  CON_PolyEdgeCurve  CON_PolylineCurve  CON_DetailView @@ -303,27 +301,27 @@ $(function() {  CON_MeshComponentRef  CON_MorphControl  CON_NurbsCage - CON_Point + CON_Point  CON_BrepVertex  CON_PointCloud  CON_PointGrid - CON_Surface + CON_Surface  CON_Extrusion  CON_NurbsSurface - CON_PlaneSurface + CON_PlaneSurface  CON_ClippingPlaneSurface  CON_RevSurfaceSurface of revolution  CON_SumSurfaceSurface of revolution - CON_SurfaceProxy + CON_SurfaceProxy  CON_BrepFace  CON_OffsetSurface  CON_TextContent  CON_TextDot  CON_Viewport - CON_ModelComponent - CON_Bitmap + CON_ModelComponent + CON_Bitmap  CON_EmbeddedBitmap - CON_WindowsBitmap + CON_WindowsBitmap  CON_WindowsBitmapEx  CON_DimStyle  CON_Group @@ -337,8 +335,8 @@ $(function() {  CON_TextStyle  CON_TextureMapping  CON_Texture - CON_UserData - CON_ObsoleteUserData + CON_UserData + CON_ObsoleteUserData  CON_RdkMaterialInstanceIdObsoleteUserData  CON_UnknownUserData  CON_UserStringList @@ -361,7 +359,7 @@ $(function() {  CON_Quaternion  CON_RANDOM_NUMBER_CONTEXT  CON_ReferencedComponentSettings - CON_RenderingAttributes + CON_RenderingAttributes  CON_ObjectRenderingAttributes  CON_RtfParser  CON_RTree @@ -387,35 +385,35 @@ $(function() {  CON_SimpleArray< double *>  CON_SimpleArray< double >  CON_SimpleArray< int > - CON_SimpleArray< ON_2dex > + CON_SimpleArray< ON_2dex >  CON_2dexMap - CON_SimpleArray< ON_2dPoint > + CON_SimpleArray< ON_2dPoint >  CON_2dPointArray - CON_SimpleArray< ON_2dVector > + CON_SimpleArray< ON_2dVector >  CON_2dVectorArray - CON_SimpleArray< ON_2fPoint > + CON_SimpleArray< ON_2fPoint >  CON_2fPointArray - CON_SimpleArray< ON_2fVector > + CON_SimpleArray< ON_2fVector >  CON_2fVectorArray  CON_SimpleArray< ON_3DM_BIG_CHUNK > - CON_SimpleArray< ON_3dPoint > - CON_3dPointArray + CON_SimpleArray< ON_3dPoint > + CON_3dPointArray  CON_Polyline - CON_SimpleArray< ON_3dVector > + CON_SimpleArray< ON_3dVector >  CON_3dVectorArray - CON_SimpleArray< ON_3fPoint > + CON_SimpleArray< ON_3fPoint >  CON_3fPointArray - CON_SimpleArray< ON_3fVector > + CON_SimpleArray< ON_3fVector >  CON_3fVectorArray - CON_SimpleArray< ON_4dPoint > + CON_SimpleArray< ON_4dPoint >  CON_4dPointArray - CON_SimpleArray< ON_4fPoint > + CON_SimpleArray< ON_4fPoint >  CON_4fPointArray  CON_SimpleArray< ON__UINT32 >  CON_SimpleArray< ON_BrepTrimPoint >  CON_SimpleArray< ON_ClippingPlaneInfo >  CON_SimpleArray< ON_Color > - CON_SimpleArray< ON_Curve *> + CON_SimpleArray< ON_Curve *>  CON_CurveArray  CON_SimpleArray< ON_DimStyle * >  CON_SimpleArray< ON_DisplayMaterialRef > @@ -430,26 +428,26 @@ $(function() {  CON_SimpleArray< ON_MeshTopologyVertex >  CON_SimpleArray< ON_ObjRef_IRefID >  CON_SimpleArray< ON_OffsetSurfaceValue > - CON_SimpleArray< ON_Surface *> + CON_SimpleArray< ON_Surface *>  CON_SurfaceArray  CON_SimpleArray< ON_SurfaceCurvature > - CON_SimpleArray< ON_TextRun * > + CON_SimpleArray< ON_TextRun * >  CON_TextRunArray  CON_SimpleArray< ON_TextStyle * >  CON_SimpleArray< ON_UserDataItemFilter > - CON_SimpleArray< ON_UUID > + CON_SimpleArray< ON_UUID >  CON_UuidList  CON_SimpleArray< ON_UUID_struct > - CON_SimpleArray< ON_UuidIndex > + CON_SimpleArray< ON_UuidIndex >  CON_UuidIndexList - CON_SimpleArray< ON_UuidPair > + CON_SimpleArray< ON_UuidPair >  CON_UuidPairList - CON_SimpleArray< ON_UuidPtr > + CON_SimpleArray< ON_UuidPtr >  CON_UuidPtrList  CON_SimpleArray< ONX_Model_UserData *>  CON_SimpleArray< struct ON_MeshPart >  CON_SimpleArray< unsigned int > - CON_SpaceMorph + CON_SpaceMorph  CON_BezierCageMorph  CON_CageMorph  CON_Sphere @@ -463,14 +461,14 @@ $(function() {  CON_TensorProduct  CON_Terminator  CON_TextBox - CON_TextBuilder + CON_TextBuilder  CON_RtfFirstChar  CON_RtfStringBuilder  CON_TextRunBuilder  CON_TextContext
     CON_TextIteratorConverts wchar_t characters to Unicode codepoints - CON_TextLog + CON_TextLog  CON_TextHash  CON_TextLogIndent  CON_TextMask @@ -511,9 +509,9 @@ $(function() { diff --git a/6/index.html b/6/index.html index 21eea375..3a8da5ed 100644 --- a/6/index.html +++ b/6/index.html @@ -3,7 +3,7 @@ - + openNURBS SDK Help: Main Page @@ -22,6 +22,7 @@
    openNURBS SDK Help +  6.0
    @@ -29,21 +30,18 @@ - + + @@ -68,9 +66,9 @@ $(function() { diff --git a/6/jquery.js b/6/jquery.js index 2771c749..f5343eda 100644 --- a/6/jquery.js +++ b/6/jquery.js @@ -1,31 +1,3 @@ -/* - @licstart The following is the entire license notice for the - JavaScript code in this file. - - Copyright (C) 1997-2017 by Dimitri van Heesch - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - @licend The above is the entire license notice - for the JavaScript code in this file - */ /*! * jQuery JavaScript Library v1.7.1 * http://jquery.com/ @@ -81,7 +53,7 @@ (function(b,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jQuery);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,k=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(k.aspectRatio),aspectRatio:k.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:k.helper||k.ghost||k.animate?k.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(c('
    ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=k.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var g=0;g');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++k.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(q){q=q||this.element;for(var n in this.handles){if(this.handles[n].constructor==String){this.handles[n]=c(this.handles[n],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var o=c(this.handles[n],this.element),p=0;p=/sw|ne|nw|se|n|s/.test(n)?o.outerHeight():o.outerWidth();var m=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");q.css(m,p);this._proportionallyResize()}if(!c(this.handles[n]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=i&&i[1]?i[1]:"se"}});if(k.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(k.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(k.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var j=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}this._renderProxy();var k=b(this.helper.css("left")),h=b(this.helper.css("top"));if(j.containment){k+=c(j.containment).scrollLeft()||0;h+=c(j.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:k,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:k,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof j.aspectRatio=="number")?j.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var i=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",i=="auto"?this.axis+"-resize":i);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,m={},q=this,j=this.originalMousePosition,n=this.axis;var r=(e.pageX-j.left)||0,p=(e.pageY-j.top)||0;var i=this._change[n];if(!i){return false}var l=i.apply(this,[e,r,p]),k=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){l=this._updateRatio(l,e)}l=this._respectSize(l,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(l);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var i=this.options,m=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:m.sizeDiff.height,k=e?0:m.sizeDiff.width;var n={width:(m.helper.width()-k),height:(m.helper.height()-f)},j=(parseInt(m.element.css("left"),10)+(m.position.left-m.originalPosition.left))||null,l=(parseInt(m.element.css("top"),10)+(m.position.top-m.originalPosition.top))||null;if(!i.animate){this.element.css(c.extend(n,{top:l,left:j}))}m.helper.height(m.size.height);m.helper.width(m.size.width);if(this._helper&&!i.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var j=this.options,i,h,f,k,e;e={minWidth:a(j.minWidth)?j.minWidth:0,maxWidth:a(j.maxWidth)?j.maxWidth:Infinity,minHeight:a(j.minHeight)?j.minHeight:0,maxHeight:a(j.maxHeight)?j.maxHeight:Infinity};if(this._aspectRatio||g){i=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;k=e.maxWidth/this.aspectRatio;if(i>e.minWidth){e.minWidth=i}if(f>e.minHeight){e.minHeight=f}if(hl.width),s=a(l.height)&&i.minHeight&&(i.minHeight>l.height);if(h){l.width=i.minWidth}if(s){l.height=i.minHeight}if(t){l.width=i.maxWidth}if(m){l.height=i.maxHeight}var f=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height;var k=/sw|nw|w/.test(q),e=/nw|ne|n/.test(q);if(h&&k){l.left=f-i.minWidth}if(t&&k){l.left=f-i.maxWidth}if(s&&e){l.top=p-i.minHeight}if(m&&e){l.top=p-i.maxHeight}var n=!l.width&&!l.height;if(n&&!l.left&&l.top){l.top=null}else{if(n&&!l.top&&l.left){l.left=null}}return l},_proportionallyResize:function(){var k=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++i.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{left:i.left+f,width:g.width-f}},n:function(h,f,e){var j=this.options,g=this.originalSize,i=this.originalPosition;return{top:i.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.18"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),i=e.options;var h=function(j){c(j).each(function(){var k=c(this);k.data("resizable-alsoresize",{width:parseInt(k.width(),10),height:parseInt(k.height(),10),left:parseInt(k.css("left"),10),top:parseInt(k.css("top"),10)})})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.parentNode){if(i.alsoResize.length){i.alsoResize=i.alsoResize[0];h(i.alsoResize)}else{c.each(i.alsoResize,function(j){h(j)})}}else{h(i.alsoResize)}},resize:function(g,i){var f=c(this).data("resizable"),j=f.options,h=f.originalSize,l=f.originalPosition;var k={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-l.top)||0,left:(f.position.left-l.left)||0},e=function(m,n){c(m).each(function(){var q=c(this),r=c(this).data("resizable-alsoresize"),p={},o=n&&n.length?n:q.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(o,function(s,u){var t=(r[u]||0)+(k[u]||0);if(t&&t>=0){p[u]=t||null}});q.css(p)})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(m,n){e(m,n)})}else{e(j.alsoResize)}},stop:function(e,f){c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(i,n){var p=c(this).data("resizable"),j=p.options;var h=p._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:p.sizeDiff.height,l=e?0:p.sizeDiff.width;var g={width:(p.size.width-l),height:(p.size.height-f)},k=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,m=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;p.element.animate(c.extend(g,m&&k?{top:m,left:k}:{}),{duration:j.animateDuration,easing:j.animateEasing,step:function(){var o={width:parseInt(p.element.css("width"),10),height:parseInt(p.element.css("height"),10),top:parseInt(p.element.css("top"),10),left:parseInt(p.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}p._updateCache(o);p._propagate("resize",i)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,r){var t=c(this).data("resizable"),j=t.options,l=t.element;var g=j.containment,k=(g instanceof c)?g.get(0):(/parent/.test(g))?l.parent().get(0):g;if(!k){return}t.containerElement=c(k);if(/document/.test(g)||g==document){t.containerOffset={left:0,top:0};t.containerPosition={left:0,top:0};t.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var n=c(k),i=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){i[p]=b(n.css("padding"+o))});t.containerOffset=n.offset();t.containerPosition=n.position();t.containerSize={height:(n.innerHeight()-i[3]),width:(n.innerWidth()-i[1])};var q=t.containerOffset,e=t.containerSize.height,m=t.containerSize.width,h=(c.ui.hasScroll(k,"left")?k.scrollWidth:m),s=(c.ui.hasScroll(k)?k.scrollHeight:e);t.parentData={element:k,left:q.left,top:q.top,width:h,height:s}}},resize:function(g,q){var t=c(this).data("resizable"),i=t.options,f=t.containerSize,p=t.containerOffset,m=t.size,n=t.position,r=t._aspectRatio||g.shiftKey,e={top:0,left:0},h=t.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=p}if(n.left<(t._helper?p.left:0)){t.size.width=t.size.width+(t._helper?(t.position.left-p.left):(t.position.left-e.left));if(r){t.size.height=t.size.width/i.aspectRatio}t.position.left=i.helper?p.left:0}if(n.top<(t._helper?p.top:0)){t.size.height=t.size.height+(t._helper?(t.position.top-p.top):t.position.top);if(r){t.size.width=t.size.height*i.aspectRatio}t.position.top=t._helper?p.top:0}t.offset.left=t.parentData.left+t.position.left;t.offset.top=t.parentData.top+t.position.top;var l=Math.abs((t._helper?t.offset.left-e.left:(t.offset.left-e.left))+t.sizeDiff.width),s=Math.abs((t._helper?t.offset.top-e.top:(t.offset.top-p.top))+t.sizeDiff.height);var k=t.containerElement.get(0)==t.element.parent().get(0),j=/relative|absolute/.test(t.containerElement.css("position"));if(k&&j){l-=t.parentData.left}if(l+t.size.width>=t.parentData.width){t.size.width=t.parentData.width-l;if(r){t.size.height=t.size.width/t.aspectRatio}}if(s+t.size.height>=t.parentData.height){t.size.height=t.parentData.height-s;if(r){t.size.width=t.size.height*t.aspectRatio}}},stop:function(f,n){var q=c(this).data("resizable"),g=q.options,l=q.position,m=q.containerOffset,e=q.containerPosition,i=q.containerElement;var j=c(q.helper),r=j.offset(),p=j.outerWidth()-q.sizeDiff.width,k=j.outerHeight()-q.sizeDiff.height;if(q._helper&&!g.animate&&(/relative/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}if(q._helper&&!g.animate&&(/static/).test(i.css("position"))){c(this).css({left:r.left-e.left-m.left,width:p,height:k})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),i=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,m){var p=c(this).data("resizable"),h=p.options,k=p.size,i=p.originalSize,j=p.originalPosition,n=p.axis,l=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((k.width-i.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((k.height-i.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f}else{if(/^(ne)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f}else{if(/^(sw)$/.test(n)){p.size.width=i.width+g;p.size.height=i.height+f;p.position.left=j.left-g}else{p.size.width=i.width+g;p.size.height=i.height+f;p.position.top=j.top-f;p.position.left=j.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jQuery);/*! * jQuery hashchange event - v1.3 - 7/21/2010 * http://benalman.com/projects/jquery-hashchange-plugin/ - * + * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ @@ -112,4 +84,4 @@ * * Licensed MIT */ -(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof module==="object"&&typeof module.exports==="object"){module.exports=a(require("jquery"))}else{a(jQuery)}}}(function(a){var b=[],e=!!window.createPopup,f=false,d="ontouchstart" in window,h=false,g=window.requestAnimationFrame||function(l){return setTimeout(l,1000/60)},c=window.cancelAnimationFrame||function(l){clearTimeout(l)};function k(m){var n=".smartmenus_mouse";if(!h&&!m){var o=true,l=null;a(document).bind(i([["mousemove",function(s){var t={x:s.pageX,y:s.pageY,timeStamp:new Date().getTime()};if(l){var q=Math.abs(l.x-t.x),p=Math.abs(l.y-t.y);if((q>0||p>0)&&q<=2&&p<=2&&t.timeStamp-l.timeStamp<=300){f=true;if(o){var r=a(s.target).closest("a");if(r.is("a")){a.each(b,function(){if(a.contains(this.$root[0],r[0])){this.itemEnter({currentTarget:r[0]});return false}})}o=false}}}l=t}],[d?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut",function(p){if(j(p.originalEvent)){f=false}}]],n));h=true}else{if(h&&m){a(document).unbind(n);h=false}}}function j(l){return !/^(4|mouse)$/.test(l.pointerType)}function i(l,n){if(!n){n=""}var m={};a.each(l,function(o,p){m[p[0].split(" ").join(n+" ")+n]=p[1]});return m}a.SmartMenus=function(m,l){this.$root=a(m);this.opts=l;this.rootId="";this.accessIdPrefix="";this.$subArrow=null;this.activatedItems=[];this.visibleSubMenus=[];this.showTimeout=0;this.hideTimeout=0;this.scrollTimeout=0;this.clickActivated=false;this.focusActivated=false;this.zIndexInc=0;this.idInc=0;this.$firstLink=null;this.$firstSub=null;this.disabled=false;this.$disableOverlay=null;this.$touchScrollingSub=null;this.cssTransforms3d="perspective" in m.style||"webkitPerspective" in m.style;this.wasCollapsible=false;this.init()};a.extend(a.SmartMenus,{hideAll:function(){a.each(b,function(){this.menuHideAll()})},destroy:function(){while(b.length){b[0].destroy()}k(true)},prototype:{init:function(n){var l=this;if(!n){b.push(this);this.rootId=(new Date().getTime()+Math.random()+"").replace(/\D/g,"");this.accessIdPrefix="sm-"+this.rootId+"-";if(this.$root.hasClass("sm-rtl")){this.opts.rightToLeftSubMenus=true}var r=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).bind(i([["mouseover focusin",a.proxy(this.rootOver,this)],["mouseout focusout",a.proxy(this.rootOut,this)],["keydown",a.proxy(this.rootKeyDown,this)]],r)).delegate("a",i([["mouseenter",a.proxy(this.itemEnter,this)],["mouseleave",a.proxy(this.itemLeave,this)],["mousedown",a.proxy(this.itemDown,this)],["focus",a.proxy(this.itemFocus,this)],["blur",a.proxy(this.itemBlur,this)],["click",a.proxy(this.itemClick,this)]],r));r+=this.rootId;if(this.opts.hideOnClick){a(document).bind(i([["touchstart",a.proxy(this.docTouchStart,this)],["touchmove",a.proxy(this.docTouchMove,this)],["touchend",a.proxy(this.docTouchEnd,this)],["click",a.proxy(this.docClick,this)]],r))}a(window).bind(i([["resize orientationchange",a.proxy(this.winResize,this)]],r));if(this.opts.subIndicators){this.$subArrow=a("").addClass("sub-arrow");if(this.opts.subIndicatorsText){this.$subArrow.html(this.opts.subIndicatorsText)}}k()}this.$firstSub=this.$root.find("ul").each(function(){l.menuInit(a(this))}).eq(0);this.$firstLink=this.$root.find("a").eq(0);if(this.opts.markCurrentItem){var p=/(index|default)\.[^#\?\/]*/i,m=/#.*/,q=window.location.href.replace(p,""),o=q.replace(m,"");this.$root.find("a").each(function(){var s=this.href.replace(p,""),t=a(this);if(s==q||s==o){t.addClass("current");if(l.opts.markCurrentTree){t.parentsUntil("[data-smartmenus-id]","ul").each(function(){a(this).dataSM("parent-a").addClass("current")})}}})}this.wasCollapsible=this.isCollapsible()},destroy:function(m){if(!m){var n=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").unbind(n).undelegate(n);n+=this.rootId;a(document).unbind(n);a(window).unbind(n);if(this.opts.subIndicators){this.$subArrow=null}}this.menuHideAll();var l=this;this.$root.find("ul").each(function(){var o=a(this);if(o.dataSM("scroll-arrows")){o.dataSM("scroll-arrows").remove()}if(o.dataSM("shown-before")){if(l.opts.subMenusMinWidth||l.opts.subMenusMaxWidth){o.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap")}if(o.dataSM("scroll-arrows")){o.dataSM("scroll-arrows").remove()}o.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})}if((o.attr("id")||"").indexOf(l.accessIdPrefix)==0){o.removeAttr("id")}}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("ie-shim").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded");this.$root.find("a.has-submenu").each(function(){var o=a(this);if(o.attr("id").indexOf(l.accessIdPrefix)==0){o.removeAttr("id")}}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub");if(this.opts.subIndicators){this.$root.find("span.sub-arrow").remove()}if(this.opts.markCurrentItem){this.$root.find("a.current").removeClass("current")}if(!m){this.$root=null;this.$firstLink=null;this.$firstSub=null;if(this.$disableOverlay){this.$disableOverlay.remove();this.$disableOverlay=null}b.splice(a.inArray(this,b),1)}},disable:function(l){if(!this.disabled){this.menuHideAll();if(!l&&!this.opts.isPopup&&this.$root.is(":visible")){var m=this.$root.offset();this.$disableOverlay=a('
    ').css({position:"absolute",top:m.top,left:m.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(true),opacity:0}).appendTo(document.body)}this.disabled=true}},docClick:function(l){if(this.$touchScrollingSub){this.$touchScrollingSub=null;return}if(this.visibleSubMenus.length&&!a.contains(this.$root[0],l.target)||a(l.target).is("a")){this.menuHideAll()}},docTouchEnd:function(m){if(!this.lastTouch){return}if(this.visibleSubMenus.length&&(this.lastTouch.x2===undefined||this.lastTouch.x1==this.lastTouch.x2)&&(this.lastTouch.y2===undefined||this.lastTouch.y1==this.lastTouch.y2)&&(!this.lastTouch.target||!a.contains(this.$root[0],this.lastTouch.target))){if(this.hideTimeout){clearTimeout(this.hideTimeout);this.hideTimeout=0}var l=this;this.hideTimeout=setTimeout(function(){l.menuHideAll()},350)}this.lastTouch=null},docTouchMove:function(m){if(!this.lastTouch){return}var l=m.originalEvent.touches[0];this.lastTouch.x2=l.pageX;this.lastTouch.y2=l.pageY},docTouchStart:function(m){var l=m.originalEvent.touches[0];this.lastTouch={x1:l.pageX,y1:l.pageY,target:l.target}},enable:function(){if(this.disabled){if(this.$disableOverlay){this.$disableOverlay.remove();this.$disableOverlay=null}this.disabled=false}},getClosestMenu:function(m){var l=a(m).closest("ul");while(l.dataSM("in-mega")){l=l.parent().closest("ul")}return l[0]||null},getHeight:function(l){return this.getOffset(l,true)},getOffset:function(n,l){var m;if(n.css("display")=="none"){m={position:n[0].style.position,visibility:n[0].style.visibility};n.css({position:"absolute",visibility:"hidden"}).show()}var o=n[0].getBoundingClientRect&&n[0].getBoundingClientRect(),p=o&&(l?o.height||o.bottom-o.top:o.width||o.right-o.left);if(!p&&p!==0){p=l?n[0].offsetHeight:n[0].offsetWidth}if(m){n.hide().css(m)}return p},getStartZIndex:function(l){var m=parseInt(this[l?"$root":"$firstSub"].css("z-index"));if(!l&&isNaN(m)){m=parseInt(this.$root.css("z-index"))}return !isNaN(m)?m:1},getTouchPoint:function(l){return l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0]||l},getViewport:function(l){var m=l?"Height":"Width",o=document.documentElement["client"+m],n=window["inner"+m];if(n){o=Math.min(o,n)}return o},getViewportHeight:function(){return this.getViewport(true)},getViewportWidth:function(){return this.getViewport()},getWidth:function(l){return this.getOffset(l)},handleEvents:function(){return !this.disabled&&this.isCSSOn()},handleItemEvents:function(l){return this.handleEvents()&&!this.isLinkInMegaMenu(l)},isCollapsible:function(){return this.$firstSub.css("position")=="static"},isCSSOn:function(){return this.$firstLink.css("display")=="block"},isFixed:function(){var l=this.$root.css("position")=="fixed";if(!l){this.$root.parentsUntil("body").each(function(){if(a(this).css("position")=="fixed"){l=true;return false}})}return l},isLinkInMegaMenu:function(l){return a(this.getClosestMenu(l[0])).hasClass("mega-menu")},isTouchMode:function(){return !f||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(p,l){var n=p.closest("ul"),q=n.dataSM("level");if(q>1&&(!this.activatedItems[q-2]||this.activatedItems[q-2][0]!=n.dataSM("parent-a")[0])){var m=this;a(n.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(n).each(function(){m.itemActivate(a(this).dataSM("parent-a"))})}if(!this.isCollapsible()||l){this.menuHideSubMenus(!this.activatedItems[q-1]||this.activatedItems[q-1][0]!=p[0]?q-1:q)}this.activatedItems[q-1]=p;if(this.$root.triggerHandler("activate.smapi",p[0])===false){return}var o=p.dataSM("sub");if(o&&(this.isTouchMode()||(!this.opts.showOnClick||this.clickActivated))){this.menuShow(o)}},itemBlur:function(m){var l=a(m.currentTarget);if(!this.handleItemEvents(l)){return}this.$root.triggerHandler("blur.smapi",l[0])},itemClick:function(o){var n=a(o.currentTarget);if(!this.handleItemEvents(n)){return}if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==n.closest("ul")[0]){this.$touchScrollingSub=null;o.stopPropagation();return false}if(this.$root.triggerHandler("click.smapi",n[0])===false){return false}var p=a(o.target).is("span.sub-arrow"),m=n.dataSM("sub"),l=m?m.dataSM("level")==2:false;if(m&&!m.is(":visible")){if(this.opts.showOnClick&&l){this.clickActivated=true}this.itemActivate(n);if(m.is(":visible")){this.focusActivated=true;return false}}else{if(this.isCollapsible()&&p){this.itemActivate(n);this.menuHide(m);return false}}if(this.opts.showOnClick&&l||n.hasClass("disabled")||this.$root.triggerHandler("select.smapi",n[0])===false){return false}},itemDown:function(m){var l=a(m.currentTarget);if(!this.handleItemEvents(l)){return}l.dataSM("mousedown",true)},itemEnter:function(n){var m=a(n.currentTarget);if(!this.handleItemEvents(m)){return}if(!this.isTouchMode()){if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}var l=this;this.showTimeout=setTimeout(function(){l.itemActivate(m)},this.opts.showOnClick&&m.closest("ul").dataSM("level")==1?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",m[0])},itemFocus:function(m){var l=a(m.currentTarget);if(!this.handleItemEvents(l)){return}if(this.focusActivated&&(!this.isTouchMode()||!l.dataSM("mousedown"))&&(!this.activatedItems.length||this.activatedItems[this.activatedItems.length-1][0]!=l[0])){this.itemActivate(l,true)}this.$root.triggerHandler("focus.smapi",l[0])},itemLeave:function(m){var l=a(m.currentTarget);if(!this.handleItemEvents(l)){return}if(!this.isTouchMode()){l[0].blur();if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}}l.removeDataSM("mousedown");this.$root.triggerHandler("mouseleave.smapi",l[0])},menuHide:function(m){if(this.$root.triggerHandler("beforehide.smapi",m[0])===false){return}m.stop(true,true);if(m.css("display")!="none"){var l=function(){m.css("z-index","")};if(this.isCollapsible()){if(this.opts.collapsibleHideFunction){this.opts.collapsibleHideFunction.call(this,m,l)}else{m.hide(this.opts.collapsibleHideDuration,l)}}else{if(this.opts.hideFunction){this.opts.hideFunction.call(this,m,l)}else{m.hide(this.opts.hideDuration,l)}}if(m.dataSM("ie-shim")){m.dataSM("ie-shim").remove().css({"-webkit-transform":"",transform:""})}if(m.dataSM("scroll")){this.menuScrollStop(m);m.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).unbind(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()}m.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false");m.attr({"aria-expanded":"false","aria-hidden":"true"});var n=m.dataSM("level");this.activatedItems.splice(n-1,1);this.visibleSubMenus.splice(a.inArray(m,this.visibleSubMenus),1);this.$root.triggerHandler("hide.smapi",m[0])}},menuHideAll:function(){if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}var m=this.opts.isPopup?1:0;for(var l=this.visibleSubMenus.length-1;l>=m;l--){this.menuHide(this.visibleSubMenus[l])}if(this.opts.isPopup){this.$root.stop(true,true);if(this.$root.is(":visible")){if(this.opts.hideFunction){this.opts.hideFunction.call(this,this.$root)}else{this.$root.hide(this.opts.hideDuration)}if(this.$root.dataSM("ie-shim")){this.$root.dataSM("ie-shim").remove()}}}this.activatedItems=[];this.visibleSubMenus=[];this.clickActivated=false;this.focusActivated=false;this.zIndexInc=0;this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(n){for(var l=this.activatedItems.length-1;l>=n;l--){var m=this.activatedItems[l].dataSM("sub");if(m){this.menuHide(m)}}},menuIframeShim:function(l){if(e&&this.opts.overlapControlsInIE&&!l.dataSM("ie-shim")){l.dataSM("ie-shim",a("